All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
icarus::trigger::details::EventInfoTree Struct Reference

Class managing the serialization of event information in a simple ROOT tree. More...

#include <EventInfoTree.h>

Inheritance diagram for icarus::trigger::details::EventInfoTree:
icarus::trigger::details::TreeHolder

Public Member Functions

 EventInfoTree (TTree &tree, bool fillGen=true, bool fillEDep=true)
 Creates the required branches and assigns addresses to them. More...
 
void assignEvent (EventInfo_t const &info)
 Fills the information of the specified event. More...
 
- Public Member Functions inherited from icarus::trigger::details::TreeHolder
 TreeHolder ()=default
 
 TreeHolder (TTree &tree)
 
TTree & tree ()
 
TTree const & tree () const
 

Public Attributes

bool const fDoGen = true
 
bool const fDoEDep = true
 
UInt_t fCC
 
UInt_t fNC
 
Int_t fIntType
 
Double_t fTime
 
Double_t fNuE
 
Double_t fOutLeptE
 
Double_t fTotE
 
Double_t fSpillE
 
Double_t fPreSpillE
 
Double_t fActiveE
 
Double_t fSpillActiveE
 
Double_t fPreSpillActiveE
 
UInt_t fNVertices
 
std::vector< geo::Point_tfVertices
 
Bool_t fInActive
 

Detailed Description

Class managing the serialization of event information in a simple ROOT tree.

The tree is supplied by the caller. This object will create the proper branches into the tree and assign addresses to them. Then it will assume they will stay assigned.

On assignEvent(), the branch addresses are assigned the values from the event information. The tree is not Fill()-ed.

The tree structure is: CC/i:NC/i:IntType/I:Time/D:NuE/D:OutLeptE/D:TotE/D:SpillE/D:InActive/O, with a single branch per element.

Branches:

Definition at line 69 of file EventInfoTree.h.

Constructor & Destructor Documentation

EventInfoTree::EventInfoTree ( TTree &  tree,
bool  fillGen = true,
bool  fillEDep = true 
)

Creates the required branches and assigns addresses to them.

Parameters
treethe tree to be filled
fillGen(default: true) create and fill generator info branches
fillEdep(default: true) create and fill energy deposition branches

Definition at line 21 of file EventInfoTree.cxx.

22  : TreeHolder(tree), fDoGen(fillGen), fDoEDep(fillEDep)
23 {
24  if (fDoGen) {
25  this->tree().Branch("CC", &fCC);
26  this->tree().Branch("NC", &fNC);
27  this->tree().Branch("IntType", &fIntType);
28  this->tree().Branch("Time", &fTime);
29  this->tree().Branch("NuE", &fNuE);
30  this->tree().Branch("OutLeptE", &fOutLeptE);
31  } // if generated
32 
33  if (fDoEDep) {
34  this->tree().Branch("TotE", &fTotE);
35  this->tree().Branch("SpillE", &fSpillE);
36  this->tree().Branch("PreSpillE", &fPreSpillE);
37  this->tree().Branch("ActiveE", &fActiveE);
38  this->tree().Branch("SpillActiveE", &fSpillActiveE);
39  this->tree().Branch("PreSpillActiveE", &fPreSpillActiveE);
40  } // if energy deposition
41 
42  if (fDoGen) {
43  this->tree().Branch("InActive", &fInActive);
44  this->tree().Branch("Vertices", &fVertices);
45  } // if generated
46 
47 } // icarus::trigger::details::EventInfoTree::EventInfoTree()
std::vector< geo::Point_t > fVertices

Member Function Documentation

void EventInfoTree::assignEvent ( EventInfo_t const &  info)

Fills the information of the specified event.

Parameters
infoevent information to fill the tree with
inPlotswhether this event is plotted (as opposed to filtered out)

Definition at line 52 of file EventInfoTree.cxx.

53 {
54 
55  if (fDoGen) {
56  fCC = info.nWeakChargedCurrentInteractions();
57  fNC = info.nWeakNeutralCurrentInteractions();
58  fIntType = info.InteractionType();
59  fTime = static_cast<Double_t>(info.InteractionTime());
60  fNuE = static_cast<Double_t>(info.NeutrinoEnergy());
61  fOutLeptE = static_cast<Double_t>(info.LeptonEnergy());
62  } // if generated
63 
64  if (fDoEDep) {
65  fTotE = static_cast<Double_t>(info.DepositedEnergy());
66  fSpillE = static_cast<Double_t>(info.DepositedEnergyInSpill());
67  fPreSpillE = static_cast<Double_t>(info.DepositedEnergyInPreSpill());
68  fActiveE = static_cast<Double_t>(info.DepositedEnergyInActiveVolume());
70  = static_cast<Double_t>(info.DepositedEnergyInSpillInActiveVolume());
72  = static_cast<Double_t>(info.DepositedEnergyInPreSpillInActiveVolume());
73  } // if energy deposition
74 
75  if (fDoGen) {
76  fInActive = static_cast<Bool_t>(info.isInActiveVolume());
77  fVertices = info.Vertices();
78  } // if generated
79 
80 } // icarus::trigger::details::EventInfoTree::assignEvent()
std::vector< geo::Point_t > fVertices

Member Data Documentation

Double_t icarus::trigger::details::EventInfoTree::fActiveE

Definition at line 99 of file EventInfoTree.h.

UInt_t icarus::trigger::details::EventInfoTree::fCC

Definition at line 90 of file EventInfoTree.h.

bool const icarus::trigger::details::EventInfoTree::fDoEDep = true

Definition at line 88 of file EventInfoTree.h.

bool const icarus::trigger::details::EventInfoTree::fDoGen = true

Definition at line 87 of file EventInfoTree.h.

Bool_t icarus::trigger::details::EventInfoTree::fInActive

Definition at line 105 of file EventInfoTree.h.

Int_t icarus::trigger::details::EventInfoTree::fIntType

Definition at line 92 of file EventInfoTree.h.

UInt_t icarus::trigger::details::EventInfoTree::fNC

Definition at line 91 of file EventInfoTree.h.

Double_t icarus::trigger::details::EventInfoTree::fNuE

Definition at line 94 of file EventInfoTree.h.

UInt_t icarus::trigger::details::EventInfoTree::fNVertices

Definition at line 102 of file EventInfoTree.h.

Double_t icarus::trigger::details::EventInfoTree::fOutLeptE

Definition at line 95 of file EventInfoTree.h.

Double_t icarus::trigger::details::EventInfoTree::fPreSpillActiveE

Definition at line 101 of file EventInfoTree.h.

Double_t icarus::trigger::details::EventInfoTree::fPreSpillE

Definition at line 98 of file EventInfoTree.h.

Double_t icarus::trigger::details::EventInfoTree::fSpillActiveE

Definition at line 100 of file EventInfoTree.h.

Double_t icarus::trigger::details::EventInfoTree::fSpillE

Definition at line 97 of file EventInfoTree.h.

Double_t icarus::trigger::details::EventInfoTree::fTime

Definition at line 93 of file EventInfoTree.h.

Double_t icarus::trigger::details::EventInfoTree::fTotE

Definition at line 96 of file EventInfoTree.h.

std::vector<geo::Point_t> icarus::trigger::details::EventInfoTree::fVertices

Definition at line 103 of file EventInfoTree.h.


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