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

G4ParameterisationParaY represents the parameterised positioning equivalent to dividing a G4Para along Y axis. More...

#include <G4ParameterisationPara.hh>

Inheritance diagram for G4ParameterisationParaY:

Public Member Functions

 G4ParameterisationParaY (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 ~G4ParameterisationParaY () 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

G4ParameterisationParaY represents the parameterised positioning equivalent to dividing a G4Para along Y axis.

Definition at line 163 of file G4ParameterisationPara.hh.

Constructor & Destructor Documentation

◆ G4ParameterisationParaY()

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

Initialises a parameterised para along Y 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 180 of file G4ParameterisationPara.cc.

184 : G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType )
185{
187 SetType( "DivisionParaY" );
188
189 auto mpara = (G4Para*)(fmotherSolid);
190 if( divType == DivWIDTH )
191 {
192 fnDiv = CalculateNDiv( 2*mpara->GetYHalfLength(), width, offset );
193 }
194 else if( divType == DivNDIV )
195 {
196 fwidth = CalculateWidth( 2*mpara->GetYHalfLength(), nDiv, offset );
197 }
198
199#ifdef G4DIVDEBUG
200 if( verbose >= 1 )
201 {
202 G4cout << " G4ParameterisationParaY - # divisions " << fnDiv
203 << " = " << nDiv << G4endl
204 << " Offset " << foffset << " = " << offset << G4endl
205 << " Width " << fwidth << " = " << width << G4endl;
206 }
207#endif
208}
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

◆ ~G4ParameterisationParaY()

G4ParameterisationParaY::~G4ParameterisationParaY ( )
overridedefault

Default Destructor.

Member Function Documentation

◆ ComputeDimensions()

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

Reimplemented from G4VPVParameterisation.

Definition at line 250 of file G4ParameterisationPara.cc.

253{
254 //---- The division along Y of a Para will result a Para
255 auto msol = (G4Para*)(fmotherSolid);
256
257 //---- Get
258 G4double pDx = msol->GetXHalfLength();
259 G4double pDy = fwidth/2. - fhgap;
260 G4double pDz = msol->GetZHalfLength();
261 G4double pAlpha = std::atan(msol->GetTanAlpha());
262 G4double pTheta = msol->GetSymAxis().theta();
263 G4double pPhi = msol->GetSymAxis().phi();
264
265 para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi );
266
267#ifdef G4DIVDEBUG
268 if( verbose >= -1 )
269 {
270 G4cout << " G4ParameterisationParaY::ComputeDimensions()"
271 << " - Mother PARA " << G4endl;
272 msol->DumpInfo();
273 G4cout << " - Parameterised PARA: " << G4endl;
274 para.DumpInfo();
275 }
276#endif
277}
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 G4ParameterisationParaY::ComputeTransformation ( const G4int copyNo,
G4VPhysicalVolume * physVol ) const
overridevirtual

Concrete methods implementing the parameterisation.

Implements G4VDivisionParameterisation.

Definition at line 222 of file G4ParameterisationPara.cc.

224{
225 auto msol = (G4Para*)(fmotherSolid );
226 G4double mdy = msol->GetYHalfLength( );
227
228 //----- translation
229 G4ThreeVector origin(0.,0.,0.);
230 G4double posiY = -mdy + foffset+(copyNo+0.5)*fwidth;
231 origin.setY( posiY );
232 G4double posiX = posiY * msol->GetTanAlpha();
233 origin.setX( posiX );
234
235#ifdef G4DIVDEBUG
236 if( verbose >= 2 )
237 {
238 G4cout << std::setprecision(8) << " G4ParameterisationParaY "
239 << copyNo << G4endl
240 << " Position: " << origin << " - Axis: " << faxis << G4endl;
241 }
242#endif
243
244 //----- set translation
245 physVol->SetTranslation( origin );
246}
CLHEP::Hep3Vector G4ThreeVector
void SetTranslation(const G4ThreeVector &v)

◆ GetMaxParameter()

G4double G4ParameterisationParaY::GetMaxParameter ( ) const
overridevirtual

Returns the max width along Y.

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

Implements G4VDivisionParameterisation.

Definition at line 214 of file G4ParameterisationPara.cc.

215{
216 auto msol = (G4Para*)(fmotherSolid);
217 return 2*msol->GetYHalfLength();
218}

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