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 ? 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()",
353 if (mSolidType ==
"G4ReflectedSolid")
361 if( mSolidType ==
"G4Box" )
367 offset, mSolid, divType );
371 offset, mSolid, divType );
375 offset, mSolid, divType );
378 ErrorInAxis( axis, mSolid );
382 else if( mSolidType ==
"G4Tubs" )
388 offset, mSolid, divType );
392 offset, mSolid, divType );
396 offset, mSolid, divType );
399 ErrorInAxis( axis, mSolid );
403 else if( mSolidType ==
"G4Cons" )
409 offset, mSolid, divType );
413 offset, mSolid, divType );
417 offset, mSolid, divType );
420 ErrorInAxis( axis, mSolid );
424 else if( mSolidType ==
"G4Trd" )
430 offset, mSolid, divType );
434 offset, mSolid, divType );
438 offset, mSolid, divType );
441 ErrorInAxis( axis, mSolid );
445 else if( mSolidType ==
"G4Para" )
451 offset, mSolid, divType );
455 offset, mSolid, divType );
459 offset, mSolid, divType );
462 ErrorInAxis( axis, mSolid );
469 else if( mSolidType ==
"G4Polycone" )
475 offset, mSolid, divType );
479 offset, mSolid, divType );
483 offset, mSolid, divType );
486 ErrorInAxis( axis, mSolid );
490 else if( mSolidType ==
"G4Polyhedra" )
496 offset, mSolid, divType );
500 offset, mSolid, divType );
504 offset, mSolid, divType );
507 ErrorInAxis( axis, mSolid );
513 std::ostringstream message;
514 message <<
"Solid type " << mSolidType <<
" not supported!" <<
G4endl
515 <<
"Divisions for " << mSolidType <<
" are not implemented.";
516 G4Exception(
"G4PVDivision::SetParameterisation()",
"GeomDiv0001",
541 error +=
"Radial3D.";
549 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)
virtual G4VPVParameterisation * GetParameterisation() const
virtual G4bool IsReplicated() const
virtual G4int GetMultiplicity() const
virtual EVolume VolumeType() const
virtual G4bool IsMany() const
G4VDivisionParameterisation * fparam
EAxis GetDivisionAxis() const
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const
G4PVDivision(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset)
G4bool IsRegularStructure() const
G4bool IsParameterised() const
G4int GetRegularStructureId() const
G4double GetWidth() const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
void SetRotation(G4RotationMatrix *)
void SetMotherLogical(G4LogicalVolume *pMother)
virtual G4GeometryType GetEntityType() const =0