Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:57

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 base class for read Ntuple manager.
0028 // It defines functions independent from the output type.
0029 //
0030 // Author: Ivana Hrivnacova, 20/07/2017 (ivana@ipno.in2p3.fr)
0031 
0032 #ifndef G4BaseRNtupleManager_h
0033 #define G4BaseRNtupleManager_h 1
0034 
0035 #include "G4VRNtupleManager.hh"
0036 #include "globals.hh"
0037 
0038 #include <vector>
0039 
0040 class G4BaseRNtupleManager : public G4VRNtupleManager
0041 {
0042   // Disable using the object managers outside G4VAnalysisManager and
0043   // its messenger
0044   friend class G4VAnalysisReader;
0045 
0046   public:
0047     explicit G4BaseRNtupleManager(const G4AnalysisManagerState& state);
0048     ~G4BaseRNtupleManager() override = default;
0049 
0050     // deleted default &copy constructors & assignment operator
0051     G4BaseRNtupleManager() = delete;
0052     G4BaseRNtupleManager(const G4BaseRNtupleManager& rhs) = delete;
0053     G4BaseRNtupleManager& operator=(const G4BaseRNtupleManager& rhs) = delete;
0054 
0055   protected:
0056     // Methods to read ntuple from a file
0057     // Methods for ntuple with id = FirstNtupleId
0058     G4bool SetNtupleIColumn(const G4String& columnName, G4int& value) final;
0059     G4bool SetNtupleFColumn(const G4String& columnName, G4float& value) final;
0060     G4bool SetNtupleDColumn(const G4String& columnName, G4double& value) final;
0061     G4bool SetNtupleSColumn(const G4String& columnName, G4String& value) final;
0062     // Methods for ntuple with id > FirstNtupleId
0063     G4bool SetNtupleIColumn(G4int ntupleId, const G4String& columnName, G4int& value) override = 0;
0064     G4bool SetNtupleFColumn(
0065       G4int ntupleId, const G4String& columnName, G4float& value) override = 0;
0066     G4bool SetNtupleDColumn(
0067       G4int ntupleId, const G4String& columnName, G4double& value) override = 0;
0068     G4bool SetNtupleSColumn(
0069       G4int ntupleId, const G4String& columnName, G4String& value) override = 0;
0070     // Bind the ntuple columns of vector type
0071     // Methods for ntuple with id = FirstNtupleId
0072     G4bool SetNtupleIColumn(const G4String& columnName, std::vector<G4int>& vector) final;
0073     G4bool SetNtupleFColumn(const G4String& columnName, std::vector<G4float>& vector) final;
0074     G4bool SetNtupleDColumn(const G4String& columnName, std::vector<G4double>& vector) final;
0075     G4bool SetNtupleSColumn(const G4String& columnName, std::vector<std::string>& vector) final;
0076     // Methods for ntuple with id > FirstNtupleId
0077     G4bool SetNtupleIColumn(
0078       G4int ntupleId, const G4String& columnName, std::vector<G4int>& vector) override = 0;
0079     G4bool SetNtupleFColumn(
0080       G4int ntupleId, const G4String& columnName, std::vector<G4float>& vector) override = 0;
0081     G4bool SetNtupleDColumn(
0082       G4int ntupleId, const G4String& columnName, std::vector<G4double>& vector) override = 0;
0083     G4bool SetNtupleSColumn(
0084       G4int ntupleId, const G4String& columnName, std::vector<std::string>& vector) override = 0;
0085     G4bool GetNtupleRow() final;
0086     G4bool GetNtupleRow(G4int ntupleId) override = 0;
0087 
0088     // Access methods
0089     G4int GetNofNtuples() const override = 0;
0090 
0091   private:
0092     // Methods
0093     G4int GetCurrentNtupleId() const;
0094 };
0095 
0096 #endif