Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PVDivision.hh File Reference

Go to the source code of this file.

Functions

 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. The elements' positions are calculated by means of a simple linear formula.
 G4PVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double offset)
 G4PVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4double width, const G4double offset)
 G4PVDivision (const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset)
 ~G4PVDivision () override
 G4PVDivision (const G4PVDivision &)=delete
G4PVDivisionoperator= (const G4PVDivision &)=delete
G4bool IsMany () const override
G4bool IsReplicated () const override
G4int GetMultiplicity () const override
G4bool IsParameterised () const override
G4VPVParameterisationGetParameterisation () const override
void GetReplicationData (EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const override
EAxis GetDivisionAxis () const
EVolume VolumeType () const override
G4bool IsRegularStructure () const override
G4int GetRegularStructureId () const override

Variables

EAxis faxis
EAxis fdivAxis
G4int fnReplicas = 0
G4double fwidth = 0.0
G4double foffset = 0.0
G4VDivisionParameterisationfparam = nullptr

Function Documentation

◆ G4PVDivision() [1/5]

G4PVDivision ( const G4PVDivision & )
delete

Copy constructor and assignment operator not allowed.

◆ G4PVDivision() [2/5]

G4PVDivision::G4PVDivision ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMother,
const EAxis pAxis,
const G4double width,
const G4double offset )

Constructor with 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]widthThe witdh of the divided slice along the axis.
[in]offsetThe optional offset distance from mother's border.

Definition at line 111 of file G4PVDivision.cc.

117 : G4PVReplica(pName, 0, pAxis, pLogical, pMotherLogical)
118{
119 if (pMotherLogical == nullptr)
120 {
121 std::ostringstream message;
122 message << "Invalid setup." << G4endl
123 << "NULL pointer specified as mother! Volume: " + pName;
124 G4Exception("G4PVDivision::G4PVDivision()", "GeomDiv0002",
125 FatalException, message);
126 return;
127 }
128 if (pLogical == pMotherLogical)
129 {
130 std::ostringstream message;
131 message << "Invalid setup." << G4endl
132 << "Cannot place a volume inside itself! Volume: "+ pName;
133 G4Exception("G4PVDivision::G4PVDivision()", "GeomDiv0002",
134 FatalException, message);
135 }
136 pMotherLogical->AddDaughter(this);
137 SetMotherLogical(pMotherLogical);
138 SetParameterisation(pMotherLogical, pAxis, 0, width, offset, DivWIDTH);
139 CheckAndSetParameters (pAxis, 0, width, offset, DivWIDTH, pMotherLogical);
140}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4ThreadLocal T * G4GeomSplitter< T >::offset
G4PVReplica(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset=0.)
G4PVReplica represents many touchable detector elements differing only in their positioning....
#define G4endl
Definition G4ios.hh:67

◆ G4PVDivision() [3/5]

G4PVDivision::G4PVDivision ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMother,
const EAxis pAxis,
const G4int nReplicas,
const G4double offset )

Constructor with 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.

Definition at line 79 of file G4PVDivision.cc.

85 : G4PVReplica(pName, nDivs, pAxis, pLogical, pMotherLogical)
86{
87 if (pMotherLogical == nullptr)
88 {
89 std::ostringstream message;
90 message << "Invalid setup." << G4endl
91 << "NULL pointer specified as mother! Volume: " << pName;
92 G4Exception("G4PVDivision::G4PVDivision()", "GeomDiv0002",
93 FatalException, message);
94 return;
95 }
96 if (pLogical == pMotherLogical)
97 {
98 std::ostringstream message;
99 message << "Invalid setup." << G4endl
100 << "Cannot place a volume inside itself! Volume: " << pName;
101 G4Exception("G4PVDivision::G4PVDivision()", "GeomDiv0002",
102 FatalException, message);
103 }
104 pMotherLogical->AddDaughter(this);
105 SetMotherLogical(pMotherLogical);
106 SetParameterisation(pMotherLogical, pAxis, nDivs, 0., offset, DivNDIV);
107 CheckAndSetParameters (pAxis, nDivs, 0., offset, DivNDIV, pMotherLogical);
108}

