33 #ifndef G4RootNtupleManager_h
34 #define G4RootNtupleManager_h 1
39 #include "tools/wroot/ntuple"
59 G4int ntupleId,
G4int columnId,
const std::string& value);
108 if ( ntupleDescription->
fNtuple ) {
109 if ( vector ==
nullptr ) {
110 ntupleDescription->
fNtuple->create_column_string(name);
114 description <<
"Column of vector<std::string> type is not supported";
115 G4Exception(
"G4RootNtupleManager::CreateTColumnInNtuple()",
125 G4int ntupleId,
G4int columnId,
const std::string& value)
133 if ( ! ntuple )
return false;
136 if ( index < 0 || index >=
G4int(ntuple->columns().size()) ) {
138 description <<
" " <<
"ntupleId " << ntupleId
139 <<
" columnId " << columnId <<
" does not exist.";
140 G4Exception(
"G4RootNtupleManager::FillNtupleTColumn()",
145 auto icolumn = ntuple->columns()[index];
146 auto column =
dynamic_cast<tools::wroot::ntuple::column_string*
>(icolumn);
149 description <<
" Column type does not match: "
150 <<
" ntupleId " << ntupleId
151 <<
" columnId " << columnId <<
" value " << value;
152 G4Exception(
"G4RootNtupleManager:FillNtupleColumn",
162 description <<
" ntupleId " << ntupleId
163 <<
" columnId " << columnId <<
" value " << value;
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4bool FillNtupleTColumn(G4int ntupleId, G4int columnId, const T &value)
std::ostringstream G4ExceptionDescription
tools::wroot::directory * fNtupleDirectory
tools::wroot::ntuple NtupleType
virtual void CreateTNtupleFromBooking(NtupleDescriptionType *ntupleDescription) final
virtual ~G4RootNtupleManager()
const G4AnalysisVerbose * GetVerboseL4() const
virtual G4bool GetActivation(G4int ntupleId) const final
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual void FinishTNtuple(NtupleDescriptionType *ntupleDescription) final
void CreateTColumnInNtuple(G4TNtupleDescription< TNTUPLE > *ntupleDescription, const G4String &name, std::vector< T > *vector)
virtual void CreateTNtuple(NtupleDescriptionType *ntupleDescription, const G4String &name, const G4String &title) final
G4int fFirstNtupleColumnId
G4RootNtupleManager(const G4AnalysisManagerState &state)
TNTUPLE * GetNtupleInFunction(G4int id, G4String function, G4bool warn=true) const
G4bool GetIsActivation() const
const G4AnalysisManagerState & fState
void SetNtupleDirectory(tools::wroot::directory *directory)