Import Geant4 10.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2017-06-30 10:49:55 +02:00
parent 3a5407696b
commit 1a1316fea4
2180 changed files with 237880 additions and 59109 deletions
+2 -7
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Box.hh 99469 2016-09-22 15:04:36Z gcosmo $
// $Id: G4Box.hh 104316 2017-05-24 13:04:23Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -75,7 +75,7 @@ class G4Box : public G4CSGSolid
const G4int n,
const G4VPhysicalVolume* pRep);
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -130,11 +130,6 @@ class G4Box : public G4CSGSolid
G4Box& operator=(const G4Box& rhs);
// Copy constructor and assignment operator.
protected: // without description
enum ESide {kUndefined,kPX,kMX,kPY,kMY,kPZ,kMZ};
// Codes for faces (kPX= +x face, kMY= -y face, etc...)
private:
G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p) const;
+2 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Cons.hh 100820 2016-11-02 15:18:48Z gcosmo $
// $Id: G4Cons.hh 104316 2017-05-24 13:04:23Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -129,7 +129,7 @@ class G4Cons : public G4CSGSolid
const G4int n,
const G4VPhysicalVolume* pRep );
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent( const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CutTubs.hh 100820 2016-11-02 15:18:48Z gcosmo $
// $Id: G4CutTubs.hh 104316 2017-05-24 13:04:23Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -77,7 +77,7 @@ class G4CutTubs : public G4OTubs
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent( const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -136,7 +136,7 @@ class G4CutTubs : public G4OTubs
void GetMaxMinZ(G4double& zmin,G4double& zmax)const;
// Get Max and Min values of Z on Cutted Plane,
// Used for Calculate Extent()
// Used for Calculate BoundingLimits()
private:
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CutTubs.icc 102769 2017-02-22 09:05:45Z gcosmo $
// $Id: G4CutTubs.icc 102768 2017-02-22 08:55:14Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -88,7 +88,7 @@ class G4OTubs : public G4CSGSolid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent( const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
+3 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Orb.hh 100820 2016-11-02 15:18:48Z gcosmo $
// $Id: G4Orb.hh 104316 2017-05-24 13:04:23Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -69,6 +69,7 @@ class G4Orb : public G4CSGSolid
// Accessors
inline G4double GetRadius() const;
inline G4double GetRadialTolerance() const;
// Modifiers
@@ -83,7 +84,7 @@ class G4Orb : public G4CSGSolid
const G4int n,
const G4VPhysicalVolume* pRep);
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
+7 -1
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Orb.icc 83572 2014-09-01 15:23:27Z gcosmo $
// $Id: G4Orb.icc 103471 2017-04-11 07:31:42Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -40,6 +40,12 @@ G4double G4Orb::GetRadius() const
return fRmax;
}
inline
G4double G4Orb::GetRadialTolerance() const
{
return fRmaxTolerance;
}
inline
void G4Orb::SetRadius(G4double newRmax)
{
+30 -27
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Para.hh 99509 2016-09-26 07:48:56Z gcosmo $
// $Id: G4Para.hh 104452 2017-05-31 15:41:24Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -81,21 +81,21 @@ class G4Para : public G4CSGSolid
G4Para(const G4String& pName,
G4double pDx, G4double pDy, G4double pDz,
G4double pAlpha, G4double pTheta, G4double pPhi);
G4Para(const G4String& pName,
const G4ThreeVector pt[8]);
virtual ~G4Para();
// Accessors
// Accessors
inline G4double GetZHalfLength() const;
inline G4ThreeVector GetSymAxis() const;
inline G4double GetYHalfLength() const;
inline G4double GetXHalfLength() const;
inline G4double GetTanAlpha() const;
// Modifiers
// Modifiers
inline void SetXHalfLength(G4double val);
inline void SetYHalfLength(G4double val);
@@ -104,25 +104,25 @@ class G4Para : public G4CSGSolid
inline void SetTanAlpha(G4double val);
inline void SetThetaAndPhi(double pTheta, double pPhi);
void SetAllParameters(G4double pDx, G4double pDy, G4double pDz,
void SetAllParameters(G4double pDx, G4double pDy, G4double pDz,
G4double pAlpha, G4double pTheta, G4double pPhi);
// Other methods of solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
// Methods of solid
G4double GetCubicVolume();
G4double GetSurfaceArea();
void ComputeDimensions(G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep);
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
const G4AffineTransform& pTransform,
G4double& pMin, G4double& pMax) const;
G4double& pMin, G4double& pMax) const;
EInside Inside(const G4ThreeVector& p) const;
G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
@@ -130,7 +130,7 @@ class G4Para : public G4CSGSolid
G4double DistanceToIn(const G4ThreeVector& p,
const G4ThreeVector& v) const;
G4double DistanceToIn(const G4ThreeVector& p) const;
G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v,
const G4bool calcNorm=G4bool(false),
G4bool *validNorm=0, G4ThreeVector *n=0) const;
@@ -138,13 +138,13 @@ class G4Para : public G4CSGSolid
G4GeometryType GetEntityType() const;
G4ThreeVector GetPointOnSurface() const;
G4ThreeVector GetPointOnSurface() const;
G4VSolid* Clone() const;
std::ostream& StreamInfo(std::ostream& os) const;
// Visualisation functions
// Visualisation functions
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
G4Polyhedron* CreatePolyhedron () const;
@@ -154,27 +154,30 @@ class G4Para : public G4CSGSolid
G4Para(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
// persistifiable objects
G4Para(const G4Para& rhs);
G4Para& operator=(const G4Para& rhs);
// Copy constructor and assignment operator.
G4Para& operator=(const G4Para& rhs);
// Copy constructor and assignment operator
private:
void CheckParameters();
// Check parameters
void MakePlanes();
// Set side planes
G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p) const;
// Algorithm for SurfaceNormal() following the original
// specification for points not on the surface
G4ThreeVector GetPointOnPlane(G4ThreeVector p0, G4ThreeVector p1,
G4ThreeVector p2, G4ThreeVector p3,
G4double& area) const;
// Returns a random point on the surface of one of the faces.
private:
private:
G4double halfCarTolerance;
G4double fDx,fDy,fDz;
G4double fTalpha,fTthetaCphi,fTthetaSphi;
struct { G4double a,b,c,d; } fPlanes[4];
};
#include "G4Para.icc"
+47 -55
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Para.icc 83572 2014-09-01 15:23:27Z gcosmo $
// $Id: G4Para.icc 104452 2017-05-31 15:41:24Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -37,114 +37,106 @@
inline
G4double G4Para::GetZHalfLength() const
{
return fDz ;
return fDz;
}
inline
G4ThreeVector G4Para::GetSymAxis() const
{
G4double cosTheta = 1.0/std::sqrt(1+fTthetaCphi*fTthetaCphi +
fTthetaSphi*fTthetaSphi) ;
return G4ThreeVector(fTthetaCphi*cosTheta,
fTthetaSphi*cosTheta,
cosTheta) ;
return G4ThreeVector(fTthetaCphi,fTthetaSphi,1.).unit();
}
inline
G4double G4Para::GetYHalfLength() const
{
return fDy ;
return fDy;
}
inline
G4double G4Para::GetXHalfLength() const
{
return fDx ;
return fDx;
}
inline
G4double G4Para::GetTanAlpha() const
{
return fTalpha ;
return fTalpha;
}
inline
void G4Para::SetXHalfLength(G4double val)
{
fDx= val;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fDx = val;
fCubicVolume = 0.;
fSurfaceArea = 0.;
fRebuildPolyhedron = true;
CheckParameters();
MakePlanes();
}
inline
void G4Para::SetYHalfLength(G4double val)
{
fDy= val;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fDy = val;
fCubicVolume = 0.;
fSurfaceArea = 0.;
fRebuildPolyhedron = true;
CheckParameters();
MakePlanes();
}
inline
void G4Para::SetZHalfLength(G4double val)
{
fDz= val;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fDz = val;
fCubicVolume = 0.;
fSurfaceArea = 0.;
fRebuildPolyhedron = true;
CheckParameters();
MakePlanes();
}
inline
void G4Para::SetAlpha(G4double alpha)
{
fTalpha= std::tan(alpha);
fSurfaceArea= 0.;
fCubicVolume= 0.;
fTalpha = std::tan(alpha);
fSurfaceArea = 0.;
fCubicVolume = 0.;
fRebuildPolyhedron = true;
MakePlanes();
}
inline
void G4Para::SetTanAlpha(G4double val)
{
fTalpha= val;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fTalpha = val;
fCubicVolume = 0.;
fSurfaceArea = 0.;
fRebuildPolyhedron = true;
MakePlanes();
}
inline
void G4Para::SetThetaAndPhi(double pTheta, double pPhi)
void G4Para::SetThetaAndPhi(double pTheta, double pPhi)
{
fTthetaCphi=std::tan(pTheta)*std::cos(pPhi);
fTthetaSphi=std::tan(pTheta)*std::sin(pPhi);
fCubicVolume= 0.;
fSurfaceArea= 0.;
G4double tanTheta = std::tan(pTheta);
fTthetaCphi = tanTheta*std::cos(pPhi);
fTthetaSphi = tanTheta*std::sin(pPhi);
fCubicVolume = 0.;
fSurfaceArea = 0.;
fRebuildPolyhedron = true;
}
inline
G4double G4Para::GetCubicVolume()
{
//
// It is like G4Box, since para transformations keep the volume to be const
if(fCubicVolume != 0.) {;}
else fCubicVolume = 8*fDx*fDy*fDz;
return fCubicVolume;
}
inline
G4double G4Para::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else
{
fSurfaceArea = 8*(fDx*fDy
+ fDx*fDz*std::sqrt(1+fTthetaSphi*fTthetaSphi)
+ fDy*fDz*std::sqrt(1+fTalpha*fTalpha
+std::pow(fTthetaCphi-fTthetaSphi*fTalpha, 2)) );
}
return fSurfaceArea;
MakePlanes();
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Sphere.hh 100820 2016-11-02 15:18:48Z gcosmo $
// $Id: G4Sphere.hh 104316 2017-05-24 13:04:23Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -135,7 +135,7 @@ class G4Sphere : public G4CSGSolid
const G4int n,
const G4VPhysicalVolume* pRep);
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Torus.hh 100820 2016-11-02 15:18:48Z gcosmo $
// $Id: G4Torus.hh 104316 2017-05-24 13:04:23Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -131,7 +131,7 @@ class G4Torus : public G4CSGSolid
inline G4double GetSurfaceArea();
EInside Inside(const G4ThreeVector& p) const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
const G4AffineTransform& pTransform,
+14 -20
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Trap.hh 99509 2016-09-26 07:48:56Z gcosmo $
// $Id: G4Trap.hh 104316 2017-05-24 13:04:23Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -199,14 +199,14 @@ class G4Trap : public G4CSGSolid
// Methods for solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
G4double GetCubicVolume();
G4double GetSurfaceArea();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep );
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent( const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -253,7 +253,8 @@ class G4Trap : public G4CSGSolid
protected: // with description
G4bool MakePlanes();
void MakePlanes();
void MakePlanes(const G4ThreeVector pt[8]);
G4bool MakePlane( const G4ThreeVector& p1,
const G4ThreeVector& p2,
const G4ThreeVector& p3,
@@ -262,31 +263,24 @@ class G4Trap : public G4CSGSolid
private:
void CheckParameters();
// Check parameters
void GetVertices(G4ThreeVector pt[8]) const;
// Compute coordinates of the trap vertices from planes
G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
// Algorithm for SurfaceNormal() following the original
// specification for points not on the surface
inline G4double GetFaceArea(const G4ThreeVector& p1,
const G4ThreeVector& p2,
const G4ThreeVector& p3,
const G4ThreeVector& p4);
//
// Provided four corners of plane in clockwise fashion,
// it returns the area of finite face
G4ThreeVector GetPointOnPlane(G4ThreeVector p0, G4ThreeVector p1,
G4ThreeVector p2, G4ThreeVector p3,
G4double& area) const;
//
// Returns a random point on the surface of one of the faces
private:
G4double halfCarTolerance;
G4double fDz,fTthetaCphi,fTthetaSphi;
G4double fDy1,fDx1,fDx2,fTalpha1;
G4double fDy2,fDx3,fDx4,fTalpha2;
TrapSidePlane fPlanes[4];
G4int fTrapType;
};
#include "G4Trap.icc"
+1 -58
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Trap.icc 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4Trap.icc 103371 2017-04-03 07:36:29Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -104,60 +104,3 @@ TrapSidePlane G4Trap::GetSidePlane( G4int n ) const
{
return fPlanes[n] ;
}
inline
G4double G4Trap::GetFaceArea(const G4ThreeVector& p0, const G4ThreeVector& p1,
const G4ThreeVector& p2, const G4ThreeVector& p3)
{
G4double area = 0.5*((p1-p0).cross(p2-p1).mag()+(p3-p2).cross(p0-p3).mag());
return area;
}
inline
G4double G4Trap::GetCubicVolume()
{
if(fCubicVolume != 0.) {;}
else { fCubicVolume = fDz*( (fDx1+fDx2+fDx3+fDx4)*(fDy1+fDy2)
+ (fDx4+fDx3-fDx2-fDx1)*(fDy2-fDy1)/3 ); }
return fCubicVolume;
}
inline
G4double G4Trap::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else
{
G4ThreeVector ba(fDx1-fDx2+fTalpha1*2*fDy1,2*fDy1,0);
G4ThreeVector bc(2*fDz*fTthetaCphi-(fDx4-fDx2)+fTalpha2*fDy2-fTalpha1*fDy1,
2*fDz*fTthetaSphi+fDy2-fDy1, 2*fDz);
G4ThreeVector dc(-fDx4+fDx3+2*fTalpha2*fDy2, 2*fDy2,0);
G4ThreeVector da(-2*fDz*fTthetaCphi-(fDx1-fDx3)-fTalpha1*fDy1+fTalpha2*fDy2,
-2*fDz*fTthetaSphi-fDy1+fDy2,-2*fDz);
G4ThreeVector ef(fDx2-fDx1+2*fTalpha1*fDy1, 2*fDy1,0);
G4ThreeVector eh(2*fDz*fTthetaCphi+fDx3-fDx1+fTalpha1*fDy1-fTalpha2*fDy2,
2*fDz*fTthetaSphi-fDy2+fDy1,2*fDz);
G4ThreeVector gh(fDx3-fDx4-2*fTalpha2*fDy2, -2*fDy2,0);
G4ThreeVector gf(-2*fDz*fTthetaCphi+fDx2-fDx4+fTalpha1*fDy1-fTalpha2*fDy2,
-2*fDz*fTthetaSphi+fDy1-fDy2,-2*fDz);
G4ThreeVector cr;
cr = ba.cross(bc);
G4double babc=cr.mag();
cr = dc.cross(da);
G4double dcda=cr.mag();
cr = ef.cross(eh);
G4double efeh=cr.mag();
cr = gh.cross(gf);
G4double ghgf=cr.mag();
fSurfaceArea = 2*fDy1*(fDx1+fDx2)+2*fDy2*(fDx3+fDx4)
+ (fDx1+fDx3)
* std::sqrt(4*fDz*fDz+std::pow(fDy2-fDy1-2*fDz*fTthetaSphi,2))
+ (fDx2+fDx4)
* std::sqrt(4*fDz*fDz+std::pow(fDy2-fDy1+2*fDz*fTthetaSphi,2))
+ 0.5*(babc+dcda+efeh+ghgf);
}
return fSurfaceArea;
}
+24 -21
View File
@@ -24,9 +24,9 @@
// ********************************************************************
//
//
// $Id: G4Trd.hh 99509 2016-09-26 07:48:56Z gcosmo $
// $Id: G4Trd.hh 104894 2017-06-26 13:30:00Z gcosmo $
//
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
@@ -51,7 +51,7 @@
// 17.02.95 P.Kent: Exiting normal return
// 19.08.96 P.Kent, V.Grichine: Fs in accordance with G4Box
// 21.04.97 J.Apostolakis: Added Set Methods
// 19.11.99 V.Grichine: kUndefined was added to Eside enum
// 19.11.99 V.Grichine: kUndefined was added to Eside enum
// --------------------------------------------------------------------
#ifndef G4TRD_HH
@@ -69,7 +69,7 @@
#include "G4CSGSolid.hh"
#include "G4Polyhedron.hh"
class G4Trd : public G4CSGSolid
class G4Trd : public G4CSGSolid
{
public: // with description
@@ -100,16 +100,20 @@ class G4Trd : public G4CSGSolid
inline void SetYHalfLength2(G4double val);
inline void SetZHalfLength(G4double val);
void SetAllParameters ( G4double pdx1, G4double pdx2,
G4double pdy1, G4double pdy2,
G4double pdz );
// Methods of solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
G4double GetCubicVolume();
G4double GetSurfaceArea();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep );
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent( const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -133,17 +137,9 @@ class G4Trd : public G4CSGSolid
G4double DistanceToOut( const G4ThreeVector& p ) const;
void CheckAndSetAllParameters ( G4double pdx1, G4double pdx2,
G4double pdy1, G4double pdy2,
G4double pdz );
void SetAllParameters ( G4double pdx1, G4double pdx2,
G4double pdy1, G4double pdy2,
G4double pdz );
G4GeometryType GetEntityType() const;
G4ThreeVector GetPointOnSurface() const;
G4ThreeVector GetPointOnSurface() const;
G4VSolid* Clone() const;
@@ -156,17 +152,22 @@ class G4Trd : public G4CSGSolid
public: // without description
enum ESide {kUndefined, kPX,kMX,kPY,kMY,kPZ,kMZ};
// Codes for faces (kPX=plus x face,kMY= minus y face etc)
G4Trd(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
G4Trd(const G4Trd& rhs);
G4Trd& operator=(const G4Trd& rhs);
// Copy constructor and assignment operator.
G4Trd& operator=(const G4Trd& rhs);
// Copy constructor and assignment operator
private:
void CheckParameters();
// Check parameters
void MakePlanes();
// Set side planes
G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
// Algorithm for SurfaceNormal() following the original
@@ -174,7 +175,9 @@ class G4Trd : public G4CSGSolid
private:
G4double halfCarTolerance;
G4double fDx1,fDx2,fDy1,fDy2,fDz;
struct { G4double a,b,c,d; } fPlanes[4];
};
#include "G4Trd.icc"
+6 -46
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Trd.icc 83572 2014-09-01 15:23:27Z gcosmo $
// $Id: G4Trd.icc 104358 2017-05-26 09:43:34Z gcosmo $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -67,69 +67,29 @@ G4double G4Trd::GetZHalfLength() const
inline
void G4Trd::SetXHalfLength1(G4double val)
{
fDx1= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fRebuildPolyhedron = true;
SetAllParameters(val,fDx2,fDy1,fDy2,fDz);
}
inline
void G4Trd::SetXHalfLength2(G4double val)
{
fDx2= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fRebuildPolyhedron = true;
SetAllParameters(fDx1,val,fDy1,fDy2,fDz);
}
inline
void G4Trd::SetYHalfLength1(G4double val)
{
fDy1= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fRebuildPolyhedron = true;
SetAllParameters(fDx1,fDx2,val,fDy2,fDz);
}
inline
void G4Trd::SetYHalfLength2(G4double val)
{
fDy2= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fRebuildPolyhedron = true;
SetAllParameters(fDx1,fDx2,fDy1,val,fDz);
}
inline
void G4Trd::SetZHalfLength(G4double val)
{
fDz= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fRebuildPolyhedron = true;
}
inline
G4double G4Trd::GetCubicVolume()
{
if(fCubicVolume != 0.) {;}
else
{
fCubicVolume = 2*fDz*( (fDx1+fDx2)*(fDy1+fDy2)
+ (fDx2-fDx1)*(fDy2-fDy1)/3 );
}
return fCubicVolume;
}
inline
G4double G4Trd::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else
{
fSurfaceArea = 4*(fDx1*fDy1+fDx2*fDy2)
+ 2*((fDy1+fDy2)*std::sqrt(4*fDz*fDz+(fDx2-fDx1)*(fDx2-fDx1))
+ (fDx1+fDx2) *std::sqrt(4*fDz*fDz+(fDy2-fDy1)*(fDy2-fDy1)) );
}
return fSurfaceArea;
SetAllParameters(fDx1,fDx2,fDy1,fDy2,val);
}
+2 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Tubs.hh 100820 2016-11-02 15:18:48Z gcosmo $
// $Id: G4Tubs.hh 104316 2017-05-24 13:04:23Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -128,7 +128,7 @@ class G4Tubs : public G4CSGSolid
const G4int n,
const G4VPhysicalVolume* pRep );
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent( const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
+10 -12
View File
@@ -34,7 +34,7 @@
//
// Class description:
//
// Wrapper class for UBox to make use of UBox from USolids module.
// Wrapper class for G4Box to make use of VecGeom Box.
// History:
// 13.09.13 G.Cosmo, CERN/PH
@@ -42,16 +42,19 @@
#ifndef G4UBOX_HH
#define G4UBOX_HH
#include "G4USolid.hh"
#include "G4UAdapter.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include "UBox.hh"
#include <volumes/UnplacedBox.h>
#include "G4Polyhedron.hh"
class G4UBox : public G4USolid
class G4UBox : public G4UAdapter<vecgeom::UnplacedBox>
{
using Shape_t = vecgeom::UnplacedBox;
using Base_t = G4UAdapter<vecgeom::UnplacedBox>;
public: // with description
G4UBox(const G4String& pName, G4double pX, G4double pY, G4double pZ);
@@ -65,8 +68,6 @@ class G4UBox : public G4USolid
G4VSolid* Clone() const;
inline UBox* GetShape() const;
G4double GetXHalfLength() const;
G4double GetYHalfLength() const;
G4double GetZHalfLength() const;
@@ -77,7 +78,9 @@ class G4UBox : public G4USolid
inline G4GeometryType GetEntityType() const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
std::ostream& StreamInfo(std::ostream& os) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -102,11 +105,6 @@ class G4UBox : public G4USolid
// Inline methods
// --------------------------------------------------------------------
inline UBox* G4UBox::GetShape() const
{
return (UBox*) fShape;
}
inline G4GeometryType G4UBox::GetEntityType() const
{
return "G4Box";
+7 -11
View File
@@ -43,16 +43,19 @@
#ifndef G4UCONS_HH
#define G4UCONS_HH
#include "G4USolid.hh"
#include "G4UAdapter.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include "UCons.hh"
#include <volumes/UnplacedCone.h>
#include "G4Polyhedron.hh"
class G4UCons : public G4USolid
class G4UCons : public G4UAdapter<vecgeom::UnplacedCone>
{
using Shape_t = vecgeom::UnplacedCone;
using Base_t = G4UAdapter<vecgeom::UnplacedCone>;
public: // with description
G4UCons(const G4String& pName,
@@ -70,8 +73,6 @@ class G4UCons : public G4USolid
G4VSolid* Clone() const;
inline UCons* GetShape() const;
G4double GetInnerRadiusMinusZ() const;
G4double GetOuterRadiusMinusZ() const;
G4double GetInnerRadiusPlusZ() const;
@@ -94,7 +95,7 @@ class G4UCons : public G4USolid
inline G4GeometryType GetEntityType() const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -119,11 +120,6 @@ class G4UCons : public G4USolid
// Inline methods
// --------------------------------------------------------------------
inline UCons* G4UCons::GetShape() const
{
return (UCons*) fShape;
}
inline G4GeometryType G4UCons::GetEntityType() const
{
return "G4Cons";
+8 -11
View File
@@ -42,16 +42,19 @@
#ifndef G4ORB_HH
#define G4ORB_HH
#include "G4USolid.hh"
#include "G4UAdapter.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include "UOrb.hh"
#include <volumes/UnplacedOrb.h>
#include "G4Polyhedron.hh"
class G4UOrb : public G4USolid
class G4UOrb : public G4UAdapter<vecgeom::UnplacedOrb>
{
using Shape_t = vecgeom::UnplacedOrb;
using Base_t = G4UAdapter<vecgeom::UnplacedOrb>;
public: // with description
G4UOrb(const G4String& pName, G4double pRmax);
@@ -64,14 +67,13 @@ class G4UOrb : public G4USolid
G4VSolid* Clone() const;
inline UOrb* GetShape() const;
G4double GetRadius() const;
void SetRadius(G4double newRmax);
G4double GetRadialTolerance() const;
inline G4GeometryType GetEntityType() const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -96,11 +98,6 @@ class G4UOrb : public G4USolid
// Inline methods
// --------------------------------------------------------------------
inline UOrb* G4UOrb::GetShape() const
{
return (UOrb*) fShape;
}
inline G4GeometryType G4UOrb::GetEntityType() const
{
return "G4Orb";
@@ -95,7 +95,7 @@ class G4USphere : public G4USolid
inline G4GeometryType GetEntityType() const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -90,7 +90,7 @@ class G4UTorus : public G4USolid
inline G4GeometryType GetEntityType() const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
+12 -13
View File
@@ -34,7 +34,7 @@
//
// Class description:
//
// Wrapper class for UTrap to make use of UTrap from USolids module.
// Wrapper class for G4Trap to make use of VecGeom Trapezoid.
// History:
// 13.09.13 G.Cosmo, CERN/PH
@@ -42,16 +42,19 @@
#ifndef G4UTrap_HH
#define G4UTrap_HH
#include "G4USolid.hh"
#include "G4UAdapter.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include "UTrap.hh"
#include <volumes/UnplacedTrapezoid.h>
#include "G4Polyhedron.hh"
class G4UTrap : public G4USolid
class G4UTrap : public G4UAdapter<vecgeom::UnplacedTrapezoid>
{
using Shape_t = vecgeom::UnplacedTrapezoid;
using Base_t = G4UAdapter<vecgeom::UnplacedTrapezoid>;
public: // with description
G4UTrap( const G4String& pName,
@@ -103,17 +106,18 @@ class G4UTrap : public G4USolid
G4VSolid* Clone() const;
inline UTrap* GetShape() const;
using Base_t::GetTanAlpha1;
using Base_t::GetTanAlpha2;
G4double GetZHalfLength() const;
G4double GetYHalfLength1() const;
G4double GetXHalfLength1() const;
G4double GetXHalfLength2() const;
G4double GetTanAlpha1() const;
G4double GetYHalfLength2() const;
G4double GetXHalfLength3() const;
G4double GetXHalfLength4() const;
G4double GetTanAlpha2() const;
G4double GetThetaCphi() const;
G4double GetThetaSphi() const;
TrapSidePlane GetSidePlane(G4int n) const;
G4ThreeVector GetSymAxis() const;
@@ -126,7 +130,7 @@ class G4UTrap : public G4USolid
inline G4GeometryType GetEntityType() const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -151,11 +155,6 @@ class G4UTrap : public G4USolid
// Inline methods
// --------------------------------------------------------------------
inline UTrap* G4UTrap::GetShape() const
{
return (UTrap*) fShape;
}
inline G4GeometryType G4UTrap::GetEntityType() const
{
return "G4Trap";
+8 -12
View File
@@ -34,7 +34,7 @@
//
// Class description:
//
// Wrapper class for UTrd to make use of UTrd from USolids module.
// Wrapper class for G4Trd to make use of VecGeom Trd.
// History:
// 13.09.13 G.Cosmo, CERN/PH
@@ -42,16 +42,19 @@
#ifndef G4UTRD_HH
#define G4UTRD_HH
#include "G4USolid.hh"
#include "G4UAdapter.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include "UTrd.hh"
#include <volumes/UnplacedTrd.h>
#include "G4Polyhedron.hh"
class G4UTrd : public G4USolid
class G4UTrd : public G4UAdapter<vecgeom::UnplacedTrd>
{
using Shape_t = vecgeom::UnplacedTrd;
using Base_t = G4UAdapter<vecgeom::UnplacedTrd>;
public: // with description
G4UTrd(const G4String& pName,
@@ -68,8 +71,6 @@ class G4UTrd : public G4USolid
G4VSolid* Clone() const;
inline UTrd* GetShape() const;
G4double GetXHalfLength1() const;
G4double GetXHalfLength2() const;
G4double GetYHalfLength1() const;
@@ -87,7 +88,7 @@ class G4UTrd : public G4USolid
inline G4GeometryType GetEntityType() const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -112,11 +113,6 @@ class G4UTrd : public G4USolid
// Inline methods
// --------------------------------------------------------------------
inline UTrd* G4UTrd::GetShape() const
{
return (UTrd*) fShape;
}
inline G4GeometryType G4UTrd::GetEntityType() const
{
return "G4Trd";
+8 -12
View File
@@ -35,7 +35,7 @@
//
// Class description:
//
// Wrapper class for UTubs to make use of UTubs from USolids module.
// Wrapper class for G4Tubs to make use of VecGeom Tube.
// History:
// 30.10.13 G.Cosmo, CERN/PH
@@ -44,16 +44,19 @@
#ifndef G4UTUBS_HH
#define G4UTUBS_HH
#include "G4USolid.hh"
#include "G4UAdapter.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include "UTubs.hh"
#include <volumes/UnplacedTube.h>
#include "G4Polyhedron.hh"
class G4UTubs : public G4USolid
class G4UTubs : public G4UAdapter<vecgeom::GenericUnplacedTube>
{
using Shape_t = vecgeom::GenericUnplacedTube;
using Base_t = G4UAdapter<vecgeom::GenericUnplacedTube>;
public: // with description
G4UTubs( const G4String& pName,
@@ -72,8 +75,6 @@ class G4UTubs : public G4USolid
G4VSolid* Clone() const;
inline UTubs* GetShape() const;
G4double GetInnerRadius () const;
G4double GetOuterRadius () const;
G4double GetZHalfLength () const;
@@ -92,7 +93,7 @@ class G4UTubs : public G4USolid
inline G4GeometryType GetEntityType() const;
void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -118,11 +119,6 @@ class G4UTubs : public G4USolid
// Inline methods
// --------------------------------------------------------------------
inline UTubs* G4UTubs::GetShape() const
{
return (UTubs*) fShape;
}
inline G4GeometryType G4UTubs::GetEntityType() const
{
return "G4Tubs";