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

Go to the source code of this file.

Functions

 G4ReplicatedSlice (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double half_gap, const G4double offset)
 G4ReplicatedSlice represents many touchable detector elements differing only in their positioning. The elements' positions are calculated by means of a simple linear formula.
 G4ReplicatedSlice (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4int nReplicas, const G4double half_gap, const G4double offset)
 G4ReplicatedSlice (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4double width, const G4double half_gap, const G4double offset)
 G4ReplicatedSlice (const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMotherPhysical, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double half_gap, const G4double offset)
 G4ReplicatedSlice (const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMotherPhysical, const EAxis pAxis, const G4int nReplicas, const G4double half_gap, const G4double offset)
 G4ReplicatedSlice (const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMotherPhysical, const EAxis pAxis, const G4double width, const G4double half_gap, const G4double offset)
 ~G4ReplicatedSlice () override
 G4ReplicatedSlice (const G4ReplicatedSlice &)=delete
G4ReplicatedSliceoperator= (const G4ReplicatedSlice &)=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 final
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

◆ G4ReplicatedSlice() [1/7]

G4ReplicatedSlice ( const G4ReplicatedSlice & )
delete

Copy constructor and assignment operator not allowed.

◆ G4ReplicatedSlice() [2/7]

G4ReplicatedSlice::G4ReplicatedSlice ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMotherLogical,
const EAxis pAxis,
const G4double width,
const G4double half_gap,
const G4double offset )

Constructor with width of the division slice.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherLogicalPointer 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]half_gapThe half-witdh of the gap between slices.
[in]offsetThe optional offset distance from mother's border.

Definition at line 73 of file G4ReplicatedSlice.cc.

80 : G4PVReplica(pName, 0, pAxis, pLogical, pMotherLogical)
81{
82 CheckAndSetParameters(pAxis, 0, width, half_gap, offset,
83 DivWIDTH, pMotherLogical, pLogical);
84}
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....

◆ G4ReplicatedSlice() [3/7]

G4ReplicatedSlice::G4ReplicatedSlice ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMotherLogical,
const EAxis pAxis,
const G4int nReplicas,
const G4double half_gap,
const G4double offset )

Constructor with number of divisions.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherLogicalPointer to the logical volume of the mother.
[in]pAxisThe axis along which do the division.
[in]nReplicasThe number of copies to replicate.
[in]half_gapThe half-witdh of the gap between slices.
[in]offsetThe optional offset distance from mother's border.

Definition at line 59 of file G4ReplicatedSlice.cc.

66 : G4PVReplica(pName, nDivs, pAxis, pLogical, pMotherLogical)
67{
68 CheckAndSetParameters(pAxis, nDivs, 0., half_gap, offset,
69 DivNDIV, pMotherLogical, pLogical);
70}

◆ G4ReplicatedSlice() [4/7]

G4ReplicatedSlice::G4ReplicatedSlice ( const G4String & pName,
G4LogicalVolume * pLogical,
G4LogicalVolume * pMotherLogical,
const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double half_gap,
const G4double offset )

G4ReplicatedSlice 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 G4ReplicatedSlice : 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]pMotherLogicalPointer 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]half_gapThe half-witdh of the gap between slices.
[in]offsetThe optional offset distance from mother's border.

Definition at line 44 of file G4ReplicatedSlice.cc.

52 : G4PVReplica(pName, nDivs, pAxis, pLogical, pMotherLogical)
53{
54 CheckAndSetParameters(pAxis, nDivs, width, half_gap, offset,
55 DivNDIVandWIDTH, pMotherLogical, pLogical);
56}

Referenced by G4ReplicatedSlice(), and operator=().

◆ G4ReplicatedSlice() [5/7]

G4ReplicatedSlice::G4ReplicatedSlice ( const G4String & pName,
G4LogicalVolume * pLogical,
G4VPhysicalVolume * pMotherPhysical,
const EAxis pAxis,
const G4double width,
const G4double half_gap,
const G4double offset )

Constructor in mother physical volume with width of division slice.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherPhysicalPointer to the physical volume of the mother.
[in]pAxisThe axis along which do the division.
[in]widthThe witdh of the divided slice along the axis.
[in]half_gapThe half-witdh of the gap between slices.
[in]offsetThe optional offset distance from mother's border.

Definition at line 136 of file G4ReplicatedSlice.cc.

143 : G4PVReplica(pName, 0, pAxis, pLogical,
144 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr)
145{
146 if (pMotherPhysical == nullptr)
147 {
148 std::ostringstream message;
149 message << "Invalid setup." << G4endl
150 << "NULL pointer specified as mother for volume: " << pName;
151 G4Exception("G4ReplicatedSlice::G4ReplicatedSlice()", "GeomDiv0002",
152 FatalException, message);
153 return;
154 }
155 CheckAndSetParameters(pAxis, 0, width, half_gap, offset,
156 DivWIDTH, pMotherPhysical->GetLogicalVolume(), pLogical);
157}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define G4endl
Definition G4ios.hh:67
G4LogicalVolume * GetLogicalVolume() const

◆ G4ReplicatedSlice() [6/7]

G4ReplicatedSlice::G4ReplicatedSlice ( const G4String & pName,
G4LogicalVolume * pLogical,
G4VPhysicalVolume * pMotherPhysical,
const EAxis pAxis,
const G4int nReplicas,
const G4double half_gap,
const G4double offset )

Constructor in mother physical volume with number of divisions.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherPhysicalPointer to the physical volume of the mother.
[in]pAxisThe axis along which do the division.
[in]nReplicasThe number of copies to replicate.
[in]half_gapThe half-witdh of the gap between slices.
[in]offsetThe optional offset distance from mother's border.

Definition at line 112 of file G4ReplicatedSlice.cc.

119 : G4PVReplica(pName, nDivs, pAxis, pLogical,
120 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr)
121{
122 if (pMotherPhysical == nullptr)
123 {
124 std::ostringstream message;
125 message << "Invalid setup." << G4endl
126 << "NULL pointer specified as mother for volume: " << pName;
127 G4Exception("G4ReplicatedSlice::G4ReplicatedSlice()", "GeomDiv0002",
128 FatalException, message);
129 return;
130 }
131 CheckAndSetParameters(pAxis, nDivs, 0., half_gap, offset,
132 DivNDIV, pMotherPhysical->GetLogicalVolume(), pLogical);
133}

◆ G4ReplicatedSlice() [7/7]

G4ReplicatedSlice::G4ReplicatedSlice ( const G4String & pName,
G4LogicalVolume * pLogical,
G4VPhysicalVolume * pMotherPhysical,
const EAxis pAxis,
const G4int nReplicas,
const G4double width,
const G4double half_gap,
const G4double offset )

Constructor in mother physical volume with number of divisions and width.

Parameters
[in]pNameThe volume name.
[in]pLogicalPointer to the logical volume of the division.
[in]pMotherPhysicalPointer 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]half_gapThe half-witdh of the gap between slices.
[in]offsetThe optional offset distance from mother's border.

Definition at line 87 of file G4ReplicatedSlice.cc.

95 : G4PVReplica(pName, nDivs, pAxis, pLogical,
96 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr)
97{
98 if (pMotherPhysical == nullptr)
99 {
100 std::ostringstream message;
101 message << "Invalid setup." << G4endl
102 << "NULL pointer specified as mother for volume: " << pName;
103 G4Exception("G4ReplicatedSlice::G4ReplicatedSlice()", "GeomDiv0002",
104 FatalException, message);
105 return;
106 }
107 CheckAndSetParameters(pAxis, nDivs, width, half_gap, offset,
108 DivNDIVandWIDTH, pMotherPhysical->GetLogicalVolume(), pLogical);
109}

◆ GetDivisionAxis()

EAxis GetDivisionAxis ( ) const

Returns the axis along which the division is made.

Returns
The string Id of the axis.

◆ GetMultiplicity()

G4int GetMultiplicity ( ) const
override

Returns the number of slices.

◆ GetParameterisation()

G4VPVParameterisation * GetParameterisation ( ) const
override

Returns the pointer to the parameterisation algorithm.

◆ GetRegularStructureId()

G4int GetRegularStructureId ( ) const
override

◆ 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).

◆ 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.

◆ IsReplicated()

G4bool IsReplicated ( ) const
override

Returns true.

◆ operator=()

G4ReplicatedSlice & operator= ( const G4ReplicatedSlice & )
delete

◆ VolumeType()

EVolume VolumeType ( ) const
final

Returns the volume type characterisation.

Returns
The string Id of the volume type, i.e. 'kParameterised'.

◆ ~G4ReplicatedSlice()

G4ReplicatedSlice::~G4ReplicatedSlice ( )
override

Destructor.

Definition at line 279 of file G4ReplicatedSlice.cc.

280{
281 delete GetRotation();
282}

Variable Documentation

◆ faxis

EAxis faxis
protected

Axis of optimisation.

Definition at line 293 of file G4ReplicatedSlice.hh.

◆ fdivAxis

EAxis fdivAxis
protected

Axis of division.

Definition at line 296 of file G4ReplicatedSlice.hh.

◆ fnReplicas

G4int fnReplicas = 0
protected

Number of slices.

Definition at line 299 of file G4ReplicatedSlice.hh.

◆ foffset

G4double foffset = 0.0
protected

Definition at line 302 of file G4ReplicatedSlice.hh.

◆ fparam

G4VDivisionParameterisation* fparam = nullptr
protected

Pointer to the parameterisation algorithm.

Definition at line 305 of file G4ReplicatedSlice.hh.

◆ fwidth

G4double fwidth = 0.0
protected

Width of the division slice and potential offset.

Definition at line 302 of file G4ReplicatedSlice.hh.