49 : fName(pName), fRegionMod(true), fCut(0), fUserInfo(0), fUserLimits(0),
50 fFieldManager(0), fFastSimulationManager(0), fWorldPhys(0),
51 fRegionalSteppingAction(0),
52 fInMassGeometry(false), fInParallelGeometry(false)
57 std::ostringstream message;
58 message <<
"The region has NOT been registered !" <<
G4endl
59 <<
" Region " << pName <<
" already existing in store !"
76 : fName(
""), fRegionMod(true), fCut(0), fUserInfo(0), fUserLimits(0),
77 fFieldManager(0), fFastSimulationManager(0), fWorldPhys(0),
78 fRegionalSteppingAction(0),
79 fInMassGeometry(false), fInParallelGeometry(false)
94 if(fUserInfo)
delete fUserInfo;
114 if(!volMat && fInMassGeometry)
116 std::ostringstream message;
117 message <<
"Logical volume <" << lv->
GetName() <<
">" <<
G4endl
118 <<
"does not have a valid material pointer." <<
G4endl
119 <<
"A logical volume belonging to the (tracking) world volume "
120 <<
"must have a valid material.";
121 G4Exception(
"G4Region::ScanVolumeTree()",
"GeomMgt0002",
126 currentRegion =
this;
131 if (baseMat) { AddMaterial(baseMat); }
142 if(noDaughters==0)
return;
155 for (
register size_t mat=0; mat<matNo; mat++)
158 if(!volMat && fInMassGeometry)
160 std::ostringstream message;
161 message <<
"The parameterisation for the physical volume <"
163 <<
"does not return a valid material pointer." <<
G4endl
164 <<
"A volume belonging to the (tracking) world volume must "
165 <<
"have a valid material.";
166 G4Exception(
"G4Region::ScanVolumeTree()",
"GeomMgt0002",
173 if (baseMat) { AddMaterial(baseMat); }
180 for (
register size_t rep=0; rep<repNo; rep++)
183 if(!volMat && fInMassGeometry)
185 std::ostringstream message;
186 message <<
"The parameterisation for the physical volume <"
188 <<
"does not return a valid material pointer." <<
G4endl
189 <<
"A volume belonging to the (tracking) world volume must "
190 <<
"have a valid material.";
191 G4Exception(
"G4Region::ScanVolumeTree()",
"GeomMgt0002",
198 if (baseMat) { AddMaterial(baseMat); }
207 for (
register size_t i=0; i<noDaughters; i++)
231 G4RootLVList::iterator pos;
232 pos = std::find(fRootVolumes.begin(),fRootVolumes.end(),lv);
233 if (pos == fRootVolumes.end())
237 fRootVolumes.push_back(lv);
260 G4RootLVList::iterator pos;
261 pos = std::find(fRootVolumes.begin(),fRootVolumes.end(),lv);
262 if (pos != fRootVolumes.end())
264 if (fRootVolumes.size() != 1)
268 fRootVolumes.erase(pos);
306 G4RootLVList::iterator pLV;
307 for (pLV=fRootVolumes.begin(); pLV!=fRootVolumes.end(); pLV++)
338 if (currLog->
GetRegion()==
this) {
return true;}
367 std::ostringstream message;
368 message <<
"Region <" << fName <<
"> belongs to more than"
369 <<
" one parent region !" <<
G4endl
370 <<
"A region cannot belong to more than one direct parent region,"
372 <<
"to have fast-simulation assigned.";
373 G4Exception(
"G4Region::ClearFastSimulationManager()",
375 fFastSimulationManager = 0;
380 fFastSimulationManager = 0;
392 G4Region* parent = 0; unique =
true;
394 G4LogicalVolumeStore::iterator lvItr;
398 for(lvItr=lvStore->begin(); lvItr!=lvStore->end(); lvItr++)
400 G4int nD = (*lvItr)->GetNoDaughters();
401 G4Region* aR = (*lvItr)->GetRegion();
405 for(
G4int iD=0; iD<nD; iD++)
407 if((*lvItr)->GetDaughter(iD)->GetLogicalVolume()->GetRegion()==
this)
411 if(parent!=aR) { unique =
false; }
static G4LogicalVolumeStore * GetInstance()
G4int GetNoDaughters() const
void SetRegionRootFlag(G4bool rreg)
void SetRegion(G4Region *reg)
G4bool IsRootRegion() const
G4Region * GetRegion() const
G4Material * GetMaterial() const
G4VPhysicalVolume * GetDaughter(const G4int i) const
const G4Material * GetBaseMaterial() const
static G4RegionStore * GetInstance()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static void Register(G4Region *pSolid)
static void DeRegister(G4Region *pSolid)
G4bool BelongsTo(G4VPhysicalVolume *thePhys) const
void ScanVolumeTree(G4LogicalVolume *lv, G4bool region)
G4Region * GetParentRegion(G4bool &unique) const
G4FastSimulationManager * GetFastSimulationManager() const
void SetWorld(G4VPhysicalVolume *wp)
void RemoveRootLogicalVolume(G4LogicalVolume *lv, G4bool scan=true)
void UpdateMaterialList()
G4Region(const G4String &name)
void ClearFastSimulationManager()
void AddRootLogicalVolume(G4LogicalVolume *lv)
virtual G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
virtual G4VVolumeMaterialScanner * GetMaterialScanner()
G4LogicalVolume * GetLogicalVolume() const
virtual G4int GetMultiplicity() const
const G4String & GetName() const
virtual G4VPVParameterisation * GetParameterisation() const =0
virtual G4bool IsParameterised() const =0
virtual G4Material * GetMaterial(G4int idx) const =0
virtual G4int GetNumberOfMaterials() const =0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)