All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventInfoTree.cxx
Go to the documentation of this file.
1 /**
2  * @file icaruscode/PMT/Trigger/Algorithms/details/EventInfoTree.cxx
3  * @brief Class writing event information into a ROOT tree (implementation).
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date May 15, 2020
6  * @see icaruscode/PMT/Trigger/Algorithms/details/EventInfoTree.h
7  */
8 
9 
10 // library header
12 
13 // ROOT libraries
14 #include "TTree.h"
15 
16 
17 //------------------------------------------------------------------------------
18 //--- icarus::trigger::details::EventInfoTree
19 //------------------------------------------------------------------------------
21  (TTree& tree, bool fillGen /* = true */, bool fillEDep /* = true */)
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()
48 
49 
50 //------------------------------------------------------------------------------
52  (EventInfo_t const& info)
53 {
54 
55  if (fDoGen) {
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());
69  fSpillActiveE
70  = static_cast<Double_t>(info.DepositedEnergyInSpillInActiveVolume());
71  fPreSpillActiveE
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()
81 
82 
83 //------------------------------------------------------------------------------
bool isInActiveVolume() const
Returns whether there is an interaction within the active volume.
Definition: EventInfo_t.h:124
void assignEvent(EventInfo_t const &info)
Fills the information of the specified event.
GeV NeutrinoEnergy() const
Returns the neutrino energy [GeV].
Definition: EventInfo_t.h:103
GeV LeptonEnergy() const
Returns the lepton energy [GeV].
Definition: EventInfo_t.h:106
EventInfoTree(TTree &tree, bool fillGen=true, bool fillEDep=true)
Creates the required branches and assigns addresses to them.
unsigned int nWeakChargedCurrentInteractions() const
Returns the number of weak charged current interactions in the event.
Definition: EventInfo_t.h:69
Simple class holding a tree.
Definition: TreeHolder.h:24
GeV DepositedEnergyInSpill() const
Returns the total energy deposited in the detector during beam [GeV].
Definition: EventInfo_t.h:146
simulation_time InteractionTime() const
Returns the time of the first interaction, in simulation time scale [ns].
Definition: EventInfo_t.h:112
GeV DepositedEnergyInSpillInActiveVolume() const
Returns the energy deposited in the active volume during the beam [GeV].
Definition: EventInfo_t.h:156
Class writing event information into a ROOT tree.
GeV DepositedEnergyInPreSpillInActiveVolume() const
Definition: EventInfo_t.h:161
GeV DepositedEnergy() const
Returns the total energy deposited in the detector during the event [GeV].
Definition: EventInfo_t.h:143
GeV DepositedEnergyInActiveVolume() const
Returns the energy deposited in the active volume during the event [GeV].
Definition: EventInfo_t.h:153
Selected information about the event.
Definition: EventInfo_t.h:45
unsigned int nWeakNeutralCurrentInteractions() const
Returns the number of weak neutral current interactions in the event.
Definition: EventInfo_t.h:73
std::vector< geo::Point_t > const & Vertices() const
Returns the list of a known interaction vertex.
Definition: EventInfo_t.h:121
int InteractionType() const
Returns the interaction type.
Definition: EventInfo_t.h:109