Warning, file /include/Geant4/G4BaseFileManager.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 G4BaseFileManager_h
0032 #define G4BaseFileManager_h 1
0033
0034 #include "G4AnalysisManagerState.hh"
0035 #include "globals.hh"
0036
0037 #include <vector>
0038
0039 class G4BaseFileManager
0040 {
0041 public:
0042 explicit G4BaseFileManager(const G4AnalysisManagerState& state);
0043 G4BaseFileManager() = delete;
0044 virtual ~G4BaseFileManager() = default;
0045
0046 void SetCompressionLevel(G4int level);
0047
0048 virtual G4bool SetFileName(const G4String& fileName);
0049
0050 virtual G4String GetFileType() const;
0051
0052 virtual G4bool HasCycles() const;
0053
0054
0055
0056
0057 void AddFileName(const G4String& fileName);
0058
0059
0060
0061 G4int GetCompressionLevel() const;
0062
0063 G4String GetFileName() const;
0064
0065 G4String GetFullFileName(const G4String& baseFileName = "",
0066 G4bool isPerThread = true) const;
0067
0068
0069
0070 const std::vector<G4String>& GetFileNames() const;
0071
0072
0073 G4String GetHnFileName(const G4String& hnType,
0074 const G4String& hnName) const;
0075
0076
0077
0078
0079 G4String GetHnFileName(const G4String& fileName,
0080 G4int cycle = 0) const;
0081
0082
0083
0084 G4String GetNtupleFileName(const G4String& ntupleName,
0085 G4int cycle = 0) const;
0086
0087
0088
0089
0090
0091
0092 G4String GetNtupleFileName(G4int ntupleFileNumber,
0093 G4int cycle = 0) const;
0094
0095
0096
0097
0098
0099 G4String GetPlotFileName() const;
0100
0101
0102 protected:
0103
0104 void Message(G4int level,
0105 const G4String& action,
0106 const G4String& objectType,
0107 const G4String& objectName = "",
0108 G4bool success = true) const;
0109
0110
0111 void ClearData();
0112
0113
0114 const G4AnalysisManagerState& fState;
0115 G4int fCompressionLevel { 1 };
0116 G4String fFileName;
0117 std::vector<G4String> fFileNames;
0118 };
0119
0120 inline void G4BaseFileManager::SetCompressionLevel(G4int level)
0121 { fCompressionLevel = level; }
0122
0123 inline G4bool G4BaseFileManager::SetFileName(const G4String& fileName) {
0124
0125 fFileName = fileName;
0126 return true;
0127 }
0128
0129 inline G4bool G4BaseFileManager::HasCycles() const {
0130 return false;
0131 }
0132
0133 inline G4int G4BaseFileManager::GetCompressionLevel() const
0134 { return fCompressionLevel; }
0135
0136 inline G4String G4BaseFileManager::GetFileName() const {
0137 return fFileName;
0138 }
0139
0140 inline const std::vector<G4String>& G4BaseFileManager::GetFileNames() const {
0141 return fFileNames;
0142 }
0143
0144 inline void G4BaseFileManager::Message(
0145 G4int level, const G4String& action, const G4String& objectType,
0146 const G4String& objectName, G4bool success) const
0147 {
0148 fState.Message(level, action, objectType, objectName, success);
0149 }
0150
0151 inline void G4BaseFileManager::ClearData() {
0152 fFileNames.clear();
0153 }
0154
0155 #endif