49 xercesc::XMLPlatformUtils::Initialize();
54 : urcode(true), strip(true)
60 xercesc::XMLPlatformUtils::Initialize();
66 : urcode(true), uwcode(true), strip(true)
72 xercesc::XMLPlatformUtils::Initialize();
78 xercesc::XMLPlatformUtils::Terminate();
94void G4GDMLParser::ImportRegions()
98 for(
auto iaux = auxInfoList->cbegin(); iaux != auxInfoList->cend(); ++iaux)
100 if(iaux->type !=
"Region")
108 if(
name.contains(
"DefaultRegionForTheWorld"))
114 "Invalid definition of geometrical region!");
121 for(
auto raux = iaux->auxList->cbegin();
122 raux != iaux->auxList->cend(); ++raux)
138 else if(
tag ==
"pcut")
140 const G4String& cvalue = raux->value;
144 G4Exception(
"G4GDMLParser::ImportRegions()",
"InvalidRead",
151 else if(
tag ==
"ecut")
153 const G4String& cvalue = raux->value;
157 G4Exception(
"G4GDMLParser::ImportRegions()",
"InvalidRead",
164 else if(
tag ==
"poscut")
166 const G4String& cvalue = raux->value;
170 G4Exception(
"G4GDMLParser::ImportRegions()",
"InvalidRead",
177 else if(
tag ==
"gamcut")
179 const G4String& cvalue = raux->value;
183 G4Exception(
"G4GDMLParser::ImportRegions()",
"InvalidRead",
190 else if(
tag ==
"ulimits")
193 G4double uekinMin = 0., urangMin = 0.;
194 const G4String& ulname = raux->value;
195 for(
auto uaux = raux->auxList->cbegin();
196 uaux != raux->auxList->cend(); ++uaux)
199 const G4String& uvalue = uaux->value;
202 if(ultag ==
"ustepMax")
206 else if(ultag ==
"utrakMax")
210 else if(ultag ==
"utimeMax")
214 else if(ultag ==
"uekinMin")
218 else if(ultag ==
"urangMin")
224 G4Exception(
"G4GDMLParser::ImportRegions()",
"ReadError",
229 ulname, ustepMax, utrakMax, utimeMax, uekinMin, urangMin);
240void G4GDMLParser::ExportRegions(
G4bool storeReferences)
244 for(std::size_t i = 0; i < rstore->size(); ++i)
247 const G4String& tname = (*rstore)[i]->GetName();
248 if(tname.
contains(
"DefaultRegionForParallelWorld"))
253 auto rlvol_iter = (*rstore)[i]->GetRootLogicalVolumeIterator();
254 for(std::size_t j = 0; j < (*rstore)[i]->GetNumberOfRootVolumes(); ++j)
265 rlist->push_back(rsubaux);
269 = (*rstore)[i]->GetProductionCuts()->GetProductionCut(
"gamma");
272 rlist->push_back(caux1);
273 G4double e_cut = (*rstore)[i]->GetProductionCuts()->GetProductionCut(
"e-");
276 rlist->push_back(caux2);
278 = (*rstore)[i]->GetProductionCuts()->GetProductionCut(
"e+");
281 rlist->push_back(caux3);
283 = (*rstore)[i]->GetProductionCuts()->GetProductionCut(
"proton");
286 rlist->push_back(caux4);
287 if((*rstore)[i]->GetUserLimits())
291 const G4String& utype = (*rstore)[i]->GetUserLimits()->GetType();
294 = (*rstore)[i]->GetUserLimits()->GetMaxAllowedStep(fake_trk);
297 ullist->push_back(ulaux1);
299 = (*rstore)[i]->GetUserLimits()->GetUserMaxTrackLength(fake_trk);
302 ullist->push_back(ulaux2);
304 = (*rstore)[i]->GetUserLimits()->GetUserMaxTime(fake_trk);
307 ullist->push_back(ulaux3);
309 = (*rstore)[i]->GetUserLimits()->GetUserMinEkine(fake_trk);
312 ullist->push_back(ulaux4);
314 = (*rstore)[i]->GetUserLimits()->GetUserMinRange(fake_trk);
317 ullist->push_back(ulaux5);
318 rlist->push_back(uaux);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4GDMLAuxStructType > G4GDMLAuxListType
G4double Evaluate(const G4String &)
G4String ConvertToString(G4int ival)
const G4GDMLAuxListType * GetAuxList() const
void AddAuxiliary(G4GDMLAuxStructType myaux)
void StripName(G4String &) const
G4String GenerateName(const G4String &, const void *const)
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
static G4LogicalVolumeStore * GetInstance()
const G4String & GetName() const
void SetProductionCut(G4double cut, G4int index=-1)
G4bool IsReflected(G4LogicalVolume *lv) const
G4LogicalVolume * GetReflectedLV(G4LogicalVolume *lv) const
static G4ReflectionFactory * Instance()
G4bool IsConstituent(G4LogicalVolume *lv) const
static G4RegionStore * GetInstance()
void SetProductionCuts(G4ProductionCuts *cut)
void SetUserLimits(G4UserLimits *ul)
void AddRootLogicalVolume(G4LogicalVolume *lv, G4bool search=true)
G4bool contains(const std::string &) const
static G4double GetValueOf(const G4String &)
static G4String GetCategory(const G4String &)
const char * name(G4int ptype)