Import Geant4 9.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:46:55 +02:00
parent 89a9605df1
commit b1eb5424d2
10957 changed files with 888481 additions and 160139 deletions
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4TwistedTubs.cc,v 1.30 2010/11/10 10:00:16 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-04 $
// $Id: G4TwistedTubs.cc,v 1.30 2010-11-10 10:00:16 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// --------------------------------------------------------------------
@@ -78,8 +78,8 @@ G4TwistedTubs::G4TwistedTubs(const G4String &pname,
{
if (endinnerrad < DBL_MIN)
{
G4Exception("G4TwistedTubs::G4TwistedTubs()", "InvalidSetup",
FatalException, "Invalid end-inner-radius!");
G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
FatalErrorInArgument, "Invalid end-inner-radius!");
}
G4double sinhalftwist = std::sin(0.5 * twistedangle);
@@ -112,14 +112,17 @@ G4TwistedTubs::G4TwistedTubs(const G4String &pname,
if (!nseg)
{
G4cerr << "ERROR - G4TwistedTubs::G4TwistedTubs()" << G4endl
<< " Invalid nseg. nseg = " << nseg << G4endl;
std::ostringstream message;
message << "Invalid number of segments." << G4endl
<< " nseg = " << nseg;
G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
FatalErrorInArgument, message);
}
if (totphi == DBL_MIN || endinnerrad < DBL_MIN)
{
G4Exception("G4TwistedTubs::G4TwistedTubs()", "InvalidSetup",
FatalException, "Invalid total-phi or end-inner-radius!");
}
G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
FatalErrorInArgument, "Invalid total-phi or end-inner-radius!");
}
G4double sinhalftwist = std::sin(0.5 * twistedangle);
@@ -151,8 +154,8 @@ G4TwistedTubs::G4TwistedTubs(const G4String &pname,
{
if (innerrad < DBL_MIN)
{
G4Exception("G4TwistedTubs::G4TwistedTubs()", "InvalidSetup",
FatalException, "Invalid end-inner-radius!");
G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
FatalErrorInArgument, "Invalid end-inner-radius!");
}
SetFields(twistedangle, innerrad, outerrad, negativeEndz, positiveEndz);
@@ -174,13 +177,16 @@ G4TwistedTubs::G4TwistedTubs(const G4String &pname,
{
if (!nseg)
{
G4cerr << "ERROR - G4TwistedTubs::G4TwistedTubs()" << G4endl
<< " Invalid nseg. nseg = " << nseg << G4endl;
std::ostringstream message;
message << "Invalid number of segments." << G4endl
<< " nseg = " << nseg;
G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
FatalErrorInArgument, message);
}
if (totphi == DBL_MIN || innerrad < DBL_MIN)
{
G4Exception("G4TwistedTubs::G4TwistedTubs()", "InvalidSetup",
FatalException, "Invalid total-phi or end-inner-radius!");
G4Exception("G4TwistedTubs::G4TwistedTubs()", "GeomSolids0002",
FatalErrorInArgument, "Invalid total-phi or end-inner-radius!");
}
fDPhi = totphi / nseg;
@@ -308,7 +314,7 @@ void G4TwistedTubs::ComputeDimensions(G4VPVParameterisation* /* p */ ,
const G4VPhysicalVolume* /* pRep */ )
{
G4Exception("G4TwistedTubs::ComputeDimensions()",
"NotSupported", FatalException,
"GeomSolids0001", FatalException,
"G4TwistedTubs does not support Parameterisation.");
}
@@ -740,7 +746,6 @@ G4double G4TwistedTubs::DistanceToIn (const G4ThreeVector& p,
G4ThreeVector xx;
G4ThreeVector bestxx;
G4int i;
G4int besti = -1;
for (i=0; i< 6; i++)
{
G4double tmpdistance = surfaces[i]->DistanceToIn(p, v, xx);
@@ -748,7 +753,6 @@ G4double G4TwistedTubs::DistanceToIn (const G4ThreeVector& p,
{
distance = tmpdistance;
bestxx = xx;
besti = i;
}
}
*tmpdist = distance;
@@ -812,7 +816,6 @@ G4double G4TwistedTubs::DistanceToIn (const G4ThreeVector& p) const
surfaces[5] = fOuterHype;
G4int i;
G4int besti = -1;
G4ThreeVector xx;
G4ThreeVector bestxx;
for (i=0; i< 6; i++)
@@ -822,7 +825,6 @@ G4double G4TwistedTubs::DistanceToIn (const G4ThreeVector& p) const
{
distance = tmpdistance;
bestxx = xx;
besti = i;
}
}
*tmpdist = distance;
@@ -830,7 +832,7 @@ G4double G4TwistedTubs::DistanceToIn (const G4ThreeVector& p) const
}
default :
{
G4Exception("G4TwistedTubs::DistanceToIn(p)", "InvalidCondition",
G4Exception("G4TwistedTubs::DistanceToIn(p)", "GeomSolids0003",
FatalException, "Unknown point location!");
}
} // switch end
@@ -1007,7 +1009,6 @@ G4double G4TwistedTubs::DistanceToOut( const G4ThreeVector& p ) const
surfaces[5] = fUpperEndcap;
G4int i;
G4int besti = -1;
G4ThreeVector xx;
G4ThreeVector bestxx;
for (i=0; i< 6; i++)
@@ -1017,7 +1018,6 @@ G4double G4TwistedTubs::DistanceToOut( const G4ThreeVector& p ) const
{
distance = tmpdistance;
bestxx = xx;
besti = i;
}
}
*tmpdist = distance;
@@ -1026,7 +1026,7 @@ G4double G4TwistedTubs::DistanceToOut( const G4ThreeVector& p ) const
}
default :
{
G4Exception("G4TwistedTubs::DistanceToOut(p)", "InvalidCondition",
G4Exception("G4TwistedTubs::DistanceToOut(p)", "GeomSolids0003",
FatalException, "Unknown point location!");
}
} // switch end
@@ -1042,6 +1042,7 @@ std::ostream& G4TwistedTubs::StreamInfo(std::ostream& os) const
//
// Stream object contents to an output stream
//
G4int oldprc = os.precision(16);
os << "-----------------------------------------------------------\n"
<< " *** Dump for solid - " << GetName() << " ***\n"
<< " ===================================================\n"
@@ -1060,6 +1061,7 @@ std::ostream& G4TwistedTubs::StreamInfo(std::ostream& os) const
<< " outer stereo angle : " << fOuterStereo/degree << " degrees \n"
<< " phi-width of a piece : " << fDPhi/degree << " degrees \n"
<< "-----------------------------------------------------------\n";
os.precision(oldprc);
return os;
}
@@ -1252,7 +1254,7 @@ G4double G4TwistedTubs::GetSurfaceArea()
G4ThreeVector G4TwistedTubs::GetPointOnSurface() const
{
G4double z = CLHEP::RandFlat::shoot(fEndZ[0],fEndZ[1]);
G4double z = G4RandFlat::shoot(fEndZ[0],fEndZ[1]);
G4double phi , phimin, phimax ;
G4double x , xmin, xmax ;
G4double r , rmin, rmax ;
@@ -1264,14 +1266,14 @@ G4ThreeVector G4TwistedTubs::GetPointOnSurface() const
G4double a5 = fLowerEndcap->GetSurfaceArea() ;
G4double a6 = fUpperEndcap->GetSurfaceArea() ;
G4double chose = CLHEP::RandFlat::shoot(0.,a1 + a2 + a3 + a4 + a5 + a6) ;
G4double chose = G4RandFlat::shoot(0.,a1 + a2 + a3 + a4 + a5 + a6) ;
if(chose < a1)
{
phimin = fOuterHype->GetBoundaryMin(z) ;
phimax = fOuterHype->GetBoundaryMax(z) ;
phi = CLHEP::RandFlat::shoot(phimin,phimax) ;
phi = G4RandFlat::shoot(phimin,phimax) ;
return fOuterHype->SurfacePoint(phi,z,true) ;
@@ -1281,7 +1283,7 @@ G4ThreeVector G4TwistedTubs::GetPointOnSurface() const
phimin = fInnerHype->GetBoundaryMin(z) ;
phimax = fInnerHype->GetBoundaryMax(z) ;
phi = CLHEP::RandFlat::shoot(phimin,phimax) ;
phi = G4RandFlat::shoot(phimin,phimax) ;
return fInnerHype->SurfacePoint(phi,z,true) ;
@@ -1291,7 +1293,7 @@ G4ThreeVector G4TwistedTubs::GetPointOnSurface() const
xmin = fLatterTwisted->GetBoundaryMin(z) ;
xmax = fLatterTwisted->GetBoundaryMax(z) ;
x = CLHEP::RandFlat::shoot(xmin,xmax) ;
x = G4RandFlat::shoot(xmin,xmax) ;
return fLatterTwisted->SurfacePoint(x,z,true) ;
@@ -1301,7 +1303,7 @@ G4ThreeVector G4TwistedTubs::GetPointOnSurface() const
xmin = fFormerTwisted->GetBoundaryMin(z) ;
xmax = fFormerTwisted->GetBoundaryMax(z) ;
x = CLHEP::RandFlat::shoot(xmin,xmax) ;
x = G4RandFlat::shoot(xmin,xmax) ;
return fFormerTwisted->SurfacePoint(x,z,true) ;
@@ -1311,11 +1313,11 @@ G4ThreeVector G4TwistedTubs::GetPointOnSurface() const
rmin = GetEndInnerRadius(0) ;
rmax = GetEndOuterRadius(0) ;
r = CLHEP::RandFlat::shoot(rmin,rmax) ;
r = G4RandFlat::shoot(rmin,rmax) ;
phimin = fLowerEndcap->GetBoundaryMin(r) ;
phimax = fLowerEndcap->GetBoundaryMax(r) ;
phi = CLHEP::RandFlat::shoot(phimin,phimax) ;
phi = G4RandFlat::shoot(phimin,phimax) ;
return fLowerEndcap->SurfacePoint(phi,r,true) ;
@@ -1324,11 +1326,11 @@ G4ThreeVector G4TwistedTubs::GetPointOnSurface() const
{
rmin = GetEndInnerRadius(1) ;
rmax = GetEndOuterRadius(1) ;
r = CLHEP::RandFlat::shoot(rmin,rmax) ;
r = G4RandFlat::shoot(rmin,rmax) ;
phimin = fUpperEndcap->GetBoundaryMin(r) ;
phimax = fUpperEndcap->GetBoundaryMax(r) ;
phi = CLHEP::RandFlat::shoot(phimin,phimax) ;
phi = G4RandFlat::shoot(phimin,phimax) ;
return fUpperEndcap->SurfacePoint(phi,r,true) ;
}