File indexing completed on 2025-01-18 09:59:12
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 G4ToolsAnalysisReader_h
0032 #define G4ToolsAnalysisReader_h 1
0033
0034 #include "G4VAnalysisReader.hh"
0035 #include "G4THnManager.hh"
0036 #include "globals.hh"
0037
0038 #include "tools/histo/h1d"
0039 #include "tools/histo/h2d"
0040 #include "tools/histo/h3d"
0041 #include "tools/histo/p1d"
0042 #include "tools/histo/p2d"
0043
0044 template <unsigned int DIM, typename HT>
0045 class G4THnToolsManager;
0046
0047 namespace tools {
0048 namespace histo {
0049 class hmpi;
0050 }
0051 }
0052
0053 class G4ToolsAnalysisReader : public G4VAnalysisReader
0054 {
0055 public:
0056 ~G4ToolsAnalysisReader() override = default;
0057
0058
0059 tools::histo::h1d* GetH1(G4int id, G4bool warn = true) const;
0060 tools::histo::h2d* GetH2(G4int id, G4bool warn = true) const;
0061 tools::histo::h3d* GetH3(G4int id, G4bool warn = true) const;
0062 tools::histo::p1d* GetP1(G4int id, G4bool warn = true) const;
0063 tools::histo::p2d* GetP2(G4int id, G4bool warn = true) const;
0064
0065 protected:
0066 explicit G4ToolsAnalysisReader(const G4String& type);
0067
0068
0069 G4int ReadH1Impl(const G4String& h1Name, const G4String& fileName, const G4String& dirName,
0070 G4bool isUserFileName) final;
0071 G4int ReadH2Impl(const G4String& h2Name, const G4String& fileName, const G4String& dirName,
0072 G4bool isUserFileName) final;
0073 G4int ReadH3Impl(const G4String& h3Name, const G4String& fileName, const G4String& dirName,
0074 G4bool isUserFileName) final;
0075 G4int ReadP1Impl(const G4String& p1Name, const G4String& fileName, const G4String& dirName,
0076 G4bool isUserFileName) final;
0077 G4int ReadP2Impl(const G4String& p2Name, const G4String& fileName, const G4String& dirName,
0078 G4bool isUserFileName) final;
0079
0080
0081 template <typename HT>
0082 G4int ReadTImpl(const G4String& htName, const G4String& fileName,
0083 const G4String& dirName, G4bool isUserFileName,
0084 G4THnManager<HT>* htManager);
0085
0086
0087 G4bool Reset();
0088
0089
0090 static constexpr std::string_view fkClass { "G4ToolsAnalysisReader" };
0091
0092
0093 G4THnToolsManager<kDim1, tools::histo::h1d>* fH1Manager { nullptr };
0094 G4THnToolsManager<kDim2, tools::histo::h2d>* fH2Manager { nullptr };
0095 G4THnToolsManager<kDim3, tools::histo::h3d>* fH3Manager { nullptr };
0096 G4THnToolsManager<kDim2, tools::histo::p1d>* fP1Manager { nullptr };
0097 G4THnToolsManager<kDim3, tools::histo::p2d>* fP2Manager { nullptr };
0098 };
0099
0100 #include "G4ToolsAnalysisReader.icc"
0101
0102 #endif