File indexing completed on 2025-01-18 09:59:27
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 G4VTBaseHnManager_h
0032 #define G4VTBaseHnManager_h 1
0033
0034 #include "G4HnInformation.hh"
0035 #include "globals.hh"
0036
0037 #include <vector>
0038 #include <memory>
0039 #include <array>
0040
0041 class G4HnManager;
0042
0043 template <unsigned int DIM>
0044 class G4VTBaseHnManager
0045 {
0046
0047 friend class G4VAnalysisManager;
0048 friend class G4VAnalysisReader;
0049
0050 public:
0051 G4VTBaseHnManager() = default;
0052 virtual ~G4VTBaseHnManager() = default;
0053
0054
0055 G4VTBaseHnManager(const G4VTBaseHnManager& rhs) = delete;
0056 G4VTBaseHnManager& operator=(const G4VTBaseHnManager& rhs) = delete;
0057
0058
0059 virtual G4int Create(const G4String& name, const G4String& title,
0060 const std::array<G4HnDimension, DIM>& bins,
0061 const std::array<G4HnDimensionInformation, DIM>& hnInfo) = 0;
0062
0063
0064
0065
0066
0067 virtual G4bool Set(G4int id,
0068 const std::array<G4HnDimension, DIM>& bins,
0069 const std::array<G4HnDimensionInformation, DIM>& hnInfo) = 0;
0070
0071
0072
0073
0074
0075 virtual G4bool Scale(G4int id, G4double factor) = 0;
0076
0077
0078 virtual G4bool Fill(G4int id, std::array<G4double, DIM> value, G4double weight = 1.0) = 0;
0079
0080
0081 virtual G4int GetId(const G4String& name, G4bool warn = true) const = 0;
0082 virtual G4int GetNofHns(G4bool onlyExisting) const = 0;
0083
0084
0085 virtual G4int GetNbins(unsigned int idim, G4int id) const = 0;
0086 virtual G4double GetMinValue(unsigned int idim, G4int id) const = 0;
0087 virtual G4double GetMaxValue(unsigned int idim, G4int id) const = 0;
0088 virtual G4double GetWidth(unsigned int idim, G4int id) const = 0;
0089
0090
0091 virtual G4bool SetTitle(G4int id, const G4String& title) = 0;
0092 virtual G4bool SetAxisTitle(unsigned int idim, G4int id, const G4String& title) = 0;
0093
0094
0095 virtual G4String GetTitle(G4int id) const = 0;
0096 virtual G4String GetAxisTitle(unsigned int idim, G4int id) const = 0;
0097
0098
0099 virtual G4bool WriteOnAscii(std::ofstream& output) = 0;
0100 virtual G4bool List(std::ostream& output, G4bool onlyIfActive = true) = 0;
0101
0102
0103 virtual G4bool Delete(G4int id, G4bool keepSetting) = 0;
0104
0105 virtual std::shared_ptr<G4HnManager> GetHnManager() = 0;
0106 virtual const std::shared_ptr<G4HnManager> GetHnManager() const = 0;
0107 };
0108
0109 #endif