44 std::vector<G4CsvRNtupleDescription*>::iterator it;
45 for (it = fNtupleVector.begin(); it != fNtupleVector.end(); it++ ) {
59 if ( index < 0 || index >=
G4int(fNtupleVector.size()) ) {
61 G4String inFunction =
"G4CsvRNtupleManager::";
62 inFunction += functionName;
64 description <<
" " <<
"ntuple " <<
id <<
" does not exist.";
70 return fNtupleVector[index];
80 return ! fNtupleVector.size();
88 std::vector<G4CsvRNtupleDescription*>::iterator it;
89 for (it = fNtupleVector.begin(); it != fNtupleVector.end(); it++ ) {
108 = GetNtupleInFunction(ntupleId,
"GetNtuple");
110 if ( ! rntupleDescription )
return nullptr;
112 return rntupleDescription->
fNtuple;
120 fNtupleVector.push_back(rntupleDescription);
148 std::vector<G4int>& vector)
155 std::vector<G4float>& vector)
162 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;
270 std::vector<G4int>& vector)
275 description <<
" ntupleId " << ntupleId <<
" " << columnName;
281 = GetNtupleInFunction(ntupleId,
"SetNtupleIColumn");
282 if ( ! ntupleDescription )
return false;
284 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
285 ntupleBinding->add_column(columnName, vector);
290 description <<
" ntupleId " << ntupleId <<
" " << columnName;
301 std::vector<G4float>& vector)
306 description <<
" ntupleId " << ntupleId <<
" " << columnName;
312 = GetNtupleInFunction(ntupleId,
"SetNtupleFColumn");
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<G4double>& vector)
337 description <<
" ntupleId " << ntupleId <<
" " << columnName;
343 = GetNtupleInFunction(ntupleId,
"SetNtupleDColumn");
344 if ( ! ntupleDescription )
return false;
346 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
347 ntupleBinding->add_column(columnName, vector);
352 description <<
" ntupleId " << ntupleId <<
" " << columnName;
368 description <<
" ntupleId " << ntupleId <<
" " << columnName;
374 = GetNtupleInFunction(ntupleId,
"SetNtupleSColumn");
375 if ( ! ntupleDescription )
return false;
377 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
378 ntupleBinding->add_column(columnName, value);
383 description <<
" ntupleId " << ntupleId <<
" " << columnName;
404 description <<
" ntupleId " << ntupleId;
410 = GetNtupleInFunction(ntupleId,
"GetNtupleRow");
411 if ( ! ntupleDescription )
return false;
413 tools::rcsv::ntuple* ntuple = ntupleDescription->
fNtuple;
416 if ( ! isInitialized ) {
417 tools::ntuple_binding* ntupleBinding = ntupleDescription->
fNtupleBinding;
418 if ( ! ntuple->initialize(
G4cout, *ntupleBinding) ) {
422 <<
"Ntuple initialization failed !!";
431 G4bool next = ntuple->next();
433 if ( ! ntuple->get_row() ) {
437 <<
"Ntuple get_row() failed !!";
447 description <<
" ntupleId " << ntupleId;
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
std::ostringstream G4ExceptionDescription
G4CsvRNtupleManager(const G4AnalysisManagerState &state)
tools::ntuple_binding * fNtupleBinding
virtual G4bool SetNtupleSColumn(const G4String &columnName, G4String &value)
virtual G4bool SetNtupleFColumn(const G4String &columnName, G4float &value)
const G4AnalysisVerbose * GetVerboseL2() const
virtual G4bool GetNtupleRow()
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
const G4AnalysisVerbose * GetVerboseL4() const
virtual ~G4CsvRNtupleManager()
tools::rcsv::ntuple * fNtuple
tools::rcsv::ntuple * GetNtuple() const
G4int SetNtuple(G4CsvRNtupleDescription *rntupleDescription)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual G4bool SetNtupleIColumn(const G4String &columnName, G4int &value)
virtual G4bool SetNtupleDColumn(const G4String &columnName, G4double &value)
const G4AnalysisManagerState & fState