Import Geant4 8.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:55:03 +02:00
parent 216a75eeb1
commit fe73f43734
6714 changed files with 118229 additions and 68144 deletions
+5 -14
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Box.hh,v 1.16 2006/06/29 18:44:04 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Box.hh,v 1.17 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
@@ -74,37 +74,28 @@ class G4Box : public G4CSGSolid
// Accessors and modifiers
inline G4double GetXHalfLength() const;
inline G4double GetYHalfLength() const;
inline G4double GetZHalfLength() const;
void SetXHalfLength(G4double dx) ;
void SetYHalfLength(G4double dy) ;
void SetZHalfLength(G4double dz) ;
inline G4double GetCubicVolume();
// Methods for solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
EInside Inside(const G4ThreeVector& p) const;
G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
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=false,
G4bool *validNorm=0, G4ThreeVector *n=0) const;
G4double DistanceToOut(const G4ThreeVector& p) const;
G4GeometryType GetEntityType() const;
G4ThreeVector GetPointOnSurface() const;
std::ostream& StreamInfo(std::ostream& os) const;
+10 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Box.icc,v 1.5 2006/06/29 18:44:07 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Box.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -60,3 +60,11 @@ G4double G4Box::GetCubicVolume()
else { fCubicVolume = 8*fDx*fDy*fDz; }
return fCubicVolume;
}
inline
G4double G4Box::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else { fSurfaceArea = 8*(fDx*fDy+fDx*fDz+fDy*fDz); }
return fSurfaceArea;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4CSGSolid.hh,v 1.11 2006/06/29 18:44:09 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4CSGSolid.hh,v 1.12 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -68,6 +68,7 @@ class G4CSGSolid : public G4VSolid
protected:
G4double fCubicVolume;
G4double fSurfaceArea;
mutable G4Polyhedron* fpPolyhedron;
};
+5 -3
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Cons.hh,v 1.16 2006/06/29 18:44:11 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Cons.hh,v 1.17 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -91,7 +91,6 @@ class G4Cons : public G4CSGSolid
inline G4double GetStartPhiAngle () const;
inline G4double GetDeltaPhiAngle () const;
inline G4double GetCubicVolume();
// Modifiers
@@ -106,6 +105,9 @@ class G4Cons : public G4CSGSolid
// Other methods for solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void ComputeDimensions(G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep);
+35 -5
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Cons.icc,v 1.5 2006/06/29 18:44:13 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Cons.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -82,6 +82,7 @@ void G4Cons::SetInnerRadiusMinusZ( G4double Rmin1 )
{
fRmin1= Rmin1 ;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -90,6 +91,7 @@ void G4Cons::SetOuterRadiusMinusZ( G4double Rmax1 )
{
fRmax1= Rmax1 ;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -98,6 +100,7 @@ void G4Cons::SetInnerRadiusPlusZ ( G4double Rmin2 )
{
fRmin2= Rmin2 ;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -106,6 +109,7 @@ void G4Cons::SetOuterRadiusPlusZ ( G4double Rmax2 )
{
fRmax2= Rmax2 ;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -114,6 +118,7 @@ void G4Cons::SetZHalfLength ( G4double newDz )
{
fDz= newDz ;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -122,6 +127,7 @@ void G4Cons::SetStartPhiAngle ( G4double newSPhi )
{
fSPhi= newSPhi;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -129,6 +135,7 @@ void G4Cons::SetDeltaPhiAngle ( G4double newDPhi )
{
fDPhi= newDPhi;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -176,12 +183,10 @@ G4double G4Cons::GetDPhi() const
return GetDeltaPhiAngle();
}
///////////////////////////////////////////////////
inline
G4double G4Cons::GetCubicVolume()
{
if(fCubicVolume != 0.) ;
if(fCubicVolume != 0.) {;}
else
{
G4double Rmean, rMean, deltaR, deltar;
@@ -196,3 +201,28 @@ G4double G4Cons::GetCubicVolume()
}
return fCubicVolume;
}
inline
G4double G4Cons::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else
{
G4double mmin, mmax, dmin, dmax;
mmin= (fRmin1+fRmin2)*0.5;
mmax= (fRmax1+fRmax2)*0.5;
dmin= (fRmin2-fRmin1);
dmax= (fRmax2-fRmax1);
fSurfaceArea = fDPhi*( mmin * std::sqrt(dmin*dmin+4*fDz*fDz)
+ mmax * std::sqrt(dmax*dmax+4*fDz*fDz)
+ 0.5*(fRmax1*fRmax1-fRmin1*fRmin1
+fRmax2*fRmax2-fRmin2*fRmin2 ));
if(fDPhi < twopi )
{
fSurfaceArea = fSurfaceArea+4*fDz*(mmax-mmin);
}
}
return fSurfaceArea;
}
+5 -3
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Orb.hh,v 1.10 2006/06/29 18:44:16 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Orb.hh,v 1.11 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -62,10 +62,12 @@ class G4Orb : public G4CSGSolid
// Modifiers
inline void SetRadius(G4double newRmax);
inline G4double GetCubicVolume();
// Methods for solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep);
+11 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Orb.icc,v 1.4 2006/06/29 18:44:19 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Orb.icc,v 1.5 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -46,6 +46,7 @@ void G4Orb::SetRadius(G4double newRmax)
{
fRmax=newRmax;
fCubicVolume= 0.;
fSurfaceArea = 0.;
fpPolyhedron = 0;
}
@@ -56,3 +57,11 @@ G4double G4Orb::GetCubicVolume()
else { fCubicVolume = 4*pi*fRmax*fRmax*fRmax/3.; }
return fCubicVolume;
}
inline
G4double G4Orb::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else { fSurfaceArea = 4*pi*fRmax*fRmax; }
return fSurfaceArea;
}
+5 -3
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Para.hh,v 1.17 2006/06/29 18:44:21 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Para.hh,v 1.18 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -94,7 +94,6 @@ class G4Para : public G4CSGSolid
inline G4double GetYHalfLength() const;
inline G4double GetXHalfLength() const;
inline G4double GetTanAlpha() const;
inline G4double GetCubicVolume();
// Modifiers
@@ -110,6 +109,9 @@ class G4Para : public G4CSGSolid
// Other methods of solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void ComputeDimensions(G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep);
+26 -7
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Para.icc,v 1.6 2006/06/29 18:44:23 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Para.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -75,6 +75,7 @@ void G4Para::SetXHalfLength(G4double val)
{
fDx= val;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -83,6 +84,7 @@ void G4Para::SetYHalfLength(G4double val)
{
fDy= val;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -91,6 +93,7 @@ void G4Para::SetZHalfLength(G4double val)
{
fDz= val;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -98,6 +101,7 @@ inline
void G4Para::SetAlpha(G4double alpha)
{
fTalpha= std::tan(alpha);
fSurfaceArea= 0.;
fCubicVolume= 0.;
fpPolyhedron = 0;
}
@@ -107,6 +111,7 @@ void G4Para::SetTanAlpha(G4double val)
{
fTalpha= val;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -116,17 +121,31 @@ 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.;
fpPolyhedron = 0;
}
///////////////////////////////////////////////////
//
// It is like G4Box, since para transformations keep the volume to be const
inline
G4double G4Para::GetCubicVolume()
{
if(fCubicVolume != 0.) ;
//
// 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;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Sphere.hh,v 1.18 2006/06/29 18:44:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Sphere.hh,v 1.19 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -93,7 +93,6 @@ class G4Sphere : public G4CSGSolid
inline G4double GetDeltaPhiAngle () const;
inline G4double GetStartThetaAngle() const;
inline G4double GetDeltaThetaAngle() const;
inline G4double GetCubicVolume();
// Modifiers
@@ -106,6 +105,9 @@ class G4Sphere : public G4CSGSolid
// Methods for solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep);
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Sphere.icc,v 1.6 2006/06/29 18:44:29 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Sphere.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -75,6 +75,7 @@ void G4Sphere::SetInsideRadius(G4double newRmin)
{
fRmin= newRmin;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -83,6 +84,7 @@ void G4Sphere::SetOuterRadius(G4double newRmax)
{
fRmax= newRmax;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -91,6 +93,7 @@ void G4Sphere::SetStartPhiAngle(G4double newSphi)
{
fSPhi= newSphi;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -99,6 +102,7 @@ void G4Sphere::SetDeltaPhiAngle(G4double newDphi)
{
fDPhi= newDphi;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -107,6 +111,7 @@ void G4Sphere::SetStartThetaAngle(G4double newSTheta)
{
fSTheta=newSTheta;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -115,6 +120,7 @@ void G4Sphere::SetDeltaThetaAngle(G4double newDTheta)
{
fDTheta=newDTheta;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -155,13 +161,60 @@ G4double G4Sphere::GetDTheta() const
{
return GetDeltaThetaAngle();
}
///////////////////////////////////////////////////
inline
G4double G4Sphere::GetCubicVolume()
{
if(fCubicVolume != 0.) ;
if(fCubicVolume != 0.) {;}
else fCubicVolume = fDPhi*(std::cos(fSTheta)-std::cos(fSTheta+fDTheta))*
(fRmax*fRmax*fRmax-fRmin*fRmin*fRmin)/3.;
return fCubicVolume;
}
inline
G4double G4Sphere::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else
{
G4double Rsq=fRmax*fRmax;
G4double rsq=fRmin*fRmin;
fSurfaceArea = fDPhi*(rsq+Rsq)*(std::cos(fSTheta)
- std::cos(fSTheta+fDTheta));
if(fDPhi < twopi)
{
fSurfaceArea = fSurfaceArea + fDTheta*(Rsq-rsq);
}
if(fSTheta >0)
{
G4double acos1=std::acos( std::pow(std::sin(fSTheta),2)
*std::cos(fDPhi)
+std::pow(std::cos(fSTheta),2));
if(fDPhi>pi)
{
fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*(twopi-acos1);
}
else
{
fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*acos1;
}
}
if(fDTheta+fSTheta < pi)
{
G4double acos2=std::acos( std::pow(std::sin(fSTheta+fDTheta),2)
*std::cos(fDPhi)
+std::pow(std::cos(fSTheta+fDTheta),2));
if(fDPhi>pi)
{
fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*(twopi-acos2);
}
else
{
fSurfaceArea = fSurfaceArea + 0.5*(Rsq-rsq)*acos2;
}
}
}
return fSurfaceArea;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Torus.hh,v 1.25 2006/06/29 18:44:43 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Torus.hh,v 1.26 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -119,10 +119,12 @@ class G4Torus : public G4CSGSolid
inline G4double GetRtor() const;
inline G4double GetSPhi() const;
inline G4double GetDPhi() const;
inline G4double GetCubicVolume();
// Methods of solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
EInside Inside(const G4ThreeVector& p) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
@@ -191,8 +193,6 @@ class G4Torus : public G4CSGSolid
G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p) const;
// Algorithm for SurfaceNormal() following the original
// specification for points not on the surface
};
#include "G4Torus.icc"
+17 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Torus.icc,v 1.5 2006/06/29 18:44:47 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Torus.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -72,3 +72,18 @@ G4double G4Torus::GetCubicVolume()
else { fCubicVolume = fDPhi*pi*fRtor*(fRmax*fRmax-fRmin*fRmin); }
return fCubicVolume;
}
inline
G4double G4Torus::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else
{
fSurfaceArea = fDPhi*2*pi*fRtor*(fRmax+fRmin);
if(fDPhi < twopi)
{
fSurfaceArea = fSurfaceArea + twopi*(fRmax*fRmax-fRmin*fRmin);
}
}
return fSurfaceArea;
}
+5 -3
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Trap.hh,v 1.16 2006/06/29 18:44:49 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Trap.hh,v 1.17 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -172,7 +172,6 @@ class G4Trap : public G4CSGSolid
inline TrapSidePlane GetSidePlane( G4int n ) const;
inline G4ThreeVector GetSymAxis() const;
inline G4double GetCubicVolume();
// Modifiers
@@ -190,6 +189,9 @@ class G4Trap : public G4CSGSolid
// Methods for solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep );
+42 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Trap.icc,v 1.7 2006/06/29 18:44:51 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Trap.icc,v 1.8 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -122,3 +122,43 @@ G4double G4Trap::GetCubicVolume()
+ (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;
}
+5 -3
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Trd.hh,v 1.15 2006/06/29 18:44:53 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Trd.hh,v 1.16 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -82,7 +82,6 @@ class G4Trd : public G4CSGSolid
inline G4double GetYHalfLength1() const;
inline G4double GetYHalfLength2() const;
inline G4double GetZHalfLength() const;
inline G4double GetCubicVolume();
// Modifiers
@@ -94,6 +93,9 @@ class G4Trd : public G4CSGSolid
// Methods of solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep );
+25 -4
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Trd.icc,v 1.6 2006/06/29 18:44:55 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Trd.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -70,6 +70,7 @@ void G4Trd::SetXHalfLength1(G4double val)
{
fDx1= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fpPolyhedron = 0;
}
@@ -78,6 +79,7 @@ void G4Trd::SetXHalfLength2(G4double val)
{
fDx2= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fpPolyhedron = 0;
}
@@ -86,6 +88,7 @@ void G4Trd::SetYHalfLength1(G4double val)
{
fDy1= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fpPolyhedron = 0;
}
@@ -94,6 +97,7 @@ void G4Trd::SetYHalfLength2(G4double val)
{
fDy2= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fpPolyhedron = 0;
}
@@ -102,6 +106,7 @@ void G4Trd::SetZHalfLength(G4double val)
{
fDz= val;
fCubicVolume= 0.;
fSurfaceArea=0;
fpPolyhedron = 0;
}
@@ -109,7 +114,23 @@ inline
G4double G4Trd::GetCubicVolume()
{
if(fCubicVolume != 0.) {;}
else { fCubicVolume = 2*fDz*( (fDx1+fDx2)*(fDy1+fDy2)
+ (fDx2-fDx1)*(fDy2-fDy1)/3 ); }
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;
}
+5 -4
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Tubs.hh,v 1.15 2006/06/29 18:44:57 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Tubs.hh,v 1.16 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// --------------------------------------------------------------------
@@ -94,8 +94,6 @@ class G4Tubs : public G4CSGSolid
inline G4double GetZHalfLength () const;
inline G4double GetStartPhiAngle () const;
inline G4double GetDeltaPhiAngle () const;
inline G4double GetCubicVolume();
// Modifiers
@@ -107,6 +105,9 @@ class G4Tubs : public G4CSGSolid
// Methods for solid
inline G4double GetCubicVolume();
inline G4double GetSurfaceArea();
void ComputeDimensions( G4VPVParameterisation* p,
const G4int n,
const G4VPhysicalVolume* pRep );
+22 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Tubs.icc,v 1.6 2006/06/29 18:45:00 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4Tubs.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
@@ -70,6 +70,7 @@ void G4Tubs::SetInnerRadius (G4double newRMin)
{
fRMin= newRMin;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -78,6 +79,7 @@ void G4Tubs::SetOuterRadius (G4double newRMax)
{
fRMax= newRMax;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -86,6 +88,7 @@ void G4Tubs::SetZHalfLength (G4double newDz)
{
fDz= newDz;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -94,6 +97,7 @@ void G4Tubs::SetStartPhiAngle (G4double newSPhi)
{
fSPhi= newSPhi;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -102,6 +106,7 @@ void G4Tubs::SetDeltaPhiAngle (G4double newDPhi)
{
fDPhi= newDPhi;
fCubicVolume= 0.;
fSurfaceArea= 0.;
fpPolyhedron = 0;
}
@@ -144,3 +149,18 @@ G4double G4Tubs::GetCubicVolume()
else { fCubicVolume = fDPhi*fDz*(fRMax*fRMax-fRMin*fRMin); }
return fCubicVolume;
}
inline
G4double G4Tubs::GetSurfaceArea()
{
if(fSurfaceArea != 0.) {;}
else
{
fSurfaceArea = fDPhi*(fRMin+fRMax)*(2*fDz+fRMax-fRMin);
if (fDPhi < twopi)
{
fSurfaceArea = fSurfaceArea + 4*fDz*(fRMax-fRMin);
}
}
return fSurfaceArea;
}