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

#include <G4ParameterisationPara.hh>

+ Inheritance diagram for G4ParameterisationParaZ:

Public Member Functions

 G4ParameterisationParaZ (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
 ~G4ParameterisationParaZ () override
 
G4double GetMaxParameter () const override
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const override
 
void ComputeDimensions (G4Para &para, const G4int copyNo, const G4VPhysicalVolume *pv) const override
 
- Public Member Functions inherited from G4VParameterisationPara
 G4VParameterisationPara (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
 ~G4VParameterisationPara () override
 
- Public Member Functions inherited from G4VDivisionParameterisation
 G4VDivisionParameterisation (EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
 
 ~G4VDivisionParameterisation () override
 
G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *) override
 
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 ()=default
 
virtual ~G4VPVParameterisation ()=default
 
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
 
virtual G4bool IsNested () const
 
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
 

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)
 
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 161 of file G4ParameterisationPara.hh.

Constructor & Destructor Documentation

◆ G4ParameterisationParaZ()

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

Definition at line 280 of file G4ParameterisationPara.cc.

284 : G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
285{
287 SetType( "DivisionParaZ" );
288
289 auto mpara = (G4Para*)(fmotherSolid);
290 if( divType == DivWIDTH )
291 {
292 fnDiv = CalculateNDiv( 2*mpara->GetZHalfLength(), width, offset );
293 }
294 else if( divType == DivNDIV )
295 {
296 fwidth = CalculateWidth( 2*mpara->GetZHalfLength(), nDiv, offset );
297 }
298
299#ifdef G4DIVDEBUG
300 if( verbose >= -1 )
301 {
302 G4cout << " G4ParameterisationParaZ - # divisions " << fnDiv
303 << " = " << nDiv << G4endl
304 << " Offset " << foffset << " = " << offset << G4endl
305 << " Width " << fwidth << " = " << width << G4endl;
306 }
307#endif
308}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void SetType(const G4String &type)
G4double CalculateWidth(G4double motherDim, G4int nDiv, G4double offset) const
G4int CalculateNDiv(G4double motherDim, G4double width, G4double offset) const
G4VParameterisationPara(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)

◆ ~G4ParameterisationParaZ()

G4ParameterisationParaZ::~G4ParameterisationParaZ ( )
overridedefault

Member Function Documentation

◆ ComputeDimensions()

void G4ParameterisationParaZ::ComputeDimensions ( G4Para & para,
const G4int copyNo,
const G4VPhysicalVolume * pv ) const
overridevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 348 of file G4ParameterisationPara.cc.

351{
352 //---- The division along Z of a Para will result a Para
353 auto msol = (G4Para*)(fmotherSolid);
354
355 //---- Get
356 G4double pDx = msol->GetXHalfLength();
357 G4double pDy = msol->GetYHalfLength();
358 G4double pDz = fwidth/2. - fhgap;
359 G4double pAlpha = std::atan(msol->GetTanAlpha());
360 G4double pTheta = msol->GetSymAxis().theta();
361 G4double pPhi = msol->GetSymAxis().phi();
362
363 para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
364
365#ifdef G4DIVDEBUG
366 if( verbose >= -1 )
367 {
368 G4cout << " G4ParameterisationParaZ::ComputeDimensions()"
369 << " - Mother PARA " << G4endl;
370 msol->DumpInfo();
371 G4cout << " - Parameterised PARA: " << G4endl;
372 para.DumpInfo();
373 }
374#endif
375}
double G4double
Definition G4Types.hh:83
void SetAllParameters(G4double pDx, G4double pDy, G4double pDz, G4double pAlpha, G4double pTheta, G4double pPhi)
Definition G4Para.cc:183
void DumpInfo() const

◆ ComputeTransformation()

void G4ParameterisationParaZ::ComputeTransformation ( const G4int copyNo,
G4VPhysicalVolume * physVol ) const
overridevirtual

Implements G4VDivisionParameterisation.

Definition at line 322 of file G4ParameterisationPara.cc.

324{
325 auto msol = (G4Para*)(fmotherSolid );
326 G4double mdz = msol->GetZHalfLength( );
327
328 //----- translation
329 G4double posi = -mdz + OffsetZ() + (copyNo+0.5)*fwidth;
330 G4ThreeVector symAxis = msol->GetSymAxis();
331 G4ThreeVector origin( symAxis * posi / symAxis.z() );
332
333#ifdef G4DIVDEBUG
334 if( verbose >= 2 )
335 {
336 G4cout << std::setprecision(8) << " G4ParameterisationParaZ "
337 << copyNo << G4endl
338 << " Position: " << origin << " - Axis: " << faxis << G4endl;
339 }
340#endif
341
342 //----- set translation
343 physVol->SetTranslation( origin );
344}
void SetTranslation(const G4ThreeVector &v)

◆ GetMaxParameter()

G4double G4ParameterisationParaZ::GetMaxParameter ( ) const
overridevirtual

Implements G4VDivisionParameterisation.

Definition at line 314 of file G4ParameterisationPara.cc.

315{
316 auto msol = (G4Para*)(fmotherSolid);
317 return 2*msol->GetZHalfLength();
318}

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