Geant4-11
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes
G4PVDivisionFactory Class Reference

#include <G4PVDivisionFactory.hh>

Inheritance diagram for G4PVDivisionFactory:
G4VPVDivisionFactory

Public Member Functions

virtual G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset)
 
virtual G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4double width, const G4double offset)
 
virtual G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4int nReplicas, const G4double offset)
 
virtual G4VPhysicalVolumeCreatePVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const G4VPVParameterisation *param)
 
virtual G4bool IsPVDivision (const G4VPhysicalVolume *pv) const
 
virtual ~G4PVDivisionFactory ()
 

Static Public Member Functions

static G4PVDivisionFactoryGetInstance ()
 
static G4VPVDivisionFactoryInstance ()
 

Protected Member Functions

 G4PVDivisionFactory ()
 

Static Protected Attributes

static G4ThreadLocal G4VPVDivisionFactoryfgInstance = nullptr
 

Detailed Description

Definition at line 43 of file G4PVDivisionFactory.hh.

Constructor & Destructor Documentation

◆ ~G4PVDivisionFactory()

G4PVDivisionFactory::~G4PVDivisionFactory ( )
virtual

Definition at line 46 of file G4PVDivisionFactory.cc.

47{
48}

◆ G4PVDivisionFactory()

G4PVDivisionFactory::G4PVDivisionFactory ( )
protected

Definition at line 37 of file G4PVDivisionFactory.cc.

39{
40 // Protected singleton constructor.
41 // ---
42}
G4VPVDivisionFactory()=default

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 
)
virtual

Implements G4VPVDivisionFactory.

Definition at line 64 of file G4PVDivisionFactory.cc.

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

◆ CreatePVDivision() [2/4]

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

Implements G4VPVDivisionFactory.

Definition at line 99 of file G4PVDivisionFactory.cc.

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

◆ CreatePVDivision() [3/4]

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

Implements G4VPVDivisionFactory.

Definition at line 82 of file G4PVDivisionFactory.cc.

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

◆ CreatePVDivision() [4/4]

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

Implements G4VPVDivisionFactory.

Definition at line 116 of file G4PVDivisionFactory.cc.

120{
121 // Create division - with parameterisation
122 // ---
123
124 // Get parameterisation data
125 //
126 const G4VDivisionParameterisation* divParam
127 = dynamic_cast<const G4VDivisionParameterisation*>(param);
128
129 if (divParam == nullptr)
130 {
131 G4Exception("G4PVDivisionFactory::CreatePVDivision()",
132 "GeomDiv0001", FatalException,
133 "Unexpected parameterisation type!");
134 return nullptr;
135 }
136 else
137 {
138 EAxis axis = divParam->GetAxis();
139 G4int nofDivisions = divParam->GetNoDiv();
140 G4double width = divParam->GetWidth();
141 G4double offset = divParam->GetOffset();
142
143 return new G4PVDivision(pName, pLogical, pMotherLogical,
144 axis, nofDivisions, width, offset);
145 }
146}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4double GetOffset() const
G4double GetWidth() const
EAxis
Definition: geomdefs.hh:54

References FatalException, G4Exception(), G4VDivisionParameterisation::GetAxis(), G4VDivisionParameterisation::GetNoDiv(), G4VDivisionParameterisation::GetOffset(), and G4VDivisionParameterisation::GetWidth().

◆ GetInstance()

G4PVDivisionFactory * G4PVDivisionFactory::GetInstance ( )
static

Definition at line 52 of file G4PVDivisionFactory.cc.

53{
54 if (fgInstance == nullptr)
55 {
57 }
58 return dynamic_cast<G4PVDivisionFactory*>(fgInstance);
59}
static G4ThreadLocal G4VPVDivisionFactory * fgInstance

References G4VPVDivisionFactory::fgInstance, and G4PVDivisionFactory().

Referenced by G4GDMLReadStructure::DivisionvolRead().

◆ Instance()

G4VPVDivisionFactory * G4VPVDivisionFactory::Instance ( )
staticinherited

Definition at line 37 of file G4VPVDivisionFactory.cc.

38{
39 // Static singleton access method.
40 // ---
41 return fgInstance;
42}

References G4VPVDivisionFactory::fgInstance.

Referenced by G4ReflectionFactory::GetPVDivisionFactory(), and G4ReflectionFactory::ReflectDaughters().

◆ IsPVDivision()

G4bool G4PVDivisionFactory::IsPVDivision ( const G4VPhysicalVolume pv) const
virtual

Implements G4VPVDivisionFactory.

Definition at line 150 of file G4PVDivisionFactory.cc.

151{
152 // Returns true if pv is division
153 // ---
154
155 return (dynamic_cast<const G4PVDivision*>(pv) != nullptr) ? true : false;
156}

Field Documentation

◆ fgInstance

G4ThreadLocal G4VPVDivisionFactory * G4VPVDivisionFactory::fgInstance = nullptr
staticprotectedinherited

Definition at line 96 of file G4VPVDivisionFactory.hh.

Referenced by GetInstance(), and G4VPVDivisionFactory::Instance().


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