HighLAND
DataClassesIO.cxx
1 #include "DataClassesIO.hxx"
2 #include "Versioning.hxx"
3 
4 Int_t prefix_index=0;
5 Int_t counter_index=0;
6 
7 //TEMP, the correspondence between the psyche detector enumeration and old
8 //highland DetUsed one
9 int subdet_enum[NDETECTORS] = {2, 3, 4, 0, 1, 5, 6, 15, 16, 17, 18, 11, 12, 13, 14, 7, 8, 9, 10 };
10 
11 // define offsets
12 int offset = 1 + TreeVars::subUniqueID - TreeVars::subDetector;
13 unsigned int TreeVars::offsetTPC = 0;
14 unsigned int TreeVars::offsetFGD = offset;
15 unsigned int TreeVars::offsetECAL = offset * 2;
16 unsigned int TreeVars::offsetSMRD = offset * 3;
17 unsigned int TreeVars::offsetP0D = offset * 4;
18 unsigned int TreeVars::offsetTRACKER = offset * 5;
19 
20 //********************************************************************
21 void AnaSubTrackIO::Define(OutputManager& man, const std::string& counter, const Int_t size2, const std::string& prefix){
22  //********************************************************************
23  man.AddMatrixVar( prefix_index+TreeVars::subDetector, prefix+"Detector", "I","",counter_index,counter,-NMAXPARTICLES,size2);
24  man.AddMatrixVar( prefix_index+TreeVars::subNNodes, prefix+"NNodes", "I","",counter_index,counter,-NMAXPARTICLES,size2);
25  man.AddMatrixVar( prefix_index+TreeVars::subNHits, prefix+"NHits", "I","",counter_index,counter,-NMAXPARTICLES,size2);
26  man.AddMatrixVar( prefix_index+TreeVars::subUniqueID, prefix+"UniqueID", "I","",counter_index,counter,-NMAXPARTICLES,size2);
27 
28  man.AddMatrixVar( prefix_index+TreeVars::subLength, prefix+"Length", "F","",counter_index,counter,-NMAXPARTICLES,size2);
29 
30  man.Add3DMatrixVar(prefix_index+TreeVars::subDirectionStart, prefix+"DirectionStart", "F","",counter_index,counter,-NMAXPARTICLES,size2,3);
31  man.Add3DMatrixVar(prefix_index+TreeVars::subPositionStart, prefix+"PositionStart", "F","",counter_index,counter,-NMAXPARTICLES,size2,4);
32  man.Add3DMatrixVar(prefix_index+TreeVars::subPositionEnd, prefix+"PositionEnd", "F","",counter_index,counter,-NMAXPARTICLES,size2,4);
33  man.Add3DMatrixVar(prefix_index+TreeVars::subDirectionEnd, prefix+"DirectionEnd", "F","",counter_index,counter,-NMAXPARTICLES,size2,3);
34 
35 
36 }
37 
38 //********************************************************************
39 void AnaSubTrackIO::Write(OutputManager& man, const AnaParticleB& seg, const std::string& prefix, Int_t indx1, Int_t indx2){
40  //********************************************************************
41 
42  (void)prefix;
43 
44  if (man.GetCounterValueForVar(prefix_index+TreeVars::subDetector)>= (int)NMAXPARTICLES){
45  std::cout << "AnaParticleB:: too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
46  return;
47  }
48 
49  man.FillMatrixVar(prefix_index+TreeVars::subNNodes, seg.NNodes, indx1, indx2);
50  man.FillMatrixVar(prefix_index+TreeVars::subNHits, seg.NHits, indx1, indx2);
51  man.FillMatrixVar(prefix_index+TreeVars::subUniqueID, seg.UniqueID, indx1, indx2);
52 
53  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::subDirectionStart, seg.DirectionStart,-1, indx2, 3);
54  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::subPositionStart, seg.PositionStart, -1, indx2, 4);
55  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::subPositionEnd, seg.PositionEnd, -1, indx2, 4);
56  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::subDirectionEnd, seg.DirectionEnd, -1, indx2, 3);
57 }
58 
59 //********************************************************************
60 void AnaTPCParticleIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
61  //********************************************************************
62 
63  // AnaTpcTrackBIO
64  prefix_index = TreeVars::offsetTPC;
65  AnaSubTrackIO::Define(man, counter, NMAXTPCS, prefix);
66  prefix_index = 0;
67 
68 
69  man.AddMatrixVar(prefix_index+TreeVars::tpcCharge, prefix+"Charge", "F", "",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
70  man.AddMatrixVar(prefix_index+TreeVars::tpcMomentum, prefix+"Momentum", "F", "",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
71  man.AddMatrixVar(prefix_index+TreeVars::tpcMomentumError, prefix+"MomentumError","F", "", counter_index, counter,-NMAXPARTICLES,NMAXTPCS);
72 
73 
74 #if VERSION_HAS_BFIELD_REFIT
75  man.AddMatrixVar(prefix_index+TreeVars::tpcRefitMomentum, prefix+"RefitMomentum", "F", "", counter_index, counter,-NMAXPARTICLES,NMAXTPCS);
76 #endif
77 #if VERSION_HAS_EFIELD_REFIT
78  man.AddMatrixVar(prefix_index+TreeVars::tpcEFieldRefitMomentum, prefix+"EFieldRefitMomentum", "F", "", counter_index, counter,-NMAXPARTICLES,NMAXTPCS);
79 #endif
80 
81  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxMeas, prefix+"dEdxMeas", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
82 
83  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxExpMu, prefix+"dEdxExpMu", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
84  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxExpEle, prefix+"dEdxExpEle", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
85  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxExpP, prefix+"dEdxExpP", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
86  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxExpPi, prefix+"dEdxExpPi", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
87 
88  man.AddMatrixVar(prefix_index+TreeVars::tpcRawdEdxMeas, prefix+"RawdEdxMeas", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
89  man.AddMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpMu, prefix+"RawdEdxExpMu", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
90  man.AddMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpEle, prefix+"RawdEdxExpEle", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
91  man.AddMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpP, prefix+"RawdEdxExpP", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
92  man.AddMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpPi, prefix+"RawdEdxExpPi", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
93 
94  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaMu, prefix+"dEdxSigmaMu", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
95  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaEle,prefix+"dEdxSigmaEle", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
96  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaP, prefix+"dEdxSigmaP", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
97  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaPi, prefix+"dEdxSigmaPi", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
98 
99  man.AddMatrixVar(prefix_index+TreeVars::tpcTrueTrackID, prefix+"TrueTrackID", "I","",counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
100 
101 
102  // AnaTpcTrack
103  man.AddMatrixVar(prefix_index+TreeVars::tpcBackMomentum, prefix+"BackMomentum", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
104 
105 #if VERSION_HAS_BFIELD_REFIT_FULL
106  man.AddMatrixVar( prefix_index+TreeVars::tpcRefitCharge, prefix+"RefitCharge", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
107  man.Add3DMatrixVar(prefix_index+TreeVars::tpcRefitPosition, prefix+"RefitPosition", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS,4);
108  man.Add3DMatrixVar(prefix_index+TreeVars::tpcRefitDirection, prefix+"RefitDirection","F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS,3);
109 #endif
110 
111  man.AddMatrixVar(prefix_index+TreeVars::tpcPullmu, prefix+"Pullmu", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
112  man.AddMatrixVar(prefix_index+TreeVars::tpcPullele, prefix+"Pullele", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
113  man.AddMatrixVar(prefix_index+TreeVars::tpcPullp, prefix+"Pullp", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
114  man.AddMatrixVar(prefix_index+TreeVars::tpcPullpi, prefix+"Pullpi", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
115  man.AddMatrixVar(prefix_index+TreeVars::tpcPullk, prefix+"Pullk", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
116 
117  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxExpK, prefix+"dEdxExpK", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
118 
119  man.AddMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpK, prefix+"RawdEdxExpK", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
120 
121  man.AddMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaK, prefix+"dEdxSigmaK","F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
122 
123 
124  man.AddMatrixVar(prefix_index+TreeVars::tpcPurity, prefix+"Purity", "F","", counter_index,counter, -NMAXPARTICLES,NMAXTPCS);
125 
126 
127 
128 
129 }
130 
131 //********************************************************************
132 void AnaTPCParticleIO::Write(OutputManager& man, const std::string& prefix, Int_t indx1, Int_t indx2) const{
133  //********************************************************************
134 
135  (void)prefix;
136 
137  if (man.GetCounterValueForVar(TreeVars::offsetTPC+TreeVars::subDetector)>= (int)NMAXPARTICLES){
138  std::cout << "AnaTPCParticleB:: too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
139  return;
140  }
141  // to avoid warning
142  (void)indx2;
143 
144  // AnaTpcTrackB
145 
146  // this is to keep highland like structure where the local detector enumeration was
147  // aslo used as an index in the output tree
148  Int_t index_old = convUtils::GetLocalDetEnum(SubDetId::kTPC, SubDetId::GetSubdetectorEnum(Detector));
149  man.FillMatrixVar(prefix_index+TreeVars::tpcCharge, Charge, indx1, index_old);
150  man.FillMatrixVar(prefix_index+TreeVars::tpcMomentum, Momentum, indx1, index_old);
151  man.FillMatrixVar(prefix_index+TreeVars::tpcMomentumError,MomentumError, indx1, index_old);
152 #if !defined ANATOOLS_FILE_VERSION
153 #warning "No nd280AnalysisTools file version information found, so am \
154  ASSUMING THAT A PRODUCTION 5 FILE IS BEING USED! \
155  If compilation fails, please upgrade to nd280AnalysisTools v1r5 or higher."
156 #endif
157 
158 #if VERSION_HAS_BFIELD_REFIT
159  man.FillMatrixVar(prefix_index+TreeVars::tpcRefitMomentum, RefitMomentum, indx1, index_old);
160 #endif
161 #if VERSION_HAS_EFIELD_REFIT
162  man.FillMatrixVar(prefix_index+TreeVars::tpcEFieldRefitMomentum, EFieldRefitMomentum, indx1, index_old);
163 #endif
164 
165  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxMeas, dEdxMeas, indx1, index_old);
166  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxExpMu, dEdxexpMuon, indx1, index_old);
167  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxExpEle, dEdxexpEle, indx1, index_old);
168  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxExpP, dEdxexpProton, indx1, index_old);
169  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxExpPi, dEdxexpPion, indx1, index_old);
170 
171  if (Original){
172  const AnaTPCParticleB* original = static_cast<const AnaTPCParticleB*>(Original);
173  man.FillMatrixVar(prefix_index+TreeVars::tpcRawdEdxMeas, original->dEdxMeas, indx1, index_old);
174  man.FillMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpMu, original->dEdxexpMuon, indx1, index_old);
175  man.FillMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpEle, original->dEdxexpEle, indx1, index_old);
176  man.FillMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpP, original->dEdxexpProton, indx1, index_old);
177  man.FillMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpPi, original->dEdxexpPion, indx1, index_old);
178  }
179 
180  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaMu, dEdxSigmaMuon, indx1, index_old);
181  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaEle, dEdxSigmaEle, indx1, index_old);
182  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaP, dEdxSigmaProton, indx1, index_old);
183  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaPi, dEdxSigmaPion, indx1, index_old);
184 
185  if (TrueObject)
186  man.FillMatrixVar(prefix_index+TreeVars::tpcTrueTrackID, TrueObject->ID, indx1, index_old);
187 
188 
189  // AnaTpcTrack
190  man.FillMatrixVar(prefix_index+TreeVars::tpcBackMomentum, MomentumEnd, indx1, index_old);
191 
192 #if !defined ANATOOLS_FILE_VERSION
193 #warning "No nd280AnalysisTools file version information found, so am \
194 ASSUMING THAT A PRODUCTION 5 FILE IS BEING USED! \
195 If compilation fails, please upgrade to nd280AnalysisTools v1r5 or higher."
196 #endif
197 
198 #if VERSION_HAS_BFIELD_REFIT_FULL
199  man.FillMatrixVar(prefix_index+TreeVars::tpcRefitCharge, RefitCharge, indx1, index_old);
200  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::tpcRefitPosition, RefitPosition, indx1, index_old, 4);
201  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::tpcRefitDirection, RefitDirection, indx1, index_old, 3);
202 #endif
203 
204  man.FillMatrixVar(prefix_index+TreeVars::tpcPullmu, Pullmu, indx1, index_old);
205  man.FillMatrixVar(prefix_index+TreeVars::tpcPullele, Pullele, indx1, index_old);
206  man.FillMatrixVar(prefix_index+TreeVars::tpcPullp, Pullp, indx1, index_old);
207  man.FillMatrixVar(prefix_index+TreeVars::tpcPullpi, Pullpi, indx1, index_old);
208  man.FillMatrixVar(prefix_index+TreeVars::tpcPullk, Pullk, indx1, index_old);
209 
210  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxExpK, dEdxexpKaon, indx1, index_old);
211  man.FillMatrixVar(prefix_index+TreeVars::tpcdEdxSigmaK,dEdxSigmaKaon, indx1, index_old);
212 
213  if (Original){
214  const AnaTPCParticle* original = static_cast<const AnaTPCParticle*>(Original);
215  man.FillMatrixVar(prefix_index+TreeVars::tpcRawdEdxExpK, original->dEdxexpKaon, indx1, index_old);
216  }
217 
218  man.FillMatrixVar(prefix_index+TreeVars::tpcPurity, Purity, indx1, index_old);
219 
220 
221 
222  prefix_index = TreeVars::offsetTPC;
223 
224  AnaSubTrackIO::Write(man,*this,prefix,indx1,index_old);
225 
226  man.FillMatrixVar(prefix_index+TreeVars::subDetector, index_old+1, indx1, index_old);
227 
228  man.FillMatrixVar(prefix_index+TreeVars::subLength, Length, indx1, index_old);
229 
230  prefix_index = 0;
231 }
232 
233 //********************************************************************
234 void AnaFGDParticleIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
235  //********************************************************************
236  prefix_index = TreeVars::offsetFGD;
237  AnaSubTrackIO::Define(man, counter,NMAXFGDS,prefix);
238  prefix_index = 0;
239 
240  // AnaFgdTrackB
241  man.AddMatrixVar(prefix_index+TreeVars::fgdX, prefix+"X", "F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
242  man.AddMatrixVar(prefix_index+TreeVars::fgdPullmu, prefix+"Pullmu", "F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
243  man.AddMatrixVar(prefix_index+TreeVars::fgdPullp, prefix+"Pullp", "F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
244  man.AddMatrixVar(prefix_index+TreeVars::fgdPullpi, prefix+"Pullpi", "F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
245  man.AddMatrixVar(prefix_index+TreeVars::fgdPullno, prefix+"Pullno", "F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
246  man.AddMatrixVar(prefix_index+TreeVars::fgdContainment, prefix+"Containment", "I","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
247 
248  // AnaFgdTrack
249 
250  man.AddMatrixVar(prefix_index+TreeVars::fgdE, prefix+"E" , "F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
251  man.AddMatrixVar(prefix_index+TreeVars::fgdAvgTime, prefix+"AvgTime", "F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
252 
253  #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY
254  man.AddMatrixVar(prefix_index+TreeVars::fgdHasFgdVA, prefix+"HasFgdVA", "I", "", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
255  man.AddMatrixVar(prefix_index+TreeVars::fgdHasFgdVA_fmode, prefix+"HasFgdVA_fmode", "I", "", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
256  man.AddMatrixVar(prefix_index+TreeVars::fgdTypeVA, prefix+"TypeVA", "I", "", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
257 #endif
258 
259  man.AddMatrixVar(prefix_index+TreeVars::fgdVertex1x1,prefix+"Vertex1x1","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
260  man.AddMatrixVar(prefix_index+TreeVars::fgdVertex3x3,prefix+"Vertex3x3","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
261  man.AddMatrixVar(prefix_index+TreeVars::fgdVertex5x5,prefix+"Vertex5x5","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
262  man.AddMatrixVar(prefix_index+TreeVars::fgdVertex7x7,prefix+"Vertex7x7","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
263  man.AddMatrixVar(prefix_index+TreeVars::fgdVertexLayer,prefix+"VertexLayer","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
264 
265 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY
266  man.AddMatrixVar(prefix_index+TreeVars::fgdHasFgdEA, prefix+"HasFgdEA", "I", "", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
267  man.AddMatrixVar(prefix_index+TreeVars::fgdHasFgdEA_fmode, prefix+"HasFgdEA_fmode", "I", "", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
268  man.AddMatrixVar(prefix_index+TreeVars::fgdTypeEA, prefix+"TypeEA", "I", "", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
269 
270  man.AddMatrixVar(prefix_index+TreeVars::fgdEnd0x0,prefix+"End0x0","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
271  man.AddMatrixVar(prefix_index+TreeVars::fgdEnd1x1,prefix+"End1x1","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
272  man.AddMatrixVar(prefix_index+TreeVars::fgdEnd3x3,prefix+"End3x3","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
273  man.AddMatrixVar(prefix_index+TreeVars::fgdEnd5x5,prefix+"End5x5","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
274  man.AddMatrixVar(prefix_index+TreeVars::fgdEnd7x7,prefix+"End7x7","F","", counter_index, counter, -NMAXPARTICLES,NMAXFGDS);
275 #endif
276 
277 
278 }
279 
280 
281 //********************************************************************
282 void AnaFGDParticleIO::Write(OutputManager& man, const std::string& prefix, Int_t indx1, Int_t indx2) const{
283  //********************************************************************
284 
285  (void)prefix;
286 
287  if (man.GetCounterValueForVar(TreeVars::offsetFGD+TreeVars::subDetector)>= (int)NMAXPARTICLES){
288  std::cout << "AnaFGDParticleB:: too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
289  return;
290  }
291 
292  // to avoid warning
293  (void)indx2;
294 
295  // AnaFgdTracB
296  // this is to keep highland like structure where the local detector enumeration was
297  // aslo used as an index in the output tree
298  Int_t index_old = convUtils::GetLocalDetEnum(SubDetId::kFGD, SubDetId::GetSubdetectorEnum(Detector));
299  man.FillMatrixVar(prefix_index+TreeVars::fgdX, X, indx1, index_old);
300  man.FillMatrixVar(prefix_index+TreeVars::fgdPullmu, Pullmu, indx1, index_old);
301  man.FillMatrixVar(prefix_index+TreeVars::fgdPullp, Pullp, indx1, index_old);
302  man.FillMatrixVar(prefix_index+TreeVars::fgdPullpi, Pullpi, indx1, index_old);
303  man.FillMatrixVar(prefix_index+TreeVars::fgdPullno, Pullno, indx1, index_old);
304  man.FillMatrixVar(prefix_index+TreeVars::fgdContainment, Containment, indx1, index_old);
305 
306  // AnaFgdTrack
307  man.FillMatrixVar(prefix_index+TreeVars::fgdE, E, indx1, index_old);
308  man.FillMatrixVar(prefix_index+TreeVars::fgdAvgTime, AvgTime, indx1, index_old);
309 
310 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY
311  man.FillMatrixVar(prefix_index+TreeVars::fgdHasFgdVA, HasFgdVA, indx1, index_old);
312  man.FillMatrixVar(prefix_index+TreeVars::fgdHasFgdVA_fmode, HasFgdVA_fmode, indx1, index_old);
313  man.FillMatrixVar(prefix_index+TreeVars::fgdTypeVA, TypeVA, indx1, index_old);
314 #endif
315 
316  man.FillMatrixVar(prefix_index+TreeVars::fgdVertex1x1, Vertex1x1, indx1, index_old);
317  man.FillMatrixVar(prefix_index+TreeVars::fgdVertex3x3, Vertex3x3, indx1, index_old);
318  man.FillMatrixVar(prefix_index+TreeVars::fgdVertex5x5, Vertex5x5, indx1, index_old);
319  man.FillMatrixVar(prefix_index+TreeVars::fgdVertex7x7, Vertex7x7, indx1, index_old);
320  man.FillMatrixVar(prefix_index+TreeVars::fgdVertexLayer, VertexLayer, indx1, index_old);
321 
322 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY
323  man.FillMatrixVar(prefix_index+TreeVars::fgdHasFgdEA, HasFgdEA, indx1, index_old);
324  man.FillMatrixVar(prefix_index+TreeVars::fgdHasFgdEA_fmode, HasFgdEA_fmode, indx1, index_old);
325  man.FillMatrixVar(prefix_index+TreeVars::fgdTypeEA, TypeEA, indx1, index_old);
326 
327  man.FillMatrixVar(prefix_index+TreeVars::fgdEnd0x0, End0x0, indx1, index_old);
328  man.FillMatrixVar(prefix_index+TreeVars::fgdEnd1x1, End1x1, indx1, index_old);
329  man.FillMatrixVar(prefix_index+TreeVars::fgdEnd3x3, End3x3, indx1, index_old);
330  man.FillMatrixVar(prefix_index+TreeVars::fgdEnd5x5, End5x5, indx1, index_old);
331  man.FillMatrixVar(prefix_index+TreeVars::fgdEnd7x7, End7x7, indx1, index_old);
332 #endif
333 
334  prefix_index = TreeVars::offsetFGD;
335  AnaSubTrackIO::Write(man,*this,prefix,indx1, index_old);
336 
337  man.FillMatrixVar(prefix_index+TreeVars::subDetector, index_old+1, indx1, index_old);
338  man.FillMatrixVar(prefix_index+TreeVars::subLength, Length, indx1, index_old);
339 
340  prefix_index = 0;
341 }
342 
343 //********************************************************************
344 void AnaECALParticleIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
345  //********************************************************************
346  // NMAXECALS corresponds to the most possbile number of ecal objects in the tracks
347  // Here for the moment (highland-like) we store all possible ECal segments (sub-detector based), so use hard-coded number
348  prefix_index = TreeVars::offsetECAL;
349  AnaSubTrackIO::Define(man, counter, NECALSUBDETS, prefix);
350  prefix_index = 0;
351 
352  // AnaEcalTrackB
353  man.AddMatrixVar(prefix_index+TreeVars::ecalTrShVal, prefix+"TrShVal", "F","",counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
354  man.AddMatrixVar(prefix_index+TreeVars::ecalPIDMipEm, prefix+"PIDMipEm", "F","",counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
355  man.AddMatrixVar(prefix_index+TreeVars::ecalEMEnergy, prefix+"EMEnergy", "F","",counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
356  man.AddMatrixVar(prefix_index+TreeVars::ecalEDeposit, prefix+"EDeposit", "F","",counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
357  man.AddMatrixVar(prefix_index+TreeVars::ecalIsShowerLike, prefix+"IsShowerLike", "I","",counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
358  man.AddMatrixVar(prefix_index+TreeVars::ecalAvgTime, prefix+"AvgTime", "F","",counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
359  man.AddMatrixVar(prefix_index+TreeVars::ecalMostUpStreamLayerHit, prefix+"MostUpStreamLayerHit", "I","",counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
360  man.Add3DMatrixVar(prefix_index+TreeVars::ecalShowerPosition, prefix+"ShowerPosition", "F","",counter_index,counter, -NMAXPARTICLES, NECALSUBDETS, 3);
361 
362  // AnaEcalTrack
363  man.AddMatrixVar( prefix_index+TreeVars::ecalPIDMipPion, prefix+"PIDMipPion", "F", "", counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
364  man.AddMatrixVar( prefix_index+TreeVars::ecalPIDEmHip, prefix+"PIDEmHip", "F", "", counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
365  man.AddMatrixVar( prefix_index+TreeVars::ecalContainment, prefix+"Containment", "F", "", counter_index,counter, -NMAXPARTICLES, NECALSUBDETS);
366 
367 }
368 
369 //********************************************************************
370 void AnaECALParticleIO::Write(OutputManager& man, const std::string& prefix, Int_t indx1, Int_t indx2) const{
371  //********************************************************************
372 
373  (void)prefix;
374 
375  if (man.GetCounterValueForVar(TreeVars::offsetECAL+TreeVars::subDetector)>= (int)NMAXPARTICLES){
376  std::cout << "AnECALParticleB:: too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
377  return;
378  }
379 
380  // to avoid warning
381  (void)indx2;
382 
383  // AnaEcalTrackB
384  // this is to keep highland like structure where the local detector enumeration was
385  // aslo used as an index in the output tree
386  Int_t index_old = convUtils::GetLocalDetEnum(SubDetId::kECAL, SubDetId::GetSubdetectorEnum(Detector));
387  man.FillMatrixVar(prefix_index+TreeVars::ecalTrShVal, TrShVal, indx1, index_old);
388  man.FillMatrixVar(prefix_index+TreeVars::ecalPIDMipEm, PIDMipEm, indx1, index_old);
389  man.FillMatrixVar(prefix_index+TreeVars::ecalEMEnergy, EMEnergy, indx1, index_old);
390  man.FillMatrixVar(prefix_index+TreeVars::ecalEDeposit, EDeposit, indx1, index_old);
391  man.FillMatrixVar(prefix_index+TreeVars::ecalIsShowerLike, IsShowerLike, indx1, index_old);
392  man.FillMatrixVar(prefix_index+TreeVars::ecalAvgTime, AvgTime, indx1, index_old);
393 
394  man.FillMatrixVar(prefix_index+TreeVars::ecalMostUpStreamLayerHit, MostUpStreamLayerHit, indx1, index_old);
395 
396  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::ecalShowerPosition, ShowerPosition, indx1, index_old, 3);
397 
398  // AnaEcalTrack
399  man.FillMatrixVar(prefix_index+TreeVars::ecalPIDMipPion, PIDMipPion, indx1, index_old);
400  man.FillMatrixVar(prefix_index+TreeVars::ecalPIDEmHip, PIDEmHip, indx1, index_old);
401  man.FillMatrixVar(prefix_index+TreeVars::ecalContainment, Containment, indx1, index_old);
402 
403 
404  prefix_index = TreeVars::offsetECAL;
405  AnaSubTrackIO::Write(man,*this,prefix, indx1, index_old);
406 
407  man.FillMatrixVar(prefix_index+TreeVars::subDetector, index_old+1, indx1, index_old);
408  man.FillMatrixVar(prefix_index+TreeVars::subLength, Length, indx1, index_old);
409 
410  prefix_index = 0;
411 }
412 
413 //********************************************************************
414 void AnaSMRDParticleIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
415  //********************************************************************
416  // NMAXSMRDS corresponds to the most possbile number of smrd objects in the tracks
417  // Here for the moment (highland-like) we store all possible SMRD segments (sub-detector based), so use hard-coded number
418 
419  prefix_index = TreeVars::offsetSMRD;
420  AnaSubTrackIO::Define(man, counter, NSMRDSUBDETS, prefix);
421  prefix_index = 0;
422 
423  man.AddMatrixVar(prefix_index+TreeVars::smrdEDeposit, prefix+"EDeposit", "F","",counter_index,counter, -NMAXPARTICLES, NSMRDSUBDETS);
424  man.AddMatrixVar(prefix_index+TreeVars::smrdAvgTime, prefix+"AvgTime", "F","",counter_index,counter, -NMAXPARTICLES, NSMRDSUBDETS);
425 }
426 
427 //********************************************************************
428 void AnaSMRDParticleIO::Write(OutputManager& man, const std::string& prefix, Int_t indx1, Int_t indx2) const{
429  //********************************************************************
430 
431  (void)prefix;
432 
433  if (man.GetCounterValueForVar(TreeVars::offsetSMRD+TreeVars::subDetector)>= (int)NMAXPARTICLES){
434  std::cout << "AnaSMRDParticleB:: too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
435  return;
436  }
437 
438  // to avoid warning
439  (void)indx2;
440 
441  // this is to keep highland like structure where the local detector enumeration was
442  // aslo used as an index in the output tree
443  Int_t index_old = convUtils::GetLocalDetEnum(SubDetId::kSMRD, SubDetId::GetSubdetectorEnum(Detector));
444  man.FillMatrixVar(prefix_index+TreeVars::smrdAvgTime, AvgTime, indx1, index_old);
445 
446  man.FillMatrixVar(prefix_index+TreeVars::smrdEDeposit, EDeposit, indx1, index_old);
447 
448  prefix_index = TreeVars::offsetSMRD;
449  AnaSubTrackIO::Write(man,*this,prefix,indx1,index_old);
450 
451  man.FillMatrixVar(prefix_index+TreeVars::subDetector, index_old+1, indx1, index_old);
452  man.FillMatrixVar(prefix_index+TreeVars::subLength, Length, indx1, index_old);
453 
454  prefix_index = 0;
455 }
456 
457 
458 //********************************************************************
459 void AnaP0DParticleIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
460  //********************************************************************
461  prefix_index = TreeVars::offsetP0D;
462  AnaSubTrackIO::Define(man, counter,1,prefix);
463  prefix_index = 0;
464 
465  #if VERSION_HAS_P0D_AVERAGED_TIME
466  man.AddMatrixVar(prefix_index+TreeVars::p0dAvgTime, prefix+"AvgTime", "F", "", counter_index, counter, -NMAXPARTICLES,NMAXP0DS);
467 #endif
468 
469 
470 }
471 
472 //********************************************************************
473 void AnaP0DParticleIO::Write(OutputManager& man, const std::string& prefix, Int_t indx1, Int_t indx2) const{
474  //********************************************************************
475 
476  (void)prefix;
477 
478  if (man.GetCounterValueForVar(TreeVars::offsetP0D+TreeVars::subDetector)>= (int)NMAXPARTICLES){
479  std::cout << "AnaP0DParticleB too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
480  return;
481  }
482 
483  indx2 = 0;
484 
485 #if VERSION_HAS_P0D_AVERAGED_TIME
486  man.FillMatrixVar(prefix_index+TreeVars::p0dAvgTime, AvgTime, indx1, 0);
487 #endif
488 
489  prefix_index = TreeVars::offsetP0D;
490  AnaSubTrackIO::Write(man,*this,prefix,indx1, 0);
491  man.FillMatrixVar(prefix_index+TreeVars::subLength, Length, indx1, 0);
492  prefix_index = 0;
493 }
494 
495 //********************************************************************
496 void AnaTrackerTrackIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
497  //********************************************************************
498  prefix_index = TreeVars::offsetTRACKER;
499  AnaSubTrackIO::Define(man, counter,NMAXTRACKERS,prefix);
500  prefix_index = 0;
501 
502  man.AddMatrixVar(prefix_index+TreeVars::trackerCharge, prefix+"Charge", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTRACKERS);
503  man.AddMatrixVar(prefix_index+TreeVars::trackerMomentum, prefix+"Momentum", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTRACKERS);
504  man.AddMatrixVar(prefix_index+TreeVars::trackerMomentumEnd, prefix+"MomentumEnd", "F","",counter_index,counter, -NMAXPARTICLES,NMAXTRACKERS);
505 
506 
507 }
508 
509 //********************************************************************
510 void AnaTrackerTrackIO::Write(OutputManager& man, const std::string& prefix, Int_t indx1, Int_t indx2) const{
511  //********************************************************************
512 
513  (void)prefix;
514 
515  if (man.GetCounterValueForVar(TreeVars::offsetTRACKER+TreeVars::subDetector)>= (int)NMAXPARTICLES){
516  std::cout << "AnaTrackerTrackB:: too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
517  return;
518  }
519 
520  if (indx2 >=(int)NMAXTRACKERS){
521  std::cout << "too many tracker segments " << indx2 << ". Maximum is " << NMAXTRACKERS << std::endl;
522  return;
523  }
524 
525  man.FillMatrixVar(prefix_index+TreeVars::trackerCharge, Charge, indx1, indx2);
526  man.FillMatrixVar(prefix_index+TreeVars::trackerMomentum, Momentum, indx1, indx2);
527  man.FillMatrixVar(prefix_index+TreeVars::trackerMomentumEnd, MomentumEnd, indx1, indx2);
528 
529  prefix_index = TreeVars::offsetTRACKER;
530  AnaSubTrackIO::Write(man,*this,prefix,indx1,indx2);
531 
532  Int_t trackerDet;
534  man.FillMatrixVar(prefix_index+TreeVars::subDetector, trackerDet, indx1, indx2);
535  man.FillMatrixVar(prefix_index+TreeVars::subLength, Length, indx1, indx2);
536 
537  prefix_index = 0;
538 }
539 
540 //********************************************************************
541 AnaTrackIO::AnaTrackIO(const AnaTrack& track){
542  //********************************************************************
543 
544  // Only get the information needed to fill the flat-trees
545 
546  // AnaRecObjectC
547  Status = track.Status;
548  Detector = track.Detector;
549  UniqueID = track.UniqueID;
550 
551  // The associated true recObj
552  TrueObject = track.TrueObject;
553 
554 
555  // AnaTrackB
556  TPCQualityCut = track.TPCQualityCut;
557  ToF = track.ToF;
558 
559  nTPCSegments = track.nTPCSegments;
560  nFGDSegments = track.nFGDSegments;
561  nP0DSegments = track.nP0DSegments;
562  nECALSegments = track.nECALSegments;
563  nSMRDSegments = track.nSMRDSegments;
564 
565  for (Int_t i=0; i<nTPCSegments;i++){
566  TPCSegments[i] = NULL;
567  }
568  for (Int_t i=0; i<nFGDSegments;i++){
569  FGDSegments[i] = NULL;
570  }
571  for (Int_t i=0; i<nECALSegments;i++){
572  ECALSegments[i] = NULL;
573  }
574  for (Int_t i=0; i<nSMRDSegments;i++){
575  SMRDSegments[i] = NULL;
576  }
577  for (Int_t i=0; i<nP0DSegments;i++){
578  P0DSegments[i] = NULL;
579  }
580 
581  // AnaParticleB
582  Index = track.Index;
583  NHits = track.NHits;
584  NNodes = track.NNodes;
585  Charge = track.Charge;
586  Momentum = track.Momentum;
587  RangeMomentumMuon = track.RangeMomentumMuon;
588 
589  anaUtils::CopyArray(track.DirectionStart, DirectionStart, 3);
590  anaUtils::CopyArray(track.DirectionEnd, DirectionEnd, 3);
591  anaUtils::CopyArray(track.PositionStart, PositionStart, 4);
592  anaUtils::CopyArray(track.PositionEnd, PositionEnd, 4);
593 
594  MomentumFlip = track.MomentumFlip;
595  anaUtils::CopyArray(track.DirectionStartFlip, DirectionStartFlip, 3);
596 
597  // AnaParticleE
599 
600  NDOF = track.NDOF;
601  Chi2 = track.Chi2;
602  Bunch = track.Bunch;
603  ReconPDG = track.ReconPDG;
604 
605  for (int i=0; i<2; i++) {
606  UpstreamHits_Position[i] = track.UpstreamHits_Position[i];
607  DownstreamHits_Position[i] = track.DownstreamHits_Position[i];
608  UpstreamHits_Charge[i] = track.UpstreamHits_Charge[i];
609  DownstreamHits_Charge[i] = track.DownstreamHits_Charge[i];
610  }
611 
612  MomentumEle = track.MomentumEle;
613  MomentumMuon = track.MomentumMuon;
614  MomentumProton = track.MomentumProton;
615  MomentumErrorEle = track.MomentumErrorEle;
616  MomentumErrorMuon = track.MomentumErrorMuon;
617  MomentumErrorProton = track.MomentumErrorProton;
618 
619 #if VERSION_HAS_REVERSED_REFITS
620  anaUtils::CopyArray(track.PositionStartFlip, PositionStartFlip, 4);
621  anaUtils::CopyArray(track.DirectionEndFlip, DirectionEndFlip, 3);
622 #endif
623 
624 #if VERSION_HAS_PRANGE_ESTIMATES
625  RangeMomentumEle = track.RangeMomentumEle;
626  RangeMomentumProton = track.RangeMomentumProton;
627  RangeMomentumMuonFlip = track.RangeMomentumMuonFlip;
628  RangeMomentumProtonFlip = track.RangeMomentumProtonFlip;
629 #endif
630 
631  // The most lower PrimaryIndex associated global vertex (if it exists).
632  ReconVertex = NULL;//track.ReconVertex;
633 
634  ReconVertices.clear();
635  /*
636  for (UInt_t i=0;i<track.ReconVertices.size();i++)
637  ReconVertices.push_back(track.ReconVertices[i]);
638  */
639  anaUtils::CopyArray(track.DirectionAtVertex, DirectionAtVertex, 3);
640  MomentumAtVertex = track.MomentumAtVertex;
641 
642 
643 #if VERSION_HAS_TIME_FITS
644  TimeNodes.clear();
645  for (UInt_t i=0;i<track.TimeNodes.size();i++)
646  TimeNodes.push_back(new AnaTimeNodeIO(*track.TimeNodes[i]));
647 #endif
648 
649  // AnaTrack
650  Length = track.Length;
651  Detectors = track.Detectors;
652 
653 
654 }
655 
656 
657 //********************************************************************
658 void AnaTrackIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
659  //********************************************************************
660 
661  // From AnaTrackBIO
662  man.AddVectorVar(prefix_index+TreeVars::globalUniqueID, prefix+"UniqueID", "I", "", counter_index, counter, -NMAXPARTICLES);
663  man.AddMatrixVar(prefix_index+TreeVars::globalDetUsed, prefix+"DetUsed", "I", "", counter_index, counter, -NMAXPARTICLES, NDETECTORS);
664  man.AddVectorVar(prefix_index+TreeVars::globalNTPCs, prefix+"NTPCs", "I", "", counter_index, counter, -NMAXPARTICLES);
665  man.AddVectorVar(prefix_index+TreeVars::globalNFGDs, prefix+"NFGDs", "I", "", counter_index, counter, -NMAXPARTICLES);
666  man.AddVectorVar(prefix_index+TreeVars::globalNECALs, prefix+"NECALs", "I", "", counter_index, counter, -NMAXPARTICLES);
667  man.AddVectorVar(prefix_index+TreeVars::globalNSMRDs, prefix+"NSMRDs", "I", "", counter_index, counter, -NMAXPARTICLES);
668  man.AddVectorVar(prefix_index+TreeVars::globalNP0Ds, prefix+"NP0Ds", "I", "", counter_index, counter, -NMAXPARTICLES);
669  man.AddVectorVar(prefix_index+TreeVars::globalNHits, prefix+"NHits", "I", "", counter_index, counter, -NMAXPARTICLES);
670  man.AddVectorVar(prefix_index+TreeVars::globalCharge, prefix+"Charge", "F", "", counter_index, counter, -NMAXPARTICLES);
671  man.AddVectorVar(prefix_index+TreeVars::globalMomentum, prefix+"Momentum", "F", "", counter_index, counter, -NMAXPARTICLES);
672 
673  man.AddVectorVar(prefix_index+TreeVars::globalToFFGD1_FGD2, prefix+"ToFFGD1_FGD2", "F", "", counter_index, counter, -NMAXPARTICLES);
674  man.AddVectorVar(prefix_index+TreeVars::globalToFP0D_FGD1, prefix+"ToFP0D_FGD1", "F", "", counter_index, counter, -NMAXPARTICLES);
675  man.AddVectorVar(prefix_index+TreeVars::globalToFECal_FGD1, prefix+"ToFECal_FGD1", "F", "", counter_index, counter, -NMAXPARTICLES);
676  man.AddVectorVar(prefix_index+TreeVars::globalToFECal_FGD2, prefix+"ToFECal_FGD2", "F", "", counter_index, counter, -NMAXPARTICLES);
677  man.AddVectorVar(prefix_index+TreeVars::globalToFFlag_FGD1_FGD2, prefix+"ToFFlag_FGD1_FGD2", "I", "", counter_index, counter, -NMAXPARTICLES);
678  man.AddVectorVar(prefix_index+TreeVars::globalToFFlag_P0D_FGD1, prefix+"ToFFlag_P0D_FGD1", "I", "", counter_index, counter, -NMAXPARTICLES);
679  man.AddVectorVar(prefix_index+TreeVars::globalToFFlag_ECal_FGD1, prefix+"ToFFlag_ECal_FGD1", "I", "", counter_index, counter, -NMAXPARTICLES);
680  man.AddVectorVar(prefix_index+TreeVars::globalToFFlag_ECal_FGD2, prefix+"ToFFlag_ECal_FGD2", "I", "", counter_index, counter, -NMAXPARTICLES);
681 
682  man.AddVectorVar(prefix_index+TreeVars::globalRangeMomentumMuon, prefix+"RangeMomentumMuon", "F", "", counter_index, counter, -NMAXPARTICLES);
683  man.AddMatrixVar(prefix_index+TreeVars::globalDirectionStart, prefix+"DirectionStart", "F", "", counter_index, counter, -NMAXPARTICLES, 3);
684  man.AddMatrixVar(prefix_index+TreeVars::globalDirectionEnd, prefix+"DirectionEnd", "F", "", counter_index, counter, -NMAXPARTICLES, 3);
685  man.AddMatrixVar(prefix_index+TreeVars::globalPositionStart, prefix+"PositionStart", "F", "", counter_index, counter, -NMAXPARTICLES, 4);
686  man.AddMatrixVar(prefix_index+TreeVars::globalPositionEnd, prefix+"PositionEnd", "F", "", counter_index, counter, -NMAXPARTICLES, 4);
687 
688  man.AddVectorVar(prefix_index+TreeVars::globalMomentumFlip, prefix+"MomentumFlip", "F", "", counter_index, counter, -NMAXPARTICLES);
689  man.AddMatrixVar(prefix_index+TreeVars::globalDirectionStartFlip, prefix+"DirectionStartFlip", "F", "", counter_index, counter, -NMAXPARTICLES, 3);
690 
691  man.AddVectorVar(prefix_index+TreeVars::globalTrueTrackID, prefix+"TrueTrackID", "I","",counter_index,counter,-NMAXPARTICLES);
692 
693  // From AnaTrack
694 
695  man.AddVectorVar(prefix_index+TreeVars::globalStatus, prefix+"Status", "I","", counter_index,counter,-NMAXPARTICLES);
696  man.AddVectorVar(prefix_index+TreeVars::globalNNodes, prefix+"NNodes", "I","", counter_index,counter,-NMAXPARTICLES);
697  man.AddVectorVar(prefix_index+TreeVars::globalMomentumError, prefix+"MomentumError", "F","", counter_index,counter,-NMAXPARTICLES);
698 
699  man.AddVectorVar(prefix_index+TreeVars::globalNTRACKERs, prefix+"NTRACKERs", "I","", counter_index,counter,-NMAXPARTICLES);
700  man.AddVectorVar(prefix_index+TreeVars::globalNDOF, prefix+"NDOF", "I","", counter_index,counter,-NMAXPARTICLES);
701  man.AddVectorVar(prefix_index+TreeVars::globalChi2, prefix+"Chi2", "F","", counter_index,counter,-NMAXPARTICLES);
702  man.AddVectorVar(prefix_index+TreeVars::globalMomentumMuon, prefix+"MomentumMuon", "F","", counter_index,counter,-NMAXPARTICLES);
703  man.AddVectorVar(prefix_index+TreeVars::globalMomentumErrorMuon, prefix+"MomentumErrorMuon", "F","", counter_index,counter,-NMAXPARTICLES);
704  man.AddVectorVar(prefix_index+TreeVars::globalMomentumProton, prefix+"MomentumProton", "F","", counter_index,counter,-NMAXPARTICLES);
705  man.AddVectorVar(prefix_index+TreeVars::globalMomentumErrorProton, prefix+"MomentumErrorProton", "F","", counter_index,counter,-NMAXPARTICLES);
706  man.AddVectorVar(prefix_index+TreeVars::globalMomentumEle, prefix+"MomentumEle", "F","", counter_index,counter,-NMAXPARTICLES);
707  man.AddVectorVar(prefix_index+TreeVars::globalMomentumErrorEle, prefix+"MomentumErrorEle", "F","", counter_index,counter,-NMAXPARTICLES);
708 
709 #if VERSION_HAS_REVERSED_REFITS
710  man.AddMatrixVar(prefix_index+TreeVars::globalPositionStartFlip, prefix+"PositionStartFlip", "F","", counter_index,counter,-NMAXPARTICLES,4);
711  man.AddMatrixVar(prefix_index+TreeVars::globalDirectionEndFlip, prefix+"DirectionEndFlip", "F","", counter_index,counter,-NMAXPARTICLES,3);
712 #endif
713 
714 #if VERSION_HAS_PRANGE_ESTIMATES
715  man.AddVectorVar(prefix_index+TreeVars::globalRangeMomentumEle, prefix+"RangeMomentumEle", "F","", counter_index,counter,-NMAXPARTICLES);
716  man.AddVectorVar(prefix_index+TreeVars::globalRangeMomentumProton, prefix+"RangeMomentumProton", "F","", counter_index,counter,-NMAXPARTICLES);
717  man.AddVectorVar(prefix_index+TreeVars::globalRangeMomentumMuonFlip, prefix+"RangeMomentumMuonFlip", "F","", counter_index,counter,-NMAXPARTICLES);
718  man.AddVectorVar(prefix_index+TreeVars::globalRangeMomentumProtonFlip, prefix+"RangeMomentumProtonFlip", "F","", counter_index,counter,-NMAXPARTICLES);
719 #endif
720 
721  man.AddVectorVar(prefix_index+TreeVars::globalReconPDG, prefix+"ReconPDG", "I","", counter_index,counter,-NMAXPARTICLES);
722  man.AddVectorVar(prefix_index+TreeVars::globalBunch, prefix+"Bunch", "I","", counter_index,counter,-NMAXPARTICLES);
723  man.AddVectorVar(prefix_index+TreeVars::globalNReconVertices, prefix+"NReconVertices", "I","", counter_index,counter,-NMAXPARTICLES);
724  man.AddVectorVar(prefix_index+TreeVars::globalMomentumAtVertex, prefix+"MomentumAtVertex", "F","", counter_index,counter,-NMAXPARTICLES);
725  man.AddMatrixVar(prefix_index+TreeVars::globalDirectionAtVertex, prefix+"DirectionAtVertex", "F","", counter_index,counter,-NMAXPARTICLES,3);
726 
727 #if VERSION_HAS_TIME_FITS
728  man.AddVectorVar(prefix_index+TreeVars::globalNTimeNodes, prefix+"NTimeNodes", "I","", counter_index,counter,-NMAXPARTICLES);
729  AnaTimeNodeIO time;
730  time.Define(man, counter, prefix+"TimeNode");
731 #endif
732 
733  // AnaTrack
734  man.AddVectorVar(prefix_index+TreeVars::globalDetectors, prefix+"Detectors", "I","", counter_index,counter,-NMAXPARTICLES);
735  man.AddVectorVar(prefix_index+TreeVars::globalLength, prefix+"Length", "F","", counter_index,counter,-NMAXPARTICLES);
736 
737  counter_index++;
738 }
739 
740 //********************************************************************
741 void AnaTrackIO::Write(OutputManager& man, const std::string& prefix) const{
742  //********************************************************************
743 
744  (void)prefix;
745 
746  if (man.GetCounterValueForVar(prefix_index+TreeVars::globalUniqueID)>= (int)NMAXPARTICLES){
747  std::cout << "AnaTrackB:: too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
748  return;
749  }
750 
751  // AnaTrackBIO
752 
753  man.FillVectorVar(prefix_index+TreeVars::globalUniqueID, UniqueID);
754  man.FillVectorVar(prefix_index+TreeVars::globalNHits, NHits);
755  man.FillVectorVar(prefix_index+TreeVars::globalCharge, Charge);
756  man.FillVectorVar(prefix_index+TreeVars::globalMomentum, Momentum);
757  man.FillVectorVar(prefix_index+TreeVars::globalToFFGD1_FGD2, ToF.FGD1_FGD2);
758  man.FillVectorVar(prefix_index+TreeVars::globalToFP0D_FGD1, ToF.P0D_FGD1);
759  man.FillVectorVar(prefix_index+TreeVars::globalToFECal_FGD1, ToF.ECal_FGD1);
760  man.FillVectorVar(prefix_index+TreeVars::globalToFECal_FGD2, ToF.ECal_FGD2);
761  man.FillVectorVar(prefix_index+TreeVars::globalToFFlag_FGD1_FGD2, ToF.Flag_FGD1_FGD2);
762  man.FillVectorVar(prefix_index+TreeVars::globalToFFlag_P0D_FGD1, ToF.Flag_P0D_FGD1);
763  man.FillVectorVar(prefix_index+TreeVars::globalToFFlag_ECal_FGD1, ToF.Flag_ECal_FGD1);
764  man.FillVectorVar(prefix_index+TreeVars::globalToFFlag_ECal_FGD2, ToF.Flag_ECal_FGD2);
765  man.FillVectorVar(prefix_index+TreeVars::globalRangeMomentumMuon, RangeMomentumMuon);
766 
767  for (UInt_t i=0;i<NDETECTORS;i++){
768  Int_t used = (Int_t)(SubDetId::GetDetectorUsed(Detector, static_cast<SubDetId::SubDetEnum>(subdet_enum[i])));
769  man.FillMatrixVar(prefix_index+TreeVars::globalDetUsed, used, -1, i);
770  }
771 
772  man.FillVectorVar(prefix_index+TreeVars::globalNTPCs, nTPCSegments ); // (int)TPCSegments .size()); - used to be a vector, now a fixed length array with hard coded no. of elements - may change
773  man.FillVectorVar(prefix_index+TreeVars::globalNFGDs, nFGDSegments ); // (int)FGDSegments .size());
774  man.FillVectorVar(prefix_index+TreeVars::globalNECALs, nECALSegments); // (int)ECALSegments.size());
775  man.FillVectorVar(prefix_index+TreeVars::globalNP0Ds, nP0DSegments ); // (int)P0DSegments .size());
776  man.FillVectorVar(prefix_index+TreeVars::globalNSMRDs, nSMRDSegments); // (int)SMRDSegments.size());
777 
778  man.FillMatrixVarFromArray( prefix_index+TreeVars::globalDirectionStart, DirectionStart, -1, 3);
779  man.FillMatrixVarFromArray( prefix_index+TreeVars::globalDirectionEnd, DirectionEnd, -1, 3);
780 
781  man.FillMatrixVarFromArray( prefix_index+TreeVars::globalPositionStart, PositionStart, -1, 4);
782 
783  man.FillMatrixVarFromArray( prefix_index+TreeVars::globalPositionEnd, PositionEnd, -1, 4);
784 
785  man.FillMatrixVarFromArray( prefix_index+TreeVars::globalDirectionStartFlip, DirectionStartFlip, -1, 3);
786 
787  man.FillVectorVar( prefix_index+TreeVars::globalMomentumFlip, MomentumFlip);
788 
789  if (TrueObject)
790  man.FillVectorVar(prefix_index+TreeVars::globalTrueTrackID, TrueObject->ID);
791 
792  man.FillVectorVar(prefix_index+TreeVars::globalStatus, Status);
793  man.FillVectorVar(prefix_index+TreeVars::globalNNodes, NNodes);
794  man.FillVectorVar(prefix_index+TreeVars::globalMomentumError, MomentumError);
795 
796 
797  man.FillVectorVar(prefix_index+TreeVars::globalNDOF, NDOF);
798  man.FillVectorVar(prefix_index+TreeVars::globalChi2, Chi2);
799  man.FillVectorVar(prefix_index+TreeVars::globalMomentumMuon, MomentumMuon);
800  man.FillVectorVar(prefix_index+TreeVars::globalMomentumErrorMuon, MomentumErrorMuon);
801  man.FillVectorVar(prefix_index+TreeVars::globalMomentumProton, MomentumProton);
802  man.FillVectorVar(prefix_index+TreeVars::globalMomentumErrorProton, MomentumErrorProton);
803  man.FillVectorVar(prefix_index+TreeVars::globalMomentumEle, MomentumEle);
804  man.FillVectorVar(prefix_index+TreeVars::globalMomentumErrorEle, MomentumErrorEle);
805 #if VERSION_HAS_REVERSED_REFITS
806  man.FillMatrixVarFromArray( prefix_index+TreeVars::globalPositionStartFlip, PositionStartFlip, -1, 4);
807  man.FillMatrixVarFromArray( prefix_index+TreeVars::globalDirectionEndFlip, DirectionEndFlip, -1, 3);
808 #endif
809 
810 #if VERSION_HAS_PRANGE_ESTIMATES
811  man.FillVectorVar(prefix_index+TreeVars::globalRangeMomentumEle, RangeMomentumEle);
812  man.FillVectorVar(prefix_index+TreeVars::globalRangeMomentumProton, RangeMomentumProton);
813  man.FillVectorVar(prefix_index+TreeVars::globalRangeMomentumMuonFlip, RangeMomentumMuonFlip);
814  man.FillVectorVar(prefix_index+TreeVars::globalRangeMomentumProtonFlip, RangeMomentumProtonFlip);
815 
816 #endif
817 
818  man.FillVectorVar(prefix_index+TreeVars::globalNTRACKERs,(int)TRACKERSegments.size());
819  man.FillVectorVar(prefix_index+TreeVars::globalReconPDG, ReconPDG);
820  man.FillVectorVar(prefix_index+TreeVars::globalBunch, Bunch);
821  man.FillVectorVar(prefix_index+TreeVars::globalNReconVertices, (int)ReconVertices.size());
822  man.FillVectorVar(prefix_index+TreeVars::globalMomentumAtVertex, MomentumAtVertex);
823 
824  man.FillMatrixVarFromArray(prefix_index+TreeVars::globalDirectionAtVertex, DirectionAtVertex, -1, 3);
825 
826 #if VERSION_HAS_TIME_FITS
827  for (UInt_t i = 0; i < TimeNodes.size(); i++){
828  (static_cast<AnaTimeNodeIO*>(TimeNodes[i]))->Write(man,prefix,-1,i);
829  }
830  man.FillVectorVar(prefix_index+TreeVars::globalNTimeNodes,(Int_t)TimeNodes.size());
831 #endif
832 
833  // AnaTrack
834  man.FillVectorVar(prefix_index+TreeVars::globalDetectors, Detectors);
835  man.FillVectorVar(prefix_index+TreeVars::globalLength, Length);
836 
837  man.IncrementCounterForVar(prefix_index+TreeVars::globalUniqueID);
838 }
839 
840 //********************************************************************
841 void AnaDetCrossingIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
842  //********************************************************************
843  man.AddMatrixVar( prefix_index+TreeVars::detCrossInActive, prefix+"InActive", "I","",counter_index,counter,-NMAXTRUEPARTICLES,NMAXCROSSEDDET);
844  man.AddMatrixVar( prefix_index+TreeVars::detCrossDetector, prefix+"Detector", "I","",counter_index,counter,-NMAXTRUEPARTICLES,NMAXCROSSEDDET);
845 
846  man.Add3DMatrixVar(prefix_index+TreeVars::detCrossEntrancePosition, prefix+"EntrancePosition", "F","",counter_index,counter,-NMAXTRUEPARTICLES,NMAXCROSSEDDET,4);
847  man.Add3DMatrixVar(prefix_index+TreeVars::detCrossExitPosition, prefix+"ExitPosition", "F","",counter_index,counter,-NMAXTRUEPARTICLES,NMAXCROSSEDDET,4);
848 
849  man.Add3DMatrixVar(prefix_index+TreeVars::detCrossEntranceMomentum, prefix+"EntranceMomentum", "F","",counter_index,counter,-NMAXTRUEPARTICLES,NMAXCROSSEDDET,4);
850  man.Add3DMatrixVar(prefix_index+TreeVars::detCrossExitMomentum, prefix+"ExitMomentum", "F","",counter_index,counter,-NMAXTRUEPARTICLES,NMAXCROSSEDDET,4);
851 
852 
853  // counter_index++;
854 }
855 
856 //********************************************************************
857 void AnaDetCrossingIO::Write(OutputManager& man, const std::string& prefix, Int_t indx1, Int_t indx2) const{
858  //********************************************************************
859 
860  (void)prefix;
861 
862  if (man.GetCounterValueForVar(prefix_index+TreeVars::trueTrackPDG)>= (int)NMAXTRUEPARTICLES){
863  std::cout << "too many DetCrossingB's. Maximum is " << NMAXTRUEPARTICLES << std::endl;
864  return;
865  }
866 
867  Int_t trueDet;
869 
870  man.FillMatrixVar(prefix_index+TreeVars::detCrossInActive, (int)InActive, indx1,indx2);
871  man.FillMatrixVar(prefix_index+TreeVars::detCrossDetector, trueDet, indx1,indx2);
872 
873  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::detCrossEntrancePosition, EntrancePosition, indx1,indx2, 4);
874  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::detCrossExitPosition, ExitPosition, indx1,indx2, 4);
875 
876  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::detCrossEntranceMomentum, EntranceMomentum, indx1,indx2, 4);
877  man.Fill3DMatrixVarFromArray(prefix_index+TreeVars::detCrossExitMomentum, ExitMomentum, indx1,indx2, 4);
878 
879 }
880 
881 //********************************************************************
882 AnaTrueParticleIO::AnaTrueParticleIO(const AnaTrueParticle& particle){
883 //********************************************************************
884  // AnaTrueObjectC
885  ID = particle.ID;
886 
887  // AnaTrueParticleB
888  PDG = particle.PDG;
889  ParentID = particle.ParentID;
890  ParentPDG = particle.ParentPDG;
891  GParentPDG = particle.GParentPDG;
892 
893  anaUtils::CopyArray(particle.Position, Position, 4);
894  anaUtils::CopyArray(particle.PositionEnd, PositionEnd, 4);
895  anaUtils::CopyArray(particle.Direction, Direction, 3);
896 
897  Momentum = particle.Momentum;
898  Charge = particle.Charge;
899  VertexID = particle.VertexID;
900  TrueVertex = particle.TrueVertex;
901 
902  /// store for each subdetector
903  /// if the true truePart enter the active volume of the subdetector i
904  /// what is the entrance position of the subdetector i
905  /// " " " exit " "
906 
907  anaUtils::CreateArray(DetCrossings, particle.nDetCrossings);
908  for (Int_t i = 0; i < particle.nDetCrossings; i++){
909  DetCrossings[i] = new AnaDetCrossingIO(*particle.DetCrossings[i]);
910  }
911  nDetCrossings = particle.nDetCrossings;
912 
913  DetCrossingsVect.clear();
914 
915 
916 
917  // AnaTrueTrack
918  PrimaryID = particle.PrimaryID;
919  Purity = particle.Purity;
920  Bunch = particle.Bunch;
921  VertexIndex = particle.VertexIndex;
922 
923  IsTruePrimaryPi0DecayPhoton = particle.IsTruePrimaryPi0DecayPhoton;
924  IsTruePrimaryPi0DecayPhotonChild = particle.IsTruePrimaryPi0DecayPhotonChild;
925 
926  ReconParticles.clear();
927 
928  // The vector of "NReconTracks" should be filled with NULL to at least keep the size
929  // this is stored in the flat-trees
930  ReconParticles = std::vector<AnaParticleB*>(particle.ReconParticles.size(), NULL);
931 }
932 
933 
934 //********************************************************************
935 void AnaTrueParticleIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
936  //********************************************************************
937 
938  // AnaTrueTrackBIO
939  man.AddVectorVar(prefix_index+TreeVars::trueTrackID, prefix+"ID", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
940  man.AddVectorVar(prefix_index+TreeVars::trueTrackPDG, prefix+"PDG", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
941  man.AddVectorVar(prefix_index+TreeVars::trueTrackParentPDG, prefix+"ParentPDG", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
942  man.AddVectorVar(prefix_index+TreeVars::trueTrackGParentPDG, prefix+"GParentPDG", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
943  man.AddVectorVar(prefix_index+TreeVars::trueTrackParentID, prefix+"ParentID", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
944  man.AddVectorVar(prefix_index+TreeVars::trueTrackMomentum, prefix+"Momentum", "F","",counter_index,counter,-NMAXTRUEPARTICLES);
945  man.AddVectorVar(prefix_index+TreeVars::trueTrackCharge, prefix+"Charge", "F","",counter_index,counter,-NMAXTRUEPARTICLES);
946  man.AddMatrixVar(prefix_index+TreeVars::trueTrackPosition, prefix+"Position", "F","",counter_index,counter,-NMAXTRUEPARTICLES,4);
947  man.AddMatrixVar(prefix_index+TreeVars::trueTrackPositionEnd, prefix+"PositionEnd", "F","",counter_index,counter,-NMAXTRUEPARTICLES,4);
948  man.AddMatrixVar(prefix_index+TreeVars::trueTrackDirection, prefix+"Direction", "F","",counter_index,counter,-NMAXTRUEPARTICLES,3);
949  man.AddVectorVar(prefix_index+TreeVars::trueTrackTruthVertexID, prefix+"TruthVertexID", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
950  man.AddVectorVar(prefix_index+TreeVars::trueTrackNDetCrossings, prefix+"NDetCrossings", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
951 
952  AnaDetCrossingIO cross;
953  cross.Define(man, counter, prefix);
954 
955 
956  // AnaTrueTrack
957  man.AddVectorVar(prefix_index+TreeVars::trueTrackPrimaryID, prefix+"PrimaryID", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
958  man.AddVectorVar(prefix_index+TreeVars::trueTrackPurity, prefix+"Purity", "F","",counter_index,counter,-NMAXTRUEPARTICLES);
959  man.AddVectorVar(prefix_index+TreeVars::trueTrackBunch, prefix+"Bunch", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
960  man.AddVectorVar(prefix_index+TreeVars::trueTrackNReconTracks, prefix+"NReconTracks", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
961  man.AddVectorVar(prefix_index+TreeVars::trueTrackVertexIndex, prefix+"VertexIndex", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
962 
963  man.AddVectorVar(prefix_index+TreeVars::trueTrackIsTruePrimaryPi0DecayPhoton, prefix+"IsTruePrimaryPi0DecayPhoton", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
964  man.AddVectorVar(prefix_index+TreeVars::trueTrackIsTruePrimaryPi0DecayPhotonChild, prefix+"IsTruePrimaryPi0DecayPhotonChild", "I","",counter_index,counter,-NMAXTRUEPARTICLES);
965 
966  counter_index++;
967 
968 }
969 
970 //********************************************************************
971 void AnaTrueParticleIO::Write(OutputManager& man, const Int_t trueVertexIndex, const std::string& prefix) const{
972  //********************************************************************
973 
974  (void)trueVertexIndex;
975  (void)prefix;
976 
977  if (man.GetCounterValueForVar(prefix_index+TreeVars::trueTrackPDG)>= (int)NMAXTRUEPARTICLES){
978  std::cout << "too many TrueParticle's. Maximum is " << NMAXTRUEPARTICLES << std::endl;
979  return;
980  }
981 
982 
983  // AnaTrueTrackBIO
984  man.FillVectorVar(prefix_index+TreeVars::trueTrackID, ID);
985  man.FillVectorVar(prefix_index+TreeVars::trueTrackPDG, PDG);
986  man.FillVectorVar(prefix_index+TreeVars::trueTrackParentPDG, ParentPDG);
987  man.FillVectorVar(prefix_index+TreeVars::trueTrackGParentPDG, GParentPDG);
988  man.FillVectorVar(prefix_index+TreeVars::trueTrackParentID, ParentID);
989 
990  man.FillVectorVar(prefix_index+TreeVars::trueTrackMomentum, Momentum);
991  man.FillVectorVar(prefix_index+TreeVars::trueTrackCharge, Charge);
992 
993  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueTrackDirection, Direction, -1, 3);
994  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueTrackPosition, Position, -1, 4);
995  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueTrackPositionEnd,PositionEnd,-1, 4);
996 
997  man.FillVectorVar(prefix_index+TreeVars::trueTrackTruthVertexID, VertexID);
998 
999 
1000  for (Int_t i=0;i<nDetCrossings;i++){
1001  //need to fill
1002  static_cast<const AnaDetCrossingIO*>(DetCrossings[i])->AnaDetCrossingIO::Write(man, prefix, -1, i);
1003  }
1004  man.FillVectorVar(prefix_index+TreeVars::trueTrackNDetCrossings, nDetCrossings);
1005 
1006  // AnaTrueTrack
1007  man.FillVectorVar(prefix_index+TreeVars::trueTrackPrimaryID, PrimaryID);
1008  man.FillVectorVar(prefix_index+TreeVars::trueTrackPurity, Purity);
1009  man.FillVectorVar(prefix_index+TreeVars::trueTrackBunch, Bunch);
1010  man.FillVectorVar(prefix_index+TreeVars::trueTrackNReconTracks, (int)ReconParticles.size());
1011 
1012  man.FillVectorVar(prefix_index+TreeVars::trueTrackIsTruePrimaryPi0DecayPhoton, IsTruePrimaryPi0DecayPhoton);
1013  man.FillVectorVar(prefix_index+TreeVars::trueTrackIsTruePrimaryPi0DecayPhotonChild,IsTruePrimaryPi0DecayPhoton);
1014 
1015  // Save the indices with which true vertices are saved (instead of ID) in order to speed up the associations (-1 if vertex not found, maybe not saved).
1016  // (-2 -> default value, when the track doesn't have a vertex).
1017  if (trueVertexIndex==-2) man.FillVectorVar(prefix_index + TreeVars::trueTrackVertexIndex, VertexIndex);
1018  else man.FillVectorVar(prefix_index + TreeVars::trueTrackVertexIndex,trueVertexIndex);
1019 
1020 
1021 
1022  man.IncrementCounterForVar(prefix_index+TreeVars::trueTrackPDG);
1023 }
1024 
1025 
1026 //********************************************************************
1027 void AnaTrueVertexIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
1028  //********************************************************************
1029 
1030  // AnaTrueVertexBIO
1031  man.AddVectorVar(prefix_index+TreeVars::trueVertexID, prefix+"ID", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1032  man.AddVectorVar(prefix_index+TreeVars::trueVertexNuPDG, prefix+"NuPDG", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1033  man.AddVectorVar(prefix_index+TreeVars::trueVertexNuEnergy, prefix+"NuEnergy", "F","",counter_index,counter,-NMAXTRUEVERTICES);
1034  man.AddMatrixVar(prefix_index+TreeVars::trueVertexPosition, prefix+"Position", "F","",counter_index,counter,-NMAXTRUEVERTICES,4);
1035  man.AddVectorVar(prefix_index+TreeVars::trueVertexNTrueTracks, prefix+"NTrueTracks", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1036  man.AddVectorVar(prefix_index+TreeVars::trueVertexBunch, prefix+"Bunch", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1037  man.AddVectorVar(prefix_index+TreeVars::trueVertexDetector, prefix+"Detector", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1038 
1039  // AnaTrueVertex
1040  man.AddMatrixVar(prefix_index+TreeVars::trueVertexLeptonDir, prefix+"LeptonDir", "F","",counter_index,counter,-NMAXTRUEVERTICES,3);
1041  man.AddVectorVar(prefix_index+TreeVars::trueVertexLeptonMom, prefix+"LeptonMom", "F","",counter_index,counter,-NMAXTRUEVERTICES);
1042  man.AddVectorVar(prefix_index+TreeVars::trueVertexLeptonPDG, prefix+"LeptonPDG", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1043  man.AddVectorVar(prefix_index+TreeVars::trueVertexNBaryons, prefix+"NBaryons", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1044  man.AddVectorVar(prefix_index+TreeVars::trueVertexNReconTracks, prefix+"NReconTracks", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1045  man.AddVectorVar(prefix_index+TreeVars::trueVertexNReconVertices, prefix+"NReconVertices", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1046  man.AddMatrixVar(prefix_index+TreeVars::trueVertexNuDir, prefix+"NuDir", "F","",counter_index,counter,-NMAXTRUEVERTICES,3);
1047  man.AddMatrixVar(prefix_index+TreeVars::trueVertexNuParentDecPoint,prefix+"NuParentDecPoint","F","",counter_index,counter,-NMAXTRUEVERTICES,4);
1048  man.AddVectorVar(prefix_index+TreeVars::trueVertexNuParentPDG, prefix+"NuParentPDG", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1049  man.AddMatrixVar(prefix_index+TreeVars::trueVertexProtonDir, prefix+"ProtonDir", "F","",counter_index,counter,-NMAXTRUEVERTICES,3);
1050  man.AddVectorVar(prefix_index+TreeVars::trueVertexProtonMom, prefix+"ProtonMom", "F","",counter_index,counter,-NMAXTRUEVERTICES);
1051  man.AddMatrixVar(prefix_index+TreeVars::trueVertexPionDir, prefix+"PionDir", "F","",counter_index,counter,-NMAXTRUEVERTICES,3);
1052  man.AddVectorVar(prefix_index+TreeVars::trueVertexPionMom, prefix+"PionMom", "F","",counter_index,counter,-NMAXTRUEVERTICES);
1053  man.AddVectorVar(prefix_index+TreeVars::trueVertexQ2, prefix+"Q2", "F","",counter_index,counter,-NMAXTRUEVERTICES);
1054  man.AddVectorVar(prefix_index+TreeVars::trueVertexReacCode, prefix+"ReacCode", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1055  man.AddVectorVar(prefix_index+TreeVars::trueVertexRooVtxEntry, prefix+"RooVtxEntry", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1056  man.AddVectorVar(prefix_index+TreeVars::trueVertexRooVtxIndex, prefix+"RooVtxIndex", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1057  man.AddMatrixVar(prefix_index+TreeVars::trueVertexTargetDir, prefix+"TargetDir", "F","",counter_index,counter,-NMAXTRUEVERTICES,3);
1058  man.AddVectorVar(prefix_index+TreeVars::trueVertexTargetMom, prefix+"TargetMom", "F","",counter_index,counter,-NMAXTRUEVERTICES);
1059  man.AddVectorVar(prefix_index+TreeVars::trueVertexTargetPDG, prefix+"TargetPDG", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1060  man.AddVectorVar(prefix_index+TreeVars::trueVertexIsPauliBlocked, prefix+"IsPauliBlocked", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1061  man.AddVectorVar(prefix_index+TreeVars::trueVertexIsCohOnH, prefix+"IsCohOnH", "I","",counter_index,counter,-NMAXTRUEVERTICES);
1062  man.AddMatrixVar(prefix_index+TreeVars::trueVertexNPrimaryParticles,prefix+"NPrimaryParticles","I","",counter_index,counter,-NMAXTRUEVERTICES,Int_t(ParticleId::kLast)+1);
1063  counter_index++;
1064 }
1065 
1066 //********************************************************************
1067 void AnaTrueVertexIO::Write(OutputManager& man, const std::string& prefix) const{
1068  //********************************************************************
1069 
1070  (void)prefix;
1071 
1072  if (man.GetCounterValueForVar(prefix_index+TreeVars::trueVertexNuPDG)>= (int)NMAXTRUEVERTICES){
1073  std::cout << "too many true vertices. Maximum is " << NMAXTRUEVERTICES << std::endl;
1074  return;
1075  }
1076  man.FillVectorVar (prefix_index+TreeVars::trueVertexID, ID );
1077  man.FillVectorVar (prefix_index+TreeVars::trueVertexNuPDG, NuPDG );
1078  man.FillVectorVar (prefix_index+TreeVars::trueVertexNuEnergy, NuEnergy );
1079  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueVertexPosition, Position, -1, 4);
1080  man.FillVectorVar (prefix_index+TreeVars::trueVertexNTrueTracks, nTrueParticles ); // (int)TrueParticles.size());
1081  man.FillVectorVar (prefix_index+TreeVars::trueVertexBunch, Bunch );
1082  man.FillVectorVar (prefix_index+TreeVars::trueVertexDetector, (Int_t)Detector );
1083 
1084 
1085  man.FillVectorVar(prefix_index+TreeVars::trueVertexRooVtxIndex,RooVtxIndex);
1086  man.FillVectorVar(prefix_index+TreeVars::trueVertexRooVtxEntry,RooVtxEntry);
1087  man.FillVectorVar(prefix_index+TreeVars::trueVertexReacCode, ReacCode);
1088 
1089  man.FillVectorVar(prefix_index+TreeVars::trueVertexTargetPDG, TargetPDG);
1090 
1091  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueVertexNuDir, NuDir, -1, 3);
1092 
1093  man.FillVectorVar(prefix_index+TreeVars::trueVertexNuParentPDG, NuParentPDG);
1094  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueVertexNuParentDecPoint, NuParentDecPoint, -1, 4);
1095 
1096  man.FillVectorVar(prefix_index+TreeVars::trueVertexNBaryons, NBaryons);
1097  man.FillVectorVar(prefix_index+TreeVars::trueVertexLeptonPDG, LeptonPDG);
1098  man.FillVectorVar(prefix_index+TreeVars::trueVertexQ2, Q2);
1099 
1100  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueVertexTargetDir, TargetDir, -1, 3);
1101  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueVertexLeptonDir, LeptonDir, -1, 3);
1102  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueVertexProtonDir, ProtonDir, -1, 3);
1103  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueVertexPionDir, PionDir, -1, 3);
1104 
1105  man.FillVectorVar(prefix_index+TreeVars::trueVertexTargetMom, TargetMom);
1106  man.FillVectorVar(prefix_index+TreeVars::trueVertexLeptonMom, LeptonMom);
1107  man.FillVectorVar(prefix_index+TreeVars::trueVertexProtonMom, ProtonMom);
1108  man.FillVectorVar(prefix_index+TreeVars::trueVertexPionMom, PionMom);
1109 
1110  man.FillVectorVar(prefix_index+TreeVars::trueVertexNReconTracks, (int)ReconParticles.size());
1111  man.FillVectorVar(prefix_index+TreeVars::trueVertexNReconVertices, (int)ReconVertices.size());
1112 
1113  man.FillVectorVar(prefix_index+TreeVars::trueVertexIsPauliBlocked, (int)IsPauliBlocked);
1114  man.FillVectorVar(prefix_index+TreeVars::trueVertexIsCohOnH, (int)IsCohOnH);
1115 
1116  man.FillMatrixVarFromArray(prefix_index+TreeVars::trueVertexNPrimaryParticles, NPrimaryParticles, -1, Int_t(ParticleId::kLast)+1);
1117 
1118  man.IncrementCounterForVar(prefix_index+TreeVars::trueVertexID);
1119 }
1120 
1121 //********************************************************************
1122 AnaBunchIO::AnaBunchIO(const AnaBunch& bunch){
1123  //********************************************************************
1124 
1125  // Only get the info needed to store the flat-trees
1126  Bunch = bunch.Bunch;
1127  Weight = bunch.Weight;
1128 
1129 }
1130 //********************************************************************
1131 void AnaBunchIO::Define(OutputManager& man,const std::string& prefix) const{
1132  //********************************************************************
1133 
1134  man.AddVar(prefix_index+TreeVars::bunchBunch, prefix+"Bunch", "I","");
1135  man.AddVar(prefix_index+TreeVars::bunchWeight,prefix+"Weight", "F","");
1136 }
1137 
1138 //********************************************************************
1139 void AnaBunchIO::Write(OutputManager& man,const std::string& prefix) const{
1140  //********************************************************************
1141 
1142  (void)prefix;
1143 
1144  man.FillVar(prefix_index+TreeVars::bunchBunch, Bunch);
1145  man.FillVar(prefix_index+TreeVars::bunchWeight, Weight);
1146 }
1147 
1148 //********************************************************************
1149 void AnaFgdTimeBinIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
1150  //********************************************************************
1151 
1152  man.AddVectorVar(prefix_index+TreeVars::fgdBinMinTime, prefix+"MinTime", "F","",counter_index,counter,-NMAXFGDTIMEBINS);
1153  man.AddVectorVar(prefix_index+TreeVars::fgdBinNHits1, prefix+"NHits1", "I","",counter_index,counter,-NMAXFGDTIMEBINS);
1154  man.AddVectorVar(prefix_index+TreeVars::fgdBinNHits2, prefix+"NHits2", "I","",counter_index,counter,-NMAXFGDTIMEBINS);
1155  man.AddVectorVar(prefix_index+TreeVars::fgdBinRawChargeSum1, prefix+"RawChargeSum1", "F","",counter_index,counter,-NMAXFGDTIMEBINS);
1156  man.AddVectorVar(prefix_index+TreeVars::fgdBinRawChargeSum2, prefix+"RawChargeSum2", "F","",counter_index,counter,-NMAXFGDTIMEBINS);
1157 
1158  counter_index++;
1159 
1160 }
1161 
1162 //********************************************************************
1163 void AnaFgdTimeBinIO::Write(OutputManager& man,const std::string& prefix) const{
1164  //********************************************************************
1165 
1166  (void)prefix;
1167 
1168  if (man.GetCounterValueForVar(prefix_index+TreeVars::fgdBinMinTime)>= (int)NMAXFGDTIMEBINS){
1169  std::cout << "too many time bins. Maximum is " << NMAXFGDTIMEBINS << std::endl;
1170  return;
1171  }
1172 
1173  man.FillVectorVar(prefix_index+TreeVars::fgdBinMinTime, MinTime);
1174  man.FillVectorVar(prefix_index+TreeVars::fgdBinNHits1, NHits[0]);
1175  man.FillVectorVar(prefix_index+TreeVars::fgdBinNHits2, NHits[1]);
1176  man.FillVectorVar(prefix_index+TreeVars::fgdBinRawChargeSum1, RawChargeSum[0]);
1177  man.FillVectorVar(prefix_index+TreeVars::fgdBinRawChargeSum2, RawChargeSum[1]);
1178 
1179  man.IncrementCounterForVar(prefix_index+TreeVars::fgdBinMinTime);
1180 }
1181 
1182 //********************************************************************
1183 AnaSpillIO::AnaSpillIO(const AnaSpill& spill){
1184  //********************************************************************
1185 
1186  // Only get the info need to dump it into the flat-tree
1187 
1188  GeomID = spill.GeomID;
1189 
1190  NTotalTrueVertices = spill.NTotalTrueVertices;
1191  NTotalTrueParticles = spill.NTotalTrueParticles;
1192 
1193  TriggerIO = new AnaTriggerIO(spill.Trigger);
1194 
1195  InputFileIndex = spill.InputFileIndex;
1196  RooVtxEntry = spill.RooVtxEntry;
1197 
1198  EventInfo = NULL;
1199  if (spill.EventInfo)
1200  EventInfo = new AnaEventInfoIO(*static_cast<const AnaEventInfo*>(spill.EventInfo));
1201 
1202  Beam = NULL;
1203  if (spill.Beam)
1204  Beam = new AnaBeamIO(*static_cast<const AnaBeam*>(spill.Beam));
1205 
1206  DataQuality = NULL;
1207  if (spill.DataQuality)
1208  DataQuality = new AnaDataQualityIO(*static_cast<const AnaDataQuality*>(spill.DataQuality));
1209 
1210 }
1211 //********************************************************************
1212 void AnaSpillIO::Define(OutputManager& man,const std::string& prefix) const{
1213  //********************************************************************
1214 
1215  //--- spill variables -------
1216  man.AddVar(prefix_index+TreeVars::spillNBunches, prefix+"NBunches", "I","");
1217  man.AddVar(prefix_index+TreeVars::spillNTotalTrueVertices, prefix+"NTotalTrueVertices", "I","");
1218  man.AddVar(prefix_index+TreeVars::spillNTotalTrueTracks, prefix+"NTotalTrueTracks", "I","");
1219 
1220  AnaEventInfoIO e; e.Define(man,prefix);
1221  AnaBeamIO b; b.Define(man,prefix+"Beam");
1222  AnaDataQualityIO d; d.Define(man,prefix+"DQ");
1223 
1224  AnaTriggerIO t; t.Define(man, prefix + "Trigger");
1225 
1226  man.AddVar(prefix_index+TreeVars::spillRooVtxEntry, prefix+"RooVtxEntry", "I","");
1227  man.AddVar(prefix_index+TreeVars::spillInputFileIndex, prefix+"InputFileIndex", "I","");
1228 
1229 }
1230 
1231 //********************************************************************
1232 void AnaSpillIO::Write(OutputManager& man,const std::string& prefix) const{
1233  //********************************************************************
1234 
1235  (void)prefix;
1236 
1237  // Spill variables
1238  man.FillVar(prefix_index+TreeVars::spillNBunches, (int)Bunches.size());
1239  man.FillVar(prefix_index+TreeVars::spillNTotalTrueVertices,(int)NTotalTrueVertices);
1240  man.FillVar(prefix_index+TreeVars::spillNTotalTrueTracks, (int)NTotalTrueParticles);
1241 
1242  //because at this moment we can be only more or less sure that the object is of IOB type defined the variables
1243  (static_cast<const AnaEventInfoIO*>(EventInfo))->Write(man,prefix);
1244  (static_cast<const AnaBeamIO*>(Beam))->Write(man,prefix+"Beam");
1245  (static_cast<const AnaDataQualityIO*>(DataQuality))->Write(man,prefix+"DQ");
1246 
1247  TriggerIO->Write(man, prefix + "Trigger");
1248 
1249  man.FillVar(prefix_index+TreeVars::spillInputFileIndex, InputFileIndex);
1250  man.FillVar(prefix_index+TreeVars::spillRooVtxEntry, RooVtxEntry);
1251 }
1252 
1253 //********************************************************************
1254 void AnaEventInfoIO::Define(OutputManager& man,const std::string& prefix) const{
1255  //********************************************************************
1256 
1257  //--- spill variables -------
1258  man.AddVar(prefix_index+TreeVars::eventInfoIsMC, prefix+"IsMC", "I","");
1259  man.AddVar(prefix_index+TreeVars::eventInfoIsSand, prefix+"IsSand", "I","");
1260  man.AddVar(prefix_index+TreeVars::eventInfoRun, prefix+"Run", "I","");
1261  man.AddVar(prefix_index+TreeVars::eventInfoSubRun, prefix+"SubRun", "I","");
1262  man.AddVar(prefix_index+TreeVars::eventInfoEvt, prefix+"Evt", "I","");
1263 }
1264 
1265 //********************************************************************
1266 void AnaEventInfoIO::Write(OutputManager& man,const std::string& prefix) const{
1267  //********************************************************************
1268 
1269  (void)prefix;
1270 
1271  // Spill variables
1272  man.FillVar(prefix_index+TreeVars::eventInfoIsMC, (Int_t)IsMC);
1273  man.FillVar(prefix_index+TreeVars::eventInfoIsSand, (Int_t)IsSand);
1274  man.FillVar(prefix_index+TreeVars::eventInfoRun, Run);
1275  man.FillVar(prefix_index+TreeVars::eventInfoSubRun, SubRun);
1276  man.FillVar(prefix_index+TreeVars::eventInfoEvt, Event);
1277 }
1278 
1279 //********************************************************************
1280 void AnaDataQualityIO::Define(OutputManager& man,const std::string& prefix) const{
1281  //********************************************************************
1282 
1283  //--- spill variables -------
1284  man.AddVar(prefix_index+TreeVars::dqGoodDaq, prefix+"GoodDaq", "I","");
1285 
1286 
1287 }
1288 
1289 //********************************************************************
1290 void AnaDataQualityIO::Write(OutputManager& man,const std::string& prefix) const{
1291  //********************************************************************
1292 
1293  (void)prefix;
1294 
1295  // Spill variables
1296  man.FillVar(prefix_index+TreeVars::dqGoodDaq, GoodDaq);
1297 
1298 }
1299 
1300 //********************************************************************
1301 void AnaBeamIO::Define(OutputManager& man,const std::string& prefix) const{
1302  //********************************************************************
1303 
1304  man.AddVar(prefix_index+TreeVars::beamGoodSpill, prefix+"GoodSpill", "I","");
1305 }
1306 
1307 //********************************************************************
1308 void AnaBeamIO::Write(OutputManager& man,const std::string& prefix) const{
1309  //********************************************************************
1310 
1311  (void)prefix;
1312 
1313  man.FillVar(prefix_index+TreeVars::beamGoodSpill, GoodSpill);
1314 }
1315 
1316 //********************************************************************
1317 void AnaVertexIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
1318  //********************************************************************
1319 
1320  man.AddVectorVar(prefix_index+TreeVars::vertexPrimaryIndex, prefix+"PrimaryIndex", "I","",counter_index,counter,-NMAXVERTICES);
1321  man.AddMatrixVar(prefix_index+TreeVars::vertexPosition, prefix+"Position", "F","",counter_index,counter,-NMAXVERTICES,4);
1322  man.AddVectorVar(prefix_index+TreeVars::vertexNReconTracks, prefix+"NReconTracks", "I","",counter_index,counter,-NMAXVERTICES);
1323  man.AddVectorVar(prefix_index+TreeVars::vertexNTrueVerticesMatch, prefix+"NTrueVerticesMatch","I","",counter_index,counter,-NMAXVERTICES);
1324  man.AddMatrixVar(prefix_index+TreeVars::vertexTracksUniqueID, prefix+"TracksUniqueID", "I","",counter_index,counter,-NMAXVERTICES,NMAXPARTICLESINVERTEX);
1325  man.AddMatrixVar(prefix_index+TreeVars::vertexTrueVertexIndex, prefix+"TrueVertexIndex", "I","",counter_index,counter,-NMAXVERTICES,NMAXTRUEVERTICESMATCH);
1326  man.AddMatrixVar(prefix_index+TreeVars::vertexTrueVerticesClean, prefix+"TrueVerticesClean", "F","",counter_index,counter,-NMAXVERTICES,NMAXTRUEVERTICESMATCH);
1327  man.AddMatrixVar(prefix_index+TreeVars::vertexTrueVerticesCompl, prefix+"TrueVerticesCompl", "F","",counter_index,counter,-NMAXVERTICES,NMAXTRUEVERTICESMATCH);
1328  counter_index++;
1329 }
1330 
1331 //********************************************************************
1332 void AnaVertexIO::Write(OutputManager& man, const std::vector<int> trueVertexIndices, const std::string& prefix) const{
1333  //********************************************************************
1334 
1335  (void)prefix;
1336 
1337  if (man.GetCounterValueForVar(prefix_index+TreeVars::vertexPosition)>= (int)NMAXVERTICES){
1338  std::cout << "AnaVertex:: too many global Vertices. Maximum is " << NMAXVERTICES << std::endl;
1339  return;
1340  }
1341 
1342  man.FillVectorVar(prefix_index+TreeVars::vertexPrimaryIndex, PrimaryIndex);
1343  man.FillMatrixVarFromArray(prefix_index+TreeVars::vertexPosition, Position, -1, 4);
1344 
1345  man.FillVectorVar(prefix_index+TreeVars::vertexNTrueVerticesMatch,(int)TrueVerticesMatch.size());
1346  man.FillVectorVar(prefix_index+TreeVars::vertexNReconTracks, nParticles); // (int)Particles.size());
1347 
1348  for (UInt_t i=0; i<(UInt_t)nParticles; i++){
1349  if(i>=NMAXPARTICLESINVERTEX) {
1350  std::cout << "AnaVertex:: too many global Vertex Constituents. Maximum is " << NMAXPARTICLESINVERTEX << std::endl;
1351  break;
1352  }
1353  if (Particles[i]) man.FillMatrixVar(prefix_index+TreeVars::vertexTracksUniqueID, Particles[i]->UniqueID, -1, i);
1354  }
1355 
1356  for (UInt_t i=0; i<TrueVerticesMatch.size(); i++){
1357  if(i>=NMAXTRUEVERTICESMATCH) {
1358  std::cout << "AnaVertex:: too many TrueVertices associated to a global Vertex. Maximum is " << NMAXTRUEVERTICESMATCH << std::endl;
1359  break;
1360  }
1361  // Save the indices with which true vertices are saved (instead of ID) in order to speed up the associations (-1 if vertex not found, maybe not saved).
1362  // man.FillMatrixVar(prefix_index+TreeVars::TrueVertexIndex, -1, i,TrueVerticesMatch[i].first->ID);
1363  man.FillMatrixVar(prefix_index+TreeVars::vertexTrueVertexIndex, trueVertexIndices[i], -1, i);
1364  man.FillMatrixVar(prefix_index+TreeVars::vertexTrueVerticesClean, TrueVerticesMatch[i].second.Cleanliness, -1, i);
1365  man.FillMatrixVar(prefix_index+TreeVars::vertexTrueVerticesCompl, TrueVerticesMatch[i].second.Completeness, -1, i);
1366  }
1367 
1368  man.IncrementCounterForVar(prefix_index+TreeVars::vertexPrimaryIndex);
1369 }
1370 
1371 //********************************************************************
1372 void AnaEventIO::Define(OutputManager& man,const std::string& prefix) const{
1373  //********************************************************************
1374 
1375  man.AddVar(prefix_index+TreeVars::eventBunch,prefix+"Bunch", "I","");
1376 
1377  static_cast<const AnaEventInfoIO*>(&EventInfo)->Define(man,prefix);
1378  static_cast<const AnaBeamIO*>(Beam)->Define(man,prefix+"Beam");
1379  static_cast<const AnaDataQualityIO*>(DataQuality)->Define(man,prefix+"DQ");
1380 }
1381 
1382 //********************************************************************
1383 void AnaEventIO::Write(OutputManager& man,const std::string& prefix) const{
1384  //********************************************************************
1385 
1386  (void)prefix;
1387 
1388  man.FillVar(prefix_index+TreeVars::eventBunch, Bunch);
1389 
1390  static_cast<const AnaEventInfoIO*>(&EventInfo)->Write(man,prefix);
1391  static_cast<const AnaBeamIO*>(Beam)->Write(man,"Beam");
1392  static_cast<const AnaDataQualityIO*>(DataQuality)->Write(man,"DQ");
1393 }
1394 
1395 //********************************************************************
1396 void AnaTriggerIO::Define(OutputManager& man,const std::string& prefix) const{
1397  //********************************************************************
1398 
1399  man.AddVar(prefix_index+TreeVars::triggerFGDCosmic, prefix+"FGDCosmic", "I","");
1400  man.AddVar(prefix_index+TreeVars::triggerTripTCosmic, prefix+"TripTCosmic","I","");
1401 }
1402 
1403 //********************************************************************
1404 void AnaTriggerIO::Write(OutputManager& man,const std::string& prefix) const{
1405  //********************************************************************
1406 
1407  (void)prefix;
1408 
1409  man.FillVar(prefix_index+TreeVars::triggerFGDCosmic, FGDCosmic);
1410  man.FillVar(prefix_index+TreeVars::triggerTripTCosmic, TripTCosmic);
1411 }
1412 
1413 //********************************************************************
1414 void AnaTimeNodeIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const{
1415  //********************************************************************
1416 
1417  man.AddMatrixVar(prefix_index+TreeVars::globalTimeNodeDetector, prefix+"Detector", "I","",counter_index, counter, -NMAXPARTICLES,NMAXTIMENODES);
1418  man.AddMatrixVar(prefix_index+TreeVars::globalTimeNodeTimeStart, prefix+"TimeStart", "F","",counter_index, counter, -NMAXPARTICLES,NMAXTIMENODES);
1419  man.AddMatrixVar(prefix_index+TreeVars::globalTimeNodeTimeEnd, prefix+"TimeEnd", "F","",counter_index, counter, -NMAXPARTICLES,NMAXTIMENODES);
1420 }
1421 
1422 //********************************************************************
1423 void AnaTimeNodeIO::Write(OutputManager& man, const std::string& prefix, Int_t indx1, Int_t indx2) const{
1424  //********************************************************************
1425 
1426  (void)prefix;
1427 
1428  if (man.GetCounterValueForVar(prefix_index+TreeVars::globalStatus)>= (Int_t)NMAXPARTICLES){
1429  std::cout << "AnaTrack:: too many tracks. Maximum is " << NMAXPARTICLES << std::endl;
1430  return;
1431  }
1432 
1433  man.FillMatrixVar(prefix_index+TreeVars::globalTimeNodeDetector, Detector, indx1,indx2);
1434  man.FillMatrixVar(prefix_index+TreeVars::globalTimeNodeTimeStart, TimeStart, indx1,indx2);
1435  man.FillMatrixVar(prefix_index+TreeVars::globalTimeNodeTimeEnd, TimeEnd, indx1,indx2);
1436 }
1437 
1438 //********************************************************************
1439 void AnaTECALReconObjectIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const {
1440  //********************************************************************
1441 
1442  man.AddVectorVar(prefix_index+TreeVars::tecalReconAverageHitTime, prefix+"AverageHitTime", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1443  man.AddVectorVar(prefix_index+TreeVars::tecalReconAverageZPos, prefix+"AverageZPosition", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1444  man.AddVectorVar(prefix_index+TreeVars::tecalReconContainment, prefix+"Containment", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1445  man.AddVectorVar(prefix_index+TreeVars::tecalReconEFitResult, prefix+"EFitResult", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1446  man.AddVectorVar(prefix_index+TreeVars::tecalReconEFitUncertainty, prefix+"EFitUncertainty", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1447  man.AddVectorVar(prefix_index+TreeVars::tecalReconFirstLayer, prefix+"FirstLayer", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1448  man.AddVectorVar(prefix_index+TreeVars::tecalReconIsShowerLike, prefix+"IsShowerLike", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1449  man.AddVectorVar(prefix_index+TreeVars::tecalReconIsTrackLike, prefix+"IsTrackLike", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1450  man.AddVectorVar(prefix_index+TreeVars::tecalReconLastLayer, prefix+"LastLayer", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1451  man.AddVectorVar(prefix_index+TreeVars::tecalReconLikeMIPEM, prefix+"LikeMIPEM", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1452  man.AddVectorVar(prefix_index+TreeVars::tecalReconLikeMIPPion, prefix+"LikeMIPPion", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1453  man.AddVectorVar(prefix_index+TreeVars::tecalReconLikeEMHIP, prefix+"LikeEMHIP", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1454  man.AddVectorVar(prefix_index+TreeVars::tecalReconLikeMIPEMLow, prefix+"LikeMIPEMLow", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1455  man.AddVectorVar(prefix_index+TreeVars::tecalReconMatchingLike, prefix+"MatchingLike", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1456  man.AddVectorVar(prefix_index+TreeVars::tecalReconMichelTagNDelayedCluster, prefix+"MichelTagNDelayedCluster","I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1457  man.AddVectorVar(prefix_index+TreeVars::tecalReconModule, prefix+"Module", "C","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1458  man.AddVectorVar(prefix_index+TreeVars::tecalReconMostDownStreamLayerHit, prefix+"MostDownStreamLayerHit", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1459  man.AddVectorVar(prefix_index+TreeVars::tecalReconMostUpStreamLayerHit, prefix+"MostUpStreamLayerHit", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1460  man.AddVectorVar(prefix_index+TreeVars::tecalReconNHits, prefix+"NHits", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1461  man.AddVectorVar(prefix_index+TreeVars::tecalReconNLayersHit, prefix+"NLayersHit", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1462  man.AddVectorVar(prefix_index+TreeVars::tecalReconObjectLength, prefix+"ObjectLength", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1463  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDAMR, prefix+"PIDAMR", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1464  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDAngle, prefix+"PIDAngle", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1465  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDAsymmetry, prefix+"PIDAsymmetry", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1466  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDCircularity, prefix+"PIDCircularity", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1467  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDFBR, prefix+"PIDFBR", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1468  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDMaxRatio, prefix+"PIDMaxRatio", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1469  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDMeanPos, prefix+"PIDMeanPos", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1470  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDShowerAngle, prefix+"PIDShowerAngle", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1471  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDShowerWidth, prefix+"PIDShowerWidth", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1472  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDTransverseChargeRatio, prefix+"PIDTransverseChargeRatio","F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1473  man.AddVectorVar(prefix_index+TreeVars::tecalReconPIDTruncatedMaxRatio, prefix+"PIDTruncatedMaxRatio", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1474  man.AddMatrixVar(prefix_index+TreeVars::tecalReconPointing, prefix+"Pointing", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS, 3);
1475  man.AddVectorVar(prefix_index+TreeVars::tecalReconThrust, prefix+"Thrust", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1476  man.AddMatrixVar(prefix_index+TreeVars::tecalReconThrustAxis, prefix+"ThrustAxis", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS, 3);
1477  man.AddMatrixVar(prefix_index+TreeVars::tecalReconThrustOrigin, prefix+"ThrustOrigin", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS, 3);
1478  man.AddVectorVar(prefix_index+TreeVars::tecalReconTimeBunch, prefix+"TimeBunch", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1479  man.AddVectorVar(prefix_index+TreeVars::tecalReconTotalHitCharge, prefix+"TotalHitCharge", "F","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1480  man.AddVectorVar(prefix_index+TreeVars::tecalReconTrueID, prefix+"TrueID", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1481  man.AddVectorVar(prefix_index+TreeVars::tecalReconTrueIDPrimary, prefix+"TrueIDPrimary", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1482  man.AddVectorVar(prefix_index+TreeVars::tecalReconTrueIDRecursive, prefix+"TrueIDRecursive", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1483  man.AddVectorVar(prefix_index+TreeVars::tecalReconTrueIDSingle, prefix+"TrueIDSingle", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1484  man.AddVectorVar(prefix_index+TreeVars::tecalReconUniqueID, prefix+"UniqueID", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1485 
1486  man.AddVectorVar(prefix_index+TreeVars::tecalReconBunch, prefix+"Bunch", "I","",counter_index,counter, -NMAXTECALRECONOBJECTS);
1487 
1488  counter_index++;
1489 
1490 }
1491 
1492 //********************************************************************
1493 void AnaTECALReconObjectIO::Write (OutputManager& man, const std::string& prefix) const{
1494  //********************************************************************
1495 
1496  (void)prefix;
1497 
1498  man.FillVectorVar(prefix_index+TreeVars::tecalReconAverageHitTime, AverageHitTime );
1499  man.FillVectorVar(prefix_index+TreeVars::tecalReconAverageZPos, AverageZPos );
1500  man.FillVectorVar(prefix_index+TreeVars::tecalReconContainment, Containment );
1501  man.FillVectorVar(prefix_index+TreeVars::tecalReconEFitResult, EFitResult );
1502  man.FillVectorVar(prefix_index+TreeVars::tecalReconEFitUncertainty, EFitUncertainty );
1503  man.FillVectorVar(prefix_index+TreeVars::tecalReconFirstLayer, FirstLayer );
1504  man.FillVectorVar(prefix_index+TreeVars::tecalReconIsShowerLike, IsShowerLike );
1505  man.FillVectorVar(prefix_index+TreeVars::tecalReconIsTrackLike, IsTrackLike );
1506  man.FillVectorVar(prefix_index+TreeVars::tecalReconLastLayer, LastLayer );
1507  man.FillVectorVar(prefix_index+TreeVars::tecalReconLikeMIPEM, LikeMIPEM );
1508  man.FillVectorVar(prefix_index+TreeVars::tecalReconLikeMIPPion, LikeMIPPion );
1509  man.FillVectorVar(prefix_index+TreeVars::tecalReconLikeEMHIP, LikeEMHIP );
1510  man.FillVectorVar(prefix_index+TreeVars::tecalReconLikeMIPEMLow, LikeMIPEMLow );
1511  man.FillVectorVar(prefix_index+TreeVars::tecalReconMatchingLike, MatchingLike );
1512  man.FillVectorVar(prefix_index+TreeVars::tecalReconMichelTagNDelayedCluster, MichelTagNDelayedCluster );
1513  man.FillVectorVar(prefix_index+TreeVars::tecalReconModule, Module );
1514  man.FillVectorVar(prefix_index+TreeVars::tecalReconMostDownStreamLayerHit, MostDownStreamLayerHit );
1515  man.FillVectorVar(prefix_index+TreeVars::tecalReconMostUpStreamLayerHit, MostUpStreamLayerHit );
1516  man.FillVectorVar(prefix_index+TreeVars::tecalReconNHits, NHits );
1517  man.FillVectorVar(prefix_index+TreeVars::tecalReconNLayersHit, NLayersHit );
1518  man.FillVectorVar(prefix_index+TreeVars::tecalReconObjectLength, ObjectLength );
1519  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDAMR, PIDAMR );
1520  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDAngle, PIDAngle );
1521  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDAsymmetry, PIDAsymmetry );
1522  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDCircularity, PIDCircularity );
1523  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDFBR, PIDFBR );
1524  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDMaxRatio, PIDMaxRatio );
1525  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDMeanPos, PIDMeanPos );
1526  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDShowerAngle, PIDShowerAngle );
1527  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDShowerWidth, PIDShowerWidth );
1528  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDTransverseChargeRatio, PIDTransverseChargeRatio );
1529  man.FillVectorVar(prefix_index+TreeVars::tecalReconPIDTruncatedMaxRatio, PIDTruncatedMaxRatio );
1530  man.FillMatrixVarFromArray(prefix_index+TreeVars::tecalReconPointing, Pointing, -1, 3);
1531  man.FillVectorVar(prefix_index+TreeVars::tecalReconThrust, Thrust );
1532  man.FillMatrixVarFromArray(prefix_index+TreeVars::tecalReconThrustAxis, ThrustAxis, -1, 3);
1533  man.FillMatrixVarFromArray(prefix_index+TreeVars::tecalReconThrustOrigin, ThrustOrigin, -1, 3);
1534  man.FillVectorVar(prefix_index+TreeVars::tecalReconTimeBunch, TimeBunch );
1535  man.FillVectorVar(prefix_index+TreeVars::tecalReconTotalHitCharge, TotalHitCharge );
1536  man.FillVectorVar(prefix_index+TreeVars::tecalReconTrueID, TrueID );
1537  man.FillVectorVar(prefix_index+TreeVars::tecalReconTrueIDPrimary, TrueIDPrimary );
1538  man.FillVectorVar(prefix_index+TreeVars::tecalReconTrueIDRecursive, TrueIDRecursive );
1539  man.FillVectorVar(prefix_index+TreeVars::tecalReconTrueIDSingle, TrueIDSingle );
1540  man.FillVectorVar(prefix_index+TreeVars::tecalReconUniqueID, UniqueID );
1541 
1542  man.FillVectorVar(prefix_index+TreeVars::tecalReconBunch, Bunch );
1543 
1544  man.IncrementCounterForVar(prefix_index+TreeVars::tecalReconBunch);
1545 
1546 }
1547 
1548 
1549 //********************************************************************
1550 void AnaTECALUnmatchedObjectIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const {
1551  //********************************************************************
1552 
1553  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedAverageHitTime, prefix+"AverageHitTime", "F","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1554  man.AddMatrixVar(prefix_index+TreeVars::tecalUnmatchedBackPos, prefix+"BackPos", "F","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS, 3);
1555  man.AddMatrixVar(prefix_index+TreeVars::tecalUnmatchedFrontPos, prefix+"FrontPos", "F","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS, 3);
1556  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedMostDownStreamLayerHit, prefix+"MostDownStreamLayerHit", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1557  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedMostUpStreamLayerHit, prefix+"MostUpStreamLayerHit", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1558  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedNHits, prefix+"NHits", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1559  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedTotalHitCharge, prefix+"TotalHitCharge", "F","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1560  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedTrueID, prefix+"TrueID", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1561  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedTrueIDPrimary, prefix+"TrueIDPrimary", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1562  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedTrueIDRecursive, prefix+"TrueIDRecursive", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1563  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedTrueIDSingle, prefix+"TrueIDSingle", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1564  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedView, prefix+"View", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1565 
1566  man.AddVectorVar(prefix_index+TreeVars::tecalUnmatchedBunch, prefix+"Bunch", "I","",counter_index,counter, -NMAXTECALUNMATCHEOBJECTS);
1567 
1568  counter_index++;
1569 
1570 }
1571 
1572 //********************************************************************
1573 void AnaTECALUnmatchedObjectIO::Write (OutputManager& man, const std::string& prefix) const{
1574  //********************************************************************
1575 
1576  (void)prefix;
1577 
1578  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedAverageHitTime, AverageHitTime );
1579  man.FillMatrixVarFromArray(prefix_index+TreeVars::tecalUnmatchedBackPos, BackPos, -1,3);
1580  man.FillMatrixVarFromArray(prefix_index+TreeVars::tecalUnmatchedFrontPos, FrontPos, -1,3);
1581  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedMostDownStreamLayerHit, MostDownStreamLayerHit );
1582  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedMostUpStreamLayerHit, MostUpStreamLayerHit );
1583  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedNHits, NHits );
1584  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedTotalHitCharge, TotalHitCharge );
1585  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedTrueID, TrueID );
1586  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedTrueIDPrimary, TrueIDPrimary );
1587  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedTrueIDRecursive, TrueIDRecursive );
1588  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedTrueIDSingle, TrueIDSingle );
1589  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedView, View );
1590 
1591  man.FillVectorVar (prefix_index+TreeVars::tecalUnmatchedBunch, Bunch );
1592 
1593  man.IncrementCounterForVar(prefix_index+TreeVars::tecalUnmatchedBunch);
1594 
1595 }
1596 
1597 //********************************************************************
1598 void AnaP0DReconObjectIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const {
1599  //********************************************************************
1600 
1601  int p0dPrefix = prefix_index;
1602  if ( prefix == "p0dParticle" ) p0dPrefix += TreeVars::p0dParticleAlgorithmName - TreeVars::p0dVertexAlgorithmName; // calculate offset to p0dParticle enum
1603 
1604 
1605  man.AddMatrixVar(p0dPrefix+TreeVars::p0dClusterTruth_PrimaryTrajIDs, prefix+"Truth_PrimaryTrajIDs", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 500);
1606  man.AddMatrixVar(p0dPrefix+TreeVars::p0dClusterTruth_TrajIDs, prefix+"Truth_TrajIDs", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 500);
1607  man.AddMatrixVar(p0dPrefix+TreeVars::p0dClusterTruth_HitCount, prefix+"Truth_HitCount", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 500);
1608  man.AddMatrixVar(p0dPrefix+TreeVars::p0dClusterTruth_ChargeShare, prefix+"Truth_ChargeShare", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 500);
1609  man.AddMatrixVar(p0dPrefix+TreeVars::p0dClusterPosition, prefix+"Position", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 4);
1610  man.AddMatrixVar(p0dPrefix+TreeVars::p0dClusterPosVariance, prefix+"PosVariance", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 4);
1611 
1612  man.AddVectorVar(p0dPrefix+TreeVars::p0dVertexAlgorithmName, prefix+"AlgorithmName", "C", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1613  man.AddVectorVar(p0dPrefix+TreeVars::p0dVertexCycle, prefix+"Cycle", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1614  man.AddVectorVar(p0dPrefix+TreeVars::p0dVertexNHits, prefix+"NHits", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1615  man.AddVectorVar(p0dPrefix+TreeVars::p0dVertexUniqueID, prefix+"UniqueID", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1616  man.AddVectorVar(p0dPrefix+TreeVars::p0dVertexBunch, prefix+"Bunch", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1617 
1618 
1619  man.AddVectorVar(p0dPrefix+TreeVars::p0dVertexValidDimensions, prefix+"ValidDimensions", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1620 
1621  man.AddMatrixVar(p0dPrefix+TreeVars::p0dVertexVertices, prefix+"Vertices", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, NMAXP0DRECONOBJECTS);
1622  man.AddMatrixVar(p0dPrefix+TreeVars::p0dVertexParticles, prefix+"Particles", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, NMAXP0DRECONOBJECTS);
1623  man.AddMatrixVar(p0dPrefix+TreeVars::p0dVertexTracks, prefix+"Tracks", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, NMAXP0DRECONOBJECTS);
1624  man.AddMatrixVar(p0dPrefix+TreeVars::p0dVertexShowers, prefix+"Showers", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, NMAXP0DRECONOBJECTS);
1625  man.AddMatrixVar(p0dPrefix+TreeVars::p0dVertexClusters, prefix+"Clusters", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, NMAXP0DRECONOBJECTS);
1626  man.AddMatrixVar(p0dPrefix+TreeVars::p0dVertexNodes, prefix+"Nodes", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 1000);
1627  man.AddMatrixVar(p0dPrefix+TreeVars::p0dVertexHits, prefix+"Hits", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 1000);
1628 
1629  counter_index++;
1630 
1631 }
1632 
1633 //********************************************************************
1634 void AnaP0DReconObjectIO::Write (OutputManager& man, const std::string& prefix) const {
1635  //********************************************************************
1636 
1637  (void) prefix;
1638 
1639  int p0dPrefix = prefix_index;
1640  if ( prefix == "p0dParticle" ) p0dPrefix += TreeVars::p0dParticleAlgorithmName - TreeVars::p0dVertexAlgorithmName; // calculate offset to p0dParticle enum
1641 
1642  man.FillVectorVar(p0dPrefix+TreeVars::p0dVertexAlgorithmName, AlgorithmName );
1643  man.FillVectorVar(p0dPrefix+TreeVars::p0dVertexCycle, (Int_t)Cycle );
1644  man.FillVectorVar(p0dPrefix+TreeVars::p0dVertexNHits, (Int_t)NHits );
1645  man.FillVectorVar(p0dPrefix+TreeVars::p0dVertexUniqueID, (Int_t)UniqueID );
1646  man.FillVectorVar(p0dPrefix+TreeVars::p0dVertexBunch, Bunch );
1647 
1648  unsigned int iObj = 0;
1649  for (iObj=0; iObj<Vertices .size(); iObj++) man.FillMatrixVar(p0dPrefix+TreeVars::p0dVertexVertices, Vertices [iObj], -1, iObj);
1650  for (iObj=0; iObj<Particles.size(); iObj++) man.FillMatrixVar(p0dPrefix+TreeVars::p0dVertexParticles, Particles[iObj], -1, iObj);
1651  for (iObj=0; iObj<Tracks .size(); iObj++) man.FillMatrixVar(p0dPrefix+TreeVars::p0dVertexTracks, Tracks [iObj], -1, iObj);
1652  for (iObj=0; iObj<Showers .size(); iObj++) man.FillMatrixVar(p0dPrefix+TreeVars::p0dVertexShowers, Showers [iObj], -1, iObj);
1653  for (iObj=0; iObj<Clusters .size(); iObj++) man.FillMatrixVar(p0dPrefix+TreeVars::p0dVertexClusters, Clusters [iObj], -1, iObj);
1654  for (iObj=0; iObj<Nodes .size(); iObj++) man.FillMatrixVar(p0dPrefix+TreeVars::p0dVertexNodes, Nodes [iObj], -1, iObj);
1655  for (iObj=0; iObj<Hits .size(); iObj++) man.FillMatrixVar(p0dPrefix+TreeVars::p0dVertexHits, Hits [iObj], -1, iObj);
1656 
1657  for (iObj=0; iObj<Truth_PrimaryTrajIDs.size(); iObj++) man.FillMatrixVar(prefix_index+TreeVars::p0dClusterTruth_PrimaryTrajIDs, Truth_PrimaryTrajIDs[iObj], -1, iObj);
1658  for (iObj=0; iObj<Truth_TrajIDs .size(); iObj++) man.FillMatrixVar(prefix_index+TreeVars::p0dClusterTruth_TrajIDs, Truth_TrajIDs [iObj], -1, iObj);
1659  for (iObj=0; iObj<Truth_HitCount .size(); iObj++) man.FillMatrixVar(prefix_index+TreeVars::p0dClusterTruth_HitCount, Truth_HitCount [iObj], -1, iObj);
1660  for (iObj=0; iObj<Truth_ChargeShare .size(); iObj++) man.FillMatrixVar(prefix_index+TreeVars::p0dClusterTruth_ChargeShare, Truth_ChargeShare [iObj], -1, iObj);
1661 
1662  man.FillVectorVar (prefix_index+TreeVars::p0dVertexValidDimensions, ValidDimensions );
1663 
1664  man.FillMatrixVarFromArray(prefix_index+TreeVars::p0dClusterPosition, Position, -1, 4);
1665  man.FillMatrixVarFromArray(prefix_index+TreeVars::p0dClusterPosVariance, PosVariance, -1, 4);
1666 
1667 
1668  man.IncrementCounterForVar(p0dPrefix+TreeVars::p0dVertexAlgorithmName);
1669 
1670 }
1671 
1672 //********************************************************************
1673 void AnaP0DReconVertexIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const {
1674  //********************************************************************
1675 
1676  man.AddVectorVar(prefix_index+TreeVars::p0dVertexStatus, prefix+"Status", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1677  man.AddVectorVar(prefix_index+TreeVars::p0dVertexQuality, prefix+"Quality", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1678  man.AddVectorVar(prefix_index+TreeVars::p0dVertexNDOF, prefix+"NDOF", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1679  man.AddVectorVar(prefix_index+TreeVars::p0dVertexFiducial, prefix+"Fiducial", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1680 
1681  // AnaP0DReconObjectIO::Define(man,counter,prefix);
1682 
1683 }
1684 
1685 //********************************************************************
1686 void AnaP0DReconVertexIO::Write (OutputManager& man, const std::string& prefix) const {
1687  //********************************************************************
1688 
1689  (void)prefix;
1690 
1691 
1692  man.FillVectorVar(prefix_index+TreeVars::p0dVertexStatus, Status );
1693  man.FillVectorVar(prefix_index+TreeVars::p0dVertexQuality, Quality);
1694  man.FillVectorVar(prefix_index+TreeVars::p0dVertexNDOF, NDOF );
1695 
1696  man.FillVectorVar (prefix_index+TreeVars::p0dVertexFiducial, Fiducial );
1697 
1698  // AnaP0DReconObjectIO::Write(man,prefix);
1699 
1700 }
1701 
1702 //********************************************************************
1703 void AnaP0DReconParticleIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const {
1704  //********************************************************************
1705 
1706  (void)prefix;
1707 
1708  man.AddVectorVar(prefix_index+TreeVars::p0dParticleStatus, prefix+"Status", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1709  man.AddVectorVar(prefix_index+TreeVars::p0dParticleQuality, prefix+"Quality", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1710  man.AddVectorVar(prefix_index+TreeVars::p0dParticleNDOF, prefix+"NDOF", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1711  man.AddVectorVar(prefix_index+TreeVars::p0dParticleSideDeposit, prefix+"SideDeposit", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1712  man.AddVectorVar(prefix_index+TreeVars::p0dParticleEndDeposit, prefix+"EndDeposit", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1713  man.AddMatrixVar(prefix_index+TreeVars::p0dParticleDirection, prefix+"Direction", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 3);
1714  man.AddMatrixVar(prefix_index+TreeVars::p0dParticleDirVariance, prefix+"DirVariance", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS, 3);
1715  man.AddVectorVar(prefix_index+TreeVars::p0dParticleMomentum, prefix+"Momentum", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1716  man.AddVectorVar(prefix_index+TreeVars::p0dParticleCharge, prefix+"Charge", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1717  man.AddVectorVar(prefix_index+TreeVars::p0dParticleLength, prefix+"Length", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1718  man.AddVectorVar(prefix_index+TreeVars::p0dParticleEDeposit, prefix+"EDeposit", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1719 
1720  // AnaP0DReconObjectIO::Define(man,counter,prefix);
1721 
1722 }
1723 
1724 //********************************************************************
1725 void AnaP0DReconParticleIO::Write (OutputManager& man, const std::string& prefix) const {
1726  //********************************************************************
1727 
1728  (void)prefix;
1729 
1730  man.FillVectorVar(prefix_index+TreeVars::p0dParticleStatus, Status );
1731  man.FillVectorVar(prefix_index+TreeVars::p0dParticleQuality, Quality);
1732  man.FillVectorVar(prefix_index+TreeVars::p0dParticleNDOF, NDOF );
1733  man.FillVectorVar(prefix_index+TreeVars::p0dParticleSideDeposit, SideDeposit );
1734  man.FillVectorVar(prefix_index+TreeVars::p0dParticleEndDeposit, EndDeposit );
1735 
1736 
1737  man.FillMatrixVarFromArray(prefix_index+TreeVars::p0dParticleDirection, Direction, -1, 3);
1738  man.FillMatrixVarFromArray(prefix_index+TreeVars::p0dParticleDirVariance, DirVariance, -1, 3);
1739  man.FillVectorVar (prefix_index+TreeVars::p0dParticleMomentum, Momentum );
1740  man.FillVectorVar (prefix_index+TreeVars::p0dParticleCharge, Charge );
1741  man.FillVectorVar (prefix_index+TreeVars::p0dParticleLength, Length );
1742  man.FillVectorVar (prefix_index+TreeVars::p0dParticleEDeposit, EDeposit );
1743 
1744  // AnaP0DReconObjectIO::Write(man,prefix);
1745 
1746 }
1747 
1748 //********************************************************************
1749 void AnaP0DReconClusterIO::Define(OutputManager& man, const std::string& counter, const std::string& prefix) const {
1750  //********************************************************************
1751 
1752  man.AddVectorVar(prefix_index+TreeVars::p0dClusterNFiducialHits, prefix+"NFiducialHits", "I", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1753  man.AddVectorVar(prefix_index+TreeVars::p0dClusterEDeposit, prefix+"EDeposit", "F", "", counter_index, counter, -NMAXP0DRECONOBJECTS);
1754 
1755  // AnaP0DReconObjectIO::Define(man,counter,prefix);
1756 
1757 }
1758 
1759 //********************************************************************
1760 void AnaP0DReconClusterIO::Write (OutputManager& man, const std::string& prefix) const {
1761  //********************************************************************
1762 
1763  (void)prefix;
1764 
1765  man.FillVectorVar (prefix_index+TreeVars::p0dClusterNFiducialHits, NFiducialHits );
1766  man.FillVectorVar (prefix_index+TreeVars::p0dClusterEDeposit, EDeposit );
1767 
1768  // AnaP0DReconObjectIO::Write(man,prefix);
1769 
1770 }
1771 
1772 //********************************************************************
1773 void AnaLocalReconBunchIO::Define(OutputManager& man,const std::string& prefix) const{
1774  //********************************************************************
1775 
1776  (void)man;
1777  (void)prefix;
1778  // AnaBunchIO::Define(man,prefix);
1779 
1780 }
1781 
1782 //********************************************************************
1783 void AnaLocalReconBunchIO::Write(OutputManager& man,const std::string& prefix) const{
1784  //********************************************************************
1785 
1786  (void)man;
1787  (void)prefix;
1788  // AnaBunchIO::Write(man,prefix);
1789 }
Float_t dEdxexpMuon
Expected dE/dx for a muon, based on the reconstructed momentum.
Float_t Pullmu
Muon pull of the segment: (dEdxMeas-dEdxexpMuon)/dEdxSigmaMuon.
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
Float_t DirectionStartFlip[3]
Direction at the start for the main PID hypothesis and reverse sense.
int nP0DSegments
How many P0D tracks are associated with this track.
virtual void Define(OutputManager &man, const std::string &prefix="") const
Add the variables for representing an AnaBunch to the OutputManager.
Float_t PositionStart[4]
The reconstructed start position of the particle.
Float_t MomentumAtVertex
The reconstructed momentum of the track, at the most primary global vertex (if exists).
void AddVar(Int_t index, const std::string &name, const std::string &type, const std::string &doc, double ini=-9999)
Add a single variable to all trees.
Representation of a global track.
unsigned long Detector
Representation of detector time info.
Int_t InputFileIndex
Index of the input file producing this spill.
int nDetCrossings
The number of DetCrossing objects.
Float_t MomentumEle
Momentum from refitting the track assuming the electron hypothesis.
bool IsTruePrimaryPi0DecayPhoton
Is this a true primary pi0 decay photon or the child of one?
Representation of the beam information, including POT and quality.
Float_t dEdxexpProton
Expected dE/dx for a proton, based on the reconstructed momentum.
virtual void Define(OutputManager &man, const std::string &counter, const std::string &prefix="") const
Add the variables for representing an AnaDetTimeInfo to the OutputManager.
int nECALSegments
How many ECAL tracks are associated with this track.
Int_t Status
The Status of the fit of this reconstructed object.
Int_t NDOF
The number of degrees of freedom when the track was fitted with a Kalman filter.
Float_t DirectionEnd[3]
The reconstructed end direction of the particle.
Float_t Pullpi
Pion pull of the segment: (dEdxMeas-dEdxexpPion)/dEdxSigmaPion.
void FillVectorVar(Int_t index, Float_t var, Int_t indx=-1)
Fill a vector variable.
Int_t NNodes
The number of nodes in the reconstructed object.
Int_t GParentPDG
The PDG code of this particle&#39;s grandparent, or 0 if there is no grandparent.
Int_t Bunch
The bunch of the track, based on the PositionStart.T()
Float_t dEdxSigmaProton
Expected error on the dE/dx measurement, for the proton hypothesis.
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
Float_t Length
The number of hits in the reconstructed object.
AnaToF ToF
Times of flight between pairs of detectors.
void Fill3DMatrixVarFromArray(Int_t index, const Double_t var[], Int_t indx1, Int_t indx2, UInt_t size)
Fill a 3D matrix variable from array.
AnaEventInfoB * EventInfo
Run, sunrun, event, time stamp, etc.
static bool GetDetectorUsed(unsigned long BitField, SubDetId::SubDetEnum det)
Method to see if a certain subdetector or subdetector system is used.
Definition: SubDetId.cxx:40
Float_t Momentum
The initial momentum of the true particle.
Float_t MomentumErrorProton
Error on momentum from refitting the track assuming the proton hypothesis.
Float_t RangeMomentumMuon
Momentum by range calculated with muon hypothesis.
void FillMatrixVarFromArray(Int_t index, const Double_t var[], Int_t indx1, UInt_t size)
Fill a matrix variable from array.
std::vector< AnaParticleB * > ReconParticles
Vector of pointers to AnaParticle&#39;s associated with this true particle.
Float_t dEdxexpPion
Expected dE/dx for a pion, based on the reconstructed momentum.
Int_t VertexID
The TruthVertexID of the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
Int_t UniqueID
The UniqueID of this reconstructed object.
Float_t dEdxexpEle
Expected dE/dx for an electron, based on the reconstructed momentum.
Float_t Charge
The reconstructed charge of the particle.
Int_t ID
The ID of the trueObj, which corresponds to the ID of the TTruthParticle that created it...
Float_t Chi2
The chi2 value when the track was fitted using a Kalman filter.
virtual void Write(OutputManager &man, const std::string &prefix="") const
Fill the current state of the AnaBunch into the OutputManager.
int nSMRDSegments
How many SMRD tracks are associated with this track.
virtual void Write(OutputManager &man, const std::string &prefix="", Int_t indx1=-1, Int_t indx2=0) const
Fill the current state of the AnaDetTimeInfo into the OutputManager.
Float_t MomentumError
Error of the momentum at the start of the segment.
Float_t MomentumFlip
Momentum for the main PID hypothesis and reverse sense.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
Int_t Index
The index of this particle track in the vector of particles. TODO: Not sure it is needed (only use in...
int nTPCSegments
How many TPC tracks are associated with this track.
TVector3 UpstreamHits_Position[2]
const AnaParticleB * Original
UInt_t GeomID
Is this the original Spill or a clone.
Float_t dEdxSigmaKaon
Expected error on the dE/dx measurement, for the proton hypothesis.
Float_t dEdxSigmaEle
Expected error on the dE/dx measurement, for the electron hypothesis.
AnaBeamB * Beam
The beam quality flags for this spill.
AnaDetCrossingB ** DetCrossings
Float_t DirectionAtVertex[3]
The reconstructed direction of the track at the most primary global vertex (if exists).
Float_t EFieldRefitMomentum
Reconstructed momentum with the E-field distortion corrections.
Int_t TPCQualityCut
Whether track passes TPC quality cut.
Int_t PDG
The PDG code of this particle.
Float_t MomentumErrorMuon
Error on momentum from refitting the track assuming the muon hypothesis.
Int_t Detectors
Int_t NHits
The number of hits in the particle.
Int_t ParentPDG
The PDG code of this particle&#39;s immediate parent, or 0 if there is no parent.
Float_t MomentumErrorEle
Error on momentum from refitting the track assuming the electron hypothesis.
Float_t dEdxMeas
dE/dx as measured by the TPC.
static SubDetId::SubDetEnum GetSubdetectorEnum(unsigned long BitField)
Get the single subdetector that this track is from.
Definition: SubDetId.cxx:165
Float_t MomentumEnd
The reconstructed momentum of the particle, at the end position.
Representation of the ND280 data quality flags.
Representation of a TPC segment of a global track.
Float_t Weight
The weight to apply to this bunch (nominally 1). An example is the beam flux weight.
int GetLocalDetEnum(SubDetId::SubDetEnum det, SubDetId::SubDetEnum idet)
Get old local detector enumeration to find array index of Flat tree.
UInt_t NTotalTrueVertices
Float_t Pullk
Kaon pull of the segment: (dEdxMeas-dEdxexpPion)/dEdxSigmaKaon.
Float_t Pullp
Proton pull of the segment: (dEdxMeas-dEdxexpProton)/dEdxSigmaProton.
Int_t RooVtxEntry
Not in the MiniTree for the Moment since it produces a seg fault.
Float_t Length
The length of this global track.
void FillVar(Int_t index, Float_t var)
Fill a single variable.
Float_t MomentumError
The error on the reconstructed momentum.
Representation of the ND280 trigger bits.
Float_t DirectionStart[3]
The reconstructed start direction of the particle.
Int_t Bunch
The index of this bunch (0-7).
Representation of a detector crossing info for a trajectory/track.
virtual void Write(OutputManager &man, const std::string &prefix="") const
Fill the current state of the AnaTriggerIO object into the OutputManager.
Float_t Pullele
Electron pull of the segment: (dEdxMeas-dEdxexpEle)/dEdxSigmaEle.
int nFGDSegments
How many FGD tracks are associated with this track.
AnaTrigger Trigger
Not in the MiniTree for the Moment since it produces a seg fault.
Float_t dEdxSigmaMuon
Expected error on the dE/dx measurement, for the muon hypothesis.
Int_t ParentID
The ID of this particle&#39;s immediate parent, or 0 if there is no parent.
Float_t PositionEnd[4]
The end position of the true particle.
Float_t Purity
The purity with which this particle was matched to a reconstructed object.
Float_t Position[4]
The initial position of the true particle.
void AddMatrixVar(Int_t index, const std::string &name, const std::string &type, const std::string &doc, Int_t counter_index, const std::string &counter_name, int size1=-MAXVECTORSIZE, int size2=-1)
Add a matrix variable to all trees.
Representation of a TPC segment of a global track.
void AddVectorVar(Int_t index, const std::string &name, const std::string &type, const std::string &doc, Int_t counter_index, const std::string &counter_name, Int_t size=-MAXVECTORSIZE)
Add a vector variable to all trees.
Float_t dEdxSigmaPion
Expected error on the dE/dx measurement, for the pion hypothesis.
Float_t Charge
The true charge of the particle.
Representation of a reconstructed particle (track or shower).
AnaDataQualityB * DataQuality
The ND280 data quality flags for this spill.
Int_t ReconPDG
PDG of the most probable particle hypothesis used at reconstruction level.
Float_t Direction[3]
The initial direction of the true particle.
UInt_t NTotalTrueParticles
Representation of a true Monte Carlo trajectory/particle.
Float_t MomentumMuon
Momentum from refitting the track assuming the muon hypothesis.
void FillMatrixVar(Int_t index, Float_t var, Int_t indx1, Int_t indx2)
Fill a matrix variable.
void ConvertBitFieldToTrueParticleDetEnum(unsigned long det, int &trueDet)
Get highland style numbering for true objects.
void Add3DMatrixVar(Int_t index, const std::string &name, const std::string &type, const std::string &doc, Int_t counter_index, const std::string &counter_name, int size1=-MAXVECTORSIZE, int size2=-1, int size3=-1)
Add a 3D matrix variable to all trees.
virtual void Define(OutputManager &man, const std::string &prefix="") const
Add the variables for representing an AnaTriggerIO object to the OutputManager.
Float_t dEdxexpKaon
Expected dE/dx for a proton, based on the reconstructed momentum.
Float_t PositionEnd[4]
The reconstructed end position of the particle.
void ConvertBitFieldToTrackerDetField(unsigned long det, int &trackerDet)
Get highland style tracker combination numbering.
Float_t RefitMomentum
Reconstructed momentum with the empirical distortion corrections.
Float_t MomentumProton
Momentum from refitting the track assuming the proton hypothesis.