39#define G4MT_copyNo ((subInstanceManager.offset[instanceID]).fcopyNo)
44G4PVReplica::G4PVReplica(
const G4String& pName,
48 const G4int nReplicas,
54 instanceID = subInstanceManager.CreateSubInstance();
58 std::ostringstream message;
59 message <<
"NULL pointer specified as mother volume." << G4endl
60 <<
"The world volume cannot be sliced or parameterised !";
61 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
62 FatalException, message);
66 if (pLogical == motherLogical)
68 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
72 SetMotherLogical(motherLogical);
73 motherLogical->AddDaughter(
this);
74 if (motherLogical->GetNoDaughters() != 1)
76 std::ostringstream message;
77 message <<
"Replica or parameterised volume must be the only daughter !"
79 <<
" Mother physical volume: " << pMother->
GetName() <<
G4endl
80 <<
" Replicated volume: " << pName;
81 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
85 CheckAndSetParameters (pAxis, nReplicas, width,
offset);
89G4PVReplica::G4PVReplica(
const G4String& pName,
93 const G4int nReplicas,
99 instanceID = subInstanceManager.CreateSubInstance();
101 if (pMotherLogical ==
nullptr)
103 std::ostringstream message;
104 message <<
"NULL pointer specified as mother volume for "
106 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
110 if (pLogical == pMotherLogical)
112 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
118 SetMotherLogical(pMotherLogical);
121 std::ostringstream message;
122 message <<
"Replica or parameterised volume must be the only daughter !"
124 <<
" Mother logical volume: " << pMotherLogical->
GetName()
126 <<
" Replicated volume: " << pName;
127 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
131 CheckAndSetParameters (pAxis, nReplicas, width,
offset);
146 instanceID = subInstanceManager.CreateSubInstance();
148 if (pMotherLogical ==
nullptr)
150 std::ostringstream message;
151 message <<
"NULL pointer specified as mother volume for "
153 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
157 if (pLogical == pMotherLogical)
159 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
163 CheckOnlyDaughter(pMotherLogical);
178 CheckAndSetParameters (pAxis, nReplicas, 0.0, 0.0);
186 std::ostringstream message;
187 message <<
"Replica or parameterised volume must be the only daughter !"
189 <<
" Mother logical volume: " << pMotherLogical->
GetName()
191 <<
" Replicated volume: " << this->GetName() <<
G4endl
192 <<
" Existing 'sister': " << pMotherLogical->
GetDaughter(0)
194 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
201void G4PVReplica::CheckAndSetParameters(
const EAxis pAxis,
202 const G4int nReplicas,
208 G4Exception(
"G4PVReplica::CheckAndSetParameters()",
"GeomVol0002",
214 G4Exception(
"G4PVReplica::CheckAndSetParameters()",
"GeomVol0002",
228 if (pRMat ==
nullptr)
230 G4Exception(
"G4PVReplica::CheckAndSetParameters()",
"GeomVol0003",
242 G4Exception(
"G4PVReplica::CheckAndSetParameters()",
"GeomVol0002",
249G4PVReplica::G4PVReplica( __void__& a )
252 instanceID = subInstanceManager.CreateSubInstance();
256G4bool G4PVReplica::IsMany()
const
262G4int G4PVReplica::GetCopyNo()
const
268void G4PVReplica::SetCopyNo(
G4int newCopyNo)
274G4bool G4PVReplica::IsReplicated()
const
280G4bool G4PVReplica::IsParameterised()
const
292G4int G4PVReplica::GetMultiplicity()
const
298EVolume G4PVReplica::VolumeType()
const
304void G4PVReplica::GetReplicationData(
EAxis&
axis,
318G4bool G4PVReplica::IsRegularStructure()
const
320 return (fRegularVolsId != 0);
324G4int G4PVReplica::GetRegularStructureId()
const
326 return fRegularVolsId;
330void G4PVReplica::SetRegularStructureId(
G4int code )
332 fRegularVolsId = code;
340 return subInstanceManager;
350void G4PVReplica::InitialiseWorker(
G4PVReplica* pMasterObject)
354 subInstanceManager.SlaveCopySubInstanceArray();
370 if (pRMat ==
nullptr)
372 G4Exception(
"G4PVReplica::InitialiseWorker(...)",
"GeomVol0003",
384 G4Exception(
"G4PVReplica::InitialiseWorker(...)",
"GeomVol0002",
399 delete GetRotation();
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....
G4GeomSplitter< G4ReplicaData > G4PVRManager
CLHEP::HepRotation G4RotationMatrix
CLHEP::Hep3Vector G4ThreeVector
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
void AddDaughter(G4VPhysicalVolume *p)
std::size_t GetNoDaughters() const
G4VPhysicalVolume * GetDaughter(const std::size_t i) const
const G4String & GetName() const
G4VPVParameterisation ia an abstract base class for Parameterisation, able to compute the transformat...
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
void InitialiseWorker(G4VPhysicalVolume *pMasterObject, G4RotationMatrix *pRot, const G4ThreeVector &tlate)
const axis_t axis_to_type< N >::axis