Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VDivisionParameterisation Class Referenceabstract

#include <G4VDivisionParameterisation.hh>

Inheritance diagram for G4VDivisionParameterisation:
Collaboration diagram for G4VDivisionParameterisation:

Public Member Functions

 G4VDivisionParameterisation (EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=0)
 
virtual ~G4VDivisionParameterisation ()
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
virtual void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const =0
 
const G4StringGetType () const
 
EAxis GetAxis () const
 
G4int GetNoDiv () const
 
G4double GetWidth () const
 
G4double GetOffset () const
 
G4VSolidGetMotherSolid () const
 
void SetType (const G4String &type)
 
G4int VolumeFirstCopyNo () const
 
void SetHalfGap (G4double hg)
 
G4double GetHalfGap () const
 
- Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()
 
virtual ~G4VPVParameterisation ()
 
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
 
virtual G4bool IsNested () const
 
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
 
virtual void ComputeDimensions (G4Box &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Tubs &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Trd &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Trap &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Cons &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Sphere &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Orb &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Ellipsoid &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Torus &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Para &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Polycone &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Polyhedra &, const G4int, const G4VPhysicalVolume *) const
 
virtual void ComputeDimensions (G4Hype &, const G4int, const G4VPhysicalVolume *) const
 

Protected Member Functions

void ChangeRotMatrix (G4VPhysicalVolume *physVol, G4double rotZ=0.) const
 
G4int CalculateNDiv (G4double motherDim, G4double width, G4double offset) const
 
G4double CalculateWidth (G4double motherDim, G4int nDiv, G4double offset) const
 
virtual void CheckParametersValidity ()
 
void CheckOffset (G4double maxPar)
 
void CheckNDivAndWidth (G4double maxPar)
 
virtual G4double GetMaxParameter () const =0
 
G4double OffsetZ () const
 

Protected Attributes

G4String ftype
 
EAxis faxis
 
G4int fnDiv
 
G4double fwidth
 
G4double foffset
 
DivisionType fDivisionType
 
G4VSolidfmotherSolid
 
G4bool fReflectedSolid
 
G4bool fDeleteSolid
 
G4int theVoluFirstCopyNo
 
G4double kCarTolerance
 
G4double fhgap
 

Static Protected Attributes

static G4ThreadLocal
G4RotationMatrix
fRot = 0
 
static const G4int verbose = 5
 

Detailed Description

Definition at line 55 of file G4VDivisionParameterisation.hh.

Constructor & Destructor Documentation

G4VDivisionParameterisation::G4VDivisionParameterisation ( EAxis  axis,
G4int  nDiv,
G4double  width,
G4double  offset,
DivisionType  divType,
G4VSolid motherSolid = 0 
)

Definition at line 49 of file G4VDivisionParameterisation.cc.

52  : faxis(axis), fnDiv( nDiv), fwidth(step), foffset(offset),
53  fDivisionType(divType), fmotherSolid( motherSolid ), fReflectedSolid(false),
54  fDeleteSolid(false), theVoluFirstCopyNo(1), fhgap(0.)
55 {
56 #ifdef G4DIVDEBUG
57  if (verbose >= 1)
58  {
59  G4cout << " G4VDivisionParameterisation no divisions " << fnDiv
60  << " = " << nDiv << G4endl
61  << " offset " << foffset << " = " << offset << G4endl
62  << " step " << fwidth << " = " << step << G4endl;
63  }
64 #endif
66 }
G4double GetSurfaceTolerance() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
static G4GeometryTolerance * GetInstance()

Here is the call graph for this function:

G4VDivisionParameterisation::~G4VDivisionParameterisation ( )
virtual

Member Function Documentation

G4int G4VDivisionParameterisation::CalculateNDiv ( G4double  motherDim,
G4double  width,
G4double  offset 
) const
protected

Definition at line 104 of file G4VDivisionParameterisation.cc.

105 {
106 #ifdef G4DIVDEBUG
107  G4cout << " G4VDivisionParameterisation::CalculateNDiv: "
108  << ( motherDim - offset ) / width
109  << " Motherdim: " << motherDim << ", Offset: " << offset
110  << ", Width: " << width << G4endl;
111 #endif
112 
113  return G4int( ( motherDim - offset ) / width );
114 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

G4double G4VDivisionParameterisation::CalculateWidth ( G4double  motherDim,
G4int  nDiv,
G4double  offset 
) const
protected

Definition at line 119 of file G4VDivisionParameterisation.cc.

120 {
121 #ifdef G4DIVDEBUG
122  G4cout << " G4VDivisionParameterisation::CalculateWidth: "
123  << ( motherDim - offset ) / nDiv
124  << ", Motherdim: " << motherDim << ", Offset: " << offset
125  << ", Number of divisions: " << nDiv << G4endl;
126 #endif
127 
128  return ( motherDim - offset ) / nDiv;
129 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4VDivisionParameterisation::ChangeRotMatrix ( G4VPhysicalVolume physVol,
G4double  rotZ = 0. 
) const
protected

Definition at line 90 of file G4VDivisionParameterisation.cc.

91 {
92  if (!fRot)
93  {
94  fRot = new G4RotationMatrix();
96  }
97  fRot->rotateZ( rotZ );
98  physVol->SetRotation(fRot);
99 }
CLHEP::HepRotation G4RotationMatrix
void SetRotation(G4RotationMatrix *)
void Register(T *inst)
Definition: G4AutoDelete.hh:65
static G4ThreadLocal G4RotationMatrix * fRot
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VDivisionParameterisation::CheckNDivAndWidth ( G4double  maxPar)
protected

Definition at line 155 of file G4VDivisionParameterisation.cc.

156 {
158  && (foffset + fwidth*fnDiv - maxPar > kCarTolerance ) )
159  {
160  std::ostringstream message;
161  message << "Configuration not supported." << G4endl
162  << "Division of solid " << fmotherSolid->GetName()
163  << " has too big offset + width*nDiv = " << G4endl
164  << " " << foffset + fwidth*fnDiv << " > "
165  << foffset << ". Width = "
166  << G4endl
167  << " " << fwidth << ". nDiv = " << fnDiv << " !";
168  G4Exception("G4VDivisionParameterisation::CheckNDivAndWidth()",
169  "GeomDiv0001", FatalException, message);
170  }
171 }
G4String GetName() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VDivisionParameterisation::CheckOffset ( G4double  maxPar)
protected

Definition at line 140 of file G4VDivisionParameterisation.cc.

141 {
142  if( foffset >= maxPar )
143  {
144  std::ostringstream message;
145  message << "Configuration not supported." << G4endl
146  << "Division of solid " << fmotherSolid->GetName()
147  << " has too big offset = " << G4endl
148  << " " << foffset << " > " << maxPar << " !";
149  G4Exception("G4VDivisionParameterisation::CheckOffset()",
150  "GeomDiv0001", FatalException, message);
151  }
152 }
G4String GetName() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VDivisionParameterisation::CheckParametersValidity ( )
protectedvirtual

Reimplemented in G4ParameterisationPolyhedraZ, G4ParameterisationPolyconeZ, G4ParameterisationPolyhedraPhi, G4ParameterisationTrdY, G4ParameterisationPolyhedraRho, G4ParameterisationTrdX, and G4ParameterisationPolyconeRho.

Definition at line 132 of file G4VDivisionParameterisation.cc.

133 {
134  G4double maxPar = GetMaxParameter();
135  CheckOffset( maxPar );
136  CheckNDivAndWidth( maxPar );
137 }
virtual G4double GetMaxParameter() const =0
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4VSolid * G4VDivisionParameterisation::ComputeSolid ( const G4int  i,
G4VPhysicalVolume pv 
)
virtual

Reimplemented from G4VPVParameterisation.

Reimplemented in G4ParameterisationTrdX.

Definition at line 77 of file G4VDivisionParameterisation.cc.

78 {
80  if (solid->GetEntityType() == "G4ReflectedSolid")
81  {
82  solid = ((G4ReflectedSolid*)solid)->GetConstituentMovedSolid();
83  }
84  return solid;
85 }
virtual G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
virtual G4GeometryType GetEntityType() const =0

Here is the call graph for this function:

Here is the caller graph for this function:

EAxis G4VDivisionParameterisation::GetAxis ( ) const
inline

Here is the caller graph for this function:

G4double G4VDivisionParameterisation::GetHalfGap ( ) const
inline
G4VSolid* G4VDivisionParameterisation::GetMotherSolid ( ) const
inline

Here is the caller graph for this function:

G4int G4VDivisionParameterisation::GetNoDiv ( ) const
inline

Here is the caller graph for this function:

G4double G4VDivisionParameterisation::GetOffset ( ) const
inline

Here is the caller graph for this function:

const G4String& G4VDivisionParameterisation::GetType ( ) const
inline
G4double G4VDivisionParameterisation::GetWidth ( ) const
inline

Here is the caller graph for this function:

G4double G4VDivisionParameterisation::OffsetZ ( ) const
protected

Definition at line 174 of file G4VDivisionParameterisation.cc.

175 {
176  // take into account reflection in the offset
177  G4double offset = foffset;
178  if (fReflectedSolid) offset = GetMaxParameter() - fwidth*fnDiv - foffset;
179 
180  return offset;
181 }
virtual G4double GetMaxParameter() const =0
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VDivisionParameterisation::SetHalfGap ( G4double  hg)
inline
void G4VDivisionParameterisation::SetType ( const G4String type)
inline

Here is the caller graph for this function:

G4int G4VDivisionParameterisation::VolumeFirstCopyNo ( ) const
inline

Member Data Documentation

EAxis G4VDivisionParameterisation::faxis
protected

Definition at line 99 of file G4VDivisionParameterisation.hh.

G4bool G4VDivisionParameterisation::fDeleteSolid
protected

Definition at line 106 of file G4VDivisionParameterisation.hh.

DivisionType G4VDivisionParameterisation::fDivisionType
protected

Definition at line 103 of file G4VDivisionParameterisation.hh.

G4double G4VDivisionParameterisation::fhgap
protected

Definition at line 115 of file G4VDivisionParameterisation.hh.

G4VSolid* G4VDivisionParameterisation::fmotherSolid
protected

Definition at line 104 of file G4VDivisionParameterisation.hh.

G4int G4VDivisionParameterisation::fnDiv
protected

Definition at line 100 of file G4VDivisionParameterisation.hh.

G4double G4VDivisionParameterisation::foffset
protected

Definition at line 102 of file G4VDivisionParameterisation.hh.

G4bool G4VDivisionParameterisation::fReflectedSolid
protected

Definition at line 105 of file G4VDivisionParameterisation.hh.

G4ThreadLocal G4RotationMatrix * G4VDivisionParameterisation::fRot = 0
staticprotected

Definition at line 108 of file G4VDivisionParameterisation.hh.

G4String G4VDivisionParameterisation::ftype
protected

Definition at line 98 of file G4VDivisionParameterisation.hh.

G4double G4VDivisionParameterisation::fwidth
protected

Definition at line 101 of file G4VDivisionParameterisation.hh.

G4double G4VDivisionParameterisation::kCarTolerance
protected

Definition at line 113 of file G4VDivisionParameterisation.hh.

G4int G4VDivisionParameterisation::theVoluFirstCopyNo
protected

Definition at line 111 of file G4VDivisionParameterisation.hh.

const G4int G4VDivisionParameterisation::verbose = 5
staticprotected

Definition at line 110 of file G4VDivisionParameterisation.hh.


The documentation for this class was generated from the following files: