Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -26,15 +26,19 @@
|
||||
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#include "G4AnalysisUtilities.hh"
|
||||
|
||||
using std::to_string;
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline void G4RootNtupleManager::SetNtupleFile(std::shared_ptr<G4RootFile> file)
|
||||
inline void G4RootNtupleManager::SetNtupleFile(std::shared_ptr<G4RootFile> file)
|
||||
{
|
||||
fNtupleFile = file;
|
||||
fNtupleFile = std::move(file);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline const
|
||||
std::vector<G4TNtupleDescription<tools::wroot::ntuple, G4RootFile>* >&
|
||||
inline const
|
||||
std::vector<G4TNtupleDescription<tools::wroot::ntuple, G4RootFile>* >&
|
||||
G4RootNtupleManager::GetNtupleDescriptionVector() const
|
||||
{
|
||||
return fNtupleDescriptionVector;
|
||||
@@ -47,44 +51,38 @@ inline G4bool G4TNtupleManager<tools::wroot::ntuple, G4RootFile>::FillNtupleTCol
|
||||
G4int ntupleId, G4int columnId, const std::string& value)
|
||||
{
|
||||
if ( fState.GetIsActivation() && ( ! GetActivation(ntupleId) ) ) {
|
||||
//G4cout << "Skipping FillNtupleIColumn for " << ntupleId << G4endl;
|
||||
return false;
|
||||
}
|
||||
//G4cout << "Skipping FillNtupleIColumn for " << ntupleId << G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
auto ntuple = GetNtupleInFunction(ntupleId, "FillNtupleTColumn");
|
||||
if ( ! ntuple ) return false;
|
||||
|
||||
auto index = columnId - fFirstNtupleColumnId;
|
||||
if ( index < 0 || index >= G4int(ntuple->columns().size()) ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "ntupleId " << ntupleId
|
||||
<< " columnId " << columnId << " does not exist.";
|
||||
G4Exception("G4RootNtupleManager::FillNtupleTColumn()",
|
||||
"Analysis_W011", JustWarning, description);
|
||||
G4Analysis::Warn(
|
||||
"ntupleId " + to_string(ntupleId) + " columnId " + to_string(columnId) +
|
||||
" does not exist.",
|
||||
fkClass, "FillNtupleTColumn");
|
||||
return false;
|
||||
}
|
||||
|
||||
auto icolumn = ntuple->columns()[index];
|
||||
auto column = dynamic_cast<tools::wroot::ntuple::column_string* >(icolumn);
|
||||
if ( ! column ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " Column type does not match: "
|
||||
<< " ntupleId " << ntupleId
|
||||
<< " columnId " << columnId << " value " << value;
|
||||
G4Exception("G4RootNtupleManager:FillNtupleColumn",
|
||||
"Analysis_W011", JustWarning, description);
|
||||
G4Analysis::Warn(
|
||||
"Column type does not match: ntupleId " + to_string(ntupleId) +
|
||||
" columnId " + to_string(columnId) + " value " + value,
|
||||
fkClass, "FillNtupleTColumn");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
column->fill(value);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fState.GetVerboseL4() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " ntupleId " << ntupleId
|
||||
<< " columnId " << columnId << " value " << value;
|
||||
fState.GetVerboseL4()->Message("fill", "ntuple T column", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
if ( IsVerbose(G4Analysis::kVL4) ) {
|
||||
Message(G4Analysis::kVL4, "fill", "ntuple T column",
|
||||
" ntupleId " + to_string(ntupleId) + " columnId " + to_string(columnId) +
|
||||
" value " + value);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user