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; }