38 auto i = dirName.length();
42 auto isl = dirName.rfind(
'/');
43 dirName.erase(0, isl + 1);
50 for(
auto st : structure)
53 for(
auto dt : detector)
60 return (
this == &right);
66 G4String remainingPath = treeStructure;
67 remainingPath.erase(0, pathName.length());
68 if(!remainingPath.empty())
71 G4String subD = ExtractDirName(remainingPath);
75 subD.insert(0, pathName);
77 structure.push_back(tgtSDS);
86 detector.push_back(aSD);
92 ed << aSD->
GetName() <<
" had already been stored in " << pathName
93 <<
". Object pointer is overwritten.\n";
94 ed <<
"It's users' responsibility to delete the old sensitive detector "
100 detector.push_back(aSD);
107 for(
auto st : structure)
109 if(subD == st->dirName)
117 for(
auto det : detector)
119 if(aSDName == det->GetName())
127 auto det = std::find(detector.begin(), detector.end(), sd);
128 if(det != detector.end())
135 auto i = aName.find(
'/');
136 if(i != G4String::npos)
144 aPath.erase(0, pathName.length());
145 if(aPath.find(
'/') != std::string::npos)
147 G4String subD = ExtractDirName(aPath);
149 if(tgtSDS ==
nullptr)
151 G4cout << subD <<
" is not found in " << pathName <<
G4endl;
155 tgtSDS->
Activate(aName, sensitiveFlag);
158 else if(aPath.empty())
160 for(
auto det : detector)
161 det->Activate(sensitiveFlag);
162 for(
auto st : structure)
163 st->Activate(
G4String(
"/"), sensitiveFlag);
170 G4cout << aPath <<
" is not found in " << pathName <<
G4endl;
183 aPath.erase(0, pathName.length());
184 if(aPath.find(
'/') != std::string::npos)
186 G4String subD = ExtractDirName(aPath);
188 if(tgtSDS ==
nullptr)
191 G4cout << subD <<
" is not found in " << pathName <<
G4endl;
205 G4cout << aPath <<
" is not found in " << pathName <<
G4endl;
214 for(
auto st : structure)
219 for(
auto dt : detector)
229 for(
auto st : structure)
234 for(
auto dt : detector)
244 for(
auto sd : detector)
253 G4cout <<
" XXX Inactive ";
257 for(
auto st : structure)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
void Initialize(G4HCofThisEvent *HCE)
G4bool operator==(const G4SDStructure &right) const
G4VSensitiveDetector * GetSD(const G4String &aName)
void Activate(const G4String &aName, G4bool sensitiveFlag)
void Terminate(G4HCofThisEvent *HCE)
G4VSensitiveDetector * FindSensitiveDetector(const G4String &aName, G4bool warning=true)
G4SDStructure(const G4String &aPath)
void AddNewDetector(G4VSensitiveDetector *aSD, const G4String &treeStructure)
void Activate(G4bool activeFlag)