Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // $Id: G4CsvAnalysisReader.hh 74257 2013-10-02 14:24:55Z gcosmo $ 26 27 27 // The main manager for Csv analysis reader. 28 // The main manager for Csv analysis reader. 28 // It delegates most of functions to the objec << 29 // It delegates most of functions to the object specific managers. 29 30 30 // Author: Ivana Hrivnacova, 05/09/2014 (ivana 31 // Author: Ivana Hrivnacova, 05/09/2014 (ivana@ipno.in2p3.fr) 31 32 32 #ifndef G4CsvAnalysisReader_h 33 #ifndef G4CsvAnalysisReader_h 33 #define G4CsvAnalysisReader_h 1 34 #define G4CsvAnalysisReader_h 1 34 35 35 #include "G4ToolsAnalysisReader.hh" 36 #include "G4ToolsAnalysisReader.hh" 36 #include "globals.hh" 37 #include "globals.hh" 37 38 >> 39 #include "tools/histo/h1d" >> 40 #include "tools/histo/h2d" >> 41 #include "tools/histo/h3d" >> 42 #include "tools/histo/p1d" >> 43 #include "tools/histo/p2d" 38 #include "tools/rcsv_ntuple" 44 #include "tools/rcsv_ntuple" 39 45 40 #include <memory> << 46 class G4H1ToolsManager; 41 #include <string_view> << 47 class G4H2ToolsManager; 42 << 48 class G4H3ToolsManager; 43 class G4CsvAnalysisReader; << 49 class G4P1ToolsManager; >> 50 class G4P2ToolsManager; 44 class G4CsvRNtupleManager; 51 class G4CsvRNtupleManager; 45 class G4CsvRFileManager; 52 class G4CsvRFileManager; 46 template <class T> << 53 47 class G4ThreadLocalSingleton; << 48 << 49 class G4CsvAnalysisReader : public G4ToolsAnal 54 class G4CsvAnalysisReader : public G4ToolsAnalysisReader 50 { 55 { 51 friend class G4ThreadLocalSingleton<G4CsvAna << 52 << 53 public: 56 public: 54 ~G4CsvAnalysisReader() override; << 57 explicit G4CsvAnalysisReader(G4bool isMaster = true); 55 << 58 virtual ~G4CsvAnalysisReader(); 56 // Static methods << 59 >> 60 // static methods 57 static G4CsvAnalysisReader* Instance(); 61 static G4CsvAnalysisReader* Instance(); 58 62 59 // Access methods 63 // Access methods 60 tools::rcsv::ntuple* GetNtuple() const; 64 tools::rcsv::ntuple* GetNtuple() const; 61 tools::rcsv::ntuple* GetNtuple(G4int ntupl 65 tools::rcsv::ntuple* GetNtuple(G4int ntupleId) const; 62 using G4VAnalysisReader::GetNtuple; 66 using G4VAnalysisReader::GetNtuple; 63 << 67 64 protected: 68 protected: 65 // Virtual methods from base class << 69 // virtual methods from base class 66 G4bool CloseFilesImpl(G4bool reset) final; << 70 virtual G4int ReadH1Impl(const G4String& h1Name, const G4String& fileName, >> 71 const G4String& dirName, G4bool isUserFileName) final; >> 72 virtual G4int ReadH2Impl(const G4String& h2Name, const G4String& fileName, >> 73 const G4String& dirName, G4bool isUserFileName) final; >> 74 virtual G4int ReadH3Impl(const G4String& h3Name, const G4String& fileName, >> 75 const G4String& dirName, G4bool isUserFileName) final; >> 76 virtual G4int ReadP1Impl(const G4String& p1Name, const G4String& fileName, >> 77 const G4String& dirName, G4bool isUserFileName) final; >> 78 virtual G4int ReadP2Impl(const G4String& p2Name, const G4String& fileName, >> 79 const G4String& dirName, G4bool isUserFileName) final; >> 80 virtual G4int ReadNtupleImpl(const G4String& ntupleName, const G4String& fileName, >> 81 const G4String& dirName, G4bool isUserFileName) final; 67 82 68 private: 83 private: 69 G4CsvAnalysisReader(); << 84 // static data members 70 << 85 static G4CsvAnalysisReader* fgMasterInstance; 71 // Static data members << 86 static G4ThreadLocal G4CsvAnalysisReader* fgInstance; 72 inline static G4CsvAnalysisReader* fgMaste << 87 73 << 88 // methods 74 // Methods << 89 G4String GetHnFileName(const G4String& hnType, >> 90 const G4String& hnName, >> 91 const G4String& baseFileName, >> 92 G4bool isUserFileName) const; >> 93 75 G4bool Reset(); 94 G4bool Reset(); 76 95 77 // Static data members << 96 // data members 78 static constexpr std::string_view fkClass << 97 G4CsvRNtupleManager* fNtupleManager; 79 << 98 G4CsvRFileManager* fFileManager; 80 // Data members << 81 std::shared_ptr<G4CsvRNtupleManager> fNtup << 82 std::shared_ptr<G4CsvRFileManager> fFile << 83 }; 99 }; 84 100 85 #include "G4CsvAnalysisReader.icc" 101 #include "G4CsvAnalysisReader.icc" 86 102 87 #endif 103 #endif 88 104 89 105