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

G4PVDivisionFactory implements the interfaces for creating volume divisions (defined in G4VPVDivisionFactory) for G4PVDivision type. More...

#include <G4PVDivisionFactory.hh>

Inheritance diagram for G4PVDivisionFactory:

Public Member Functions

 ~G4PVDivisionFactory () override=default
G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset) override
G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double offset) override
G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4double width, const G4double offset) override
G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const G4VPVParameterisation *param) override
G4bool IsPVDivision (const G4VPhysicalVolume *pv) const override
Public Member Functions inherited from G4VPVDivisionFactory
virtual ~G4VPVDivisionFactory ()=default

Static Public Member Functions

static G4PVDivisionFactoryGetInstance ()
Static Public Member Functions inherited from G4VPVDivisionFactory
static G4VPVDivisionFactoryInstance ()

Protected Member Functions

 G4PVDivisionFactory ()=default
Protected Member Functions inherited from G4VPVDivisionFactory
 G4VPVDivisionFactory ()=default

Additional Inherited Members

Static Protected Attributes inherited from G4VPVDivisionFactory
static G4ThreadLocal G4VPVDivisionFactoryfgInstance = nullptr

Detailed Description

G4PVDivisionFactory implements the interfaces for creating volume divisions (defined in G4VPVDivisionFactory) for G4PVDivision type.

Definition at line 48 of file G4PVDivisionFactory.hh.

Constructor & Destructor Documentation

◆ ~G4PVDivisionFactory()

G4PVDivisionFactory::~G4PVDivisionFactory ( )
overridedefault

Default Destructor.

◆ G4PVDivisionFactory()

G4PVDivisionFactory::G4PVDivisionFactory ( )
protecteddefault

Protected default Constructor.

Referenced by GetInstance(), and ~G4PVDivisionFactory().

Member Function Documentation

◆ CreatePVDivision() [1/4]

G4VPhysicalVolume * G4PVDivisionFactory::CreatePVDivision ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMother,
const EAxis pAxis,
const G4double width,
const G4double offset )
overridevirtual

Creates a division, using the width of the division slice.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherPointer to the logical volume of the mother.
[in]pAxisThe axis along which do the division.
[in]widthThe witdh of the divided slice along the axis.
[in]offsetThe optional offset distance from mother's border.
Returns
The pointer to physical divided volume.

Implements G4VPVDivisionFactory.

Definition at line 84 of file G4PVDivisionFactory.cc.

90{
91 // Create division - with width
92 // ---
93
94 return new G4PVDivision(pName, pLogical, pMotherLogical,
95 pAxis, width, offset);
96}
G4ThreadLocal T * G4GeomSplitter< T >::offset
G4PVDivision(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset)
G4PVDivision represents many touchable detector elements differing only in their positioning....

◆ CreatePVDivision() [2/4]

G4VPhysicalVolume * G4PVDivisionFactory::CreatePVDivision ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMother,
const EAxis pAxis,
const G4int nReplicas,
const G4double offset )
overridevirtual

Creates a division, using the number of divisions.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherPointer to the logical volume of the mother.
[in]pAxisThe axis along which do the division.
[in]nReplicasThe number of copies to replicate.
[in]offsetThe optional offset distance from mother's border.
Returns
The pointer to physical divided volume.

Implements G4VPVDivisionFactory.

Definition at line 67 of file G4PVDivisionFactory.cc.

73{
74 // Create division - with number of divisions
75 // ---
76
77 return new G4PVDivision(pName, pLogical, pMotherLogical,
78 pAxis, nReplicas, offset);
79}

◆ CreatePVDivision() [3/4]

G4VPhysicalVolume * G4PVDivisionFactory::CreatePVDivision ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMother,
const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double offset )
overridevirtual

Creates a division, using number of divisions and width.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherPointer to the logical volume of the mother.
[in]pAxisThe axis along which do the division.
[in]nReplicasThe number of copies to replicate.
[in]widthThe witdh of the divided slice along the axis.
[in]offsetThe optional offset distance from mother's border.
Returns
The pointer to physical divided volume.

Implements G4VPVDivisionFactory.

Definition at line 49 of file G4PVDivisionFactory.cc.

56{
57 // Create division - with number of divisions and width
58 // ---
59
60 return new G4PVDivision(pName, pLogical, pMotherLogical,
61 pAxis, nReplicas, width, offset);
62}

◆ CreatePVDivision() [4/4]

G4VPhysicalVolume * G4PVDivisionFactory::CreatePVDivision ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMother,
const G4VPVParameterisation * param )
overridevirtual

Creates a division, using a parameterisation algorithm.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherPointer to the logical volume of the mother.
[in]paramThe pointer to the parameterisation algorithm.
Returns
The pointer to physical divided volume.

Implements G4VPVDivisionFactory.

Definition at line 101 of file G4PVDivisionFactory.cc.

105{
106 // Create division - with parameterisation
107 // ---
108
109 // Get parameterisation data
110 //
111 const auto divParam = dynamic_cast<const G4VDivisionParameterisation*>(param);
112
113 if (divParam == nullptr)
114 {
115 G4Exception("G4PVDivisionFactory::CreatePVDivision()",
116 "GeomDiv0001", FatalException,
117 "Unexpected parameterisation type!");
118 return nullptr;
119 }
120
121 EAxis axis = divParam->GetAxis();
122 G4int nofDivisions = divParam->GetNoDiv();
123 G4double width = divParam->GetWidth();
124 G4double offset = divParam->GetOffset();
125
126 return new G4PVDivision(pName, pLogical, pMotherLogical,
127 axis, nofDivisions, width, offset);
128}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
EAxis
Definition geomdefs.hh:54
const axis_t axis_to_type< N >::axis
Definition pugixml.cc:9668

◆ GetInstance()

G4PVDivisionFactory * G4PVDivisionFactory::GetInstance ( )
static

Creates the unique instance of the singleton.

Definition at line 37 of file G4PVDivisionFactory.cc.

38{
39 if (fgInstance == nullptr)
40 {
42 }
43 return dynamic_cast<G4PVDivisionFactory*>(fgInstance);
44}
G4PVDivisionFactory()=default
static G4ThreadLocal G4VPVDivisionFactory * fgInstance

Referenced by G4GDMLReadStructure::DivisionvolRead().

◆ IsPVDivision()

G4bool G4PVDivisionFactory::IsPVDivision ( const G4VPhysicalVolume * pv) const
overridevirtual

Returns true if 'pv' is a pointer to a division.

Implements G4VPVDivisionFactory.

Definition at line 132 of file G4PVDivisionFactory.cc.

133{
134 // Returns true if pv is division
135 // ---
136
137 return dynamic_cast<const G4PVDivision*>(pv) != nullptr;
138}

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