#include <G4CsvRFileManager.hh>
Definition at line 43 of file G4CsvRFileManager.hh.
◆ G4CsvRFileManager() [1/2]
Definition at line 38 of file G4CsvRFileManager.cc.
40{
41
42 fH1RFileManager = std::make_shared<G4CsvHnRFileManager<histo::h1d>>(
this);
43 fH2RFileManager = std::make_shared<G4CsvHnRFileManager<histo::h2d>>(
this);
44 fH3RFileManager = std::make_shared<G4CsvHnRFileManager<histo::h3d>>(
this);
45 fP1RFileManager = std::make_shared<G4CsvHnRFileManager<histo::p1d>>(
this);
46 fP2RFileManager = std::make_shared<G4CsvHnRFileManager<histo::p2d>>(
this);
47}
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
◆ G4CsvRFileManager() [2/2]
G4CsvRFileManager::G4CsvRFileManager |
( |
| ) |
|
|
delete |
◆ ~G4CsvRFileManager()
G4CsvRFileManager::~G4CsvRFileManager |
( |
| ) |
|
|
override |
Definition at line 50 of file G4CsvRFileManager.cc.
51{
52 for ( auto& rfile : fRFiles ) {
53 delete rfile.second;
54 }
55}
◆ CloseFiles()
void G4CsvRFileManager::CloseFiles |
( |
| ) |
|
|
inlinefinalvirtual |
◆ GetFileType()
G4String G4CsvRFileManager::GetFileType |
( |
| ) |
const |
|
inlinefinalvirtual |
◆ GetRFile()
std::ifstream * G4CsvRFileManager::GetRFile |
( |
const G4String & |
fileName | ) |
const |
Definition at line 89 of file G4CsvRFileManager.cc.
90{
91 auto it = fRFiles.find(fileName);
92 if (it != fRFiles.end()) {
93 return it->second;
94 }
95 return nullptr;
96}
◆ OpenRFile()
Definition at line 62 of file G4CsvRFileManager.cc.
63{
64 Message(
kVL4,
"open",
"read analysis file", fileName);
65
66
67 auto newFile = new std::ifstream(fileName);
68 if ( ! newFile->is_open() ) {
69 Warn(
"Cannot open file " + fileName, fkClass,
"OpenRFile");
70 return false;
71 }
72
73
74 auto it = fRFiles.find(fileName);
75 if ( it != fRFiles.end() ) {
76 delete it->second;
77 it->second = newFile;
78 }
79 else {
80 fRFiles[fileName] = newFile;
81 }
82
83 Message(
kVL1,
"open",
"read analysis file", fileName);
84
85 return true;
86}
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: