Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParameterisationPolyhedraRho Class Reference

#include <G4ParameterisationPolyhedra.hh>

+ Inheritance diagram for G4ParameterisationPolyhedraRho:

Public Member Functions

 G4ParameterisationPolyhedraRho (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
 
 ~G4ParameterisationPolyhedraRho ()
 
void CheckParametersValidity ()
 
G4double GetMaxParameter () const
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
 
void ComputeDimensions (G4Polyhedra &phedra, const G4int copyNo, const G4VPhysicalVolume *physVol) const
 
- Public Member Functions inherited from G4VParameterisationPolyhedra
 G4VParameterisationPolyhedra (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
virtual ~G4VParameterisationPolyhedra ()
 
- Public Member Functions inherited from G4VDivisionParameterisation
 G4VDivisionParameterisation (EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
 
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 void ComputeTransformation (const G4int, G4VPhysicalVolume *) const =0
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
 
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
 

Additional Inherited Members

- Protected Member Functions inherited from G4VDivisionParameterisation
void ChangeRotMatrix (G4VPhysicalVolume *physVol, G4double rotZ=0.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 inherited from G4VDivisionParameterisation
G4String ftype
 
EAxis faxis
 
G4int fnDiv = 0
 
G4double fwidth = 0.0
 
G4double foffset = 0.0
 
DivisionType fDivisionType
 
G4VSolidfmotherSolid = nullptr
 
G4bool fReflectedSolid = false
 
G4bool fDeleteSolid = false
 
G4int theVoluFirstCopyNo = 1
 
G4double kCarTolerance
 
G4double fhgap = 0.0
 
- Static Protected Attributes inherited from G4VDivisionParameterisation
static G4ThreadLocal G4RotationMatrixfRot = nullptr
 
static const G4int verbose = 5
 

Detailed Description

Definition at line 79 of file G4ParameterisationPolyhedra.hh.

Constructor & Destructor Documentation

◆ G4ParameterisationPolyhedraRho()

G4ParameterisationPolyhedraRho::G4ParameterisationPolyhedraRho ( EAxis  axis,
G4int  nCopies,
G4double  offset,
G4double  step,
G4VSolid motherSolid,
DivisionType  divType 
)

Definition at line 135 of file G4ParameterisationPolyhedra.cc.

139 : G4VParameterisationPolyhedra( axis, nDiv, width, offset, msolid, divType )
140{
141
143 SetType( "DivisionPolyhedraRho" );
144
146 G4PolyhedraHistorical* original_pars = msol->GetOriginalParameters();
147
148 if( divType == DivWIDTH )
149 {
150 fnDiv = CalculateNDiv( original_pars->Rmax[0]
151 - original_pars->Rmin[0], width, offset );
152 }
153 else if( divType == DivNDIV )
154 {
155 fwidth = CalculateWidth( original_pars->Rmax[0]
156 - original_pars->Rmin[0], nDiv, offset );
157 }
158
159#ifdef G4DIVDEBUG
160 if( verbose >= 1 )
161 {
162 G4cout << " G4ParameterisationPolyhedraRho - # divisions " << fnDiv
163 << " = " << nDiv << G4endl
164 << " Offset " << foffset << " = " << offset << G4endl
165 << " Width " << fwidth << " = " << width << G4endl;
166 }
167#endif
168}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4PolyhedraHistorical * GetOriginalParameters() const
void SetType(const G4String &type)
G4double CalculateWidth(G4double motherDim, G4int nDiv, G4double offset) const
G4int CalculateNDiv(G4double motherDim, G4double width, G4double offset) const

◆ ~G4ParameterisationPolyhedraRho()

G4ParameterisationPolyhedraRho::~G4ParameterisationPolyhedraRho ( )

Definition at line 171 of file G4ParameterisationPolyhedra.cc.

172{
173}

Member Function Documentation

◆ CheckParametersValidity()

void G4ParameterisationPolyhedraRho::CheckParametersValidity ( )
virtual

Reimplemented from G4VDivisionParameterisation.

Definition at line 176 of file G4ParameterisationPolyhedra.cc.

177{
179
181
183 {
184 std::ostringstream message;
185 message << "In solid " << msol->GetName() << G4endl
186 << "Division along R will be done with a width "
187 << "different for each solid section." << G4endl
188 << "WIDTH will not be used !";
189 G4Exception("G4ParameterisationPolyhedraRho::CheckParametersValidity()",
190 "GeomDiv1001", JustWarning, message);
191 }
192 if( foffset != 0. )
193 {
194 std::ostringstream message;
195 message << "In solid " << msol->GetName() << G4endl
196 << "Division along R will be done with a width "
197 << "different for each solid section." << G4endl
198 << "OFFSET will not be used !";
199 G4Exception("G4ParameterisationPolyhedraRho::CheckParametersValidity()",
200 "GeomDiv1001", JustWarning, message);
201 }
202}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
G4String GetName() const

Referenced by G4ParameterisationPolyhedraRho().

◆ ComputeDimensions()

void G4ParameterisationPolyhedraRho::ComputeDimensions ( G4Polyhedra phedra,
const G4int  copyNo,
const G4VPhysicalVolume physVol 
) const
virtual

Reimplemented from G4VPVParameterisation.

Definition at line 250 of file G4ParameterisationPolyhedra.cc.

253{
255
256 G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters();
257 G4PolyhedraHistorical origparam( *origparamMother );
258 G4int nZplanes = origparamMother->Num_z_planes;
259
260 G4double width = 0.;
261 for( G4int ii = 0; ii < nZplanes; ++ii )
262 {
263 width = CalculateWidth( origparamMother->Rmax[ii]
264 - origparamMother->Rmin[ii], fnDiv, foffset );
265 origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo;
266 origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1);
267 }
268
269 phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers
270 phedra.Reset(); // reset to new solid parameters
271
272#ifdef G4DIVDEBUG
273 if( verbose >= -2 )
274 {
275 G4cout << "G4ParameterisationPolyhedraRho::ComputeDimensions()" << G4endl
276 << "-- Parametrised phedra copy-number: " << copyNo << G4endl;
277 phedra.DumpInfo();
278 }
279#endif
280}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
void SetOriginalParameters(G4PolyhedraHistorical *pars)
G4bool Reset()
Definition: G4Polyhedra.cc:469
void DumpInfo() const

◆ ComputeTransformation()

void G4ParameterisationPolyhedraRho::ComputeTransformation ( const G4int  copyNo,
G4VPhysicalVolume physVol 
) const
virtual

Implements G4VDivisionParameterisation.

Definition at line 214 of file G4ParameterisationPolyhedra.cc.

216{
217 //----- translation
218 G4ThreeVector origin(0.,0.,0.);
219
220 //----- set translation
221 physVol->SetTranslation( origin );
222
223 //----- calculate rotation matrix: unit
224
225#ifdef G4DIVDEBUG
226 if( verbose >= 2 )
227 {
228 G4cout << " G4ParameterisationPolyhedraRho " << G4endl
229 << " foffset: " << foffset/deg
230 << " - fwidth: " << fwidth/deg << G4endl;
231 }
232#endif
233
234 ChangeRotMatrix( physVol );
235
236#ifdef G4DIVDEBUG
237 if( verbose >= 2 )
238 {
239 G4cout << std::setprecision(8) << " G4ParameterisationPolyhedraRho "
240 << G4endl
241 << " Position: " << origin
242 << " - Width: " << fwidth
243 << " - Axis: " << faxis << G4endl;
244 }
245#endif
246}
void ChangeRotMatrix(G4VPhysicalVolume *physVol, G4double rotZ=0.0) const
void SetTranslation(const G4ThreeVector &v)

◆ GetMaxParameter()

G4double G4ParameterisationPolyhedraRho::GetMaxParameter ( ) const
virtual

Implements G4VDivisionParameterisation.

Definition at line 205 of file G4ParameterisationPolyhedra.cc.

206{
208 G4PolyhedraHistorical* original_pars = msol->GetOriginalParameters();
209 return original_pars->Rmax[0] - original_pars->Rmin[0];
210}

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