Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Polyhedra.cc,v 1.33 2007/01/22 12:58:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4Polyhedra.cc,v 1.36 2007/07/12 15:52:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// --------------------------------------------------------------------
@@ -677,14 +677,16 @@ G4ThreeVector G4Polyhedra::GetPointOnSurface() const
G4double chose, totArea=0., Achose1, Achose2,
rad1, rad2, sinphi1, sinphi2, cosphi1, cosphi2;
G4double a, b, l2, rang,
ksi = (endPhi-startPhi)/(double)numSide,
totalPhi,ksi,
area, aTop=0., aBottom=0.,zVal=0.;
G4ThreeVector p0, p1, p2, p3;
std::vector<G4double> aVector1;
std::vector<G4double> aVector2;
std::vector<G4double> aVector3;
G4double cosksi = std::cos(ksi/2.);
totalPhi= (phiIsOpen) ? (endPhi-startPhi) : twopi;
ksi = totalPhi/numSide;
G4double cosksi = std::cos(ksi/2.);
// below we generate the areas relevant to our solid
//
@@ -750,14 +752,15 @@ G4ThreeVector G4Polyhedra::GetPointOnSurface() const
chose = RandFlat::shoot(0.,totArea+aTop+aBottom);
if( (chose >= 0.) && (chose < aTop + aBottom) )
{
chose = RandFlat::shoot(startPhi,endPhi);
chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
rang = std::floor((chose-startPhi)/ksi-0.01);
if(rang<0)rang=0;
rang = std::fabs(rang);
sinphi1 = std::sin(startPhi+rang*ksi);
sinphi2 = std::sin(startPhi+(rang+1)*ksi);
cosphi1 = std::cos(startPhi+rang*ksi);
cosphi2 = std::cos(startPhi+(rang+1)*ksi);
chose = RandFlat::shoot(0., aTop + aBottom);
if(chose>=0. && chose<aTop)
{
@@ -798,8 +801,9 @@ G4ThreeVector G4Polyhedra::GetPointOnSurface() const
if( (chose>=0.) && (chose<numSide*aVector1[j]) )
{
chose = RandFlat::shoot(startPhi,endPhi);
rang = std::floor((chose-startPhi)/ksi-0.01);
chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
rang = std::floor((chose-startPhi)/ksi-0.01);
if(rang<0)rang=0;
rang = std::fabs(rang);
rad1 = original_parameters->Rmax[j];
rad2 = original_parameters->Rmax[j+1];
@@ -816,14 +820,15 @@ G4ThreeVector G4Polyhedra::GetPointOnSurface() const
p2 = G4ThreeVector(rad2*cosphi2,rad2*sinphi2,zVal);
p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,zVal);
return GetPointOnPlane(p0,p1,p2,p3);
}
else if ( (chose >= numSide*aVector1[j])
&& (chose <= numSide*(aVector1[j]+aVector2[j])) )
{
chose = RandFlat::shoot(startPhi,endPhi);
chose = RandFlat::shoot(startPhi,startPhi+totalPhi);
rang = std::floor((chose-startPhi)/ksi-0.01);
if(rang<0)rang=0;
rang = std::fabs(rang);
rad1 = original_parameters->Rmin[j];
rad2 = original_parameters->Rmin[j+1];
@@ -840,7 +845,6 @@ G4ThreeVector G4Polyhedra::GetPointOnSurface() const
p2 = G4ThreeVector(rad2*cosphi2,rad2*sinphi2,zVal);
p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,zVal);
return GetPointOnPlane(p0,p1,p2,p3);
}
@@ -869,7 +873,6 @@ G4ThreeVector G4Polyhedra::GetPointOnSurface() const
original_parameters->Z_values[j+1]);
p3 = G4ThreeVector(rad2*cosphi1,rad2*sinphi1,
original_parameters->Z_values[j+1]);
return GetPointOnPlane(p0,p1,p2,p3);
}
@@ -1061,7 +1064,8 @@ G4Polyhedron* G4Polyhedra::CreatePolyhedron() const
nFaces = numSide * numCorner;;
xyz = new double3[nNodes];
faces_vec = new int4[nFaces];
const G4double dPhi = (endPhi - startPhi) / numSide;
// const G4double dPhi = (endPhi - startPhi) / numSide;
const G4double dPhi = twopi / numSide; // !phiIsOpen endPhi-startPhi = 360 degrees.
G4double phi = startPhi;
G4int ixyz = 0, iface = 0;
for (G4int iSide = 0; iSide < numSide; ++iSide)