#include <G4SDStructure.hh>
Definition at line 47 of file G4SDStructure.hh.
G4SDStructure::G4SDStructure |
( |
G4String |
aPath | ) |
|
G4SDStructure::~G4SDStructure |
( |
| ) |
|
Definition at line 48 of file G4SDStructure.cc.
50 for(
auto st : structure)
delete st;
52 for(
auto dt : detector)
delete dt;
Definition at line 127 of file G4SDStructure.cc.
130 aPath.
remove(0,pathName.length());
131 if( aPath.
first(
'/') !=
G4int(std::string::npos) )
133 G4String subD = ExtractDirName(aPath);
135 if( tgtSDS ==
nullptr )
137 G4cout << subD <<
" is not found in " << pathName <<
G4endl;
141 tgtSDS->
Activate(aName,sensitiveFlag);
146 for(
auto det : detector) det->Activate(sensitiveFlag);
147 for(
auto st : structure) st->Activate(
G4String(
"/"),sensitiveFlag);
152 if( tgtSD ==
nullptr )
154 G4cout << aPath <<
" is not found in " << pathName <<
G4endl;
void Activate(G4bool activeFlag)
G4String & remove(str_size)
void Activate(G4String aName, G4bool sensitiveFlag)
G4GLOB_DLL std::ostream G4cout
G4VSensitiveDetector * GetSD(G4String aName)
Definition at line 61 of file G4SDStructure.cc.
64 G4String remainingPath = treeStructure;
65 remainingPath.
remove(0,pathName.length());
66 if( ! remainingPath.
isNull() )
69 G4String subD = ExtractDirName( remainingPath );
71 if( tgtSDS ==
nullptr )
75 structure.push_back( tgtSDS );
83 { detector.push_back( aSD ); }
84 else if( tgtSD != aSD )
88 ed << aSD->
GetName() <<
" had already been stored in "
89 << pathName <<
". Object pointer is overwitten.\n";
90 ed <<
"It's users' responsibility to delete the old sensitive detector object.";
94 detector.push_back( aSD );
void AddNewDetector(G4VSensitiveDetector *aSD, G4String treeStructure)
std::ostringstream G4ExceptionDescription
G4String & remove(str_size)
G4String & prepend(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VSensitiveDetector * GetSD(G4String aName)
G4SDStructure(G4String aPath)
Definition at line 163 of file G4SDStructure.cc.
166 aPath.
remove(0,pathName.length());
167 if( aPath.
first(
'/') !=
G4int(std::string::npos) )
169 G4String subD = ExtractDirName(aPath);
171 if( tgtSDS ==
nullptr )
174 G4cout << subD <<
" is not found in " << pathName <<
G4endl;
185 if( tgtSD ==
nullptr )
188 G4cout << aPath <<
" is not found in " << pathName <<
G4endl;
G4String & remove(str_size)
G4GLOB_DLL std::ostream G4cout
G4VSensitiveDetector * GetSD(G4String aName)
G4VSensitiveDetector * FindSensitiveDetector(G4String aName, G4bool warning=true)
Definition at line 106 of file G4SDStructure.cc.
108 for(
auto det : detector)
109 {
if(aSDName == det->GetName())
return det; }
Definition at line 194 of file G4SDStructure.cc.
197 for(
auto st : structure)
198 { st->Initialize(HCE); }
200 for(
auto dt : detector)
201 {
if(dt->isActive()) dt->Initialize(HCE); }
void G4SDStructure::ListTree |
( |
| ) |
|
Definition at line 214 of file G4SDStructure.cc.
217 for(
auto sd : detector)
219 G4cout << pathName << sd->GetName();
221 {
G4cout <<
" *** Active "; }
223 {
G4cout <<
" XXX Inactive "; }
226 for(
auto st : structure) st->ListTree();
G4GLOB_DLL std::ostream G4cout
void G4SDStructure::SetVerboseLevel |
( |
G4int |
vl | ) |
|
|
inline |
Definition at line 76 of file G4SDStructure.hh.
79 for(
size_t i=0; i<structure.size(); i++)
80 { structure[i]->SetVerboseLevel(vl); }
81 for(
size_t j=0; j<detector.size(); j++)
82 { detector[j]->SetVerboseLevel(vl); }
Definition at line 204 of file G4SDStructure.cc.
207 for(
auto st : structure)
208 { st->Terminate(HCE); }
210 for(
auto dt : detector)
211 {
if(dt->isActive()) dt->EndOfEvent(HCE); }
The documentation for this class was generated from the following files: