Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ClippablePolygon.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ClippablePolygon.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Ellipsoid.hh 73430 2013-08-27 11:04:49Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -81,6 +81,10 @@ class G4Ellipsoid : public G4VSolid
// Solid standard methods
void ComputeDimensions(G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep);
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
const G4AffineTransform& pTransform,
@@ -111,7 +115,6 @@ class G4Ellipsoid : public G4VSolid
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
G4VisExtent GetExtent() const;
G4Polyhedron* CreatePolyhedron() const;
G4NURBS* CreateNURBS() const;
public: // without description
@@ -134,6 +137,7 @@ class G4Ellipsoid : public G4VSolid
private:
G4double kRadTolerance;
G4double halfCarTolerance, halfRadTolerance;
G4double fCubicVolume;
G4double fSurfaceArea;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Ellipsoid.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4EllipticalCone.hh 72937 2013-08-14 13:20:38Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -144,7 +144,6 @@ class G4EllipticalCone : public G4VSolid
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
G4VisExtent GetExtent() const;
G4Polyhedron* CreatePolyhedron() const;
G4NURBS* CreateNURBS() const;
public: // without description
@@ -167,6 +166,7 @@ class G4EllipticalCone : public G4VSolid
private:
G4double kRadTolerance;
G4double halfRadTol, halfCarTol;
G4double fCubicVolume;
G4double fSurfaceArea;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4EllipticalCone.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4EllipticalTube.hh 72937 2013-08-14 13:20:38Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -143,6 +143,8 @@ class G4EllipticalTube : public G4VSolid
// Algorithm for SurfaceNormal() following the original
// specification for points not on the surface.
G4double halfTol;
G4double fCubicVolume;
G4double fSurfaceArea;
mutable G4Polyhedron* fpPolyhedron;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4EllipticalTube.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4EnclosingCylinder.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ExtrudedSolid.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ExtrudedSolid.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -0,0 +1,155 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GenerciPolycone.hh 72077 2013-07-08 12:31:44Z tnikitin $
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
//
// G4GenericPolycone
//
// Class description:
//
// Class implementing a GenericPolycone constructed by points with
// (r,z)coordinates, allows Z 'go back'
//
//
// G4GenericPolycone( const G4String& name,
// G4double phiStart, // initial phi starting angle
// G4double phiTotal, // total phi angle
// G4int numRZ, // number corners in r,z space
// const G4double r[], // r coordinate of these corners
// const G4double z[]) // z coordinate of these corners
//
//
// --------------------------------------------------------------------
#ifndef G4GenericPolycone_hh
#define G4GenericPolycone_hh
#if defined(G4GEOM_USE_USOLIDS)
#define G4GEOM_USE_UGENERICPOLYCONE 1
#endif
#if defined(G4GEOM_USE_UGENERICPOLYCONE)
#define G4UGenericPolycone G4GenericPolycone
#include "G4UGenericPolycone.hh"
#else
#include "G4VCSGfaceted.hh"
#include "G4PolyconeSide.hh"
class G4EnclosingCylinder;
class G4ReduciblePolygon;
class G4VCSGface;
class G4GenericPolycone : public G4VCSGfaceted
{
public: // with description
G4GenericPolycone( const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numRZ, // number corners in r,z space
const G4double r[], // r coordinate of these corners
const G4double z[] ); // z coordinate of these corners
virtual ~G4GenericPolycone();
// Methods for solid
EInside Inside( const G4ThreeVector &p ) const;
G4double DistanceToIn( const G4ThreeVector &p, const G4ThreeVector &v ) const;
G4double DistanceToIn( const G4ThreeVector &p ) const;
G4ThreeVector GetPointOnSurface() const;
G4GeometryType GetEntityType() const;
G4VSolid* Clone() const;
std::ostream& StreamInfo(std::ostream& os) const;
G4Polyhedron* CreatePolyhedron() const;
G4bool Reset();
// Accessors
inline G4double GetStartPhi() const;
inline G4double GetEndPhi() const;
inline G4bool IsOpen() const;
inline G4int GetNumRZCorner() const;
inline G4PolyconeSideRZ GetCorner(G4int index) const;
public: // without description
G4GenericPolycone(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
G4GenericPolycone( const G4GenericPolycone &source );
const G4GenericPolycone &operator=( const G4GenericPolycone &source );
// Copy constructor and assignment operator.
protected: // without description
// Generic initializer, called by all constructors
// void SetOriginalParameters(G4ReduciblePolygon *rz);
void Create( G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4ReduciblePolygon *rz ); // r/z coordinate of these corners
void CopyStuff( const G4GenericPolycone &source );
// Methods for random point generation
protected: // without description
// Here are our parameters
G4double startPhi; // Starting phi value (0 < phiStart < 2pi)
G4double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
G4bool phiIsOpen; // true if there is a phi segment
G4int numCorner; // number RZ points
G4PolyconeSideRZ *corners; // corner r,z points
// Our quick test
G4EnclosingCylinder *enclosingCylinder;
};
#include "G4GenericPolycone.icc"
#endif
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GenericPolycone.icc 72078 2013-07-08 12:31:53Z tnikitin $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
//
// G4GenericPolycone.icc
//
// Implementation of inline methods of G4GenericPolycone
// --------------------------------------------------------------------
inline
G4double G4GenericPolycone::GetStartPhi() const
{
return startPhi;
}
inline
G4double G4GenericPolycone::GetEndPhi() const
{
return endPhi;
}
inline
G4bool G4GenericPolycone::IsOpen() const
{
return phiIsOpen;
}
inline
G4int G4GenericPolycone::GetNumRZCorner() const
{
return numCorner;
}
inline
G4PolyconeSideRZ G4GenericPolycone::GetCorner(G4int index) const
{
return corners[index];
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4GenericTrap.hh 72937 2013-08-14 13:20:38Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -133,7 +133,6 @@ class G4GenericTrap : public G4VSolid
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
G4VisExtent GetExtent() const;
G4Polyhedron* CreatePolyhedron() const;
G4NURBS* CreateNURBS() const;
public: // without description
@@ -198,6 +197,8 @@ class G4GenericTrap : public G4VSolid
static const G4int fgkNofVertices;
static const G4double fgkTolerance;
G4double halfCarTolerance;
// data members
G4double fDz;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4GenericTrap.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Hype.hh 72937 2013-08-14 13:20:38Z gcosmo $
// $Original: G4Hype.hh,v 1.0 1998/06/09 16:57:50 safai Exp $
//
//
@@ -122,7 +122,6 @@ class G4Hype : public G4VSolid
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
G4VisExtent GetExtent () const;
G4Polyhedron* CreatePolyhedron () const;
G4NURBS* CreateNURBS () const;
G4Polyhedron* GetPolyhedron () const;
public: // without description
@@ -197,6 +196,8 @@ class G4Hype : public G4VSolid
G4double fCubicVolume;
G4double fSurfaceArea;
G4double fHalfTol;
mutable G4Polyhedron* fpPolyhedron;
};
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Hype.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4IntersectingCone.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Paraboloid.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -122,7 +122,6 @@ class G4Paraboloid : public G4VSolid
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
G4Polyhedron* CreatePolyhedron() const;
G4Polyhedron* GetPolyhedron () const;
G4NURBS* CreateNURBS() const;
public: // without description
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Paraboloid.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4PolyPhiFace.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4PolyPhiFace.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Polycone.hh 76510 2013-11-12 10:28:06Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -41,11 +41,13 @@
// G4Polycone( const G4String& name,
// G4double phiStart, // initial phi starting angle
// G4double phiTotal, // total phi angle
// G4int numZPlanes, // number of z planes
// G4int numZPlanes, // number of z planes
// const G4double zPlane[], // position of z planes
// const G4double rInner[], // tangent distance to inner surface
// const G4double rOuter[]) // tangent distance to outer surface
//
// Alternative constructor, but limited to increasing-only Z sections:
//
// G4Polycone( const G4String& name,
// G4double phiStart, // initial phi starting angle
// G4double phiTotal, // total phi angle
@@ -56,31 +58,25 @@
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4Polycone_hh
#define G4Polycone_hh
#if defined(G4GEOM_USE_USOLIDS)
#define G4GEOM_USE_UPOLYCONE 1
#endif
#if defined(G4GEOM_USE_UPOLYCONE)
#define G4UPolycone G4Polycone
#include "G4UPolycone.hh"
#else
#include "G4VCSGfaceted.hh"
#include "G4PolyconeSide.hh"
#include "G4PolyconeHistorical.hh"
class G4EnclosingCylinder;
class G4ReduciblePolygon;
class G4VCSGface;
class G4PolyconeHistorical
{
public:
G4PolyconeHistorical();
~G4PolyconeHistorical();
G4PolyconeHistorical( const G4PolyconeHistorical& source );
G4PolyconeHistorical& operator=( const G4PolyconeHistorical& right );
G4double Start_angle;
G4double Opening_angle;
G4int Num_z_planes;
G4double *Z_values;
G4double *Rmin;
G4double *Rmax;
};
class G4Polycone : public G4VCSGfaceted
{
@@ -123,7 +119,6 @@ class G4Polycone : public G4VCSGfaceted
std::ostream& StreamInfo(std::ostream& os) const;
G4Polyhedron* CreatePolyhedron() const;
G4NURBS* CreateNURBS() const;
G4bool Reset();
@@ -132,7 +127,6 @@ class G4Polycone : public G4VCSGfaceted
inline G4double GetStartPhi() const;
inline G4double GetEndPhi() const;
inline G4bool IsOpen() const;
inline G4bool IsGeneric() const;
inline G4int GetNumRZCorner() const;
inline G4PolyconeSideRZ GetCorner(G4int index) const;
inline G4PolyconeHistorical* GetOriginalParameters() const;
@@ -153,7 +147,7 @@ class G4Polycone : public G4VCSGfaceted
// Generic initializer, called by all constructors
inline void SetOriginalParameters();
G4bool SetOriginalParameters(G4ReduciblePolygon *rz);
void Create( G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
@@ -188,7 +182,6 @@ class G4Polycone : public G4VCSGfaceted
G4double startPhi; // Starting phi value (0 < phiStart < 2pi)
G4double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
G4bool phiIsOpen; // true if there is a phi segment
G4bool genericPcon; // true if created through the 2nd generic constructor
G4int numCorner; // number RZ points
G4PolyconeSideRZ *corners; // corner r,z points
G4PolyconeHistorical *original_parameters; // original input parameters
@@ -202,3 +195,5 @@ class G4Polycone : public G4VCSGfaceted
#include "G4Polycone.icc"
#endif
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Polycone.icc 75218 2013-10-29 16:11:15Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -52,12 +52,6 @@ G4bool G4Polycone::IsOpen() const
return phiIsOpen;
}
inline
G4bool G4Polycone::IsGeneric() const
{
return genericPcon;
}
inline
G4int G4Polycone::GetNumRZCorner() const
{
@@ -87,26 +81,3 @@ void G4Polycone::SetOriginalParameters(G4PolyconeHistorical* pars)
fpPolyhedron = 0;
}
inline
void G4Polycone::SetOriginalParameters()
{
G4int numPlanes = (G4int)numCorner/2;
original_parameters = new G4PolyconeHistorical;
original_parameters->Z_values = new G4double[numPlanes];
original_parameters->Rmin = new G4double[numPlanes];
original_parameters->Rmax = new G4double[numPlanes];
for(G4int j=0; j < numPlanes; j++)
{
original_parameters->Z_values[j] = corners[numPlanes+j].z;
original_parameters->Rmax[j] = corners[numPlanes+j].r;
original_parameters->Rmin[j] = corners[numPlanes-1-j].r;
}
original_parameters->Start_angle = startPhi;
original_parameters->Opening_angle = endPhi-startPhi;
original_parameters->Num_z_planes = numPlanes;
}
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id:$
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
//
// G4PolyconeHistorical
//
// Class description:
//
// Data structure for G4Polycone
// --------------------------------------------------------------------
#ifndef G4Polycone_historical_hh
#define G4Polycone_historical_hh
#include "G4Types.hh"
class G4PolyconeHistorical
{
public:
G4PolyconeHistorical();
G4PolyconeHistorical( G4int z_planes );
~G4PolyconeHistorical();
G4PolyconeHistorical( const G4PolyconeHistorical& source );
G4PolyconeHistorical& operator=( const G4PolyconeHistorical& right );
G4double Start_angle;
G4double Opening_angle;
G4int Num_z_planes;
G4double *Z_values;
G4double *Rmin;
G4double *Rmax;
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4PolyconeSide.hh 67973 2013-03-13 10:16:25Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -63,7 +63,42 @@ struct G4PolyconeSideRZ
{
G4double r, z; // start of vector
};
// ----------------------------------------------------------------------------
// MT-specific utility code
#include "G4GeomSplitter.hh"
// The class G4PlSideData is introduced to encapsulate the
// fields of the class G4PolyconeSide that may not be read-only.
//
class G4PlSideData
{
public:
void initialize()
{
fPhi.first = G4ThreeVector(0,0,0);
fPhi.second= 0.0;
}
std::pair<G4ThreeVector, G4double> fPhi; // Cached value for phi
};
// The type G4PlSideManager is introduced to
// encapsulate the methods used by both the master thread and
// worker threads to allocate memory space for the fields encapsulated
// by the class G4PlSideData.
//
typedef G4GeomSplitter<G4PlSideData> G4PlSideManager;
// This macro changes the references to fields that are now encapsulated
// in the class G4PlSideData.
//
#define G4MT_pcphi ((subInstanceManager.offset[instanceID]).fPhi)
//
// ----------------------------------------------------------------------------
class G4PolyconeSide : public G4VCSGface
{
public:
@@ -110,6 +145,12 @@ class G4PolyconeSide : public G4VCSGface
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
inline G4int GetInstanceID() const { return instanceID; }
// Returns the instance ID.
static const G4PlSideManager& GetSubInstanceManager();
// Returns the private data instance manager.
protected:
G4double DistanceAway( const G4ThreeVector &p, G4bool opposite,
@@ -155,9 +196,13 @@ class G4PolyconeSide : public G4VCSGface
private:
std::pair<G4ThreeVector, G4double> fPhi; // Cached value for phi
G4double kCarTolerance; // Geometrical surface thickness
G4double fSurfaceArea; // Used for surface calculation
G4int instanceID;
// This field is used as instance ID.
G4GEOM_DLL static G4PlSideManager subInstanceManager;
// This field helps to use the class G4PlSideManager introduced above.
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Polyhedra.hh 76263 2013-11-08 11:41:52Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -58,32 +58,24 @@
// Author:
// David C. Williams (davidw@scipp.ucsc.edu)
// --------------------------------------------------------------------
#ifndef G4Polyhedra_hh
#define G4Polyhedra_hh
#if defined(G4GEOM_USE_USOLIDS)
#define G4GEOM_USE_UPOLYHEDRA 1
#endif
#if defined(G4GEOM_USE_UPOLYHEDRA)
#define G4UPolyhedra G4Polyhedra
#include "G4UPolyhedra.hh"
#else
#include "G4VCSGfaceted.hh"
#include "G4PolyhedraSide.hh"
#include "G4PolyhedraHistorical.hh"
class G4EnclosingCylinder;
class G4ReduciblePolygon;
class G4PolyhedraHistorical
{
public:
G4PolyhedraHistorical();
~G4PolyhedraHistorical();
G4PolyhedraHistorical( const G4PolyhedraHistorical &source );
G4PolyhedraHistorical& operator=( const G4PolyhedraHistorical& right );
G4double Start_angle;
G4double Opening_angle;
G4int numSide;
G4int Num_z_planes;
G4double *Z_values;
G4double *Rmin;
G4double *Rmax;
};
class G4Polyhedra : public G4VCSGfaceted
{
@@ -128,7 +120,6 @@ class G4Polyhedra : public G4VCSGfaceted
std::ostream& StreamInfo( std::ostream& os ) const;
G4Polyhedron* CreatePolyhedron() const;
G4NURBS* CreateNURBS() const;
G4bool Reset();
@@ -162,7 +153,7 @@ class G4Polyhedra : public G4VCSGfaceted
protected: // without description
inline void SetOriginalParameters();
void SetOriginalParameters(G4ReduciblePolygon *rz);
// Sets internal parameters for the generic constructor.
void Create( G4double phiStart, // initial phi starting angle
@@ -201,3 +192,5 @@ class G4Polyhedra : public G4VCSGfaceted
#include "G4Polyhedra.icc"
#endif
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Polyhedra.icc 75218 2013-10-29 16:11:15Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -94,28 +94,3 @@ void G4Polyhedra::SetOriginalParameters(G4PolyhedraHistorical* pars)
fCubicVolume = 0.;
fpPolyhedron = 0;
}
inline
void G4Polyhedra::SetOriginalParameters()
{
G4int numPlanes = (G4int) numCorner/2;
original_parameters = new G4PolyhedraHistorical;
original_parameters->Z_values = new G4double[numPlanes];
original_parameters->Rmin = new G4double[numPlanes];
original_parameters->Rmax = new G4double[numPlanes];
for(G4int j=0; j < numPlanes; j++)
{
original_parameters->Z_values[j] = corners[numPlanes+j].z;
original_parameters->Rmax[j] = corners[numPlanes+j].r;
original_parameters->Rmin[j] = corners[numPlanes-1-j].r;
}
original_parameters->Start_angle = startPhi;
original_parameters->Opening_angle = endPhi-startPhi;
original_parameters->Num_z_planes = numPlanes;
original_parameters->numSide = numSide;
}
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id:$
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
//
// G4PolyhedraHistorical.hh
//
// Class description:
//
// Data structure for G4Polyhedra
// --------------------------------------------------------------------
#ifndef G4Polyhedra_Historical_hh
#define G4Polyhedra_Historical_hh
#include "G4Types.hh"
class G4PolyhedraHistorical
{
public:
G4PolyhedraHistorical();
G4PolyhedraHistorical( G4int z_planes );
~G4PolyhedraHistorical();
G4PolyhedraHistorical( const G4PolyhedraHistorical &source );
G4PolyhedraHistorical& operator=( const G4PolyhedraHistorical& right );
G4double Start_angle;
G4double Opening_angle;
G4int numSide;
G4int Num_z_planes;
G4double *Z_values;
G4double *Rmin;
G4double *Rmax;
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4PolyhedraSide.hh 67973 2013-03-13 10:16:25Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -65,6 +65,40 @@ struct G4PolyhedraSideRZ
G4double r, z; // start of vector
};
// ----------------------------------------------------------------------------
// MT-specific utility code
#include "G4GeomSplitter.hh"
// The class G4PhSideData is introduced to encapsulate the
// fields of the class G4PolyhedraSide that may not be read-only.
//
class G4PhSideData
{
public:
void initialize()
{
fPhi.first = G4ThreeVector(0,0,0);
fPhi.second= 0.0;
}
std::pair<G4ThreeVector, G4double> fPhi; // Cached value for phi
};
// The type G4PhSideManager is introduced to encapsulate the methods used
// by both the master thread and worker threads to allocate memory space
// for the fields encapsulated by the class G4PhSideData.
//
typedef G4GeomSplitter<G4PhSideData> G4PhSideManager;
// This macro changes the references to fields that are now encapsulated
// in the class G4PhSideData.
//
#define G4MT_phphi ((subInstanceManager.offset[instanceID]).fPhi)
//
// ----------------------------------------------------------------------------
class G4PolyhedraSide : public G4VCSGface
{
@@ -124,6 +158,12 @@ class G4PolyhedraSide : public G4VCSGface
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
inline G4int GetInstanceID() const { return instanceID; }
// Returns the instance ID.
static const G4PhSideManager& GetSubInstanceManager();
// Returns the private data instance manager.
protected:
//
@@ -197,9 +237,13 @@ class G4PolyhedraSide : public G4VCSGface
private:
std::pair<G4ThreeVector, G4double> fPhi; // Cached value for phi
G4double kCarTolerance; // Geometrical surface thickness
G4double fSurfaceArea; // Surface Area
G4int instanceID;
// This field is used as instance ID.
G4GEOM_DLL static G4PhSideManager subInstanceManager;
// This field helps to use the class G4PhSideManager introduced above.
};
#endif
@@ -24,7 +24,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4QuadrangularFacet.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4ReduciblePolygon.hh 72091 2013-07-09 09:55:52Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -100,6 +100,7 @@ class G4ReduciblePolygon
G4bool RemoveRedundantVertices( G4double tolerance );
void ReverseOrder();
void StartWithZMin();
//
// Tests
@@ -108,7 +109,7 @@ class G4ReduciblePolygon
G4bool CrossesItself( G4double tolerance );
G4bool BisectedBy( G4double a1, G4double b1,
G4double a2, G4double b2, G4double tolerance );
void Print(); // Debugging only
public: // without description
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4SolidExtentList.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -0,0 +1,90 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Description:
// Manage the per-thread state of solids - those which
// have a per-thread state and dependent classes (if any)
// In particular it
// - owns the arrays that implement 'split' classes
// - classes/objects which are owned by the split classes.
// Background: the classes/objects affected are
// - 'split' classes part of its state is per-thread,
// - per-thread objects, in particular those which are owned
// by the split classes.
// Goal: Take ownership and control of per-thread state of
// classes to work with multi-threading.
// Offshoot of G4GeometryWorkspace, to deal with Solids.
//
// Designed / created by John Apostolakis
// Interface design - review with Andrea Dotti.
//
// First version: 4th Oct 2013
// Created due to dependency issue with G4GeometryWorkspace
// Working version:
#ifndef G4SOLIDSWORKSPACE_HH
#define G4SOLIDSWORKSPACE_HH
#include "G4VSolid.hh"
#include "G4PolyconeSide.hh"
#include "G4PolyhedraSide.hh"
// #include "G4AutoLock.hh"
class G4SolidsWorkspace
{
public:
G4SolidsWorkspace(G4bool verbose=false);
~G4SolidsWorkspace();
void UseWorkspace(); //Take ownership
void ReleaseWorkspace(); //Release ownership
void DestroyWorkspace(); //Release ownership and destroy
void InitialiseWorkspace();
// To be called at start of each run (especially 2nd and further runs)
void SetVerbose(G4bool v) { fVerbose=v; }
G4bool GetVerbose() { return fVerbose; }
protected: // Implementation methods
void InitialiseSolids();
private: // Helper pointers - can be per instance or shared
G4PlSideManager *fpPolyconeSideSIM;
G4PhSideManager *fpPolyhedraSideSIM;
// Per Instance variables
// NOTE: the ownership of the Data Arrays is IN this object
private:
// Store SubInstanceManager object pointers (SIM pointers)
G4PlSideData *fPolyconeSideOffset;
G4PhSideData *fPolyhedraSideOffset;
G4bool fVerbose;
};
#endif //G4SOLIDSWORKSPACE_HH
@@ -0,0 +1,80 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Create, recycle and Workspaces
// Only one object of this type exists - it is a true Singleton (not per thread).
#ifndef G4SOLIDSWORKSPACEPOOL_HH
#define G4SOLIDSWORKSPACEPOOL_HH
class G4SolidsWorkspace;
// #include "G4SolidsWorkspace.hh"
//Note: Investigate potential to make it a template - on the workspace type
class G4SolidsWorkspacePool
{
public:
static G4SolidsWorkspacePool* GetInstance();
// For use with simple MT mode - each thread gets a workspace and uses it until end
G4SolidsWorkspace* CreateWorkspace();
void CreateAndUseWorkspace(); // Create it (as above) and use it
// For use with 'dynamic' model of threading - workspaces can be recycled
G4SolidsWorkspace* FindOrCreateWorkspace();
// Reuse an existing workspace - or create a new one if needed.
// This will never fail, except if system is out of resources
inline G4SolidsWorkspace* GetWorkspace() { return fMyWorkspace; }
// Give back the existing, active workspace for my thread / task
void Recycle( G4SolidsWorkspace * );
// Keep the unused Workspace - for recycling
void CleanUpAndDestroyAllWorkspaces();
// To be called once at the end of the job
protected:
void ReleaseAndDestroyWorkspace(G4SolidsWorkspace*);
// Destroy workspace - after releasing it
// void RegisterWarehouse( G4GeometryWarehouse *) ;
// The (optional) warehouse keeps a list of free workspaces
private:
G4SolidsWorkspacePool();
~G4SolidsWorkspacePool();
private:
static G4SolidsWorkspacePool* thePool;
static G4ThreadLocal G4SolidsWorkspace* fMyWorkspace;
// The thread's workspace - if assigned.
};
#endif //G4GEOMETRYWORKSPACEPOOL_HH
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4SurfBits.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id:$
// $Id: G4SurfaceVoxelizer.hh 72335 2013-07-16 09:01:49Z gcosmo $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// --------------------------------------------------------------------
@@ -78,7 +78,7 @@ class G4SurfaceVoxelizer
void DisplayVoxelLimits();
void DisplayBoundaries();
void DisplayListNodes();
void DisplayListNodes() const;
G4SurfaceVoxelizer();
~G4SurfaceVoxelizer();
@@ -185,11 +185,11 @@ class G4SurfaceVoxelizer
private:
static int fDefaultVoxelsCount;
static G4ThreadLocal G4int fDefaultVoxelsCount;
void BuildEmpty ();
G4String GetCandidatesAsString(const G4SurfBits &bits);
G4String GetCandidatesAsString(const G4SurfBits &bits) const;
void CreateSortedBoundary(std::vector<G4double> &boundaryRaw, G4int axis);
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id:$
// $Id: G4SurfaceVoxelizer.icc 72335 2013-07-16 09:01:49Z gcosmo $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// --------------------------------------------------------------------
@@ -62,7 +62,13 @@ void G4SurfaceVoxelizer::GetVoxel(std::vector<G4int> &curVoxel,
{
for (G4int i=0; i<=2; ++i)
{
curVoxel[i] = BinarySearch(GetBoundary(i), point[i]);
const std::vector<double> &boundary = GetBoundary(i);
G4int n = BinarySearch(boundary, point[i]);
if (n == -1)
{ n = 0; }
else if (n == G4int(boundary.size()) - 1)
{ n--; }
curVoxel[i] = n;
}
}
@@ -25,7 +25,6 @@
// ********************************************************************
//
// $Id:
// GEANT4 tag $Name: not supported by cvs2svn $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -24,7 +24,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TessellatedSolid.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -200,7 +200,6 @@ class G4TessellatedSolid : public G4VSolid
virtual G4Polyhedron* CreatePolyhedron () const;
virtual G4Polyhedron* GetPolyhedron () const;
virtual G4NURBS* CreateNURBS () const;
virtual void DescribeYourselfTo (G4VGraphicsScene& scene) const;
virtual G4VisExtent GetExtent () const;
@@ -28,7 +28,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4Tet.hh 76263 2013-11-08 11:41:52Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -51,6 +51,15 @@
#ifndef G4TET_HH
#define G4TET_HH
#if defined(G4GEOM_USE_USOLIDS)
#define G4GEOM_USE_UTET 1
#endif
#if defined(G4GEOM_USE_UTET)
#define G4UTet G4Tet
#include "G4UTet.hh"
#else
#include "G4VSolid.hh"
class G4Tet : public G4VSolid
@@ -107,7 +116,6 @@ class G4Tet : public G4VSolid
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
G4VisExtent GetExtent () const;
G4Polyhedron* CreatePolyhedron () const;
G4NURBS* CreateNURBS () const;
G4Polyhedron* GetPolyhedron () const;
public: // without description
@@ -122,7 +130,7 @@ class G4Tet : public G4VSolid
// Copy constructor and assignment operator.
const char* CVSHeaderVers()
{ return "$Id: G4Tet.hh,v 1.11 2010-10-20 08:54:18 gcosmo Exp $"; }
{ return "$Id: G4Tet.hh 76263 2013-11-08 11:41:52Z gcosmo $"; }
const char* CVSFileVers()
{ return CVSVers; }
void PrintWarnings(G4bool flag)
@@ -164,3 +172,5 @@ class G4Tet : public G4VSolid
};
#endif
#endif
@@ -24,7 +24,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4TriangularFacet.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistBoxSide.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistTrapAlphaSide.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistTrapFlatSide.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistTrapParallelSide.hh 67973 2013-03-13 10:16:25Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -149,9 +149,6 @@ class G4TwistTrapParallelSide : public G4VTwistSurface
G4double fDy2minus1; // fDy2 - fDy1 -
G4double fa1md1; // 2 fDx2 - 2 fDx1 == a1 - d1
G4double fa2md2; // 2 fDx4 - 2 fDx3
G4double fDy ; // temporary
};
//========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistTubsFlatSide.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistTubsHypeSide.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistTubsSide.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistedBox.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistedTrap.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistedTrd.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4TwistedTubs.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -129,7 +129,6 @@ class G4TwistedTubs : public G4VSolid
void DescribeYourselfTo (G4VGraphicsScene &scene) const;
G4Polyhedron *CreatePolyhedron () const;
G4NURBS *CreateNURBS () const;
G4Polyhedron *GetPolyhedron () const;
std::ostream &StreamInfo(std::ostream& os) const;
@@ -0,0 +1,117 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id:$
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
//
// G4UGenericPolycone
//
// Class description:
//
// Wrapper class for G4UGenericPolycone to make use of it from USolids module.
// History:
// 30.10.13 G.Cosmo, CERN/PH
// --------------------------------------------------------------------
#ifndef G4UGENERICPOLYCONE_hh
#define G4UGENERICPOLYCONE_hh
#include "G4USolid.hh"
#include "UGenericPolycone.hh"
#include "G4PolyconeSide.hh"
class G4UGenericPolycone : public G4USolid
{
public: // with description
G4UGenericPolycone(const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numRZ, // number corners in r,z space
const G4double r[], // r coordinate of these corners
const G4double z[] ); // z coordinate of these corners
~G4UGenericPolycone();
inline UGenericPolycone* GetShape() const;
inline G4double GetStartPhi() const;
inline G4double GetEndPhi() const;
inline G4bool IsOpen() const;
inline G4int GetNumRZCorner() const;
inline G4PolyconeSideRZ GetCorner(G4int index) const;
public: // without description
G4UGenericPolycone(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
G4UGenericPolycone( const G4UGenericPolycone& source );
G4UGenericPolycone &operator=(const G4UGenericPolycone& source);
// Copy constructor and assignment operator.
G4Polyhedron* CreatePolyhedron() const;
};
// --------------------------------------------------------------------
// Inline methods
// --------------------------------------------------------------------
inline UGenericPolycone* G4UGenericPolycone::GetShape() const
{
return (UGenericPolycone*) fShape;
}
inline G4double G4UGenericPolycone::GetStartPhi() const
{
return GetShape()->GetStartPhi();
}
inline G4double G4UGenericPolycone::GetEndPhi() const
{
return GetShape()->GetEndPhi();
}
inline G4bool G4UGenericPolycone::IsOpen() const
{
return GetShape()->IsOpen();
}
inline G4int G4UGenericPolycone::GetNumRZCorner() const
{
return GetShape()->GetNumRZCorner();
}
inline G4PolyconeSideRZ G4UGenericPolycone::GetCorner(G4int index) const
{
UPolyconeSideRZ pside = GetShape()->GetCorner(index);
G4PolyconeSideRZ psiderz = { pside.r, pside.z };
return psiderz;
}
#endif
@@ -0,0 +1,169 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id:$
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
//
// G4UPolycone
//
// Class description:
//
// Wrapper class for UPolycone to make use of it from USolids module.
// History:
// 31.10.13 G.Cosmo, CERN/PH
// --------------------------------------------------------------------
#ifndef G4UPOLYCONE_HH
#define G4UPOLYCONE_HH
#include "G4USolid.hh"
#include "UPolycone.hh"
#include "G4PolyconeSide.hh"
#include "G4PolyconeHistorical.hh"
class G4UPolycone : public G4USolid
{
public: // with description
G4UPolycone(const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numZPlanes, // number of z planes
const G4double zPlane[], // position of z planes
const G4double rInner[], // tangent distance to inner surface
const G4double rOuter[] ); // tangent distance to outer surface
G4UPolycone(const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numRZ, // number corners in r,z space
const G4double r[], // r coordinate of these corners
const G4double z[] ); // z coordinate of these corners
~G4UPolycone();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep);
inline UPolycone* GetShape() const;
inline G4double GetStartPhi() const;
inline G4double GetEndPhi() const;
inline G4bool IsOpen() const;
inline G4int GetNumRZCorner() const;
inline G4PolyconeSideRZ GetCorner(G4int index) const;
inline G4PolyconeHistorical* GetOriginalParameters() const;
inline void SetOriginalParameters(G4PolyconeHistorical* pars);
inline G4bool Reset();
public: // without description
G4UPolycone(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
G4UPolycone( const G4UPolycone &source );
G4UPolycone &operator=( const G4UPolycone &source );
// Copy constructor and assignment operator.
G4Polyhedron* CreatePolyhedron() const;
};
// --------------------------------------------------------------------
// Inline methods
// --------------------------------------------------------------------
inline UPolycone* G4UPolycone::GetShape() const
{
return (UPolycone*) fShape;
}
inline G4double G4UPolycone::GetStartPhi() const
{
return GetShape()->GetStartPhi();
}
inline G4double G4UPolycone::GetEndPhi() const
{
return GetShape()->GetEndPhi();
}
inline G4bool G4UPolycone::IsOpen() const
{
return GetShape()->IsOpen();
}
inline G4int G4UPolycone::GetNumRZCorner() const
{
return GetShape()->GetNumRZCorner();
}
inline G4PolyconeSideRZ G4UPolycone::GetCorner(G4int index) const
{
UPolyconeSideRZ pside = GetShape()->GetCorner(index);
G4PolyconeSideRZ psiderz = { pside.r, pside.z };
return psiderz;
}
inline G4PolyconeHistorical* G4UPolycone::GetOriginalParameters() const
{
UPolyconeHistorical* pars = GetShape()->GetOriginalParameters();
G4PolyconeHistorical* pdata = new G4PolyconeHistorical(pars->fNumZPlanes);
pdata->Start_angle = pars->fStartAngle;
pdata->Opening_angle = pars->fOpeningAngle;
for (G4int i=0; i<pars->fNumZPlanes; ++i)
{
pdata->Z_values[i] = pars->fZValues[i];
pdata->Rmin[i] = pars->Rmin[i];
pdata->Rmax[i] = pars->Rmax[i];
}
return pdata;
}
inline void G4UPolycone::SetOriginalParameters(G4PolyconeHistorical* pars)
{
UPolyconeHistorical* pdata = GetShape()->GetOriginalParameters();
pdata->fStartAngle = pars->Start_angle;
pdata->fOpeningAngle = pars->Opening_angle;
pdata->fNumZPlanes = pars->Num_z_planes;
for (G4int i=0; i<pdata->fNumZPlanes; ++i)
{
pdata->fZValues[i] = pars->Z_values[i];
pdata->Rmin[i] = pars->Rmin[i];
pdata->Rmax[i] = pars->Rmax[i];
}
ResetPolyhedron();
}
inline G4bool G4UPolycone::Reset()
{
GetShape()->Reset();
return 0;
}
#endif
@@ -0,0 +1,183 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id:$
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
//
// G4UPolyhedra
//
// Class description:
//
// Wrapper class for UPolyhedra to make use of it from USolids module.
// History:
// 31.10.13 G.Cosmo, CERN/PH
// --------------------------------------------------------------------
#ifndef G4UPOLYHEDRA_HH
#define G4UPOLYHEDRA_HH
#include "G4USolid.hh"
#include "UPolyhedra.hh"
#include "G4PolyhedraSide.hh"
#include "G4PolyhedraHistorical.hh"
class G4EnclosingCylinder;
class G4ReduciblePolygon;
class G4UPolyhedra : public G4USolid
{
public: // with description
G4UPolyhedra( const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numSide, // number sides
G4int numZPlanes, // number of z planes
const G4double zPlane[], // position of z planes
const G4double rInner[], // tangent distance to inner surface
const G4double rOuter[] ); // tangent distance to outer surface
G4UPolyhedra( const G4String& name,
G4double phiStart, // initial phi starting angle
G4double phiTotal, // total phi angle
G4int numSide, // number sides
G4int numRZ, // number corners in r,z space
const G4double r[], // r coordinate of these corners
const G4double z[] ); // z coordinate of these corners
~G4UPolyhedra();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep);
inline UPolyhedra* GetShape() const;
inline G4int GetNumSide() const;
inline G4double GetStartPhi() const;
inline G4double GetEndPhi() const;
inline G4bool IsOpen() const;
inline G4bool IsGeneric() const;
inline G4int GetNumRZCorner() const;
inline G4PolyhedraSideRZ GetCorner( const G4int index ) const;
inline G4PolyhedraHistorical* GetOriginalParameters() const;
inline void SetOriginalParameters(G4PolyhedraHistorical* pars);
inline G4bool Reset();
public: // without description
G4UPolyhedra(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
G4UPolyhedra( const G4UPolyhedra &source );
G4UPolyhedra &operator=( const G4UPolyhedra &source );
// Copy constructor and assignment operator.
G4Polyhedron* CreatePolyhedron() const;
};
// --------------------------------------------------------------------
// Inline methods
// --------------------------------------------------------------------
inline UPolyhedra* G4UPolyhedra::GetShape() const
{
return (UPolyhedra*) fShape;
}
inline G4int G4UPolyhedra::GetNumSide() const
{
return GetShape()->GetNumSide();
}
inline G4double G4UPolyhedra::GetStartPhi() const
{
return GetShape()->GetStartPhi();
}
inline G4double G4UPolyhedra::GetEndPhi() const
{
return GetShape()->GetEndPhi();
}
inline G4bool G4UPolyhedra::IsOpen() const
{
return GetShape()->IsOpen();
}
inline G4bool G4UPolyhedra::IsGeneric() const
{
return GetShape()->IsGeneric();
}
inline G4int G4UPolyhedra::GetNumRZCorner() const
{
return GetShape()->GetNumRZCorner();
}
inline G4PolyhedraSideRZ G4UPolyhedra::GetCorner(G4int index) const
{
UPolyhedraSideRZ pside = GetShape()->GetCorner(index);
G4PolyhedraSideRZ psiderz = { pside.r, pside.z };
return psiderz;
}
inline G4PolyhedraHistorical* G4UPolyhedra::GetOriginalParameters() const
{
UPolyhedraHistorical* pars = GetShape()->GetOriginalParameters();
G4PolyhedraHistorical* pdata = new G4PolyhedraHistorical(pars->fNumZPlanes);
pdata->Start_angle = pars->fStartAngle;
pdata->Opening_angle = pars->fOpeningAngle;
pdata->numSide = pars->fNumSide;
for (G4int i=0; i<pars->fNumZPlanes; ++i)
{
pdata->Z_values[i] = pars->fZValues[i];
pdata->Rmin[i] = pars->Rmin[i];
pdata->Rmax[i] = pars->Rmax[i];
}
return pdata;
}
inline void G4UPolyhedra::SetOriginalParameters(G4PolyhedraHistorical* pars)
{
UPolyhedraHistorical* pdata = GetShape()->GetOriginalParameters();
pdata->fStartAngle = pars->Start_angle;
pdata->fOpeningAngle = pars->Opening_angle;
pdata->fNumSide = pars->numSide;
pdata->fNumZPlanes = pars->Num_z_planes;
for (G4int i=0; i<pdata->fNumZPlanes; ++i)
{
pdata->fZValues[i] = pars->Z_values[i];
pdata->Rmin[i] = pars->Rmin[i];
pdata->Rmax[i] = pars->Rmax[i];
}
ResetPolyhedron();
}
inline G4bool G4UPolyhedra::Reset()
{
return GetShape()->Reset();
}
#endif
@@ -0,0 +1,104 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * Vanderbilt University Free Electron Laser Center *
// * Vanderbilt University, Nashville, TN, USA *
// * Development supported by: *
// * United States MFEL program under grant FA9550-04-1-0045 *
// * and NASA under contract number NNG04CT05P. *
// * Written by Marcus H. Mendenhall and Robert A. Weller. *
// * *
// * Contributed to the Geant4 Core, January, 2005. *
// * *
// ********************************************************************
//
//
// $Id:$
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
// G4UTet
//
// Class description:
//
// Wrapper class for UTet to make use of UTet from USolids module.
// History:
// 1.11.13 G.Cosmo, CERN/PH
// --------------------------------------------------------------------
#ifndef G4UTET_HH
#define G4UTET_HH
#include "G4USolid.hh"
#include "UTet.hh"
class G4UTet : public G4USolid
{
public: // with description
G4UTet(const G4String& pName,
G4ThreeVector anchor,
G4ThreeVector p2,
G4ThreeVector p3,
G4ThreeVector p4,
G4bool *degeneracyFlag=0);
~G4UTet();
inline UTet* GetShape() const;
public: // without description
G4UTet(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
G4UTet(const G4UTet& rhs);
G4UTet& operator=(const G4UTet& rhs);
// Copy constructor and assignment operator.
inline std::vector<G4ThreeVector> GetVertices() const;
// Return the four vertices of the shape.
};
// --------------------------------------------------------------------
// Inline methods
// --------------------------------------------------------------------
inline UTet* G4UTet::GetShape() const
{
return (UTet*) fShape;
}
inline std::vector<G4ThreeVector> G4UTet::GetVertices() const
{
std::vector<UVector3> vec = GetShape()->GetVertices();
std::vector<G4ThreeVector> vertices;
for (unsigned int i=0; i<vec.size(); ++i)
{
G4ThreeVector v(vec[i].x, vec[i].y, vec[i].z);
vertices.push_back(v);
}
return vertices;
}
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4VCSGface.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4VCSGfaceted.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4VFacet.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4VTwistSurface.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4VTwistSurface.icc 66356 2012-12-18 09:02:32Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4VTwistedFaceted.hh 66356 2012-12-18 09:02:32Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -110,7 +110,6 @@ class G4VTwistedFaceted: public G4VSolid
virtual void DescribeYourselfTo (G4VGraphicsScene &scene) const;
virtual G4Polyhedron *CreatePolyhedron () const ;
virtual G4NURBS *CreateNURBS () const;
virtual G4Polyhedron *GetPolyhedron () const;
virtual std::ostream &StreamInfo(std::ostream& os) const;