45 const G4int nReplicas,
48: G4PVReplica(pName, nReplicas, pAxis, pLogical,
49 pMotherPhysical != nullptr ? pMotherPhysical->GetLogicalVolume() : nullptr ),
55 SetMotherLogical( motherLogical );
56 if( motherLogical !=
nullptr )
63 if ((pMotherPhysical !=
nullptr) && (pMotherPhysical->
IsParameterised()))
65 std::ostringstream message;
66 std::ostringstream hint;
67 message <<
"A parameterised volume is being placed" <<
G4endl
68 <<
"inside another parameterised volume !";
69 hint <<
"To make sure that no overlaps are generated," <<
G4endl
70 <<
"you should verify the mother replicated shapes" <<
G4endl
71 <<
"are of the same type and dimensions." <<
G4endl
72 <<
" Mother physical volume: " << pMotherPhysical->
GetName() <<
G4endl
73 <<
" Parameterised volume: " << pName <<
G4endl
74 <<
" (To switch this warning off, compile with G4_NO_VERBOSE)";
75 G4Exception(
"G4PVParameterised::G4PVParameterised()",
"GeomVol1002",
89 const G4int nReplicas,
92 : G4PVReplica(pName, nReplicas, pAxis, pLogical, pMotherLogical ),
95 SetMotherLogical( pMotherLogical );
96 if( pMotherLogical !=
nullptr )
158 G4PVReplica::SetRegularStructureId(
code );
171 if (res<=0) {
return false; }
179 std::vector<G4ThreeVector> points;
183 G4cout <<
"Checking overlaps for parameterised volume "
184 << GetName() <<
" ... ";
189 solidA = fparam->ComputeSolid(i,
this);
191 fparam->ComputeTransformation(i,
this);
202 for (
auto n=0; n<res; ++n)
213 ++trials; retval =
true;
214 std::ostringstream message;
215 message <<
"Overlap with mother volume !" <<
G4endl
216 <<
" Overlap is detected for volume "
217 << GetName() <<
", parameterised instance: " << i <<
G4endl
218 <<
" with its mother volume "
220 <<
" at mother local point " << mp <<
", "
221 <<
"overlapping by at least: "
226 <<
"NOTE: Reached maximum fixed number -" << maxErr
227 <<
"- of overlaps reports for this volume !";
231 if (trials>=maxErr) {
return true; }
234 points.push_back(mp);
241 solidB = fparam->ComputeSolid(j,
this);
243 fparam->ComputeTransformation(j,
this);
249 for (
const auto & point : points)
260 ++trials; retval =
true;
261 std::ostringstream message;
262 message <<
"Overlap within parameterised volumes !" <<
G4endl
263 <<
" Overlap is detected for volume "
264 << GetName() <<
", parameterised instance: " << i <<
G4endl
265 <<
" with parameterised volume instance: " << j
267 <<
" at local point " << md <<
", "
268 <<
"overlapping by at least: "
270 <<
", related to volume instance: " << j <<
".";
274 <<
"NOTE: Reached maximum fixed number -" << maxErr
275 <<
"- of overlaps reports for this volume !";
279 if (trials>=maxErr) {
return true; }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4ThreadLocal T * G4GeomSplitter< T >::offset
G4int GetMultiplicity() const override
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
G4VSolid * GetSolid() const
void AddDaughter(G4VPhysicalVolume *p)
const G4String & GetName() const
G4bool IsParameterised() const override
void SetRegularStructureId(G4int code) override
G4VPVParameterisation * GetParameterisation() const override
EVolume VolumeType() const final
G4bool CheckOverlaps(G4int res=1000, G4double tol=0., G4bool verbose=true, G4int maxErr=1) override
void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const override
G4PVParameterised(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4int nReplicas, G4VPVParameterisation *pParam, G4bool pSurfChk=false)
G4VPVParameterisation ia an abstract base class for Parameterisation, able to compute the transformat...
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
virtual G4bool IsParameterised() const =0
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
virtual G4ThreeVector GetPointOnSurface() const
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
const axis_t axis_to_type< N >::axis