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

G4ParameterisationParaX represents the parameterised positioning equivalent to dividing a G4Para along X axis. More...

#include <G4ParameterisationPara.hh>

Inheritance diagram for G4ParameterisationParaX:

Public Member Functions

 G4ParameterisationParaX (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
 ~G4ParameterisationParaX () 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 *pSolid, 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 *pv) override
const G4StringGetType () const
EAxis GetAxis () const
G4int GetNoDiv () const
G4double GetWidth () const
G4double GetOffset () const
G4VSolidGetMotherSolid () const
void SetType (const G4String &type)
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
G4double kCarTolerance
G4double fhgap = 0.0
Static Protected Attributes inherited from G4VDivisionParameterisation
static G4ThreadLocal G4RotationMatrixfRot = nullptr
static const G4int verbose = 5

Detailed Description

G4ParameterisationParaX represents the parameterised positioning equivalent to dividing a G4Para along X axis.

Definition at line 92 of file G4ParameterisationPara.hh.

Constructor & Destructor Documentation

◆ G4ParameterisationParaX()

G4ParameterisationParaX::G4ParameterisationParaX ( EAxis axis,
G4int nCopies,
G4double offset,
G4double step,
G4VSolid * pSolid,
DivisionType divType )

Initialises a parameterised para along X axis.

Parameters
[in]axisThe axis along which apply the parameterisation.
[in]nCopiesThe total number of divided copies.
[in]offsetPotential initial offset along the axis.
[in]stepThe width of the divided entity.
[in]pSolidPointer to the original shape to parameterise.
[in]divTypeString identifier for the kind of division.

Definition at line 82 of file G4ParameterisationPara.cc.

86 : G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
87{
89 SetType( "DivisionParaX" );
90
91 auto mpara = (G4Para*)(fmotherSolid);
92 if( divType == DivWIDTH )
93 {
94 fnDiv = CalculateNDiv( 2*mpara->GetXHalfLength(), width, offset );
95 }
96 else if( divType == DivNDIV )
97 {
98 fwidth = CalculateWidth( 2*mpara->GetXHalfLength(), nDiv, offset );
99 }
100
101#ifdef G4DIVDEBUG
102 if( verbose >= 1 )
103 {
104 G4cout << " G4ParameterisationParaX - # divisions " << fnDiv
105 << " = " << nDiv << G4endl
106 << " Offset " << foffset << " = " << offset << G4endl
107 << " Width " << fwidth << " = " << width << G4endl;
108 }
109#endif
110}
G4ThreadLocal T * G4GeomSplitter< T >::offset
#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 *pSolid, DivisionType divType)
const axis_t axis_to_type< N >::axis
Definition pugixml.cc:9668

◆ ~G4ParameterisationParaX()

G4ParameterisationParaX::~G4ParameterisationParaX ( )
overridedefault

Default Destructor.

Member Function Documentation

◆ ComputeDimensions()

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

Reimplemented from G4VPVParameterisation.

Definition at line 150 of file G4ParameterisationPara.cc.

153{
154 //---- The division along X of a Para will result a Para
155 auto msol = (G4Para*)(fmotherSolid);
156
157 //---- Get
158 G4double pDx = fwidth/2. - fhgap;
159 G4double pDy = msol->GetYHalfLength();
160 G4double pDz = msol->GetZHalfLength();
161 G4double pAlpha = std::atan(msol->GetTanAlpha());
162 G4double pTheta = msol->GetSymAxis().theta();
163 G4double pPhi = msol->GetSymAxis().phi();
164
165 para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
166
167#ifdef G4DIVDEBUG
168 if( verbose >= 1 )
169 {
170 G4cout << " G4ParameterisationParaX::ComputeDimensions()"
171 << " - Mother PARA " << G4endl;
172 msol->DumpInfo();
173 G4cout << " - Parameterised PARA: " << G4endl;
174 para.DumpInfo();
175 }
176#endif
177}
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 G4ParameterisationParaX::ComputeTransformation ( const G4int copyNo,
G4VPhysicalVolume * physVol ) const
overridevirtual

Concrete methods implementing the parameterisation.

Implements G4VDivisionParameterisation.

Definition at line 124 of file G4ParameterisationPara.cc.

126{
127 auto msol = (G4Para*)(fmotherSolid );
128 G4double mdx = msol->GetXHalfLength( );
129
130 //----- translation
131 G4ThreeVector origin(0.,0.,0.);
132 G4double posi = -mdx + foffset+(copyNo+0.5)*fwidth;
133 origin.setX( posi );
134
135#ifdef G4DIVDEBUG
136 if( verbose >= 2 )
137 {
138 G4cout << std::setprecision(8) << " G4ParameterisationParaX "
139 << copyNo << G4endl
140 << " Position: " << origin << " - Axis: " << faxis << G4endl;
141 }
142#endif
143
144 //----- set translation
145 physVol->SetTranslation( origin );
146}
CLHEP::Hep3Vector G4ThreeVector
void SetTranslation(const G4ThreeVector &v)

◆ GetMaxParameter()

G4double G4ParameterisationParaX::GetMaxParameter ( ) const
overridevirtual

Returns the max width along X.

Returns
The maximum width of the solid to divide along the X axis.

Implements G4VDivisionParameterisation.

Definition at line 113 of file G4ParameterisationPara.cc.

114{
115 auto msol = (G4Para*)(fmotherSolid);
116 return 2*msol->GetXHalfLength();
117}

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