#include <G4RootRFileManager.hh>
Definition at line 41 of file G4RootRFileManager.hh.
◆ G4RootRFileManager() [1/2]
Definition at line 42 of file G4RootRFileManager.cc.
44{
45
46 fH1RFileManager = std::make_shared<G4RootHnRFileManager<histo::h1d>>(
this);
47 fH2RFileManager = std::make_shared<G4RootHnRFileManager<histo::h2d>>(
this);
48 fH3RFileManager = std::make_shared<G4RootHnRFileManager<histo::h3d>>(
this);
49 fP1RFileManager = std::make_shared<G4RootHnRFileManager<histo::p1d>>(
this);
50 fP2RFileManager = std::make_shared<G4RootHnRFileManager<histo::p2d>>(
this);
51}
std::shared_ptr< G4VTHnRFileManager< tools::histo::h2d > > fH2RFileManager
std::shared_ptr< G4VTHnRFileManager< tools::histo::p2d > > fP2RFileManager
std::shared_ptr< G4VTHnRFileManager< tools::histo::h3d > > fH3RFileManager
std::shared_ptr< G4VTHnRFileManager< tools::histo::p1d > > fP1RFileManager
std::shared_ptr< G4VTHnRFileManager< tools::histo::h1d > > fH1RFileManager
◆ G4RootRFileManager() [2/2]
G4RootRFileManager::G4RootRFileManager |
( |
| ) |
|
|
delete |
◆ ~G4RootRFileManager()
G4RootRFileManager::~G4RootRFileManager |
( |
| ) |
|
|
override |
Definition at line 54 of file G4RootRFileManager.cc.
55{
56
57 for ( auto& mapElement : fRFiles ) {
58 auto rfileTuple = mapElement.second;
59 delete std::get<1>(*rfileTuple);
60 delete std::get<2>(*rfileTuple);;
61 delete std::get<0>(*rfileTuple);
62 delete rfileTuple;
63 }
64}
◆ CloseFiles()
void G4RootRFileManager::CloseFiles |
( |
| ) |
|
|
inlinefinalvirtual |
◆ GetFileType()
G4String G4RootRFileManager::GetFileType |
( |
| ) |
const |
|
inlinefinalvirtual |
◆ GetRFile()
Definition at line 107 of file G4RootRFileManager.cc.
109{
110
112
113 auto it = fRFiles.find(name);
114 if (it != fRFiles.end()) {
115 return it->second;
116 }
117 return nullptr;
118}
G4String GetFullFileName(const G4String &baseFileName="", G4bool isPerThread=true) const
const char * name(G4int ptype)
◆ OpenRFile()
Definition at line 71 of file G4RootRFileManager.cc.
73{
74
76
78
79
80 auto newFile =
new tools::rroot::file(
G4cout, name);
81 newFile->add_unziper('Z',toolx::decompress_buffer);
82
83 if ( ! newFile->is_open() ) {
84 Warn(
"Cannot open file " + name, fkClass,
"OpenRFile");
85 delete newFile;
86 return false;
87 }
88
89 auto newFileTuple =
new G4RootRFile(newFile,
nullptr,
nullptr);
90
91
92 auto it = fRFiles.find(name);
93 if ( it != fRFiles.end() ) {
94 delete it->second;
95 it->second = newFileTuple;
96 }
97 else {
98 fRFiles[
name] = newFileTuple;
99 }
100
102
103 return true;
104}
std::tuple< tools::rroot::file *, tools::rroot::directory *, tools::rroot::directory * > G4RootRFile
G4GLOB_DLL std::ostream G4cout
void Message(G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)
The documentation for this class was generated from the following files: