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

G4ParameterisationPolyconePhi represents the parameterised positioning equivalent to dividing a G4Polycone along Phi axis. More...

#include <G4ParameterisationPolycone.hh>

Inheritance diagram for G4ParameterisationPolyconePhi:

Public Member Functions

 G4ParameterisationPolyconePhi (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
 ~G4ParameterisationPolyconePhi () override
G4double GetMaxParameter () const override
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const override
void ComputeDimensions (G4Polycone &pcone, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
Public Member Functions inherited from G4VParameterisationPolycone
 G4VParameterisationPolycone (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
 ~G4VParameterisationPolycone () 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

G4ParameterisationPolyconePhi represents the parameterised positioning equivalent to dividing a G4Polycone along Phi axis.

Definition at line 168 of file G4ParameterisationPolycone.hh.

Constructor & Destructor Documentation

◆ G4ParameterisationPolyconePhi()

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

Initialises a parameterised polycone, along the Phi axis.

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

Definition at line 241 of file G4ParameterisationPolycone.cc.

245 : G4VParameterisationPolycone( axis, nDiv, width, offset, msolid, divType )
246{
248 SetType( "DivisionPolyconePhi" );
249
250 auto msol = (G4Polycone*)(fmotherSolid);
251 G4double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
252
253 if( divType == DivWIDTH )
254 {
255 fnDiv = CalculateNDiv( deltaPhi, width, offset );
256 }
257 else if( divType == DivNDIV )
258 {
259 fwidth = CalculateWidth( deltaPhi, nDiv, offset );
260 }
261
262#ifdef G4DIVDEBUG
263 if( verbose >= 1 )
264 {
265 G4cout << " G4ParameterisationPolyconePhi - # divisions " << fnDiv
266 << " = " << nDiv << G4endl
267 << " Offset " << foffset/CLHEP::deg << " = " << offset/CLHEP::deg << G4endl
268 << " Width " << fwidth/CLHEP::deg << " = " << width/CLHEP::deg << G4endl;
269 }
270#endif
271}
G4ThreadLocal T * G4GeomSplitter< T >::offset
double G4double
Definition G4Types.hh:83
#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
G4VParameterisationPolycone(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
const axis_t axis_to_type< N >::axis
Definition pugixml.cc:9668

◆ ~G4ParameterisationPolyconePhi()

G4ParameterisationPolyconePhi::~G4ParameterisationPolyconePhi ( )
overridedefault

Default Destructor.

Member Function Documentation

◆ ComputeDimensions()

void G4ParameterisationPolyconePhi::ComputeDimensions ( G4Polycone & pcone,
const G4int copyNo,
const G4VPhysicalVolume * physVol ) const
overridevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 321 of file G4ParameterisationPolycone.cc.

324{
325 auto msol = (G4Polycone*)(fmotherSolid);
326
327 G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
328 G4PolyconeHistorical origparam( *origparamMother );
329 origparam.Start_angle = origparamMother->Start_angle;
330 origparam.Opening_angle = fwidth;
331
332 pcone.SetOriginalParameters(&origparam); // copy values & transfer pointers
333 pcone.Reset(); // reset to new solid parameters
334
335#ifdef G4DIVDEBUG
336 if( verbose >= 2 )
337 {
338 G4cout << "G4ParameterisationPolyconePhi::ComputeDimensions():" << G4endl;
339 pcone.DumpInfo();
340 }
341#endif
342}
void SetOriginalParameters(G4PolyconeHistorical *pars)
G4bool Reset()
void DumpInfo() const

◆ ComputeTransformation()

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

Concrete methods implementing the parameterisation.

Implements G4VDivisionParameterisation.

Definition at line 285 of file G4ParameterisationPolycone.cc.

287{
288 //----- translation
289 G4ThreeVector origin(0.,0.,0.);
290 //----- set translation
291 physVol->SetTranslation( origin );
292
293 //----- calculate rotation matrix (so that all volumes point to the centre)
294 G4double posi = foffset + copyNo*fwidth;
295
296#ifdef G4DIVDEBUG
297 if( verbose >= 2 )
298 {
299 G4cout << " G4ParameterisationPolyconePhi - position: " << posi/CLHEP::deg
300 << G4endl
301 << " copyNo: " << copyNo << " - foffset: " << foffset/CLHEP::deg
302 << " - fwidth: " << fwidth/CLHEP::deg << G4endl;
303 }
304#endif
305
306 ChangeRotMatrix( physVol, -posi );
307
308#ifdef G4DIVDEBUG
309 if( verbose >= 2 )
310 {
311 G4cout << std::setprecision(8) << " G4ParameterisationPolyconePhi "
312 << copyNo << G4endl
313 << " Position: (0,0,0) - Width: " << fwidth
314 << " - Axis: " << faxis << G4endl;
315 }
316#endif
317}
CLHEP::Hep3Vector G4ThreeVector
void ChangeRotMatrix(G4VPhysicalVolume *physVol, G4double rotZ=0.0) const
void SetTranslation(const G4ThreeVector &v)

◆ GetMaxParameter()

G4double G4ParameterisationPolyconePhi::GetMaxParameter ( ) const
overridevirtual

Returns the max width along Phi.

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

Implements G4VDivisionParameterisation.

Definition at line 277 of file G4ParameterisationPolycone.cc.

278{
279 auto msol = (G4Polycone*)(fmotherSolid);
280 return msol->GetEndPhi() - msol->GetStartPhi();
281}

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