Back to home page

EIC code displayed by LXR

 
 

    


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

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