◆ G4PVDivision() [4/5]

G4PVDivision::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. The elements' positions are calculated by means of a simple linear formula.

Division may occur along:

o Cartesian axes (kXAxis,kYAxis,kZAxis)

The divisions, of specified width have coordinates of form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1 for the case of kXAxis, and are unrotated.

o Radial axis (cylindrical polar) (kRho)

The divisions are cons/tubs sections, centred on the origin and are unrotated. They have radii of width*n+offset to width*(n+1)+offset where n=0..nReplicas-1

o Phi axis (cylindrical polar) (kPhi) The divisions are `phi sections' or wedges, and of cons/tubs form They have phi of offset+n*width to offset+(n+1)*width where n=0..nReplicas-1 */

class G4PVDivision : public G4PVReplica { public:

/** Constructor with 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.

Definition at line 44 of file G4PVDivision.cc.

51 : G4PVReplica(pName, nDivs, pAxis, pLogical, pMotherLogical)
52{
53 if (pMotherLogical == nullptr)
54 {
55 std::ostringstream message;
56 message << "Invalid setup." << G4endl
57 << "NULL pointer specified as mother for volume: " << pName;
58 G4Exception("G4PVDivision::G4PVDivision()", "GeomDiv0002",
59 FatalException, message);
60 return;
61 }
62 if (pLogical == pMotherLogical)
63 {
64 std::ostringstream message;
65 message << "Invalid setup." << G4endl
66 << "Cannot place a volume inside itself! Volume: " << pName;
67 G4Exception("G4PVDivision::G4PVDivision()", "GeomDiv0002",
68 FatalException, message);
69 }
70 pMotherLogical->AddDaughter(this);
71 SetMotherLogical(pMotherLogical);
72 SetParameterisation(pMotherLogical, pAxis, nDivs,
73 width, offset, DivNDIVandWIDTH);
74 CheckAndSetParameters (pAxis, nDivs, width, offset,
75 DivNDIVandWIDTH, pMotherLogical);
76}

Referenced by G4GDMLWrite::AddModule(), G4tgbVolume::ConstructG4PhysVol(), G4PVDivisionFactory::CreatePVDivision(), G4PVDivisionFactory::CreatePVDivision(), G4PVDivisionFactory::CreatePVDivision(), G4PVDivisionFactory::CreatePVDivision(), G4GDMLWriteStructure::DivisionvolWrite(), G4PVDivision(), G4PVDivisionFactory::IsPVDivision(), operator=(), G4ScoringBox::SetupGeometry(), G4ScoringCylinder::SetupGeometry(), and G4GDMLWriteStructure::TraverseVolumeTree().

◆ G4PVDivision() [5/5]

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

Constructor in mother physical volume (same as first constructor).

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherPointer to the physical 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.

Definition at line 143 of file G4PVDivision.cc.

150 : G4PVReplica(pName, nDivs, pAxis, pLogical,
151 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr)
152{
153 if (pMotherPhysical == nullptr)
154 {
155 std::ostringstream message;
156 message << "Invalid setup." << G4endl
157 << "NULL pointer specified as mother for volume: " << pName;
158 G4Exception("G4PVDivision::G4PVDivision()", "GeomDiv0002",
159 FatalException, message);
160 return;
161 }
162 G4LogicalVolume* pMotherLogical = pMotherPhysical->GetLogicalVolume();
163 if (pLogical == pMotherLogical)
164 {
165 std::ostringstream message;
166 message << "Invalid setup." << G4endl
167 << "Cannot place a volume inside itself! Volume: " << pName;
168 G4Exception("G4PVDivision::G4PVDivision()", "GeomDiv0002",
169 FatalException, message);
170 }
171 pMotherLogical->AddDaughter(this);
172 SetMotherLogical(pMotherLogical);
173 SetParameterisation(pMotherLogical, pAxis, nDivs,
174 width, offset, DivNDIVandWIDTH);
175 CheckAndSetParameters (pAxis, nDivs, width, offset,
176 DivNDIVandWIDTH, pMotherLogical);
177}
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
void AddDaughter(G4VPhysicalVolume *p)

◆ GetDivisionAxis()

EAxis G4ReplicatedSlice::GetDivisionAxis ( ) const

Returns the axis along which the division is made.

Returns
The string Id of the axis.

Definition at line 275 of file G4PVDivision.cc.

276{
277 return fdivAxis;
278}
EAxis fdivAxis

◆ GetMultiplicity()

G4int GetMultiplicity ( ) const
override

Returns the number of divisions.

Referenced by G4PVParameterised::CheckOverlaps().

◆ GetParameterisation()

G4VPVParameterisation * GetParameterisation ( ) const
override

Returns the pointer to the parameterisation algorithm.

Referenced by G4PhysicalVolumeModel::CalculateExtent(), and G4PhysicalVolumeModel::VisitGeometryAndGetVisReps().

◆ GetRegularStructureId()

G4int GetRegularStructureId ( ) const
override

Referenced by GetRegularStructureId().

◆ GetReplicationData()

void GetReplicationData ( EAxis & axis,
G4int & nReplicas,
G4double & width,
G4double & offset,
G4bool & consuming ) const
override

Fills arguments with the attributes from the base replica.

Parameters
[in,out]axisAxis of parameterisation returned.
[in,out]nReplicasThe number of division copies.
[in,out]widthWidth of the division slice.
[in,out]offsetPotential offset in replication.
[in,out]consumingFlag of replica characterisation (always false for parameterisations).

Referenced by G4PhysicalVolumeModel::VisitGeometryAndGetVisReps().

◆ IsMany()

G4bool IsMany ( ) const
override

Not used.

◆ IsParameterised()

G4bool IsParameterised ( ) const
override

Returns true to identify if it is a parameterised physical volume.

◆ IsRegularStructure()

G4bool IsRegularStructure ( ) const
override

Methods to identify volumes that can have revised 'regular' navigation. Currently divisions do not qualify for this.

Referenced by IsRegularStructure().

◆ IsReplicated()

G4bool IsReplicated ( ) const
override

◆ operator=()

G4PVDivision & operator= ( const G4PVDivision & )
delete

◆ VolumeType()

EVolume VolumeType ( ) const
override

◆ ~G4PVDivision()

G4PVDivision::~G4PVDivision ( )
overridedefault

Destructor.

Variable Documentation

◆ faxis

EAxis faxis
protected

Axis of optimisation.

Definition at line 246 of file G4PVDivision.hh.

Referenced by G4PVReplica(), and G4PVParameterised::GetReplicationData().

◆ fdivAxis

EAxis fdivAxis
protected

Axis of division.

Definition at line 249 of file G4PVDivision.hh.

Referenced by GetDivisionAxis().

◆ fnReplicas

G4int fnReplicas = 0
protected

Number of divisions.

Definition at line 252 of file G4PVDivision.hh.

Referenced by G4PVReplica(), and G4PVParameterised::GetReplicationData().

◆ foffset

G4double foffset = 0.0
protected

Definition at line 255 of file G4PVDivision.hh.

Referenced by G4PVReplica(), and G4PVParameterised::GetReplicationData().

◆ fparam

G4VDivisionParameterisation* fparam = nullptr
protected

Pointer to the parameterisation algorithm.

Definition at line 258 of file G4PVDivision.hh.

◆ fwidth

G4double fwidth = 0.0
protected

Width of the division slice and potential offset.

Definition at line 255 of file G4PVDivision.hh.

Referenced by G4ExcitedMesonConstructor::ConstructMesons(), G4PVReplica(), G4PVParameterised::GetReplicationData(), and G4Abla::width().