Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Manager class for Xml read ntuples.
0028 // It implements functions specific to Xml read ntuples.
0029 //
0030 // Author: Ivana Hrivnacova, 25/07/2014 (ivana@ipno.in2p3.fr)
0031 
0032 #ifndef G4XmlRNtupleManager_h
0033 #define G4XmlRNtupleManager_h 1
0034 
0035 #include "G4TRNtupleManager.hh"
0036 #include "globals.hh"
0037 
0038 #include "toolx/raxml"
0039 
0040 #include <string_view>
0041 #include <utility>
0042 #include <vector>
0043 
0044 class G4XmlRFileManager;
0045 struct G4XmlRNtupleDescription;
0046 
0047 class G4XmlRNtupleManager : public G4TRNtupleManager<tools::aida::ntuple>
0048 {
0049   friend class G4XmlAnalysisReader;
0050 
0051   public:
0052     explicit G4XmlRNtupleManager(const G4AnalysisManagerState& state);
0053     G4XmlRNtupleManager() = delete;
0054     ~G4XmlRNtupleManager() override = default;
0055 
0056   protected:
0057     // Set methods
0058     void SetFileManager(std::shared_ptr<G4XmlRFileManager> fileManager);
0059 
0060     // Methods from base classes
0061     using G4BaseRNtupleManager::SetNtupleIColumn;
0062     using G4BaseRNtupleManager::SetNtupleFColumn;
0063     using G4BaseRNtupleManager::SetNtupleDColumn;
0064     using G4TRNtupleManager<tools::aida::ntuple>::SetNtupleIColumn;
0065     using G4TRNtupleManager<tools::aida::ntuple>::SetNtupleFColumn;
0066     using G4TRNtupleManager<tools::aida::ntuple>::SetNtupleDColumn;
0067     using G4TRNtupleManager<tools::aida::ntuple>::SetNtupleSColumn;
0068 
0069     // Override base class functions for vector columns
0070     // in order to fill the maps
0071 
0072     G4bool SetNtupleIColumn(
0073       G4int ntupleId, const G4String& columnName, std::vector<G4int>& vector) final;
0074     G4bool SetNtupleFColumn(
0075       G4int ntupleId, const G4String& columnName, std::vector<G4float>& vector) final;
0076     G4bool SetNtupleDColumn(
0077       G4int ntupleId, const G4String& columnName, std::vector<G4double>& vector) final;
0078     G4bool SetNtupleSColumn(
0079       G4int ntupleId, const G4String& columnName, std::vector<std::string>& vector) final;
0080 
0081   private:
0082     // Methods from the base class
0083     G4int ReadNtupleImpl(const G4String& ntupleName, const G4String& fileName,
0084       const G4String& dirName, G4bool isUserFileName) final;
0085     G4bool GetTNtupleRow(G4TRNtupleDescription<tools::aida::ntuple>* ntupleDescription) final;
0086 
0087     // Static data members
0088     static constexpr std::string_view fkClass { "G4XmlRNtupleManager" };
0089 
0090     // Data members
0091     std::shared_ptr<G4XmlRFileManager>  fFileManager { nullptr };
0092 };
0093 
0094 inline void
0095 G4XmlRNtupleManager::SetFileManager(std::shared_ptr<G4XmlRFileManager> fileManager)
0096 {
0097   fFileManager = std::move(fileManager);
0098 }
0099 
0100 #endif