52 :
G4PVReplica(pName, nDivs, pAxis, pLogical, pMotherLogical)
54 CheckAndSetParameters(pAxis, nDivs, width, half_gap, offset,
66 :
G4PVReplica(pName, nDivs, pAxis, pLogical, pMotherLogical)
68 CheckAndSetParameters(pAxis, nDivs, 0., half_gap, offset,
69 DivNDIV, pMotherLogical, pLogical);
80 :
G4PVReplica(pName, 0, pAxis, pLogical, pMotherLogical)
82 CheckAndSetParameters(pAxis, 0, width, half_gap, offset,
96 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr)
98 if (pMotherPhysical ==
nullptr)
100 std::ostringstream message;
101 message <<
"Invalid setup." <<
G4endl
102 <<
"NULL pointer specified as mother for volume: " << pName;
103 G4Exception(
"G4ReplicatedSlice::G4ReplicatedSlice()",
"GeomDiv0002",
107 CheckAndSetParameters(pAxis, nDivs, width, half_gap, offset,
120 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr)
122 if (pMotherPhysical ==
nullptr)
124 std::ostringstream message;
125 message <<
"Invalid setup." <<
G4endl
126 <<
"NULL pointer specified as mother for volume: " << pName;
127 G4Exception(
"G4ReplicatedSlice::G4ReplicatedSlice()",
"GeomDiv0002",
131 CheckAndSetParameters(pAxis, nDivs, 0., half_gap, offset,
144 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr)
146 if (pMotherPhysical ==
nullptr)
148 std::ostringstream message;
149 message <<
"Invalid setup." <<
G4endl
150 <<
"NULL pointer specified as mother for volume: " << pName;
151 G4Exception(
"G4ReplicatedSlice::G4ReplicatedSlice()",
"GeomDiv0002",
155 CheckAndSetParameters(pAxis, 0, width, half_gap, offset,
161G4ReplicatedSlice::CheckAndSetParameters(
const EAxis pAxis,
170 if(pMotherLogical ==
nullptr)
172 std::ostringstream message;
173 message <<
"Invalid setup." <<
G4endl
174 <<
"NULL pointer specified as mother! Volume: " <<
GetName();
175 G4Exception(
"G4ReplicatedSlice::CheckAndSetParameters()",
"GeomDiv0002",
178 if(pLogical == pMotherLogical)
180 std::ostringstream message;
181 message <<
"Invalid setup." <<
G4endl
182 <<
"Cannot place a volume inside itself! Volume: " <<
GetName();
183 G4Exception(
"G4ReplicatedSlice::CheckAndSetParameters()",
"GeomDiv0002",
193 if( msolType != dsolType && ( msolType !=
"G4Trd" || dsolType !=
"G4Trap" ) )
195 std::ostringstream message;
196 message <<
"Invalid setup." <<
G4endl
197 <<
"Incorrect solid type for division of volume: "
199 <<
" It is: " << msolType
200 <<
", while it should be: " << dsolType;
201 G4Exception(
"G4ReplicatedSlice::CheckAndSetParameters()",
207 SetParameterisation(pMotherLogical, pAxis, nDivs,
208 width, half_gap, offset, divType);
220 G4Exception(
"G4ReplicatedSlice::CheckAndSetParameters()",
"GeomDiv0002",
233 G4Exception(
"G4ReplicatedSlice::CheckAndSetParameters()",
"GeomDiv0002",
236 if(
fwidth < 2.*half_gap )
238 G4Exception(
"G4ReplicatedSlice::CheckAndSetParameters()",
"GeomDiv0002",
265 G4Exception(
"G4ReplicatedSlice::CheckAndSetParameters()",
"GeomDiv0002",
342void G4ReplicatedSlice::SetParameterisation(
G4LogicalVolume* motherLogical,
357 if (mSolidType ==
"G4ReflectedSolid")
365 if( mSolidType ==
"G4Box" )
371 offset, mSolid, divType );
375 offset, mSolid, divType );
379 offset, mSolid, divType );
382 ErrorInAxis( axis, mSolid );
386 else if( mSolidType ==
"G4Tubs" )
392 offset, mSolid, divType );
396 offset, mSolid, divType );
400 offset, mSolid, divType );
403 ErrorInAxis( axis, mSolid );
407 else if( mSolidType ==
"G4Cons" )
413 offset, mSolid, divType );
417 offset, mSolid, divType );
421 offset, mSolid, divType );
424 ErrorInAxis( axis, mSolid );
428 else if( mSolidType ==
"G4Trd" )
434 offset, mSolid, divType );
438 offset, mSolid, divType );
442 offset, mSolid, divType );
445 ErrorInAxis( axis, mSolid );
449 else if( mSolidType ==
"G4Para" )
455 offset, mSolid, divType );
459 offset, mSolid, divType );
463 offset, mSolid, divType );
466 ErrorInAxis( axis, mSolid );
517 std::ostringstream message;
518 message <<
"Solid type not supported: " << mSolidType <<
"." <<
G4endl
519 <<
"Divisions for " << mSolidType <<
" not implemented.";
520 G4Exception(
"G4ReplicatedSlice::SetParameterisation()",
"GeomDiv0001",
528void G4ReplicatedSlice::ErrorInAxis(
EAxis axis,
G4VSolid* solid )
547 error +=
"Radial3D.";
555 G4Exception(
"G4ReplicatedSlice::ErrorInAxis()",
"GeomDiv0002",
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::HepRotation G4RotationMatrix
G4VSolid * GetSolid() const
void AddDaughter(G4VPhysicalVolume *p)
EAxis GetDivisionAxis() const
G4bool IsRegularStructure() const override
G4int GetRegularStructureId() const override
G4int GetMultiplicity() const override
G4bool IsMany() const override
G4VPVParameterisation * GetParameterisation() const override
G4ReplicatedSlice(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double half_gap, const G4double offset)
EVolume VolumeType() const final
void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const override
G4VDivisionParameterisation * fparam
G4bool IsReplicated() const override
G4bool IsParameterised() const override
~G4ReplicatedSlice() override
void SetHalfGap(G4double hg)
G4double GetWidth() const
const G4RotationMatrix * GetRotation() const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
void SetRotation(G4RotationMatrix *)
void SetMotherLogical(G4LogicalVolume *pMother)
virtual G4GeometryType GetEntityType() const =0