Warning, file /include/Geant4/G4GenericFileManager.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef G4GenericFileManager_h
0032 #define G4GenericFileManager_h 1
0033
0034 #include "G4VFileManager.hh"
0035 #include "G4AnalysisUtilities.hh"
0036 #include "globals.hh"
0037
0038 #include <vector>
0039 #include <memory>
0040 #include <string_view>
0041
0042 class G4HnInformation;
0043 class G4VNtupleFileManager;
0044
0045 class G4CsvFileManager;
0046 #ifdef TOOLS_USE_HDF5
0047 class G4Hdf5FileManager;
0048 #endif
0049 class G4RootFileManager;
0050 class G4XmlFileManager;
0051
0052 class G4GenericFileManager : public G4VFileManager
0053 {
0054 public:
0055 explicit G4GenericFileManager(const G4AnalysisManagerState& state);
0056 ~G4GenericFileManager() override = default;
0057
0058
0059 G4bool OpenFile(const G4String& fileName) final;
0060
0061
0062 virtual G4bool OpenFiles() final;
0063 G4bool WriteFiles() final;
0064 G4bool CloseFiles() final;
0065 G4bool DeleteEmptyFiles() final;
0066
0067
0068 void Clear() final;
0069
0070
0071 G4bool CreateFile(const G4String& fileName) final;
0072 G4bool WriteFile(const G4String& fileName) final;
0073 G4bool CloseFile(const G4String& fileName) final;
0074 G4bool SetIsEmpty(const G4String& fileName, G4bool isEmpty) final;
0075
0076 G4bool SetHistoDirectoryName(const G4String& dirName) override;
0077 G4bool SetNtupleDirectoryName(const G4String& dirName) override;
0078
0079 G4String GetFileType() const final { return ""; }
0080
0081
0082
0083 void SetDefaultFileType(const G4String& value);
0084 G4String GetDefaultFileType() const;
0085
0086
0087 std::shared_ptr<G4VFileManager> GetFileManager(const G4String& fileName);
0088
0089 template <typename HT>
0090 G4bool WriteTExtra(const G4String& fileName, HT* ht, const G4String& htName);
0091
0092
0093 std::shared_ptr<G4VNtupleFileManager> CreateNtupleFileManager(G4AnalysisOutput output);
0094
0095 private:
0096
0097 void CreateFileManager(G4AnalysisOutput output);
0098 std::shared_ptr<G4VFileManager> GetFileManager(G4AnalysisOutput output) const;
0099
0100
0101 static constexpr std::string_view fkClass { "G4GenericFileManager" };
0102
0103
0104
0105
0106 G4String fDefaultFileType;
0107 std::shared_ptr<G4VFileManager> fDefaultFileManager { nullptr };
0108 std::vector<std::shared_ptr<G4VFileManager>> fFileManagers {
0109
0110 nullptr, nullptr, nullptr, nullptr
0111 };
0112 std::shared_ptr<G4CsvFileManager> fCsvFileManager { nullptr };
0113 #ifdef TOOLS_USE_HDF5
0114 std::shared_ptr<G4Hdf5FileManager> fHdf5FileManager { nullptr };
0115 #endif
0116 std::shared_ptr<G4RootFileManager> fRootFileManager { nullptr };
0117 std::shared_ptr<G4XmlFileManager> fXmlFileManager { nullptr };
0118 G4bool fHdf5Warn { true };
0119 };
0120
0121 #include "G4GenericFileManager.icc"
0122
0123 #endif
0124