38#define G4MT_copyNo ((subInstanceManager.offset[instanceID]).fcopyNo)
47 const G4int nReplicas,
57 std::ostringstream message;
58 message <<
"NULL pointer specified as mother volume." << G4endl
59 <<
"The world volume cannot be sliced or parameterised !";
60 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
61 FatalException, message);
65 if (pLogical == motherLogical)
67 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
72 motherLogical->AddDaughter(
this);
73 if (motherLogical->GetNoDaughters() != 1)
75 std::ostringstream message;
76 message <<
"Replica or parameterised volume must be the only daughter !"
78 <<
" Mother physical volume: " << pMother->
GetName() <<
G4endl
79 <<
" Replicated volume: " << pName;
80 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
84 CheckAndSetParameters (pAxis, nReplicas, width, offset);
92 const G4int nReplicas,
100 if (pMotherLogical ==
nullptr)
102 std::ostringstream message;
103 message <<
"NULL pointer specified as mother volume for "
105 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
109 if (pLogical == pMotherLogical)
111 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
120 std::ostringstream message;
121 message <<
"Replica or parameterised volume must be the only daughter !"
123 <<
" Mother logical volume: " << pMotherLogical->
GetName()
125 <<
" Replicated volume: " << pName;
126 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
130 CheckAndSetParameters (pAxis, nReplicas, width, offset);
147 if (pMotherLogical ==
nullptr)
149 std::ostringstream message;
150 message <<
"NULL pointer specified as mother volume for "
152 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
156 if (pLogical == pMotherLogical)
158 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
162 CheckOnlyDaughter(pMotherLogical);
177 CheckAndSetParameters (pAxis, nReplicas, 0.0, 0.0);
185 std::ostringstream message;
186 message <<
"Replica or parameterised volume must be the only daughter !"
188 <<
" Mother logical volume: " << pMotherLogical->
GetName()
191 <<
" Existing 'sister': " << pMotherLogical->
GetDaughter(0)
193 G4Exception(
"G4PVReplica::G4PVReplica()",
"GeomVol0002",
200void G4PVReplica::CheckAndSetParameters(
const EAxis pAxis,
201 const G4int nReplicas,
207 G4Exception(
"G4PVReplica::CheckAndSetParameters()",
"GeomVol0002",
213 G4Exception(
"G4PVReplica::CheckAndSetParameters()",
"GeomVol0002",
227 if (pRMat ==
nullptr)
229 G4Exception(
"G4PVReplica::CheckAndSetParameters()",
"GeomVol0003",
241 G4Exception(
"G4PVReplica::CheckAndSetParameters()",
"GeomVol0002",
322 return (fRegularVolsId != 0);
328 return fRegularVolsId;
334 fRegularVolsId =
code;
342 return subInstanceManager;
372 if (pRMat ==
nullptr)
374 G4Exception(
"G4PVReplica::InitialiseWorker(...)",
"GeomVol0003",
386 G4Exception(
"G4PVReplica::InitialiseWorker(...)",
"GeomVol0002",
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::HepRotation G4RotationMatrix
CLHEP::Hep3Vector G4ThreeVector
G4int CreateSubInstance()
void SlaveCopySubInstanceArray()
void AddDaughter(G4VPhysicalVolume *p)
std::size_t GetNoDaughters() const
G4VPhysicalVolume * GetDaughter(const std::size_t i) const
const G4String & GetName() const
void SetCopyNo(G4int CopyNo) override
virtual void SetRegularStructureId(G4int code)
G4PVReplica(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset=0.)
G4bool IsRegularStructure() const override
G4int GetRegularStructureId() const override
G4bool IsMany() const override
G4bool IsParameterised() const override
G4int GetMultiplicity() const override
G4bool IsReplicated() const override
static const G4PVRManager & GetSubInstanceManager()
G4int GetCopyNo() const override
EVolume VolumeType() const override
G4VPVParameterisation * GetParameterisation() const override
void TerminateWorker(G4PVReplica *pMasterObject)
void InitialiseWorker(G4PVReplica *pMasterObject)
void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const override
const G4RotationMatrix * GetRotation() const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
void SetRotation(G4RotationMatrix *)
void SetMotherLogical(G4LogicalVolume *pMother)
void InitialiseWorker(G4VPhysicalVolume *pMasterObject, G4RotationMatrix *pRot, const G4ThreeVector &tlate)