All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventInfoTree.h
Go to the documentation of this file.
1 /**
2  * @file icaruscode/PMT/Trigger/Algorithms/details/EventInfoTree.h
3  * @brief Class writing event information into a ROOT tree.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date May 15, 2020
6  * @see icaruscode/PMT/Trigger/Algorithms/details/EventInfoTree.cxx
7  */
8 
9 #ifndef ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_EVENTINFOTREE_H
10 #define ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_EVENTINFOTREE_H
11 
12 
13 // ICARUS libraries
16 
17 // LArSoft libraries
19 
20 // ROOT libraries
21 #include "Rtypes.h"
22 
23 // C/C++ standard libraries
24 #include <vector>
25 
26 
27 // -----------------------------------------------------------------------------
28 namespace icarus::trigger::details { struct EventInfoTree; }
29 
30 /**
31  * @brief Class managing the serialization of event information in a simple ROOT
32  * tree.
33  *
34  * The tree is supplied by the caller.
35  * This object will create the proper branches into the tree and assign
36  * addresses to them. Then it will assume they will stay assigned.
37  *
38  * On `assignEvent()`, the branch addresses are assigned the values from the
39  * event information. The tree is not `Fill()`-ed.
40  *
41  * The tree structure is:
42  * `CC/i:NC/i:IntType/I:Time/D:NuE/D:OutLeptE/D:TotE/D:SpillE/D:InActive/O`,
43  * with a single branch per element.
44  *
45  * Branches:
46  * * `CC` (unsigned integer): number of neutrino CC interactions in the event
47  * * `NC` (unsigned integer): number of neutrino NC interactions in the event
48  * * `IntType` (integer): code of interaction type (see `simb::int_type_`)
49  * * `Time` (double): time of the interaction in simulation time scale
50  * * `NuE` (double): energy of the generated initial state neutrino [GeV]
51  * * `OutLeptE` (double): energy of the generated final state lepton [GeV]
52  * * `TotE` (double): total deposited energy in the event [GeV]
53  * * `SpillE` (double): total deposited energy during the beam gate [GeV]
54  * * `PreSpillE` (double): total deposited energy during the pre-spill window
55  * [GeV]
56  * * `ActiveE` (double): energy deposited in active volume [GeV]
57  * * `SpillActiveE` (double): energy deposited in active volume during the beam
58  * gate [GeV]
59  * * `PreSpillActiveE` (double): energy deposited in active volume during the
60  * pre-spill window [GeV]
61  * * `InActive` (bool): whether an interaction happened in active volume'
62  * this requires an interaction vertex (e.g. cosmic rays are out)
63  * * `NVertices` (unsigned integer): number of interaction vertices in event
64  * * `Vertices_` (list of points): the location of all the interaction vertices
65  * in the event; it's a vector of GenVector 3D points (can access coordinates
66  * as `Vertices.X()` or `Vertices.fCoordinates.fX`)
67  *
68  */
70 
71  /**
72  * @brief Creates the required branches and assigns addresses to them.
73  * @param tree the tree to be filled
74  * @param fillGen (default: `true`) create and fill generator info branches
75  * @param fillEdep (default: `true`) create and fill energy deposition
76  * branches
77  */
78  EventInfoTree(TTree& tree, bool fillGen = true, bool fillEDep = true);
79 
80  /**
81  * @brief Fills the information of the specified event.
82  * @param info event information to fill the tree with
83  * @param inPlots whether this event is plotted (as opposed to filtered out)
84  */
85  void assignEvent(EventInfo_t const& info);
86 
87  bool const fDoGen = true;
88  bool const fDoEDep = true;
89 
90  UInt_t fCC;
91  UInt_t fNC;
92  Int_t fIntType;
93  Double_t fTime;
94  Double_t fNuE;
95  Double_t fOutLeptE;
96  Double_t fTotE;
97  Double_t fSpillE;
98  Double_t fPreSpillE;
99  Double_t fActiveE;
100  Double_t fSpillActiveE;
102  UInt_t fNVertices;
103  std::vector<geo::Point_t> fVertices; // is this ROOT tree friendly?
104 
105  Bool_t fInActive;
106 
107 }; // struct icarus::trigger::details::EventInfoTree
108 
109 
110 //------------------------------------------------------------------------------
111 
112 
113 #endif // ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_EVENTINFOTREE_H
void assignEvent(EventInfo_t const &info)
Fills the information of the specified event.
Class managing the serialization of event information in a simple ROOT tree.
std::vector< geo::Point_t > fVertices
Class holding a ROOT tree, to be shared by other classes.
Definitions of geometry vector data types.
EventInfoTree(TTree &tree, bool fillGen=true, bool fillEDep=true)
Creates the required branches and assigns addresses to them.
Simple class holding a tree.
Definition: TreeHolder.h:24
Class hosting selected information about the event.
Class managing the serialization of event information in a simple ROOT tree.
Definition: EventInfoTree.h:69
Selected information about the event.
Definition: EventInfo_t.h:45