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

#include <G4ParameterisationBox.hh>

+ Inheritance diagram for G4ParameterisationBoxZ:

Public Member Functions

 G4ParameterisationBoxZ (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
 ~G4ParameterisationBoxZ ()
 
G4double GetMaxParameter () const
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
 
void ComputeDimensions (G4Box &box, const G4int copyNo, const G4VPhysicalVolume *physVol) const
 
- Public Member Functions inherited from G4VParameterisationBox
 G4VParameterisationBox (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
virtual ~G4VParameterisationBox ()
 
- Public Member Functions inherited from G4VDivisionParameterisation
 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 void ComputeTransformation (const G4int, G4VPhysicalVolume *) const =0
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
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 (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.) 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
 
G4double fwidth
 
G4double foffset
 
DivisionType fDivisionType
 
G4VSolidfmotherSolid
 
G4bool fReflectedSolid
 
G4bool fDeleteSolid
 
G4int theVoluFirstCopyNo
 
G4double kCarTolerance
 
G4double fhgap
 
- Static Protected Attributes inherited from G4VDivisionParameterisation
static G4int verbose = 5
 

Detailed Description

Definition at line 160 of file G4ParameterisationBox.hh.

Constructor & Destructor Documentation

◆ G4ParameterisationBoxZ()

G4ParameterisationBoxZ::G4ParameterisationBoxZ ( EAxis  axis,
G4int  nCopies,
G4double  offset,
G4double  step,
G4VSolid msolid,
DivisionType  divType 
)

Definition at line 274 of file G4ParameterisationBox.cc.

278 : G4VParameterisationBox( axis, nDiv, width, offset, msolid, divType )
279{
281 SetType( "DivisionBoxZ" );
282
283 G4Box* mbox = (G4Box*)(fmotherSolid);
284 if( divType == DivWIDTH )
285 {
286 fnDiv = CalculateNDiv( 2*mbox->GetZHalfLength(), width, offset );
287 }
288 else if ( divType == DivNDIV )
289 {
290 fwidth = CalculateWidth( 2*mbox->GetZHalfLength(), nDiv, offset );
291 }
292#ifdef G4DIVDEBUG
293 if( verbose >= 1 )
294 {
295 G4cout << " G4ParameterisationBoxZ - no divisions " << fnDiv << " = "
296 << nDiv << ". Offset " << foffset << " = " << offset
297 << ". Width " << fwidth << " = " << width << G4endl;
298 }
299#endif
300}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
Definition: G4Box.hh:55
G4double GetZHalfLength() const
void SetType(const G4String &type)
G4double CalculateWidth(G4double motherDim, G4int nDiv, G4double offset) const
G4int CalculateNDiv(G4double motherDim, G4double width, G4double offset) const

◆ ~G4ParameterisationBoxZ()

G4ParameterisationBoxZ::~G4ParameterisationBoxZ ( )

Definition at line 303 of file G4ParameterisationBox.cc.

304{
305}

Member Function Documentation

◆ ComputeDimensions()

void G4ParameterisationBoxZ::ComputeDimensions ( G4Box box,
const G4int  copyNo,
const G4VPhysicalVolume physVol 
) const
virtual

Reimplemented from G4VPVParameterisation.

Definition at line 350 of file G4ParameterisationBox.cc.

353{
354 G4Box* msol = (G4Box*)(fmotherSolid);
355
356 G4double pDx = msol->GetXHalfLength();
357 G4double pDy = msol->GetYHalfLength();
358 G4double pDz = fwidth/2. - fhgap;
359
360 box.SetXHalfLength( pDx );
361 box.SetYHalfLength( pDy );
362 box.SetZHalfLength( pDz );
363
364#ifdef G4DIVDEBUG
365 if( verbose >= 2 )
366 {
367 G4cout << " G4ParameterisationBoxZ::ComputeDimensions()" << G4endl
368 << " pDx: " << pDz << G4endl;
369 box.DumpInfo();
370 }
371#endif
372}
double G4double
Definition: G4Types.hh:64
G4double GetYHalfLength() const
void SetZHalfLength(G4double dz)
Definition: G4Box.cc:170
G4double GetXHalfLength() const
void SetYHalfLength(G4double dy)
Definition: G4Box.cc:150
void SetXHalfLength(G4double dx)
Definition: G4Box.cc:130
void DumpInfo() const

◆ ComputeTransformation()

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

Implements G4VDivisionParameterisation.

Definition at line 316 of file G4ParameterisationBox.cc.

318{
319 G4Box* msol = (G4Box*)(fmotherSolid );
320 G4double mdz = msol->GetZHalfLength();
321
322 //----- translation
323 G4ThreeVector origin(0.,0.,0.);
324 G4double posi = -mdz + OffsetZ() + (copyNo+0.5)*fwidth;
325
326 if( faxis == kZAxis )
327 {
328 origin.setZ( posi );
329 }
330 else
331 {
332 G4Exception("G4ParameterisationBoxZ::ComputeTransformation()",
333 "GeomDiv0002", FatalException,
334 "Only axes along Z are allowed ! Axis: "+faxis);
335 }
336#ifdef G4DIVDEBUG
337 if( verbose >= 2 )
338 {
339 G4cout << std::setprecision(8) << " G4ParameterisationBoxZ: "
340 << copyNo << G4endl
341 << " Position " << origin << " Axis " << faxis << G4endl;
342 }
343#endif
344 //----- set translation
345 physVol->SetTranslation( origin );
346}
@ FatalException
void SetTranslation(const G4ThreeVector &v)
@ kZAxis
Definition: geomdefs.hh:54
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ GetMaxParameter()

G4double G4ParameterisationBoxZ::GetMaxParameter ( ) const
virtual

Implements G4VDivisionParameterisation.

Definition at line 308 of file G4ParameterisationBox.cc.

309{
310 G4Box* msol = (G4Box*)(fmotherSolid);
311 return 2*msol->GetZHalfLength();
312}

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