44 std::vector<G4RootRNtupleDescription*>::iterator it;
45 for (it = fNtupleVector.begin(); it != fNtupleVector.end(); it++ ) {
59 if ( index < 0 || index >=
G4int(fNtupleVector.size()) ) {
61 G4String inFunction =
"G4RootRNtupleManager::";
62 inFunction += functionName;
64 description <<
" " <<
"ntuple " <<
id <<
" does not exist.";
70 return fNtupleVector[index];
80 return ! fNtupleVector.size();
88 std::vector<G4RootRNtupleDescription*>::iterator it;
89 for (it = fNtupleVector.begin(); it != fNtupleVector.end(); it++ ) {
108 = GetNtupleInFunction(ntupleId,
"GetRNtuple");
110 if ( ! rntupleDescription )
return nullptr;
112 return rntupleDescription->
fNtuple;
120 fNtupleVector.push_back(rntupleDescription);
155 std::vector<G4int>& vector)
162 std::vector<G4float>& vector)
169 std::vector<G4double>& vector)
182 description <<
" ntupleId " << ntupleId <<
" " << columnName;
188 = GetNtupleInFunction(ntupleId,
"SetNtupleIColumn");
189 if ( ! ntupleDescription )
return false;
191 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
192 ntupleBinding->add_column(columnName, value);
197 description <<
" ntupleId " << ntupleId <<
" " << columnName;
213 description <<
" ntupleId " << ntupleId <<
" " << columnName;
219 = GetNtupleInFunction(ntupleId,
"SetNtupleFColumn");
220 if ( ! ntupleDescription )
return false;
222 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
223 ntupleBinding->add_column(columnName, value);
228 description <<
" ntupleId " << ntupleId <<
" " << columnName;
244 description <<
" ntupleId " << ntupleId <<
" " << columnName;
250 = GetNtupleInFunction(ntupleId,
"SetNtupleDColumn");
251 if ( ! ntupleDescription )
return false;
253 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
254 ntupleBinding->add_column(columnName, value);
259 description <<
" ntupleId " << ntupleId <<
" " << columnName;
275 description <<
" ntupleId " << ntupleId <<
" " << columnName;
281 = GetNtupleInFunction(ntupleId,
"SetNtupleSColumn");
282 if ( ! ntupleDescription )
return false;
284 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
285 ntupleBinding->add_column(columnName, value);
290 description <<
" ntupleId " << ntupleId <<
" " << columnName;
301 std::vector<G4int>& vector)
306 description <<
" ntupleId " << ntupleId <<
" " << columnName;
312 = GetNtupleInFunction(ntupleId,
"SetNtupleIColumn");
313 if ( ! ntupleDescription )
return false;
315 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
316 ntupleBinding->add_column(columnName, vector);
321 description <<
" ntupleId " << ntupleId <<
" " << columnName;
332 std::vector<G4float>& vector)
337 description <<
" ntupleId " << ntupleId <<
" " << columnName;
343 = GetNtupleInFunction(ntupleId,
"SetNtupleFColumn");
344 if ( ! ntupleDescription )
return false;
346 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
347 ntupleBinding->add_column(columnName, vector);
352 description <<
" ntupleId " << ntupleId <<
" " << columnName;
363 std::vector<G4double>& vector)
368 description <<
" ntupleId " << ntupleId <<
" " << columnName;
374 = GetNtupleInFunction(ntupleId,
"SetNtupleDColumn");
375 if ( ! ntupleDescription )
return false;
377 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
378 ntupleBinding->add_column(columnName, vector);
383 description <<
" ntupleId " << ntupleId <<
" " << columnName;
403 description <<
" ntupleId " << ntupleId;
409 = GetNtupleInFunction(ntupleId,
"GetNtupleRow");
410 if ( ! ntupleDescription )
return false;
412 tools::rroot::ntuple* ntuple = ntupleDescription->
fNtuple;
413 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
416 if ( ! isInitialized ) {
421 description <<
" ntupleId " << ntupleId;
425 if ( ! ntuple->initialize(
G4cout, *ntupleBinding) ) {
429 <<
"Ntuple initialization failed !!";
438 G4bool next = ntuple->next();
440 if ( ! ntuple->get_row() ) {
444 <<
"Ntuple get_row() failed !!";
454 description <<
" ntupleId " << ntupleId;
tools::rroot::ntuple * GetNtuple() const
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
virtual G4bool SetNtupleIColumn(const G4String &columnName, G4int &value)
std::ostringstream G4ExceptionDescription
G4RootRNtupleManager(const G4AnalysisManagerState &state)
virtual G4bool SetNtupleSColumn(const G4String &columnName, G4String &value)
const G4AnalysisVerbose * GetVerboseL2() const
G4int SetNtuple(G4RootRNtupleDescription *rntupleDescription)
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
const G4AnalysisVerbose * GetVerboseL4() const
virtual G4bool SetNtupleDColumn(const G4String &columnName, G4double &value)
virtual G4bool GetNtupleRow()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual ~G4RootRNtupleManager()
tools::rroot::ntuple * fNtuple
tools::ntuple_binding * fNtupleBinding
const G4AnalysisManagerState & fState
virtual G4bool SetNtupleFColumn(const G4String &columnName, G4float &value)