Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Box.hh,v 1.4 2000/04/07 12:55:02 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Box.hh,v 1.5 2000/11/02 17:06:38 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
@@ -23,8 +23,8 @@
|
||||
//
|
||||
// As inherited from G4CSGSolid +
|
||||
//
|
||||
// G4Box(const G4String& pName, G4double pX,
|
||||
// G4double pY, G4double pZ)
|
||||
// G4Box(const G4String& pName,
|
||||
// G4double pX, G4double pY, G4double pZ)
|
||||
//
|
||||
// - Construct a box with name, and half lengths pX,pY,pZ
|
||||
//
|
||||
@@ -63,10 +63,9 @@
|
||||
|
||||
class G4Box : public G4CSGSolid
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
G4Box(const G4String& pName, G4double pX,
|
||||
G4double pY, G4double pZ);
|
||||
G4Box(const G4String& pName, G4double pX, G4double pY, G4double pZ);
|
||||
|
||||
virtual ~G4Box();
|
||||
|
||||
@@ -78,69 +77,51 @@ public:
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
G4double& pmin, G4double& pmax) const;
|
||||
// Access functions
|
||||
// Access functions
|
||||
|
||||
G4double GetXHalfLength() const
|
||||
{
|
||||
return fDx;
|
||||
}
|
||||
G4double GetXHalfLength() const { return fDx; }
|
||||
|
||||
G4double GetYHalfLength() const
|
||||
{
|
||||
return fDy;
|
||||
}
|
||||
G4double GetYHalfLength() const { return fDy; }
|
||||
|
||||
G4double GetZHalfLength() const
|
||||
{
|
||||
return fDz;
|
||||
}
|
||||
G4double GetZHalfLength() const { return fDz; }
|
||||
|
||||
void SetXHalfLength(G4double dx)
|
||||
{
|
||||
fDx=dx;
|
||||
}
|
||||
void SetXHalfLength(G4double dx) { fDx=dx; }
|
||||
|
||||
void SetYHalfLength(G4double dy)
|
||||
{
|
||||
fDy=dy;
|
||||
}
|
||||
void SetYHalfLength(G4double dy) { fDy=dy; }
|
||||
|
||||
void SetZHalfLength(G4double dz)
|
||||
{
|
||||
fDz=dz;
|
||||
}
|
||||
void SetZHalfLength(G4double dz) { fDz=dz; }
|
||||
|
||||
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 G4ThreeVector& v) const;
|
||||
|
||||
G4double DistanceToIn(const G4ThreeVector& p) const;
|
||||
|
||||
G4double DistanceToOut(const G4ThreeVector& p,const G4ThreeVector& v,
|
||||
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;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Box"); }
|
||||
G4GeometryType GetEntityType() const { return G4String("G4Box"); }
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4VisExtent GetExtent () const;
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4VisExtent GetExtent () const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform) const;
|
||||
|
||||
// Codes for faces (kPX=plus x face,kMY= minus y face etc)
|
||||
// Codes for faces (kPX=plus x face,kMY= minus y face etc)
|
||||
|
||||
enum ESide {kUndefined,kPX,kMX,kPY,kMY,kPZ,kMZ};
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
G4double fDx,fDy,fDz;
|
||||
};
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4CSGSolid.hh,v 1.3 2000/04/07 12:55:02 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4CSGSolid.hh,v 1.4 2000/11/02 17:06:38 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -34,7 +34,8 @@
|
||||
|
||||
class G4CSGSolid : public G4VSolid
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
G4CSGSolid(const G4String& pName);
|
||||
|
||||
virtual ~G4CSGSolid();
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Cons.hh,v 1.4 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Cons.hh,v 1.5 2000/11/02 17:06:38 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
class G4Cons : public G4CSGSolid
|
||||
{
|
||||
public:
|
||||
public:
|
||||
G4Cons(const G4String& pName,
|
||||
G4double pRmin1, G4double pRmax1,
|
||||
G4double pRmin2, G4double pRmax2,
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
|
||||
virtual ~G4Cons() ;
|
||||
|
||||
// Access functions
|
||||
// Access functions
|
||||
G4double GetInnerRadiusMinusZ() const { return fRmin1 ; }
|
||||
G4double GetOuterRadiusMinusZ() const { return fRmax1 ; }
|
||||
G4double GetInnerRadiusPlusZ() const { return fRmin2 ; }
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
|
||||
G4double DistanceToOut(const G4ThreeVector& p) const ;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Cons"); }
|
||||
G4GeometryType GetEntityType() const { return G4String("G4Cons"); }
|
||||
|
||||
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
|
||||
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
G4double GetSPhi() const { return GetStartPhiAngle(); } // fSPhi
|
||||
G4double GetDPhi() const { return GetDeltaPhiAngle(); } // fDPhi
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform) const;
|
||||
@@ -140,7 +140,7 @@ protected:
|
||||
|
||||
enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
G4double fRmin1,fRmin2,
|
||||
fRmax1,fRmax2,
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Para.hh,v 1.5 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Para.hh,v 1.6 2000/11/02 17:06:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -55,79 +55,51 @@
|
||||
|
||||
#include "G4CSGSolid.hh"
|
||||
|
||||
class G4Para : public G4CSGSolid {
|
||||
public:
|
||||
G4Para(const G4String& pName,
|
||||
class G4Para : public G4CSGSolid
|
||||
{
|
||||
public:
|
||||
|
||||
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() ;
|
||||
|
||||
// Access functions
|
||||
G4Para( const G4String& pName,
|
||||
const G4ThreeVector pt[8]) ;
|
||||
|
||||
G4double GetZHalfLength() const
|
||||
{
|
||||
return fDz ;
|
||||
}
|
||||
virtual ~G4Para() ;
|
||||
|
||||
// Access functions
|
||||
|
||||
G4double GetZHalfLength() const { return fDz ; }
|
||||
G4ThreeVector GetSymAxis() const
|
||||
{
|
||||
G4double cosTheta = 1.0/sqrt(1+fTthetaCphi*fTthetaCphi+fTthetaSphi*fTthetaSphi) ;
|
||||
G4double cosTheta = 1.0/sqrt(1+fTthetaCphi*fTthetaCphi +
|
||||
fTthetaSphi*fTthetaSphi) ;
|
||||
|
||||
return G4ThreeVector(fTthetaCphi*cosTheta,fTthetaSphi*cosTheta,cosTheta) ;
|
||||
}
|
||||
|
||||
G4double GetYHalfLength() const
|
||||
{
|
||||
return fDy ;
|
||||
return G4ThreeVector(fTthetaCphi*cosTheta,
|
||||
fTthetaSphi*cosTheta,
|
||||
cosTheta) ;
|
||||
}
|
||||
G4double GetYHalfLength() const { return fDy ; }
|
||||
G4double GetXHalfLength() const { return fDx ; }
|
||||
G4double GetTanAlpha() const { return fTalpha ; }
|
||||
|
||||
// Set functions
|
||||
|
||||
G4double GetXHalfLength() const
|
||||
{
|
||||
return fDx ;
|
||||
}
|
||||
|
||||
|
||||
G4double GetTanAlpha() const
|
||||
{
|
||||
return fTalpha ;
|
||||
}
|
||||
|
||||
// Set functions
|
||||
|
||||
void SetXHalfLength(G4double val)
|
||||
{
|
||||
fDx= val;
|
||||
}
|
||||
void SetYHalfLength(G4double val)
|
||||
{
|
||||
fDy= val;
|
||||
}
|
||||
void SetZHalfLength(G4double val)
|
||||
{
|
||||
fDz= val;
|
||||
}
|
||||
void SetAlpha(double alpha)
|
||||
{
|
||||
fTalpha= tan(alpha);
|
||||
}
|
||||
void SetTanAlpha(double val)
|
||||
{
|
||||
fTalpha= val;
|
||||
}
|
||||
void SetXHalfLength(G4double val) { fDx= val; }
|
||||
void SetYHalfLength(G4double val) { fDy= val; }
|
||||
void SetZHalfLength(G4double val) { fDz= val; }
|
||||
void SetAlpha(G4double alpha) { fTalpha= tan(alpha); }
|
||||
void SetTanAlpha(G4double val) { fTalpha= val; }
|
||||
void SetThetaAndPhi(double pTheta, double pPhi)
|
||||
{
|
||||
fTthetaCphi=tan(pTheta)*cos(pPhi);
|
||||
fTthetaSphi=tan(pTheta)*sin(pPhi);
|
||||
}
|
||||
void SetAllParameters(G4double pDx, G4double pDy, G4double pDz,
|
||||
G4double pAlpha, G4double pTheta, G4double pPhi);
|
||||
G4double pAlpha, G4double pTheta, G4double pPhi);
|
||||
|
||||
// Methods
|
||||
// Methods
|
||||
|
||||
void ComputeDimensions(G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
@@ -153,33 +125,23 @@ public:
|
||||
|
||||
// Naming method (pseudo-RTTI : run-time type identification
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Para"); }
|
||||
G4GeometryType GetEntityType() const { return G4String("G4Para"); }
|
||||
|
||||
// Visualisation functions
|
||||
// Visualisation functions
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
G4double fDx,fDy,fDz;
|
||||
G4double fTalpha,fTthetaCphi,fTthetaSphi;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Sphere.hh,v 1.4 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Sphere.hh,v 1.5 2000/11/02 17:06:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -53,8 +53,9 @@
|
||||
|
||||
#include "G4CSGSolid.hh"
|
||||
|
||||
class G4Sphere : public G4CSGSolid {
|
||||
public:
|
||||
class G4Sphere : public G4CSGSolid
|
||||
{
|
||||
public:
|
||||
G4Sphere(const G4String& pName,
|
||||
G4double pRmin, G4double pRmax,
|
||||
G4double pSPhi, G4double pDPhi,
|
||||
@@ -62,7 +63,7 @@ public:
|
||||
|
||||
virtual ~G4Sphere() ;
|
||||
|
||||
// Access functions
|
||||
// Access functions
|
||||
|
||||
G4double GetInsideRadius () const { return fRmin; }
|
||||
G4double GetOuterRadius () const { return fRmax; }
|
||||
@@ -104,19 +105,18 @@ public:
|
||||
|
||||
G4double DistanceToOut(const G4ThreeVector& p) const;
|
||||
|
||||
// Naming method (pseudo-RTTI : run-time type identification)
|
||||
G4GeometryType GetEntityType() const { return G4String("G4Sphere"); }
|
||||
// Naming method (pseudo-RTTI : run-time type identification)
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Sphere"); }
|
||||
|
||||
// Visualisation functions
|
||||
// Visualisation functions
|
||||
|
||||
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
|
||||
|
||||
void DescribeYourselfTo(G4VGraphicsScene& scene) const;
|
||||
G4Polyhedron* CreatePolyhedron() const;
|
||||
|
||||
G4NURBS* CreateNURBS() const;
|
||||
|
||||
// Old access functions
|
||||
// Old access functions
|
||||
|
||||
G4double GetRmin() const { return GetInsideRadius (); }
|
||||
G4double GetRmax() const { return GetOuterRadius (); }
|
||||
G4double GetSPhi() const { return GetStartPhiAngle (); }
|
||||
@@ -124,26 +124,25 @@ public:
|
||||
G4double GetSTheta() const { return GetStartThetaAngle(); }
|
||||
G4double GetDTheta() const { return GetDeltaThetaAngle(); }
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform,
|
||||
G4int& noPolygonVertices) const;
|
||||
|
||||
// Used by distanceToOut
|
||||
// Used by distanceToOut
|
||||
|
||||
enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kSTheta,kETheta};
|
||||
|
||||
// used by normal
|
||||
// used by normal
|
||||
|
||||
enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNSTheta,kNETheta};
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
G4double fRmin,fRmax,
|
||||
fSPhi,fDPhi,
|
||||
fSTheta,fDTheta;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Torus.hh,v 1.5 2000/05/26 13:20:40 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Torus.hh,v 1.11 2000/11/02 17:06:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -71,6 +71,7 @@
|
||||
// 21.04.98 J.Apostolakis Added SetAllParameters function
|
||||
// 26.05.00 V.Grichine, new SolveBiQuadratic/Cubic developed by O.Cremonesi were
|
||||
// added
|
||||
// 31.08.00 E.Medernach Added SolveNumeric Functions
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#ifndef G4Torus_HH
|
||||
@@ -78,79 +79,166 @@
|
||||
|
||||
#include "G4CSGSolid.hh"
|
||||
|
||||
class G4Torus : public G4CSGSolid {
|
||||
class G4Torus : public G4CSGSolid
|
||||
{
|
||||
|
||||
public:
|
||||
G4Torus(const G4String &pName,
|
||||
G4double pRmin,
|
||||
G4double pRmax,
|
||||
G4double pRtor,
|
||||
G4double pSPhi,
|
||||
G4double pDPhi);
|
||||
|
||||
virtual ~G4Torus();
|
||||
G4Torus(const G4String &pName,
|
||||
G4double pRmin,
|
||||
G4double pRmax,
|
||||
G4double pRtor,
|
||||
G4double pSPhi,
|
||||
G4double pDPhi);
|
||||
|
||||
virtual ~G4Torus();
|
||||
|
||||
void SetAllParameters(G4double pRmin, G4double pRmax, G4double pRtor,
|
||||
G4double pSPhi, G4double pDPhi);
|
||||
void SetAllParameters(G4double pRmin, G4double pRmax, G4double pRtor,
|
||||
G4double pSPhi, G4double pDPhi);
|
||||
|
||||
void ComputeDimensions(G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
const G4VPhysicalVolume* pRep);
|
||||
void ComputeDimensions(G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
const G4VPhysicalVolume* pRep);
|
||||
|
||||
G4int TorusRoots(G4double Ri,
|
||||
const G4ThreeVector& p,
|
||||
const G4ThreeVector& v) const ;
|
||||
G4int TorusRoots(G4double Ri,
|
||||
const G4ThreeVector& p,
|
||||
const G4ThreeVector& v) const ;
|
||||
|
||||
G4bool CalculateExtent(const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
G4double& pmin, G4double& pmax) const;
|
||||
G4bool CalculateExtent(const EAxis pAxis,
|
||||
const G4VoxelLimits& pVoxelLimit,
|
||||
const G4AffineTransform& pTransform,
|
||||
G4double& pmin, G4double& pmax) const;
|
||||
|
||||
G4double GetRmin() const { return fRmin ; }
|
||||
G4double GetRmax() const { return fRmax ; }
|
||||
G4double GetRtor () const { return fRtor ; }
|
||||
G4double GetSPhi() const { return fSPhi ; }
|
||||
G4double GetDPhi() const { return fDPhi ; }
|
||||
G4double GetRmin() const { return fRmin ; }
|
||||
G4double GetRmax() const { return fRmax ; }
|
||||
G4double GetRtor() const { return fRtor ; }
|
||||
G4double GetSPhi() const { return fSPhi ; }
|
||||
G4double GetDPhi() const { return fDPhi ; }
|
||||
|
||||
EInside Inside(const G4ThreeVector& p) const;
|
||||
EInside Inside(const G4ThreeVector& p) const;
|
||||
|
||||
G4ThreeVector SurfaceNormal( 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=G4bool(false),
|
||||
G4bool *validNorm=0,G4ThreeVector *n=0) const;
|
||||
G4double DistanceToOut(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=G4bool(false),
|
||||
G4bool *validNorm=0,G4ThreeVector *n=0) const;
|
||||
G4double DistanceToOut(const G4ThreeVector& p) const;
|
||||
|
||||
G4GeometryType GetEntityType() const { return G4String("G4Torus"); }
|
||||
// Naming method (pseudo-RTTI : run-time type identification)
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Torus"); }
|
||||
|
||||
// Visualisation functions
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () const;
|
||||
// Visualisation functions
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
protected:
|
||||
|
||||
G4int SolveBiQuadratic(G4double c[], G4double s[] ) const ;
|
||||
G4int SolveCubic(G4double c[], G4double s[] ) const ;
|
||||
G4int SolveBiQuadratic(G4double c[], G4double s[] ) const ;
|
||||
G4int SolveCubic(G4double c[], G4double s[] ) const ;
|
||||
|
||||
G4int SolveBiQuadraticNew(G4double c[], G4double s[] ) const ;
|
||||
G4int SolveCubicNew(G4double c[], G4double s[], G4double& cd ) const ;
|
||||
G4int SolveBiQuadraticNew(G4double c[], G4double s[] ) const ;
|
||||
G4int SolveCubicNew(G4double c[], G4double s[], G4double& cd ) const ;
|
||||
|
||||
G4int SolveQuadratic(double c[], double s[] ) const ;
|
||||
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform,
|
||||
G4int& noPolygonVertices) const;
|
||||
G4int SolveQuadratic(G4double c[], G4double s[] ) const ;
|
||||
|
||||
G4double fRmin,fRmax,fRtor,fSPhi,fDPhi;
|
||||
G4double SolveNumeric(const G4ThreeVector& p,
|
||||
const G4ThreeVector& v,
|
||||
G4bool IsDistanceToIn) const;
|
||||
|
||||
G4ThreeVectorList* CreateRotatedVertices(const G4AffineTransform& pTransform,
|
||||
G4int& noPolygonVertices) const;
|
||||
|
||||
G4double fRmin,fRmax,fRtor,fSPhi,fDPhi;
|
||||
|
||||
// Used by distanceToOut
|
||||
enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi};
|
||||
// used by normal
|
||||
enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi};
|
||||
|
||||
private:
|
||||
|
||||
G4double TorusEquation (G4double x, G4double y, G4double z,
|
||||
G4double R0, G4double R1) const
|
||||
{
|
||||
/* R0 : Radius of all little circles
|
||||
R1 : Radius of little circles
|
||||
*/
|
||||
/*
|
||||
An interesting property is that the sign
|
||||
tell if the point is inside or outside
|
||||
or if > EPSILON on the surface
|
||||
*/
|
||||
G4double temp;
|
||||
|
||||
temp = ((x*x + y*y + z*z) + R0*R0 - R1*R1) ;
|
||||
temp = temp*temp ;
|
||||
temp = temp - 4*R0*R0*(x*x + y*y) ;
|
||||
|
||||
/*
|
||||
> 0 Outside
|
||||
< 0 Inside
|
||||
*/
|
||||
return temp ;
|
||||
}
|
||||
|
||||
G4double TorusDerivativeX (G4double x, G4double y, G4double z,
|
||||
G4double R0, G4double R1) const
|
||||
{
|
||||
return 4*x*(x*x + y*y + z*z + R0*R0 - R1*R1) - 8*R0*R0*x ;
|
||||
}
|
||||
|
||||
G4double TorusDerivativeY (G4double x, G4double y, G4double z,
|
||||
G4double R0, G4double R1) const
|
||||
{
|
||||
return 4*y*(x*x + y*y + z*z + R0*R0 - R1*R1) - 8*R0*R0*y ;
|
||||
}
|
||||
|
||||
G4double TorusDerivativeZ (G4double x, G4double y, G4double z,
|
||||
G4double R0, G4double R1) const
|
||||
{
|
||||
return 4*z*(x*x + y*y + z*z + R0*R0 - R1*R1) ;
|
||||
}
|
||||
|
||||
G4double TorusGradient(G4double dx, G4double dy, G4double dz,
|
||||
G4double x, G4double y, G4double z,
|
||||
G4double Rmax, G4double Rmin) const
|
||||
{
|
||||
/* This tell the normal at a surface point */
|
||||
G4double result;
|
||||
result = 0;
|
||||
result += dx*TorusDerivativeX(x,y,z,Rmax,Rmin);
|
||||
result += dy*TorusDerivativeY(x,y,z,Rmax,Rmin);
|
||||
result += dz*TorusDerivativeZ(x,y,z,Rmax,Rmin);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void BVMIntersection (G4double x, G4double y, G4double z,
|
||||
G4double dx, G4double dy, G4double dz,
|
||||
G4double Rmax, G4double Rmin,
|
||||
G4double *NewL, G4int *valid) const;
|
||||
|
||||
void SortIntervals (G4double *SortL, G4double *NewL,
|
||||
G4int *valid, G4int *NbIntersection) const;
|
||||
|
||||
G4double DistanceToTorus (G4double x, G4double y, G4double z,
|
||||
G4double dx, G4double dy, G4double dz,
|
||||
G4double R0,G4double R1) const;
|
||||
|
||||
G4int SafeNewton(G4double x, G4double y, G4double z,
|
||||
G4double dx, G4double dy, G4double dz,
|
||||
G4double Rmax, G4double Rmin,
|
||||
G4double *Lmin,G4double *Lmax) const;
|
||||
|
||||
G4double Newton (G4double guess,
|
||||
G4double x, G4double y, G4double z,
|
||||
G4double dx, G4double dy, G4double dz,
|
||||
G4double Rmax, G4double Rmin,
|
||||
G4double Lmin,G4double Lmax) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Trap.hh,v 1.4 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Trap.hh,v 1.5 2000/11/02 17:06:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -159,11 +159,12 @@ struct TrapSidePlane
|
||||
// => Ax+By+Cz+D=0
|
||||
};
|
||||
|
||||
class G4Trap : public G4CSGSolid {
|
||||
class G4Trap : public G4CSGSolid
|
||||
{
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
// The most general constructor for G4Trap
|
||||
// The most general constructor for G4Trap
|
||||
|
||||
G4Trap( const G4String& pName,
|
||||
G4double pDz,
|
||||
@@ -176,94 +177,57 @@ public:
|
||||
G4Trap( const G4String& pName,
|
||||
const G4ThreeVector pt[8]) ;
|
||||
|
||||
// Constructor for Right Angular Wedge from STEP
|
||||
// Constructor for Right Angular Wedge from STEP (assumes pLTX<=pX)
|
||||
|
||||
G4Trap( const G4String& pName,
|
||||
G4double pZ,
|
||||
G4double pY,
|
||||
G4double pX, G4double pLTX);
|
||||
|
||||
// Constructor for G4Trd
|
||||
// Constructor for G4Trd
|
||||
|
||||
G4Trap( const G4String& pName,
|
||||
G4double pDx1, G4double pDx2,
|
||||
G4double pDy1, G4double pDy2,
|
||||
G4double pDz);
|
||||
|
||||
// Constructor for G4Para
|
||||
// Constructor for G4Para
|
||||
|
||||
G4Trap(const G4String& pName,
|
||||
G4double pDx, G4double pDy, G4double pDz,
|
||||
G4double pAlpha, G4double pTheta, G4double pPhi);
|
||||
|
||||
virtual ~G4Trap() ;
|
||||
virtual ~G4Trap() ;
|
||||
|
||||
// Constructor for "nominal" G4Trap whose parameters are to be set
|
||||
// by a G4VPramaterisation later.
|
||||
// by a G4VParamaterisation later.
|
||||
|
||||
G4Trap(const G4String& pName);
|
||||
|
||||
// Access functions
|
||||
// Access functions
|
||||
|
||||
G4double GetZHalfLength() const
|
||||
{
|
||||
return fDz ;
|
||||
}
|
||||
|
||||
G4double GetZHalfLength() const { return fDz ; }
|
||||
G4ThreeVector GetSymAxis() const
|
||||
{
|
||||
G4double cosTheta = 1.0/sqrt(1+fTthetaCphi*fTthetaCphi+fTthetaSphi*fTthetaSphi) ;
|
||||
G4double cosTheta = 1.0/sqrt(1+fTthetaCphi*fTthetaCphi +
|
||||
fTthetaSphi*fTthetaSphi) ;
|
||||
|
||||
return G4ThreeVector(fTthetaCphi*cosTheta,fTthetaSphi*cosTheta,cosTheta) ;
|
||||
return G4ThreeVector(fTthetaCphi*cosTheta,
|
||||
fTthetaSphi*cosTheta,
|
||||
cosTheta) ;
|
||||
}
|
||||
G4double GetYHalfLength1() const { return fDy1 ; }
|
||||
G4double GetXHalfLength1() const { return fDx1 ; }
|
||||
G4double GetXHalfLength2() const { return fDx2 ; }
|
||||
G4double GetTanAlpha1() const { return fTalpha1 ; }
|
||||
G4double GetYHalfLength2() const { return fDy2 ; }
|
||||
G4double GetXHalfLength3() const { return fDx3 ; }
|
||||
G4double GetXHalfLength4() const { return fDx4 ; }
|
||||
G4double GetTanAlpha2() const { return fTalpha2 ; }
|
||||
TrapSidePlane GetSidePlane(G4int n ) const { return fPlanes[n] ; }
|
||||
|
||||
G4double GetYHalfLength1() const
|
||||
{
|
||||
return fDy1 ;
|
||||
}
|
||||
|
||||
// Set Methods
|
||||
|
||||
G4double GetXHalfLength1() const
|
||||
{
|
||||
return fDx1 ;
|
||||
}
|
||||
|
||||
G4double GetXHalfLength2() const
|
||||
{
|
||||
return fDx2 ;
|
||||
}
|
||||
|
||||
G4double GetTanAlpha1() const
|
||||
{
|
||||
return fTalpha1 ;
|
||||
}
|
||||
|
||||
G4double GetYHalfLength2() const
|
||||
{
|
||||
return fDy2 ;
|
||||
}
|
||||
|
||||
G4double GetXHalfLength3() const
|
||||
{
|
||||
return fDx3 ;
|
||||
}
|
||||
|
||||
G4double GetXHalfLength4() const
|
||||
{
|
||||
return fDx4 ;
|
||||
}
|
||||
|
||||
G4double GetTanAlpha2() const
|
||||
{
|
||||
return fTalpha2 ;
|
||||
}
|
||||
|
||||
TrapSidePlane GetSidePlane(G4int n ) const
|
||||
{
|
||||
return fPlanes[n] ;
|
||||
}
|
||||
|
||||
// Set Methods
|
||||
void SetAllParameters ( G4double pDz,
|
||||
G4double pTheta,
|
||||
G4double pPhi,
|
||||
@@ -276,7 +240,7 @@ public:
|
||||
G4double pDx4,
|
||||
G4double pAlp2);
|
||||
|
||||
// Methods
|
||||
// Methods
|
||||
|
||||
void ComputeDimensions(G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
@@ -301,19 +265,16 @@ public:
|
||||
|
||||
G4double DistanceToOut(const G4ThreeVector& p) const;
|
||||
|
||||
// Naming method (pseudo-RTTI : run-time type identification
|
||||
G4GeometryType GetEntityType() const { return G4String("G4Trap"); }
|
||||
// Naming method (pseudo-RTTI : run-time type identification
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Trap"); }
|
||||
// Visualisation functions
|
||||
|
||||
// Visualisation functions
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
G4bool MakePlanes();
|
||||
G4bool MakePlane( const G4ThreeVector& p1,
|
||||
@@ -325,7 +286,7 @@ protected:
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
G4double fDz,fTthetaCphi,fTthetaSphi;
|
||||
G4double fDy1,fDx1,fDx2,fTalpha1;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Trd.hh,v 1.5 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Trd.hh,v 1.6 2000/11/02 17:06:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -87,52 +87,23 @@ class G4Trd : public G4CSGSolid
|
||||
|
||||
virtual ~G4Trd();
|
||||
|
||||
// Access functions
|
||||
G4double GetXHalfLength1() const
|
||||
{
|
||||
return fDx1;
|
||||
}
|
||||
// Access functions
|
||||
|
||||
G4double GetXHalfLength2() const
|
||||
{
|
||||
return fDx2;
|
||||
}
|
||||
|
||||
G4double GetYHalfLength1() const
|
||||
{
|
||||
return fDy1;
|
||||
}
|
||||
G4double GetXHalfLength1() const { return fDx1; }
|
||||
G4double GetXHalfLength2() const { return fDx2; }
|
||||
G4double GetYHalfLength1() const { return fDy1; }
|
||||
G4double GetYHalfLength2() const { return fDy2; }
|
||||
G4double GetZHalfLength() const { return fDz; }
|
||||
|
||||
G4double GetYHalfLength2() const
|
||||
{
|
||||
return fDy2;
|
||||
}
|
||||
|
||||
G4double GetZHalfLength() const
|
||||
{
|
||||
return fDz;
|
||||
}
|
||||
|
||||
void SetXHalfLength1(G4double val)
|
||||
{
|
||||
fDx1= val;
|
||||
}
|
||||
void SetXHalfLength2(G4double val)
|
||||
{
|
||||
fDx2= val;
|
||||
}
|
||||
void SetYHalfLength1(G4double val)
|
||||
{
|
||||
fDy1= val;
|
||||
}
|
||||
void SetYHalfLength2(G4double val)
|
||||
{
|
||||
fDy2= val;
|
||||
}
|
||||
void SetZHalfLength(G4double val)
|
||||
{
|
||||
fDz= val;
|
||||
}
|
||||
// Set functions
|
||||
|
||||
void SetXHalfLength1(G4double val) { fDx1= val; }
|
||||
void SetXHalfLength2(G4double val) { fDx2= val; }
|
||||
void SetYHalfLength1(G4double val) { fDy1= val; }
|
||||
void SetYHalfLength2(G4double val) { fDy2= val; }
|
||||
void SetZHalfLength(G4double val) { fDz= val; }
|
||||
|
||||
// Methods
|
||||
|
||||
void ComputeDimensions(G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
@@ -161,42 +132,34 @@ class G4Trd : public G4CSGSolid
|
||||
|
||||
G4double DistanceToOut(const G4ThreeVector& p) const;
|
||||
|
||||
// Naming method (pseudo-RTTI : run-time type identification
|
||||
void CheckAndSetAllParameters (G4double pdx1, G4double pdx2,
|
||||
G4double pdy1, G4double pdy2,
|
||||
G4double pdz);
|
||||
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Trd"); }
|
||||
void SetAllParameters (G4double pdx1, G4double pdx2,
|
||||
G4double pdy1, G4double pdy2,
|
||||
G4double pdz);
|
||||
|
||||
// Visualisation functions
|
||||
G4GeometryType GetEntityType() const { return G4String("G4Trd"); }
|
||||
// Naming method (pseudo-RTTI : run-time type identification
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
// Visualisation functions
|
||||
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () 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);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform) const;
|
||||
|
||||
G4double fDx1,fDx2,fDy1,fDy2,fDz;
|
||||
|
||||
// Codes for faces (kPX=plus x face,kMY= minus y face etc)
|
||||
// Codes for faces (kPX=plus x face,kMY= minus y face etc)
|
||||
|
||||
enum ESide {kUndefined, kPX,kMX,kPY,kMY,kPZ,kMZ};
|
||||
enum ESide {kUndefined, kPX,kMX,kPY,kMY,kPZ,kMZ};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Tubs.hh,v 1.4 2000/04/11 16:04:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Tubs.hh,v 1.5 2000/11/02 17:06:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -75,8 +75,10 @@
|
||||
|
||||
#include "G4CSGSolid.hh"
|
||||
|
||||
class G4Tubs : public G4CSGSolid {
|
||||
public:
|
||||
class G4Tubs : public G4CSGSolid
|
||||
{
|
||||
public:
|
||||
|
||||
G4Tubs(const G4String &pName,
|
||||
G4double pRMin,
|
||||
G4double pRMax,
|
||||
@@ -95,14 +97,14 @@ public:
|
||||
const G4AffineTransform& pTransform,
|
||||
G4double& pmin, G4double& pmax) const;
|
||||
|
||||
G4double GetInnerRadius () const { return fRMin; }
|
||||
G4double GetOuterRadius () const { return fRMax; }
|
||||
G4double GetInnerRadius () const { return fRMin; }
|
||||
G4double GetOuterRadius () const { return fRMax; }
|
||||
G4double GetZHalfLength () const { return fDz ; }
|
||||
G4double GetStartPhiAngle () const { return fSPhi; }
|
||||
G4double GetDeltaPhiAngle () const { return fDPhi; }
|
||||
|
||||
void SetInnerRadius (G4double newRMin) { fRMin= newRMin; }
|
||||
void SetOuterRadius (G4double newRMax) { fRMax= newRMax; }
|
||||
void SetInnerRadius (G4double newRMin) { fRMin= newRMin; }
|
||||
void SetOuterRadius (G4double newRMax) { fRMax= newRMax; }
|
||||
void SetZHalfLength (G4double newDz) { fDz= newDz ; }
|
||||
void SetStartPhiAngle (G4double newSPhi) { fSPhi= newSPhi; }
|
||||
void SetDeltaPhiAngle (G4double newDPhi) { fDPhi= newDPhi; }
|
||||
@@ -118,31 +120,34 @@ public:
|
||||
G4bool *validNorm=0,G4ThreeVector *n=0) const;
|
||||
G4double DistanceToOut(const G4ThreeVector& p) const;
|
||||
|
||||
// Naming method (pseudo-RTTI : run-time type identification)
|
||||
virtual G4GeometryType GetEntityType() const { return G4String("G4Tubs"); }
|
||||
G4GeometryType GetEntityType() const { return G4String("G4Tubs"); }
|
||||
// Naming method (pseudo-RTTI : run-time type identification)
|
||||
|
||||
// Visualisation functions
|
||||
|
||||
// Visualisation functions
|
||||
void DescribeYourselfTo (G4VGraphicsScene& scene) const;
|
||||
G4Polyhedron* CreatePolyhedron () const;
|
||||
G4NURBS* CreateNURBS () const;
|
||||
|
||||
// Older names for access functions
|
||||
G4double GetRMin() const { return GetInnerRadius(); } // fRMin
|
||||
// Older names for access functions
|
||||
|
||||
G4double GetRMin() const { return GetInnerRadius(); } // fRMin
|
||||
G4double GetRMax() const { return GetOuterRadius(); } // fRMax
|
||||
G4double GetDz () const { return GetZHalfLength() ; } // fDz
|
||||
G4double GetSPhi() const { return GetStartPhiAngle(); } // fSPhi
|
||||
G4double GetDPhi() const { return GetDeltaPhiAngle(); } // fDPhi
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
G4ThreeVectorList*
|
||||
CreateRotatedVertices(const G4AffineTransform& pTransform) const;
|
||||
|
||||
G4double fRMin,fRMax,fDz,fSPhi,fDPhi;
|
||||
|
||||
// Used by distanceToOut
|
||||
enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
|
||||
enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
|
||||
// used by normal
|
||||
enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
|
||||
enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user