Warning, file /include/Geant4/G4HnManager.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
0032
0033 #ifndef G4HnManager_h
0034 #define G4HnManager_h 1
0035
0036 #include "G4BaseAnalysisManager.hh"
0037 #include "G4HnInformation.hh"
0038 #include "globals.hh"
0039
0040 #include <set>
0041 #include <string_view>
0042 #include <utility>
0043 #include <vector>
0044
0045 class G4VFileManager;
0046 class G4HnMessenger;
0047
0048 class G4HnManager : public G4BaseAnalysisManager
0049 {
0050 public:
0051 G4HnManager(G4String hnType, const G4AnalysisManagerState& state);
0052 G4HnManager() = delete;
0053 ~G4HnManager() override;
0054
0055 void CreateMessenger();
0056
0057
0058 void AddHnInformation(G4HnInformation* info);
0059 void AddHnInformation(G4HnInformation* info, G4int index);
0060
0061 void SetHnDeleted(G4HnInformation* info, G4bool keepSetting);
0062 void ClearData();
0063
0064
0065 G4HnInformation* GetHnInformation(G4int id,
0066 std::string_view functionName,
0067 G4bool warn = true) const;
0068
0069 G4HnDimensionInformation* GetHnDimensionInformation(G4int id,
0070 G4int dimension,
0071 std::string_view functionName,
0072 G4bool warn = true) const;
0073
0074 const std::vector<G4HnInformation*>& GetHnVector() const;
0075 G4int GetNofActiveHns() const;
0076 G4String GetHnType() const;
0077
0078
0079
0080
0081
0082 G4bool IsActive() const;
0083
0084
0085
0086
0087
0088 G4bool IsAscii() const;
0089
0090
0091
0092
0093
0094 G4bool IsPlotting() const;
0095
0096
0097 G4bool IsFileName() const;
0098
0099
0100
0101 void SetActivation(G4bool activation);
0102 void SetActivation(G4int id, G4bool activation);
0103 void SetAscii(G4int id, G4bool ascii);
0104 void SetPlotting(G4int id, G4bool plotting);
0105 void SetPlotting(G4bool plotting);
0106 void SetFileName(G4int id, const G4String& fileName);
0107 void SetFileName(const G4String& fileName);
0108 G4bool SetAxisIsLog(unsigned int idim, G4int id, G4bool isLogAxis);
0109
0110
0111
0112 G4String GetName(G4int id) const;
0113 G4double GetUnit(unsigned int idim, G4int id) const;
0114 G4bool GetAxisIsLog(unsigned int idim, G4int id) const;
0115 G4bool GetActivation(G4int id) const;
0116 G4bool GetAscii(G4int id) const;
0117 G4bool GetPlotting(G4int id) const;
0118 G4String GetFileName(G4int id) const;
0119
0120 void SetFileManager(std::shared_ptr<G4VFileManager> fileManager);
0121 void SetDefaultFileType(const G4String& fileType);
0122
0123 private:
0124
0125 void SetActivation(G4HnInformation* info, G4bool activation);
0126 void SetPlotting(G4HnInformation* info, G4bool plotting);
0127 void SetFileName(G4HnInformation* info, const G4String& fileName);
0128
0129
0130 static constexpr std::string_view fkClass { "G4HnManager" };
0131
0132
0133 G4String fHnType;
0134 G4String fDefaultFileType;
0135 G4int fNofActiveObjects { 0 };
0136 G4int fNofAsciiObjects { 0 };
0137 G4int fNofPlottingObjects { 0 };
0138 G4int fNofFileNameObjects { 0 };
0139
0140
0141 std::vector<G4HnInformation*> fHnVector;
0142 std::set<G4int> fFreeIds;
0143 std::shared_ptr<G4VFileManager> fFileManager { nullptr };
0144
0145
0146 std::unique_ptr<G4HnMessenger> fMessenger;
0147 };
0148
0149 inline G4int G4HnManager::GetNofActiveHns() const
0150 { return fNofActiveObjects; }
0151
0152 inline G4String G4HnManager::GetHnType() const
0153 { return fHnType; }
0154
0155 inline const std::vector<G4HnInformation*>& G4HnManager::GetHnVector() const
0156 { return fHnVector; }
0157
0158 inline void G4HnManager::SetFileManager(std::shared_ptr<G4VFileManager> fileManager)
0159 {
0160 fFileManager = std::move(fileManager);
0161 }
0162
0163 inline void G4HnManager::SetDefaultFileType(const G4String& fileType)
0164 {
0165 fDefaultFileType = fileType;
0166 }
0167
0168 #endif