Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RootPNtupleManager Class Reference

#include <G4RootPNtupleManager.hh>

Inheritance diagram for G4RootPNtupleManager:
Collaboration diagram for G4RootPNtupleManager:

Public Member Functions

 G4RootPNtupleManager (G4RootMainNtupleManager *main, const G4AnalysisManagerState &state)
 
 ~G4RootPNtupleManager ()
 
template<>
G4bool FillNtupleTColumn (G4int ntupleId, G4int columnId, const std::string &value)
 
- Public Member Functions inherited from G4VNtupleManager
 G4VNtupleManager (const G4AnalysisManagerState &state)
 
virtual ~G4VNtupleManager ()
 
 G4VNtupleManager (const G4VNtupleManager &rhs)=delete
 
G4VNtupleManageroperator= (const G4VNtupleManager &rhs)=delete
 
- Public Member Functions inherited from G4BaseAnalysisManager
 G4BaseAnalysisManager (const G4AnalysisManagerState &state)
 
virtual ~G4BaseAnalysisManager ()
 
G4bool SetFirstId (G4int firstId)
 
void SetLockFirstId (G4bool lockFirstId)
 
G4int GetFirstId () const
 

Friends

class G4RootAnalysisManager
 

Additional Inherited Members

- Protected Member Functions inherited from G4VNtupleManager
G4bool SetFirstNtupleColumnId (G4int firstId)
 
G4int GetFirstNtupleColumnId () const
 
- Protected Attributes inherited from G4VNtupleManager
G4int fFirstNtupleColumnId
 
G4bool fLockFirstNtupleColumnId
 
- Protected Attributes inherited from G4BaseAnalysisManager
const G4AnalysisManagerStatefState
 
G4int fFirstId
 
G4bool fLockFirstId
 

Detailed Description

Definition at line 79 of file G4RootPNtupleManager.hh.

Constructor & Destructor Documentation

G4RootPNtupleManager::G4RootPNtupleManager ( G4RootMainNtupleManager main,
const G4AnalysisManagerState state 
)
explicit

Definition at line 45 of file G4RootPNtupleManager.cc.

47  : G4VNtupleManager(state),
49  fMainNtupleManager(main),
50  fNtupleVector()
51 {}
G4VNtupleManager(const G4AnalysisManagerState &state)
G4RootPNtupleManager::~G4RootPNtupleManager ( )

Definition at line 54 of file G4RootPNtupleManager.cc.

55 {
56  for ( auto ntupleDescription : fNtupleDescriptionVector ) {
57  delete ntupleDescription;
58  }
59 }

Member Function Documentation

template<>
G4bool G4RootPNtupleManager::FillNtupleTColumn ( G4int  ntupleId,
G4int  columnId,
const std::string &  value 
)
inline

Definition at line 231 of file G4RootPNtupleManager.hh.

233 {
234  if ( fState.GetIsActivation() && ( ! GetActivation(ntupleId) ) ) {
235  G4cout << "Skipping FillNtupleIColumn for " << ntupleId << G4endl;
236  return false;
237  }
238 
239 #ifdef G4VERBOSE
240  if ( fState.GetVerboseL4() ) {
241  G4ExceptionDescription description;
242  description << " ntupleId " << ntupleId
243  << " columnId " << columnId << " value " << value;
244  fState.GetVerboseL4()->Message("fill", "pntuple T column", description);
245  }
246 #endif
247 
248  auto ntuple = GetNtupleInFunction(ntupleId, "FillNtupleTColumn");
249  if ( ! ntuple ) return false;
250 
251  auto index = columnId - fFirstNtupleColumnId;
252  if ( index < 0 || index >= G4int(ntuple->columns().size()) ) {
253  G4ExceptionDescription description;
254  description << " " << "ntupleId " << ntupleId
255  << " columnId " << columnId << " does not exist.";
256  G4Exception("G4RootNtupleManager::FillNtupleTColumn()",
257  "Analysis_W011", JustWarning, description);
258  return false;
259  }
260 
261  auto icolumn = ntuple->columns()[index];
262  auto column = dynamic_cast<tools::wroot::pntuple::column_string* >(icolumn);
263  if ( ! column ) {
264  G4ExceptionDescription description;
265  description << " Column type does not match: "
266  << " ntupleId " << ntupleId
267  << " columnId " << columnId << " value " << value;
268  G4Exception("G4RootNtupleManager:FillNtupleColumn",
269  "Analysis_W011", JustWarning, description);
270  return false;
271  }
272 
273  column->fill(value);
274 
275 #ifdef G4VERBOSE
276  if ( fState.GetVerboseL4() ) {
277  G4ExceptionDescription description;
278  description << " ntupleId " << ntupleId
279  << " columnId " << columnId << " value " << value;
280  fState.GetVerboseL4()->Message("done fill", "pntuple T column", description);
281  }
282 #endif
283  return true;
284 }
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
Definition: expat.h:331
const G4AnalysisVerbose * GetVerboseL4() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
const G4AnalysisManagerState & fState

Here is the call graph for this function:

Friends And Related Function Documentation

friend class G4RootAnalysisManager
friend

Definition at line 81 of file G4RootPNtupleManager.hh.


The documentation for this class was generated from the following files: