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,
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);
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);
152 if (pMotherPhysical ==
nullptr)
154 std::ostringstream message;
155 message <<
"Invalid setup." <<
G4endl
156 <<
"NULL pointer specified as mother for volume: " << pName;
157 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
162 if (pLogical == pMotherLogical)
164 std::ostringstream message;
165 message <<
"Invalid setup." <<
G4endl
166 <<
"Cannot place a volume inside itself! Volume: " << pName;
167 G4Exception(
"G4PVDivision::G4PVDivision()",
"GeomDiv0002",
172 SetParameterisation(pMotherLogical, pAxis, nDivs,
174 CheckAndSetParameters (pAxis, nDivs, width, offset,
180G4PVDivision::CheckAndSetParameters(
const EAxis pAxis,
197 G4Exception(
"G4PVDivision::CheckAndSetParameters()",
"GeomDiv0002",
211 G4Exception(
"G4PVDivision::CheckAndSetParameters()",
"GeomDiv0002",
246 G4Exception(
"G4PVDivision::CheckAndSetParameters()",
"GeomDiv0002",
258 if( msolType != dsolType && ( msolType !=
"G4Trd" || dsolType !=
"G4Trap" ) )
260 std::ostringstream message;
261 message <<
"Incorrect solid type for division of volume "
263 <<
"It is: " << msolType
264 <<
", while it should be: " << dsolType <<
"!";
265 G4Exception(
"G4PVDivision::CheckAndSetParameters()",
364 if (mSolidType ==
"G4ReflectedSolid")
372 if( mSolidType ==
"G4Box" )
378 offset, mSolid, divType );
382 offset, mSolid, divType );
386 offset, mSolid, divType );
389 ErrorInAxis( axis, mSolid );
393 else if( mSolidType ==
"G4Tubs" )
399 offset, mSolid, divType );
403 offset, mSolid, divType );
407 offset, mSolid, divType );
410 ErrorInAxis( axis, mSolid );
414 else if( mSolidType ==
"G4Cons" )
420 offset, mSolid, divType );
424 offset, mSolid, divType );
428 offset, mSolid, divType );
431 ErrorInAxis( axis, mSolid );
435 else if( mSolidType ==
"G4Trd" )
441 offset, mSolid, divType );
445 offset, mSolid, divType );
449 offset, mSolid, divType );
452 ErrorInAxis( axis, mSolid );
456 else if( mSolidType ==
"G4Para" )
462 offset, mSolid, divType );
466 offset, mSolid, divType );
470 offset, mSolid, divType );
473 ErrorInAxis( axis, mSolid );
480 else if( mSolidType ==
"G4Polycone" )
486 offset, mSolid, divType );
490 offset, mSolid, divType );
494 offset, mSolid, divType );
497 ErrorInAxis( axis, mSolid );
501 else if( mSolidType ==
"G4Polyhedra" )
507 offset, mSolid, divType );
511 offset, mSolid, divType );
515 offset, mSolid, divType );
518 ErrorInAxis( axis, mSolid );
524 std::ostringstream message;
525 message <<
"Solid type " << mSolidType <<
" not supported!" <<
G4endl
526 <<
"Divisions for " << mSolidType <<
" are not implemented.";
527 G4Exception(
"G4PVDivision::SetParameterisation()",
"GeomDiv0001",
552 error +=
"Radial3D.";
560 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 void SetCopyNo(G4int CopyNo)
virtual EVolume VolumeType() const
virtual G4bool IsMany() const
virtual G4int GetCopyNo() 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