Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PolyconeSide.cc,v 1.17 2007/08/13 10:33:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4PolyconeSide.cc,v 1.19 2008/05/15 11:41:59 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -46,6 +46,8 @@
|
||||
#include "G4SolidExtentList.hh"
|
||||
#include "G4GeometryTolerance.hh"
|
||||
|
||||
#include "Randomize.hh"
|
||||
|
||||
//
|
||||
// Constructor
|
||||
//
|
||||
@@ -63,6 +65,7 @@ G4PolyconeSide::G4PolyconeSide( const G4PolyconeSideRZ *prevRZ,
|
||||
: ncorners(0), corners(0)
|
||||
{
|
||||
kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
||||
fSurfaceArea = 0.0;
|
||||
|
||||
//
|
||||
// Record values
|
||||
@@ -210,6 +213,7 @@ void G4PolyconeSide::CopyStuff( const G4PolyconeSide &source )
|
||||
allBehind = source.allBehind;
|
||||
|
||||
kCarTolerance = source.kCarTolerance;
|
||||
fSurfaceArea = source.fSurfaceArea;
|
||||
|
||||
cone = new G4IntersectingCone( *source.cone );
|
||||
|
||||
@@ -1043,3 +1047,51 @@ void G4PolyconeSide::FindLineIntersect( G4double x1, G4double y1,
|
||||
x = 0.5*( x1+s1*tx1 + x2+s2*tx2 );
|
||||
y = 0.5*( y1+s1*ty1 + y2+s2*ty2 );
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate surface area for GetPointOnSurface()
|
||||
//
|
||||
G4double G4PolyconeSide::SurfaceArea()
|
||||
{
|
||||
if(fSurfaceArea==0)
|
||||
{
|
||||
fSurfaceArea = (r[0]+r[1])* std::sqrt(sqr(r[0]-r[1])+sqr(z[0]-z[1]));
|
||||
fSurfaceArea *= 0.5*(deltaPhi);
|
||||
}
|
||||
return fSurfaceArea;
|
||||
}
|
||||
|
||||
//
|
||||
// GetPointOnFace
|
||||
//
|
||||
G4ThreeVector G4PolyconeSide::GetPointOnFace()
|
||||
{
|
||||
G4double x,y,zz;
|
||||
G4double rr,phi,dz,dr;
|
||||
dr=r[1]-r[0];dz=z[1]-z[0];
|
||||
phi=startPhi+deltaPhi*G4UniformRand();
|
||||
rr=r[0]+dr*G4UniformRand();
|
||||
|
||||
x=rr*std::cos(phi);
|
||||
y=rr*std::sin(phi);
|
||||
|
||||
// PolyconeSide has a Ring Form
|
||||
//
|
||||
if (dz==0.)
|
||||
{
|
||||
zz=z[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(dr==0.) // PolyconeSide has a Tube Form
|
||||
{
|
||||
zz = z[0]+dz*G4UniformRand();
|
||||
}
|
||||
else
|
||||
{
|
||||
zz = z[0]+(rr-r[0])*dz/dr;
|
||||
}
|
||||
}
|
||||
|
||||
return G4ThreeVector(x,y,zz);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user