Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:12

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 
0027 // The common implementation of analysis reader classes.
0028 
0029 // Author: Ivana Hrivnacova, 20/07/2015  (ivana@ipno.in2p3.fr)
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     // Access methods
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     // Virtual methods from base class
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     // Fuction specific to output type
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     // Methods
0087     G4bool Reset();
0088 
0089     // Static data members
0090     static constexpr std::string_view fkClass { "G4ToolsAnalysisReader" };
0091 
0092     // Data members
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