#include <G4PersistencyCenter.hh>
Definition at line 66 of file G4PersistencyCenter.hh.
◆ AddDCIOmanager()
void G4PersistencyCenter::AddDCIOmanager |
( |
const G4String & | detName | ) |
|
Definition at line 313 of file G4PersistencyCenter.cc.
314{
316
317 G4String colName = "";
318 G4VDCIOentry* ioe = ioc->
GetEntry(detName);
319 if(ioe != nullptr)
320 {
322 }
323 else
324 {
325 G4cerr <<
"Error! -- DCIO assignment failed for detector " << detName
326 <<
", collection " << colName <<
G4endl;
327 }
328}
G4GLOB_DLL std::ostream G4cerr
G4VDCIOentry * GetEntry(const G4String &name)
static G4DCIOcatalog * GetDCIOcatalog()
virtual void CreateDCIOmanager(const G4String &, const G4String &)
◆ AddHCIOmanager()
void G4PersistencyCenter::AddHCIOmanager |
( |
const G4String & | detName, |
|
|
const G4String & | colName ) |
Definition at line 288 of file G4PersistencyCenter.cc.
290{
292
293 G4VHCIOentry* ioe = ioc->
GetEntry(detName);
294 if(ioe != nullptr)
295 {
297 }
298 else
299 {
300 G4cerr <<
"Error! -- HCIO assignment failed for detector " << detName
301 <<
", collection " << colName <<
G4endl;
302 }
303}
G4VHCIOentry * GetEntry(const G4String &name)
static G4HCIOcatalog * GetHCIOcatalog()
virtual void CreateHCIOmanager(const G4String &, const G4String &)
◆ CurrentDCIOmanager()
G4String G4PersistencyCenter::CurrentDCIOmanager |
( |
| ) |
|
◆ CurrentHCIOmanager()
G4String G4PersistencyCenter::CurrentHCIOmanager |
( |
| ) |
|
◆ CurrentHepMCObjyReaderFile()
G4String G4PersistencyCenter::CurrentHepMCObjyReaderFile |
( |
| ) |
|
Definition at line 147 of file G4PersistencyCenter.cc.
148{
150 {
152 }
153 else
154 {
155 return "";
156 }
157}
G4bool CurrentRetrieveMode(const G4String &objName)
G4String CurrentReadFile(const G4String &objName)
◆ CurrentObject()
Definition at line 272 of file G4PersistencyCenter.cc.
273{
274 for(auto itr = f_readFileName.cbegin(); itr != f_readFileName.cend(); ++itr)
275 {
276 if(file == (*itr).second)
277 return (*itr).first;
278 }
279 for(auto itr = f_writeFileName.cbegin(); itr != f_writeFileName.cend(); ++itr)
280 {
281 if(file == (*itr).second)
282 return (*itr).first;
283 }
284 return "?????";
285}
◆ CurrentPersistencyManager()
◆ CurrentReadFile()
◆ CurrentRetrieveMode()
G4bool G4PersistencyCenter::CurrentRetrieveMode |
( |
const G4String & | objName | ) |
|
◆ CurrentStoreMode()
Definition at line 186 of file G4PersistencyCenter.cc.
187{
188 if((*(f_writeFileName.find(objName))).second != "")
189 {
190 return f_writeFileMode[objName];
191 }
192 else
193 {
195 }
196}
Referenced by PrintAll().
◆ CurrentSystem()
const G4String & G4PersistencyCenter::CurrentSystem |
( |
| ) |
|
|
inline |
◆ CurrentWriteFile()
Definition at line 246 of file G4PersistencyCenter.cc.
247{
248 if((*(f_writeFileName.find(objName))).second != "")
249 {
250 return f_writeFileName[objName];
251 }
252 else
253 {
254 return "?????";
255 }
256}
Referenced by PrintAll().
◆ DeletePersistencyManager()
void G4PersistencyCenter::DeletePersistencyManager |
( |
| ) |
|
Definition at line 450 of file G4PersistencyCenter.cc.
451{
452 if(f_currentManager != nullptr)
453 delete f_currentManager;
454 f_currentManager = nullptr;
455}
◆ GetPersistencyCenter()
◆ GetPersistencyManager()
Definition at line 436 of file G4PersistencyCenter.cc.
437{
438 if(f_theCatalog.find(nam) != f_theCatalog.cend())
439 return f_theCatalog[nam];
440 return nullptr;
441}
Referenced by SelectSystem().
◆ PrintAll()
void G4PersistencyCenter::PrintAll |
( |
| ) |
|
Definition at line 338 of file G4PersistencyCenter.cc.
339{
342
345
346 G4cout <<
"Output object types and file names:" <<
G4endl;
347 for(auto itr = f_wrObj.cbegin(); itr != f_wrObj.cend(); ++itr)
348 {
349 name = (*itr).second;
350
351 if(name != "HepMC" && name != "MCTruth")
352 {
353 G4cout <<
" Object: " << PadString(name, 9);
356 {
358 }
359 else if(mode ==
kOff)
360 {
362 }
364 {
366 }
368 if(file == "")
369 file = " <N/A>";
371 }
372 }
374
375 G4cout <<
"Input object types and file names:" <<
G4endl;
376 for(auto itr = f_rdObj.cbegin(); itr != f_rdObj.cend(); ++itr)
377 {
378 name = (*itr).second;
379
380 if(name != "HepMC" && name != "MCTruth")
381 {
382 G4cout <<
" Object: " << PadString(name, 9);
384 {
386 }
387 else
388 {
390 }
392 if(file == "")
393 file = " <N/A>";
395 }
396 }
398
400 if(hioc != nullptr)
401 {
406 }
407 else
408 {
409 G4cout <<
"Hit IO Manager catalog is not registered." <<
G4endl;
410 }
411
413 if(dioc != nullptr)
414 {
419 }
420 else
421 {
422 G4cout <<
"Digit IO Manager catalog is not registered." <<
G4endl;
423 }
424}
G4GLOB_DLL std::ostream G4cout
StoreMode CurrentStoreMode(const G4String &objName)
const G4String & CurrentSystem()
G4String CurrentWriteFile(const G4String &objName)
const char * name(G4int ptype)
◆ RegisterPersistencyManager()
◆ SelectSystem()
void G4PersistencyCenter::SelectSystem |
( |
const G4String & | systemName | ) |
|
Definition at line 90 of file G4PersistencyCenter.cc.
91{
93
94 if(f_currentManager != nullptr)
95 delete f_currentManager;
96
97 G4PersistencyManager* pm = nullptr;
98
99 if(systemName == "ROOT")
100 {
101 G4cout <<
" G4PersistencyCenter: \"ROOT\" Persistency Package is selected."
103
104
105
106 if(st == 0)
107 {
109 }
110 }
111 else if(systemName == "ODBMS")
112 {
113 G4cout <<
" G4PersistencyCenter: \"ODBMS\" package is selected." <<
G4endl;
114
115
116
117 if(st == 0)
118 {
120 }
121 }
122 else
123 {
124 G4cout <<
" G4PersistencyCenter: Default is selected." <<
G4endl;
125 pm = new G4PersistencyManager(this, "Default");
126 }
127
128 if(st == 0)
129 {
130 f_currentManager = pm->
Create();
131 if(f_currentManager != nullptr)
133 f_currentSystemName = systemName;
134 }
135}
G4PersistencyManager * GetPersistencyManager(const G4String &nam)
virtual G4PersistencyManager * Create()
void SetVerboseLevel(G4int v)
◆ SetHepMCObjyReaderFile()
void G4PersistencyCenter::SetHepMCObjyReaderFile |
( |
const G4String & | file | ) |
|
Definition at line 138 of file G4PersistencyCenter.cc.
139{
141 {
143 }
144}
void SetRetrieveMode(const G4String &objName, G4bool mode)
G4bool SetReadFile(const G4String &objName, const G4String &readFileName)
◆ SetPersistencyManager()
◆ SetReadFile()
Definition at line 228 of file G4PersistencyCenter.cc.
230{
231#ifndef WIN32
232 if(f_ut.FileExists(readFileName))
233 {
234 f_readFileName[objName] = readFileName;
235 }
236 else
237 {
238 G4cerr <<
"!! File \"" << objName <<
"\" does not exist." <<
G4endl;
239 return false;
240 }
241#endif
242 return true;
243}
Referenced by SetHepMCObjyReaderFile().
◆ SetRetrieveMode()
void G4PersistencyCenter::SetRetrieveMode |
( |
const G4String & | objName, |
|
|
G4bool | mode ) |
Definition at line 173 of file G4PersistencyCenter.cc.
174{
175 if((*(f_readFileName.find(objName))).second != "")
176 {
177 f_readFileMode[objName] = mode;
178 }
179 else
180 {
181 G4cerr <<
"!! unknown object type " << objName <<
" for input." <<
G4endl;
182 }
183}
Referenced by SetHepMCObjyReaderFile().
◆ SetStoreMode()
Definition at line 160 of file G4PersistencyCenter.cc.
161{
162 if((*(f_writeFileName.find(objName))).second != "")
163 {
164 f_writeFileMode[objName] = mode;
165 }
166 else
167 {
168 G4cerr <<
"!! unknown object type " << objName <<
" for output." <<
G4endl;
169 }
170}
◆ SetVerboseLevel()
void G4PersistencyCenter::SetVerboseLevel |
( |
G4int | v | ) |
|
Definition at line 458 of file G4PersistencyCenter.cc.
459{
460 m_verbose = v;
461 if(f_currentManager != nullptr)
462 f_currentManager->SetVerboseLevel(m_verbose);
463}
◆ SetWriteFile()
Definition at line 212 of file G4PersistencyCenter.cc.
214{
215 if((*(f_writeFileName.find(objName))).second != "")
216 {
217 f_writeFileName[objName] = writeFileName;
218 }
219 else
220 {
221 G4cerr <<
"!! unknown object type " << objName <<
" for output." <<
G4endl;
222 return false;
223 }
224 return true;
225}
◆ VerboseLevel()
G4int G4PersistencyCenter::VerboseLevel |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: