45 : rlist(0), ullist(0), urcode(false), uwcode(false), strip(true), rexp(false)
51 xercesc::XMLPlatformUtils::Initialize();
55 : rlist(0), ullist(0), urcode(true), uwcode(false), strip(true), rexp(false)
61 xercesc::XMLPlatformUtils::Initialize();
66 : rlist(0), ullist(0), urcode(true), uwcode(true), strip(true), rexp(false)
72 xercesc::XMLPlatformUtils::Initialize();
77 xercesc::XMLPlatformUtils::Terminate();
78 if (!urcode) {
delete reader; }
79 if (!uwcode) {
delete writer;
delete ullist;
delete rlist; }
84 void G4GDMLParser::ImportRegions()
88 for(std::vector<G4GDMLAuxStructType>::const_iterator
89 iaux = auxInfoList->begin(); iaux != auxInfoList->end(); iaux++ )
91 if (iaux->type !=
"Region")
return;
95 if (name.
contains(
"DefaultRegionForTheWorld"))
continue;
101 "Invalid definition of geometrical region!");
108 for(std::vector<G4GDMLAuxStructType>::const_iterator
109 raux = iaux->auxList->begin(); raux != iaux->auxList->end(); raux++ )
115 if (strip) { reader->
StripName(volname); }
122 const G4String& cvalue = raux->value;
125 G4Exception(
"G4GDMLParser::ImportRegions()",
"InvalidRead",
132 const G4String& cvalue = raux->value;
135 G4Exception(
"G4GDMLParser::ImportRegions()",
"InvalidRead",
142 const G4String& cvalue = raux->value;
145 G4Exception(
"G4GDMLParser::ImportRegions()",
"InvalidRead",
152 const G4String& cvalue = raux->value;
155 G4Exception(
"G4GDMLParser::ImportRegions()",
"InvalidRead",
164 const G4String& ulname = raux->value;
165 for(std::vector<G4GDMLAuxStructType>::const_iterator
166 uaux=raux->auxList->begin(); uaux!=raux->auxList->end(); uaux++ )
169 const G4String& uvalue = uaux->value;
172 if (ultag==
"ustepMax") { ustepMax = ulvalue; }
else
173 if (ultag==
"utrakMax") { utrakMax = ulvalue; }
else
174 if (ultag==
"utimeMax") { utimeMax = ulvalue; }
else
175 if (ultag==
"uekinMin") { uekinMin = ulvalue; }
else
176 if (ultag==
"urangMin") { urangMin = ulvalue; }
181 "Invalid definition of user-limits!");
185 utimeMax, uekinMin, urangMin);
194 void G4GDMLParser::ExportRegions(
G4bool storeReferences)
198 for (
size_t i=0; i<rstore->size(); ++i)
200 const G4String& tname = (*rstore)[i]->GetName();
201 if (tname.
contains(
"DefaultRegionForParallelWorld"))
continue;
205 std::vector<G4LogicalVolume*>::iterator rlvol_iter
206 = (*rstore)[i]->GetRootLogicalVolumeIterator();
207 for (
size_t j=0; j<(*rstore)[i]->GetNumberOfRootVolumes(); ++j)
212 if (!storeReferences) { reader->
StripName(vname); }
214 rlist->push_back(rsubaux);
217 G4double gam_cut = (*rstore)[i]->GetProductionCuts()->GetProductionCut(
"gamma");
219 rlist->push_back(caux1);
220 G4double e_cut = (*rstore)[i]->GetProductionCuts()->GetProductionCut(
"e-");
222 rlist->push_back(caux2);
223 G4double pos_cut = (*rstore)[i]->GetProductionCuts()->GetProductionCut(
"e+");
225 rlist->push_back(caux3);
226 G4double p_cut = (*rstore)[i]->GetProductionCuts()->GetProductionCut(
"proton");
228 rlist->push_back(caux4);
229 if ((*rstore)[i]->GetUserLimits())
233 const G4String& utype = (*rstore)[i]->GetUserLimits()->GetType();
235 G4double max_step = (*rstore)[i]->GetUserLimits()->GetMaxAllowedStep(fake_trk);
237 ullist->push_back(ulaux1);
238 G4double max_trk = (*rstore)[i]->GetUserLimits()->GetUserMaxTrackLength(fake_trk);
240 ullist->push_back(ulaux2);
241 G4double max_time = (*rstore)[i]->GetUserLimits()->GetUserMaxTime(fake_trk);
243 ullist->push_back(ulaux3);
244 G4double min_ekin = (*rstore)[i]->GetUserLimits()->GetUserMinEkine(fake_trk);
246 ullist->push_back(ulaux4);
247 G4double min_rng = (*rstore)[i]->GetUserLimits()->GetUserMinRange(fake_trk);
249 ullist->push_back(ulaux5);
250 rlist->push_back(uaux);
void AddRootLogicalVolume(G4LogicalVolume *lv)
void SetProductionCut(G4double cut, G4int index=-1)
G4bool IsReflected(G4LogicalVolume *lv) const
const G4GDMLAuxListType * GetAuxList() const
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
static G4ReflectionFactory * Instance()
static G4RegionStore * GetInstance()
static G4double GetValueOf(const G4String &)
G4String ConvertToString(G4int ival)
static G4LogicalVolumeStore * GetInstance()
G4String GenerateName(const G4String &, const void *const)
void StripName(G4String &) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4String GetCategory(const G4String &)
G4bool contains(const std::string &) const
std::vector< G4GDMLAuxStructType > G4GDMLAuxListType
G4LogicalVolume * GetReflectedLV(G4LogicalVolume *lv) const
void SetProductionCuts(G4ProductionCuts *cut)
void SetUserLimits(G4UserLimits *ul)
void AddAuxiliary(G4GDMLAuxStructType myaux)
const G4String & GetName() const
G4bool IsConstituent(G4LogicalVolume *lv) const
G4double Evaluate(const G4String &)