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

#include <G4PVDivisionFactory.hh>

+ Inheritance diagram for G4PVDivisionFactory:

Public Member Functions

 ~G4PVDivisionFactory () override
 
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 *pMotherLogical, const EAxis pAxis, const G4int nReplicas, const G4double offset) override
 
G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4double width, const G4double offset) override
 
G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, 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 ()
 
- Protected Member Functions inherited from G4VPVDivisionFactory
 G4VPVDivisionFactory ()=default
 

Additional Inherited Members

- Static Protected Attributes inherited from G4VPVDivisionFactory
static G4ThreadLocal G4VPVDivisionFactoryfgInstance = nullptr
 

Detailed Description

Definition at line 43 of file G4PVDivisionFactory.hh.

Constructor & Destructor Documentation

◆ ~G4PVDivisionFactory()

G4PVDivisionFactory::~G4PVDivisionFactory ( )
overridedefault

◆ G4PVDivisionFactory()

G4PVDivisionFactory::G4PVDivisionFactory ( )
protected

Definition at line 37 of file G4PVDivisionFactory.cc.

38{
39 // Protected singleton constructor.
40 // ---
41}

Referenced by GetInstance().

Member Function Documentation

◆ CreatePVDivision() [1/4]

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

Implements G4VPVDivisionFactory.

Definition at line 61 of file G4PVDivisionFactory.cc.

68{
69 // Create division - with number of divisions and width
70 // ---
71
72 return new G4PVDivision(pName, pLogical, pMotherLogical,
73 pAxis, nReplicas, width, offset);
74}

◆ CreatePVDivision() [2/4]

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

Implements G4VPVDivisionFactory.

Definition at line 96 of file G4PVDivisionFactory.cc.

102{
103 // Create division - with width
104 // ---
105
106 return new G4PVDivision(pName, pLogical, pMotherLogical,
107 pAxis, width, offset);
108}

◆ CreatePVDivision() [3/4]

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

Implements G4VPVDivisionFactory.

Definition at line 79 of file G4PVDivisionFactory.cc.

85{
86 // Create division - with number of divisions
87 // ---
88
89 return new G4PVDivision(pName, pLogical, pMotherLogical,
90 pAxis, nReplicas, offset);
91}

◆ CreatePVDivision() [4/4]

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

Implements G4VPVDivisionFactory.

Definition at line 113 of file G4PVDivisionFactory.cc.

117{
118 // Create division - with parameterisation
119 // ---
120
121 // Get parameterisation data
122 //
123 const auto divParam = dynamic_cast<const G4VDivisionParameterisation*>(param);
124
125 if (divParam == nullptr)
126 {
127 G4Exception("G4PVDivisionFactory::CreatePVDivision()",
128 "GeomDiv0001", FatalException,
129 "Unexpected parameterisation type!");
130 return nullptr;
131 }
132 else
133 {
134 EAxis axis = divParam->GetAxis();
135 G4int nofDivisions = divParam->GetNoDiv();
136 G4double width = divParam->GetWidth();
137 G4double offset = divParam->GetOffset();
138
139 return new G4PVDivision(pName, pLogical, pMotherLogical,
140 axis, nofDivisions, width, offset);
141 }
142}
@ 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

◆ GetInstance()

G4PVDivisionFactory * G4PVDivisionFactory::GetInstance ( )
static

Definition at line 49 of file G4PVDivisionFactory.cc.

50{
51 if (fgInstance == nullptr)
52 {
54 }
55 return dynamic_cast<G4PVDivisionFactory*>(fgInstance);
56}
static G4ThreadLocal G4VPVDivisionFactory * fgInstance

Referenced by G4GDMLReadStructure::DivisionvolRead().

◆ IsPVDivision()

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

Implements G4VPVDivisionFactory.

Definition at line 146 of file G4PVDivisionFactory.cc.

147{
148 // Returns true if pv is division
149 // ---
150
151 return dynamic_cast<const G4PVDivision*>(pv) != nullptr;
152}

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