60 return subInstanceManager;
69 :
fName(pName), fRegionMod(true), fCut(0), fUserInfo(0), fUserLimits(0),
70 fFieldManager(0), fWorldPhys(0),
71 fInMassGeometry(false), fInParallelGeometry(false)
81 std::ostringstream message;
82 message <<
"The region has NOT been registered !" <<
G4endl
83 <<
" Region " << pName <<
" already existing in store !"
100 :
fName(
""), fRegionMod(true), fCut(0), fUserInfo(0), fUserLimits(0),
101 fFieldManager(0), fWorldPhys(0),
102 fInMassGeometry(false), fInParallelGeometry(false)
121 if(fUserInfo)
delete fUserInfo;
141 if(!volMat && fInMassGeometry)
143 std::ostringstream message;
144 message <<
"Logical volume <" << lv->
GetName() <<
">" <<
G4endl
145 <<
"does not have a valid material pointer." <<
G4endl
146 <<
"A logical volume belonging to the (tracking) world volume "
147 <<
"must have a valid material.";
148 G4Exception(
"G4Region::ScanVolumeTree()",
"GeomMgt0002",
153 currentRegion =
this;
158 if (baseMat) { AddMaterial(baseMat); }
169 if(noDaughters==0)
return;
182 for (
register size_t mat=0;
mat<matNo;
mat++)
185 if(!volMat && fInMassGeometry)
187 std::ostringstream message;
188 message <<
"The parameterisation for the physical volume <"
190 <<
"does not return a valid material pointer." <<
G4endl
191 <<
"A volume belonging to the (tracking) world volume must "
192 <<
"have a valid material.";
193 G4Exception(
"G4Region::ScanVolumeTree()",
"GeomMgt0002",
200 if (baseMat) { AddMaterial(baseMat); }
207 for (
register size_t rep=0; rep<repNo; rep++)
210 if(!volMat && fInMassGeometry)
212 std::ostringstream message;
213 message <<
"The parameterisation for the physical volume <"
215 <<
"does not return a valid material pointer." <<
G4endl
216 <<
"A volume belonging to the (tracking) world volume must "
217 <<
"have a valid material.";
218 G4Exception(
"G4Region::ScanVolumeTree()",
"GeomMgt0002",
225 if (baseMat) { AddMaterial(baseMat); }
234 for (
register size_t i=0; i<noDaughters; i++)
258 G4RootLVList::iterator pos;
259 pos = std::find(fRootVolumes.begin(),fRootVolumes.end(),lv);
260 if (pos == fRootVolumes.end())
264 fRootVolumes.push_back(lv);
287 G4RootLVList::iterator pos;
288 pos = std::find(fRootVolumes.begin(),fRootVolumes.end(),lv);
289 if (pos != fRootVolumes.end())
291 if (fRootVolumes.size() != 1)
295 fRootVolumes.erase(pos);
333 G4RootLVList::iterator pLV;
334 for (pLV=fRootVolumes.begin(); pLV!=fRootVolumes.end(); pLV++)
365 if (currLog->
GetRegion()==
this) {
return true;}
394 std::ostringstream message;
395 message <<
"Region <" << fName <<
"> belongs to more than"
396 <<
" one parent region !" <<
G4endl
397 <<
"A region cannot belong to more than one direct parent region,"
399 <<
"to have fast-simulation assigned.";
400 G4Exception(
"G4Region::ClearFastSimulationManager()",
419 G4Region* parent = 0; unique =
true;
421 G4LogicalVolumeStore::iterator lvItr;
425 for(lvItr=lvStore->begin(); lvItr!=lvStore->end(); lvItr++)
427 G4int nD = (*lvItr)->GetNoDaughters();
428 G4Region* aR = (*lvItr)->GetRegion();
432 for(
G4int iD=0; iD<nD; iD++)
434 if((*lvItr)->GetDaughter(iD)->GetLogicalVolume()->GetRegion()==
this)
438 if(parent!=aR) { unique =
false; }
virtual G4VVolumeMaterialScanner * GetMaterialScanner()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
virtual G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
void AddRootLogicalVolume(G4LogicalVolume *lv)
void SetRegionRootFlag(G4bool rreg)
G4Material * GetMaterial() const
G4VPhysicalVolume * GetDaughter(const G4int i) const
G4Region * GetRegion() const
G4int CreateSubInstance()
virtual G4int GetNumberOfMaterials() const =0
static void DeRegister(G4Region *pSolid)
static G4RegionStore * GetInstance()
void SetRegion(G4Region *reg)
virtual G4Material * GetMaterial(G4int idx) const =0
G4Region(const G4String &name)
void ScanVolumeTree(G4LogicalVolume *lv, G4bool region)
const G4String & GetName() const
G4bool IsRootRegion() const
virtual G4VPVParameterisation * GetParameterisation() const =0
static G4LogicalVolumeStore * GetInstance()
void ClearFastSimulationManager()
G4int GetNoDaughters() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual G4bool IsParameterised() const =0
G4bool BelongsTo(G4VPhysicalVolume *thePhys) const
G4LogicalVolume * GetLogicalVolume() const
void SetWorld(G4VPhysicalVolume *wp)
G4Region * GetParentRegion(G4bool &unique) const
const G4Material * GetBaseMaterial() const
G4FastSimulationManager * GetFastSimulationManager() const
virtual G4int GetMultiplicity() const
static void Register(G4Region *pSolid)
void UpdateMaterialList()
void RemoveRootLogicalVolume(G4LogicalVolume *lv, G4bool scan=true)
static const G4RegionManager & GetSubInstanceManager()