NAIA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Event.cpp
Go to the documentation of this file.
1 #include "Chain/Event.h"
2 
3 namespace NAIA {
4 void Event::BranchAll(TTree *tree) {
5  header.Branch(tree);
6  evSummary.Branch(tree);
7 
8  daq.Branch(tree);
9 
10  tofBase.Branch(tree);
11  tofPlus.Branch(tree);
12 
13  tofBaseSt.Branch(tree);
14  tofPlusSt.Branch(tree);
15 
16  ecalBase.Branch(tree);
17  ecalPlus.Branch(tree);
18 
19  trdKBase.Branch(tree);
20  trdKBaseSt.Branch(tree);
21 
22  trTrackBase.Branch(tree);
23  trTrackPlus.Branch(tree);
24 
25  richBase.Branch(tree);
26  richPlus.Branch(tree);
27 
28  extHitBase.Branch(tree);
29 
30  if (m_isMC) {
31  mcTruthBase.Branch(tree);
32  mcTruthPlus.Branch(tree);
33  }
34 }
35 
36 void Event::SetAllBranchAddress(TTree *tree) {
39 
40  daq.SetBranchAddress(tree);
41 
44 
47 
50 
53 
56 
59 
61 
62  if (m_isMC) {
65  }
66 }
67 
68 void Event::MirrorBranches(TTree *tree, const Event &sourceEvent) {
69  header.MirrorBranch(tree, &(sourceEvent.header));
70  evSummary.MirrorBranch(tree, &(sourceEvent.evSummary));
71 
72  daq.MirrorBranch(tree, &(sourceEvent.daq));
73 
74  tofBase.MirrorBranch(tree, &(sourceEvent.tofBase));
75  tofPlus.MirrorBranch(tree, &(sourceEvent.tofPlus));
76 
77  tofBaseSt.MirrorBranch(tree, &(sourceEvent.tofBaseSt));
78  tofPlusSt.MirrorBranch(tree, &(sourceEvent.tofPlusSt));
79 
80  ecalBase.MirrorBranch(tree, &(sourceEvent.ecalBase));
81  ecalPlus.MirrorBranch(tree, &(sourceEvent.ecalPlus));
82 
83  trdKBase.MirrorBranch(tree, &(sourceEvent.trdKBase));
84  trdKBaseSt.MirrorBranch(tree, &(sourceEvent.trdKBaseSt));
85 
86  trTrackBase.MirrorBranch(tree, &(sourceEvent.trTrackBase));
87  trTrackPlus.MirrorBranch(tree, &(sourceEvent.trTrackPlus));
88 
89  richBase.MirrorBranch(tree, &(sourceEvent.richBase));
90  richPlus.MirrorBranch(tree, &(sourceEvent.richPlus));
91 
92  extHitBase.MirrorBranch(tree, &(sourceEvent.extHitBase));
93 
94  if (sourceEvent.m_isMC) {
95  mcTruthBase.MirrorBranch(tree, &(sourceEvent.mcTruthBase));
96  mcTruthPlus.MirrorBranch(tree, &(sourceEvent.mcTruthPlus));
97  }
98 }
99 
101  header.LoadEvent();
103 
104  daq.LoadEvent();
105 
106  tofBase.LoadEvent();
107  tofPlus.LoadEvent();
108 
111 
114 
117 
120 
123 
125 
126  if (m_isMC) {
129  }
130 }
131 
132 void Event::SetEventNumber(unsigned long long iEv) {
133  header.SetTreeEntry(iEv);
134  evSummary.SetTreeEntry(iEv);
135 
136  daq.SetTreeEntry(iEv);
137 
138  tofBase.SetTreeEntry(iEv);
139  tofPlus.SetTreeEntry(iEv);
140 
141  tofBaseSt.SetTreeEntry(iEv);
142  tofPlusSt.SetTreeEntry(iEv);
143 
144  ecalBase.SetTreeEntry(iEv);
145  ecalPlus.SetTreeEntry(iEv);
146 
147  trdKBase.SetTreeEntry(iEv);
149 
152 
153  richBase.SetTreeEntry(iEv);
154  richPlus.SetTreeEntry(iEv);
155 
157 
158  if (m_isMC) {
161  }
162 }
163 
164 void Event::Clear() {
165  header.Clear();
166  evSummary.Clear();
167 
168  daq.Clear();
169 
170  tofBase.Clear();
171  tofPlus.Clear();
172 
173  tofBaseSt.Clear();
174  tofPlusSt.Clear();
175 
176  ecalBase.Clear();
177  ecalPlus.Clear();
178 
179  trdKBase.Clear();
180  trdKBaseSt.Clear();
181 
182  trTrackBase.Clear();
183  trTrackPlus.Clear();
184 
185  richBase.Clear();
186  richPlus.Clear();
187 
188  extHitBase.Clear();
189 
190  if (m_isMC) {
191  mcTruthBase.Clear();
192  mcTruthPlus.Clear();
193  }
194 
195  LinkContainers();
196 }
197 
202 }
203 } // namespace NAIA
void Clear()
Clear container content.
Definition: TrdK.cpp:79
UnbExtHitBase extHitBase
Definition: Event.h:119
void Branch(TTree *tree)
Create the TBranch associated with this container.
TofBase tofBase
Definition: Event.h:101
void Clear()
Clear the container.
Definition: DAQ.cpp:6
void MirrorBranches(TTree *tree, const Event &sourceEvent)
Set all branch addresses for skimming, creates all branches reading from outside Event.
Definition: Event.cpp:68
void Clear()
Clear container content.
Definition: Rich.cpp:44
void Clear()
Clear container content.
Definition: Ecal.cpp:18
const TrTrackBaseData * trkBase
Definition: TrdK.h:134
void BranchAll(TTree *tree)
Forwards this tree to all containers so that each one can create its own branch.
Definition: Event.cpp:4
void Clear()
Clear container content.
Definition: Ecal.cpp:9
void SetAllBranchAddress(TTree *tree)
Forwards this tree to all containers so that each one can create its own branch address for reading o...
Definition: Event.cpp:36
EcalPlus ecalPlus
Definition: Event.h:108
RichPlus richPlus
Definition: Event.h:117
void Clear()
Clear all containers.
Definition: Event.cpp:164
TofPlusStandalone tofPlusSt
Definition: Event.h:105
TrTrackBase trTrackBase
Definition: Event.h:110
void Clear()
Clear container content.
Definition: Tof.cpp:11
void Clear()
Clear container content.
Definition: MCTruth.cpp:36
Event object.
Definition: Event.h:20
MCTruthBase mcTruthBase
Definition: Event.h:121
void Clear()
Clear container content.
Definition: UnbExtHit.cpp:9
void LinkContainers()
Setup dependencies between containers. E.g: TrTrackPlus needs info from TrTrackBase, and so on...
Definition: Event.cpp:198
void ForceReadAllBranches()
Force data reading for all branches. Don't use unless you need it. Rely on read-on-demand instead...
Definition: Event.cpp:100
TrdKBaseStandalone trdKBaseSt
Definition: Event.h:114
EventSummary evSummary
Definition: Event.h:97
DAQ daq
Definition: Event.h:99
void SetEventNumber(unsigned long long iEv)
Set the Event Number for all containers. The corresponding entry will be loaded upon the first read r...
Definition: Event.cpp:132
Header header
Definition: Event.h:96
void SetTreeEntry(unsigned long long treeEntry)
Set the TTree entry number.
TrdKBase trdKBase
Definition: Event.h:113
void Clear()
Clear container content.
Definition: Tof.cpp:18
void Clear()
Clear container content.
Definition: TrTrack.cpp:60
TrTrackPlus trTrackPlus
Definition: Event.h:111
EcalBase ecalBase
Definition: Event.h:107
void Clear()
Clear container content.
Definition: MCTruth.cpp:10
const TofBaseData * tofBase
Definition: UnbExtHit.h:102
Event class description.
MCTruthPlus mcTruthPlus
Definition: Event.h:122
TofBaseStandalone tofBaseSt
Definition: Event.h:104
void SetBranchAddress(TTree *tree)
Setup reading of the data container.
void Clear()
Clear container content.
void LoadEvent()
Wrapper to call GetEntry on the underlying TBranch.
void MirrorBranch(TTree *targetTree, const T *sourceContainer)
Create a TBranch associated with this container mirroring from an existing container.
bool m_isMC
Definition: Event.h:125
RichBase richBase
Definition: Event.h:116
const TrTrackBaseData * trkBase
Definition: TrTrack.h:223
void Clear()
Clear container content.
Definition: Header.cpp:9
TofPlus tofPlus
Definition: Event.h:102
void Clear()
Clear container content.
Definition: Rich.cpp:8
void Clear()
Clear container content.
Definition: TrTrack.cpp:73