51 :
G4PVReplica(pName, nDivs, pAxis, pLogical, pMotherLogical)
53 if (pMotherLogical ==
nullptr)
55 std::ostringstream message;
56 message <<
"Invalid setup." <<
G4endl
57 <<
"NULL pointer specified as mother for volume: " << pName;
58 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
62 if (pLogical == pMotherLogical)
64 std::ostringstream message;
65 message <<
"Invalid setup." <<
G4endl
66 <<
"Cannot place a volume inside itself! Volume: " << pName;
67 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
72 SetParameterisation(pMotherLogical, pAxis, nDivs,
74 CheckAndSetParameters (pAxis, nDivs, width, offset,
85 :
G4PVReplica(pName, nDivs, pAxis, pLogical, pMotherLogical)
87 if (pMotherLogical ==
nullptr)
89 std::ostringstream message;
90 message <<
"Invalid setup." <<
G4endl
91 <<
"NULL pointer specified as mother! Volume: " << pName;
92 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
96 if (pLogical == pMotherLogical)
98 std::ostringstream message;
99 message <<
"Invalid setup." <<
G4endl
100 <<
"Cannot place a volume inside itself! Volume: " << pName;
101 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
106 SetParameterisation(pMotherLogical, pAxis, nDivs, 0., offset,
DivNDIV);
107 CheckAndSetParameters (pAxis, nDivs, 0., offset,
DivNDIV, pMotherLogical);
117 :
G4PVReplica(pName, 0, pAxis, pLogical, pMotherLogical)
119 if (pMotherLogical ==
nullptr)
121 std::ostringstream message;
122 message <<
"Invalid setup." <<
G4endl
123 <<
"NULL pointer specified as mother! Volume: " + pName;
124 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
128 if (pLogical == pMotherLogical)
130 std::ostringstream message;
131 message <<
"Invalid setup." <<
G4endl
132 <<
"Cannot place a volume inside itself! Volume: "+ pName;
133 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
138 SetParameterisation(pMotherLogical, pAxis, 0, width, offset,
DivWIDTH);
139 CheckAndSetParameters (pAxis, 0, width, offset,
DivWIDTH, pMotherLogical);
151 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr)
153 if (pMotherPhysical ==
nullptr)
155 std::ostringstream message;
156 message <<
"Invalid setup." <<
G4endl
157 <<
"NULL pointer specified as mother for volume: " << pName;
158 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
163 if (pLogical == pMotherLogical)
165 std::ostringstream message;
166 message <<
"Invalid setup." <<
G4endl
167 <<
"Cannot place a volume inside itself! Volume: " << pName;
168 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
173 SetParameterisation(pMotherLogical, pAxis, nDivs,
175 CheckAndSetParameters (pAxis, nDivs, width, offset,
181G4PVDivision::CheckAndSetParameters(
const EAxis pAxis,
198 G4Exception(
"G4PVDivision::CheckAndSetParameters()",
"GeomDiv0002",
212 G4Exception(
"G4PVDivision::CheckAndSetParameters()",
"GeomDiv0002",
247 G4Exception(
"G4PVDivision::CheckAndSetParameters()",
"GeomDiv0002",
259 if( msolType != dsolType && ( msolType !=
"G4Trd" || dsolType !=
"G4Trap" ) )
261 std::ostringstream message;
262 message <<
"Incorrect solid type for division of volume "
264 <<
"It is: " << msolType
265 <<
", while it should be: " << dsolType <<
"!";
266 G4Exception(
"G4PVDivision::CheckAndSetParameters()",
351 if (mSolidType ==
"G4ReflectedSolid")
359 if( mSolidType ==
"G4Box" )
365 offset, mSolid, divType );
369 offset, mSolid, divType );
373 offset, mSolid, divType );
376 ErrorInAxis( axis, mSolid );
380 else if( mSolidType ==
"G4Tubs" )
386 offset, mSolid, divType );
390 offset, mSolid, divType );
394 offset, mSolid, divType );
397 ErrorInAxis( axis, mSolid );
401 else if( mSolidType ==
"G4Cons" )
407 offset, mSolid, divType );
411 offset, mSolid, divType );
415 offset, mSolid, divType );
418 ErrorInAxis( axis, mSolid );
422 else if( mSolidType ==
"G4Trd" )
428 offset, mSolid, divType );
432 offset, mSolid, divType );
436 offset, mSolid, divType );
439 ErrorInAxis( axis, mSolid );
443 else if( mSolidType ==
"G4Para" )
449 offset, mSolid, divType );
453 offset, mSolid, divType );
457 offset, mSolid, divType );
460 ErrorInAxis( axis, mSolid );
467 else if( mSolidType ==
"G4Polycone" )
473 offset, mSolid, divType );
477 offset, mSolid, divType );
481 offset, mSolid, divType );
484 ErrorInAxis( axis, mSolid );
488 else if( mSolidType ==
"G4Polyhedra" )
494 offset, mSolid, divType );
498 offset, mSolid, divType );
502 offset, mSolid, divType );
505 ErrorInAxis( axis, mSolid );
511 std::ostringstream message;
512 message <<
"Solid type " << mSolidType <<
" not supported!" <<
G4endl
513 <<
"Divisions for " << mSolidType <<
" are not implemented.";
514 G4Exception(
"G4PVDivision::SetParameterisation()",
"GeomDiv0001",
539 error +=
"Radial3D.";
547 G4Exception(
"G4PVDivision::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)
G4int GetRegularStructureId() const override
void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const override
G4bool IsMany() const override
G4bool IsReplicated() const override
EVolume VolumeType() const override
G4bool IsRegularStructure() const override
G4VDivisionParameterisation * fparam
EAxis GetDivisionAxis() const
G4VPVParameterisation * GetParameterisation() const override
G4PVDivision(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset)
G4int GetMultiplicity() const override
G4bool IsParameterised() const override
G4double GetWidth() const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
void SetRotation(G4RotationMatrix *)
void SetMotherLogical(G4LogicalVolume *pMother)
virtual G4GeometryType GetEntityType() const =0