12 #include "G4VPhysicalVolume.hh"
13 #include "G4PVPlacement.hh"
14 #include "G4Region.hh"
18 #include "G4UImanager.hh"
19 #include "G4Tokenizer.hh"
20 #include "G4Version.hh"
24 : componentName(compName), verboseLevel(vl)
27 commandDir =
"/eAST/component/" + compName +
"/";
43 G4VPhysicalVolume* worldPhys)
51 if (
verboseLevel > 0 ) G4cout <<
"LocateDataFile: Searching for " << fn
52 <<
" in " << G4UImanager::GetUIpointer()->GetMacroSearchPath()
55 if(fn ==
"*NOTDEFINED*"){
57 if (
verboseLevel > 0 ) G4cout <<
"LocateDataFile: Returning " << fn << G4endl;
61 auto UImanager = G4UImanager::GetUIpointer();
62 auto ret = UImanager->FindMacroPath(fn);
63 if (
verboseLevel > 0 ) G4cout <<
"LocateDataFile: Returning " << ret << G4endl;
69 enum { BUFSIZE = 128 };
71 std::ifstream matFile;
75 G4ExceptionDescription ed;
76 ed <<
"Material definition file <" << fileName <<
"> couldn't be opened.";
77 G4Exception(
"eASTBeamPipe::Construct",
"eASTBeamPipe001",
83 { G4cout <<
"Reading material definition file <" << fileName <<
">..." << G4endl;}
84 while(!(matFile.eof()))
86 matFile.getline(line,BUFSIZE);
87 if(line[0]==
'#')
continue;
88 G4Tokenizer next(line);
89 G4String logVolName = next();
90 G4String matName = next();
91 #if G4VERSION_NUMBER < 1100
92 if(logVolName.isNull() || matName.isNull())
continue;
94 if(logVolName.empty() || matName.empty())
continue;
96 G4String cmd =
"/eAST/material/create " + matName;
97 G4UImanager::GetUIpointer()->ApplyCommand(cmd);
98 cmd =
"/eAST/material/set " + logVolName +
" " + matName;
99 G4UImanager::GetUIpointer()->ApplyCommand(cmd);
124 G4ExceptionDescription ed;
125 ed <<
"Component <" <<
componentName <<
"> does not have a valid G4Region pointer.";
126 G4Exception(
"eASTVDetectorComponent::RegisterUserAction()",
"eASTComp0001",