Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -36,39 +36,42 @@
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
#include <string_view>
|
||||
|
||||
// TN - ntuple type, TF - file type
|
||||
template <typename TN, typename TF>
|
||||
// NT - ntuple type, FT - file type
|
||||
template <typename NT, typename FT>
|
||||
class G4TNtupleManager : public G4BaseNtupleManager {
|
||||
|
||||
public:
|
||||
explicit G4TNtupleManager(const G4AnalysisManagerState& state);
|
||||
G4TNtupleManager() = delete;
|
||||
~G4TNtupleManager();
|
||||
|
||||
protected:
|
||||
// Methods to manipulate ntuples
|
||||
// Methods to manipulate ntuples
|
||||
virtual G4int CreateNtuple(G4NtupleBooking* ntupleBooking) override;
|
||||
|
||||
virtual void CreateNtuplesFromBooking(
|
||||
const std::vector<G4NtupleBooking*>& ntupleBookings);
|
||||
// virtual void CreateNtuplesFromBooking();
|
||||
virtual G4bool Reset(G4bool deleteNtuple);
|
||||
|
||||
virtual G4bool Reset();
|
||||
virtual void Clear() override;
|
||||
|
||||
// Methods to create ntuples
|
||||
// are implemented in G4NtupleBookingManager base class
|
||||
|
||||
// Methods to fill ntuples
|
||||
// Methods for ntuple with id = FirstNtupleId (from base class)
|
||||
// Methods for ntuple with id = FirstNtupleId (from base class)
|
||||
using G4BaseNtupleManager::FillNtupleIColumn;
|
||||
using G4BaseNtupleManager::FillNtupleFColumn;
|
||||
using G4BaseNtupleManager::FillNtupleDColumn;
|
||||
using G4BaseNtupleManager::FillNtupleSColumn;
|
||||
using G4BaseNtupleManager::AddNtupleRow;
|
||||
// Methods for ntuple with id > FirstNtupleId (when more ntuples exist)
|
||||
// Methods for ntuple with id > FirstNtupleId (when more ntuples exist)
|
||||
virtual G4bool FillNtupleIColumn(G4int ntupleId, G4int columnId, G4int value) final;
|
||||
virtual G4bool FillNtupleFColumn(G4int ntupleId, G4int columnId, G4float value) final;
|
||||
virtual G4bool FillNtupleDColumn(G4int ntupleId, G4int columnId, G4double value) final;
|
||||
virtual G4bool FillNtupleSColumn(G4int ntupleId, G4int columnId,
|
||||
virtual G4bool FillNtupleSColumn(G4int ntupleId, G4int columnId,
|
||||
const G4String& value) final;
|
||||
virtual G4bool AddNtupleRow(G4int ntupleId) override;
|
||||
|
||||
@@ -79,45 +82,48 @@ class G4TNtupleManager : public G4BaseNtupleManager {
|
||||
virtual G4bool GetActivation(G4int ntupleId) const final;
|
||||
|
||||
// Access methods
|
||||
TN* GetNtuple() const;
|
||||
TN* GetNtuple(G4int ntupleId) const;
|
||||
NT* GetNtuple() const;
|
||||
NT* GetNtuple(G4int ntupleId) const;
|
||||
virtual G4int GetNofNtuples() const final;
|
||||
|
||||
// Iterators
|
||||
typename std::vector<TN*>::iterator BeginNtuple();
|
||||
typename std::vector<TN*>::iterator EndNtuple();
|
||||
typename std::vector<TN*>::const_iterator BeginConstNtuple() const;
|
||||
typename std::vector<TN*>::const_iterator EndConstNtuple() const;
|
||||
|
||||
typename std::vector<NT*>::iterator BeginNtuple();
|
||||
typename std::vector<NT*>::iterator EndNtuple();
|
||||
typename std::vector<NT*>::const_iterator BeginConstNtuple() const;
|
||||
typename std::vector<NT*>::const_iterator EndConstNtuple() const;
|
||||
|
||||
// Data members
|
||||
std::vector<G4TNtupleDescription<TN, TF>*> fNtupleDescriptionVector;
|
||||
std::vector<TN*> fNtupleVector;
|
||||
std::vector<G4TNtupleDescription<NT, FT>*> fNtupleDescriptionVector;
|
||||
std::vector<NT*> fNtupleVector;
|
||||
|
||||
private:
|
||||
// methods
|
||||
// Methods
|
||||
|
||||
// Fuctions which are specific to output type
|
||||
//
|
||||
virtual void CreateTNtupleFromBooking(
|
||||
G4TNtupleDescription<TN, TF>* ntupleDescription) = 0;
|
||||
G4TNtupleDescription<NT, FT>* ntupleDescription) = 0;
|
||||
|
||||
virtual void FinishTNtuple(
|
||||
G4TNtupleDescription<TN, TF>* ntupleDescription,
|
||||
G4TNtupleDescription<NT, FT>* ntupleDescription,
|
||||
G4bool fromBooking) = 0;
|
||||
|
||||
// Common implementation
|
||||
//
|
||||
|
||||
G4TNtupleDescription<TN, TF>* GetNtupleDescriptionInFunction(G4int id,
|
||||
G4String function,
|
||||
G4TNtupleDescription<NT, FT>* GetNtupleDescriptionInFunction(G4int id,
|
||||
std::string_view function,
|
||||
G4bool warn = true) const;
|
||||
TN* GetNtupleInFunction(G4int id,
|
||||
G4String function,
|
||||
NT* GetNtupleInFunction(G4int id,
|
||||
std::string_view function,
|
||||
G4bool warn = true) const;
|
||||
|
||||
// template functions for filling ntuple columns
|
||||
template <typename T>
|
||||
template <typename T>
|
||||
G4bool FillNtupleTColumn(G4int ntupleId, G4int columnId, const T& value);
|
||||
|
||||
// Static data members
|
||||
static constexpr std::string_view fkClass { "G4TNtupleManager<NT,FT>" };
|
||||
};
|
||||
|
||||
#include "G4TNtupleManager.icc"
|
||||
|
||||
Reference in New Issue
Block a user