1 #include "FlatTreeConverter.hxx" 2 #include "BasicUtils.hxx" 3 #include "TreeConverterUtils.hxx" 4 #include "HighlandTreeConverterUtils.hxx" 5 #include "HighlandAnalysisUtils.hxx" 6 #include "Parameters.hxx" 9 bool suppress_err_msg =
true;
16 _readRooTrackerVtx = readRooTrackerVtx;
19 _RooVtxEntryInCurrentInputFile=0;
31 sBeamBeamRunNumber = 0;
34 for(
int i = 0; i < 7; i++) sDQDetFlag[i] = 0;
37 for (
unsigned int i = 0; i < NMAXTRUEVERTICES; i++) {
38 sTrueVertexNReconTracks[i] = 0;
39 sTrueVertexNReconVertices[i] = 0;
40 sTrueVertexBunch[i] = 0;
41 sTrueVertexLeptonPDG[i] = 0;
43 sTrueVertexTargetMom[i] = 0;
44 sTrueVertexLeptonMom[i] = 0;
45 sTrueVertexProtonMom[i] = 0;
46 sTrueVertexPionMom[i] = 0;
47 sTrueVertexIsPauliBlocked[i] = 0;
48 sTrueVertexIsCohOnH[i] = 0;
50 for (
unsigned int j = 0; j < 3; j++) {
51 sTrueVertexTargetDir[i][j] = 0;
52 sTrueVertexLeptonDir[i][j] = 0;
53 sTrueVertexProtonDir[i][j] = 0;
54 sTrueVertexPionDir[i][j] = 0;
57 for (
int j = 0; j < Int_t(ParticleId::kLast)+1; j++) {
58 sTrueVertexNPrimaryParticles[i][j]=0;
63 for (
unsigned int i = 0; i < NMAXPARTICLES; i++) {
67 trRangeMomentumMuonFlip[i] = 0;
68 trRangeMomentumProtonFlip[i] = 0;
69 trTrueParticleID[i] = 0;
72 for (
unsigned int j = 0; j < NMAXTIMENODES; j++) {
73 trTimeNodeDetector[i][j] = 0;
74 trTimeNodeTimeStart[i][j] = 0;
75 trTimeNodeTimeEnd[i][j] = 0;
78 for (
int j = 0; j < 3; j++) {
79 trDirectionAtVertex[i][j] = 0;
80 trDirectionStartFlip[i][j] = 0;
81 trDirectionEndFlip[i][j] = 0;
84 for (
int j = 0; j < 3; j++) {
85 trTpcUniqueID[i][j] = 0;
86 trTpcLength[i][j] = 0;
87 trTpcPullmu[i][j] = 0;
88 trTpcPullele[i][j] = 0;
90 trTpcPullpi[i][j] = 0;
92 trTpcRawdEdxMeas[i][j] = 0;
93 trTpcRawdEdxExpMu[i][j] = 0;
94 trTpcRawdEdxExpEle[i][j] = 0;
95 trTpcRawdEdxExpP[i][j] = 0;
96 trTpcRawdEdxExpPi[i][j] = 0;
97 trTpcRawdEdxExpK[i][j] = 0;
100 for (
int j = 0; j < 2; j++) {
101 trFgdUniqueID[i][j] = 0;
103 trFgdHasFgdVA[i][j] = 0;
104 trFgdHasFgdVA_fmode[i][j] = 0;
105 trFgdTypeVA[i][j] = 0;
107 trFgdHasFgdEA[i][j] = 0;
108 trFgdHasFgdEA_fmode[i][j] = 0;
109 trFgdTypeEA[i][j] = 0;
110 trFgdEnd0x0[i][j] = 0;
111 trFgdEnd1x1[i][j] = 0;
112 trFgdEnd3x3[i][j] = 0;
113 trFgdEnd5x5[i][j] = 0;
114 trFgdEnd7x7[i][j] = 0;
117 for (
int j = 0; j < (int)NECALSUBDETS; j++) {
118 trECALUniqueID[i][j] = 0;
119 trECALPIDMipPion[i][j] = 0;
120 trECALContainment[i][j] = 0;
123 for (
int j = 0; j < (int)NSMRDSUBDETS; j++) {
124 trSMRDUniqueID[i][j] = 0;
125 trSMRDEDeposit[i][j] = 0;
128 for (
int j = 0; j < 1; j++) {
129 trP0DUniqueID[i][j] = 0;
132 for (
int j = 0; j < (int)NMAXTRACKERS; j++) {
133 trTRACKERDetector[i][j] = 0;
134 trTRACKERNHits[i][j] = 0;
135 trTRACKERNNodes[i][j] = 0;
136 trTRACKERUniqueID[i][j] = 0;
137 trTRACKERLength[i][j] = 0;
138 trTRACKERCharge[i][j] = 0;
139 trTRACKERMomentum[i][j] = 0;
140 trTRACKERMomentumEnd[i][j] = 0;
142 for (
int k = 0; k < 3; k++) {
143 trTRACKERDirectionStart[i][j][k] = 0;
144 trTRACKERDirectionEnd[i][j][k] = 0;
147 for (
int k = 0; k < 4; k++) {
148 trTRACKERPositionStart[i][j][k] = 0;
149 trTRACKERPositionEnd[i][j][k] = 0;
156 for (
unsigned int i=0; i<NMAXTECALRECONOBJECTS; i++){
157 tecalReconAverageHitTime [i] = 0;
158 tecalReconAverageZPosition [i] = 0;
159 tecalReconContainment [i] = 0;
160 tecalReconEFitResult [i] = 0;
161 tecalReconEFitUncertainty [i] = 0;
162 tecalReconFirstLayer [i] = 0;
163 tecalReconIsShowerLike [i] = 0;
164 tecalReconIsTrackLike [i] = 0;
165 tecalReconLastLayer [i] = 0;
166 tecalReconLikeMIPEM [i] = 0;
167 tecalReconLikeMIPPion [i] = 0;
168 tecalReconLikeEMHIP [i] = 0;
169 tecalReconLikeMIPEMLow [i] = 0;
170 tecalReconMatchingLike [i] = 0;
171 tecalReconMichelTagNDelayedCluster[i] = 0;
172 tecalReconModule [i] = 0;
173 tecalReconMostDownStreamLayerHit [i] = 0;
174 tecalReconMostUpStreamLayerHit [i] = 0;
175 tecalReconNHits [i] = 0;
176 tecalReconNLayersHit [i] = 0;
177 tecalReconObjectLength [i] = 0;
178 tecalReconPIDAMR [i] = 0;
179 tecalReconPIDAngle [i] = 0;
180 tecalReconPIDAsymmetry [i] = 0;
181 tecalReconPIDCircularity [i] = 0;
182 tecalReconPIDFBR [i] = 0;
183 tecalReconPIDMaxRatio [i] = 0;
184 tecalReconPIDMeanPos [i] = 0;
185 tecalReconPIDShowerAngle [i] = 0;
186 tecalReconPIDShowerWidth [i] = 0;
187 tecalReconPIDTransverseChargeRatio[i] = 0;
188 tecalReconPIDTruncatedMaxRatio [i] = 0;
189 tecalReconThrust [i] = 0;
190 tecalReconTimeBunch [i] = 0;
191 tecalReconTotalHitCharge [i] = 0;
192 tecalReconTrueID [i] = 0;
193 tecalReconTrueIDPrimary [i] = 0;
194 tecalReconTrueIDRecursive [i] = 0;
195 tecalReconTrueIDSingle [i] = 0;
196 tecalReconUniqueID [i] = 0;
197 tecalReconBunch [i] = 0;
199 for (
int j=0; j<3; j++){
200 tecalReconPointing [i][j] = 0;
201 tecalReconThrustAxis [i][j] = 0;
202 tecalReconThrustOrigin [i][j] = 0;
212 b_sBeamPOTCT4 = NULL;
214 b_sBeamSpillNumber = NULL;
215 b_sBeamBeamRunNumber = NULL;
216 b_sDQND280Flag = NULL;
220 b_sTrueVertexLeptonPDG = NULL;
221 b_sTrueVertexLeptonDir = NULL;
222 b_sTrueVertexProtonDir = NULL;
223 b_sTrueVertexPionDir = NULL;
224 b_sTrueVertexLeptonMom = NULL;
225 b_sTrueVertexProtonMom = NULL;
226 b_sTrueVertexPionMom = NULL;
227 b_sTrueVertexIsPauliBlocked = NULL;
228 b_sTrueVertexIsCohOnH = NULL;
229 b_sTrueVertexNPrimaryParticles = NULL;
230 b_sTrueVertexPionMom = NULL;
231 b_sTrueVertexTargetDir = NULL;
232 b_sTrueVertexTargetMom = NULL;
235 b_trDirectionAtVertex = NULL;
237 b_trNTRACKERs = NULL;
239 b_trTpcPullmu = NULL;
240 b_trTpcPullele = NULL;
242 b_trTpcPullpi = NULL;
244 b_trNTimeNodes = NULL;
245 b_trTimeNodeDetector = NULL;
246 b_trTimeNodeTimeStart = NULL;
247 b_trTimeNodeTimeEnd = NULL;
249 b_trTpcUniqueID = NULL;
250 b_trFgdUniqueID = NULL;
251 b_trECALUniqueID = NULL;
252 b_trSMRDUniqueID = NULL;
253 b_trP0DUniqueID = NULL;
255 b_trTpcRawdEdxMeas = NULL;
256 b_trTpcRawdEdxExpMu = NULL;
257 b_trTpcRawdEdxExpEle = NULL;
258 b_trTpcRawdEdxExpP = NULL;
259 b_trTpcRawdEdxExpPi = NULL;
260 b_trTpcRawdEdxExpK = NULL;
262 b_trFgdHasFgdVA = NULL;
263 b_trFgdHasFgdVA_fmode = NULL;
264 b_trFgdTypeVA = NULL;
265 b_trFgdHasFgdEA = NULL;
266 b_trFgdHasFgdEA_fmode = NULL;
267 b_trFgdTypeEA = NULL;
268 b_trFgdEnd0x0 = NULL;
269 b_trFgdEnd1x1 = NULL;
270 b_trFgdEnd3x3 = NULL;
271 b_trFgdEnd5x5 = NULL;
272 b_trFgdEnd7x7 = NULL;
274 b_trP0DAvgTime = NULL;
276 b_trTRACKERDetector = NULL;
277 b_trTRACKERNHits = NULL;
278 b_trTRACKERNNodes = NULL;
279 b_trTRACKERUniqueID = NULL;
280 b_trTRACKERLength = NULL;
281 b_trTRACKERDirectionStart = NULL;
282 b_trTRACKERDirectionEnd = NULL;
283 b_trTRACKERPositionStart = NULL;
284 b_trTRACKERPositionEnd = NULL;
285 b_trTRACKERCharge = NULL;
286 b_trTRACKERMomentum = NULL;
287 b_trTRACKERMomentumEnd = NULL;
289 b_trDirectionStartFlip = NULL;
290 b_trDirectionEndFlip = NULL;
291 b_trRangeMomentumMuonFlip = NULL;
292 b_trRangeMomentumProtonFlip = NULL;
293 b_trMomentumAtVertex = NULL;
296 b_trECALPIDMipPion = NULL;
297 b_trECALContainment = NULL;
300 b_trSMRDEDeposit = NULL;
302 b_tecalReconCounter = NULL;
303 b_tecalReconAverageHitTime = NULL;
304 b_tecalReconAverageZPosition = NULL;
305 b_tecalReconContainment = NULL;
306 b_tecalReconEFitResult = NULL;
307 b_tecalReconEFitUncertainty = NULL;
308 b_tecalReconFirstLayer = NULL;
309 b_tecalReconIsShowerLike = NULL;
310 b_tecalReconIsTrackLike = NULL;
311 b_tecalReconLastLayer = NULL;
312 b_tecalReconLikeMIPEM = NULL;
313 b_tecalReconLikeMIPPion = NULL;
314 b_tecalReconLikeEMHIP = NULL;
315 b_tecalReconLikeMIPEMLow = NULL;
316 b_tecalReconMatchingLike = NULL;
317 b_tecalReconMichelTagNDelayedCluster = NULL;
318 b_tecalReconModule = NULL;
319 b_tecalReconMostDownStreamLayerHit = NULL;
320 b_tecalReconMostUpStreamLayerHit = NULL;
321 b_tecalReconNHits = NULL;
322 b_tecalReconNLayersHit = NULL;
323 b_tecalReconObjectLength = NULL;
324 b_tecalReconPIDAMR = NULL;
325 b_tecalReconPIDAngle = NULL;
326 b_tecalReconPIDAsymmetry = NULL;
327 b_tecalReconPIDCircularity = NULL;
328 b_tecalReconPIDFBR = NULL;
329 b_tecalReconPIDMaxRatio = NULL;
330 b_tecalReconPIDMeanPos = NULL;
331 b_tecalReconPIDShowerAngle = NULL;
332 b_tecalReconPIDShowerWidth = NULL;
333 b_tecalReconPIDTransverseChargeRatio = NULL;
334 b_tecalReconPIDTruncatedMaxRatio = NULL;
335 b_tecalReconPointing = NULL;
336 b_tecalReconThrust = NULL;
337 b_tecalReconThrustAxis = NULL;
338 b_tecalReconThrustOrigin = NULL;
339 b_tecalReconTimeBunch = NULL;
340 b_tecalReconTotalHitCharge = NULL;
341 b_tecalReconTrueID = NULL;
342 b_tecalReconTrueIDPrimary = NULL;
343 b_tecalReconTrueIDRecursive = NULL;
344 b_tecalReconTrueIDSingle = NULL;
345 b_tecalReconUniqueID = NULL;
346 b_tecalReconBunch = NULL;
359 _useCorrectedValues = ND::params().
GetParameterI(
"highlandIO.ReadFlatTree.UseCorrectedValues");
363 _isUsingReconDirP0D = ND::params().
GetParameterI(
"highlandIO.FlatTree.UseReconDirP0D" );
364 _isUsingReconDirPECAL = ND::params().
GetParameterI(
"highlandIO.FlatTree.UseReconDirP0DECal" );
365 _isUsingReconDirTECAL = ND::params().
GetParameterI(
"highlandIO.FlatTree.UseReconDirTrackerECal");
381 anaUtils::ConfigureTreeBranch(
fChain,
"sIsMC", &sIsMC, &b_sIsMC);
382 anaUtils::ConfigureTreeBranch(
fChain,
"sEventTime", &sEventTime, &b_sEventTime);
383 anaUtils::ConfigureTreeBranch(
fChain,
"sNTotalTrueTracks", &sNTotalTrueParticles, &b_sNTotalTrueParticles);
384 anaUtils::ConfigureTreeBranch(
fChain,
"sNTotalTrueVertices", &sNTotalTrueVertices, &b_sNTotalTrueVertices);
386 anaUtils::ConfigureTreeBranch(
fChain,
"sInputFileIndex", &sInputFileIndex, &b_sInputFileIndex);
387 anaUtils::ConfigureTreeBranch(
fChain,
"sRooVtxEntry", &sRooVtxEntry, &b_sRooVtxEntry);
390 anaUtils::ConfigureTreeBranch(
fChain,
"sBeamPOT", &sBeamPOT, &b_sBeamPOT);
391 #if !VERSION_HAS_OFFICIAL_POT 392 anaUtils::ConfigureTreeBranch(
fChain,
"sBeamPOTCT4", &sBeamPOTCT4, &b_sBeamPOTCT4);
394 anaUtils::ConfigureTreeBranch(
fChain,
"sBeamSpill", &sBeamSpill, &b_sBeamSpill);
395 anaUtils::ConfigureTreeBranch(
fChain,
"sBeamSpillNumber", &sBeamSpillNumber, &b_sBeamSpillNumber);
396 anaUtils::ConfigureTreeBranch(
fChain,
"sBeamGoodSpill", &sBeamGoodSpill, &b_sBeamGoodSpill);
397 anaUtils::ConfigureTreeBranch(
fChain,
"sBeamBeamRunNumber", &sBeamBeamRunNumber, &b_sBeamBeamRunNumber);
398 anaUtils::ConfigureTreeBranch(
fChain,
"sDQGoodDaq", &sDQGoodDaq, &b_sDQGoodDaq);
399 anaUtils::ConfigureTreeBranch(
fChain,
"sDQND280Flag", &sDQND280Flag, &b_sDQND280Flag);
400 anaUtils::ConfigureTreeBranch(
fChain,
"sDQDetFlag", sDQDetFlag, &b_sDQDetFlag);
401 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexRooVtxIndex", sTrueVertexRooVtxIndex, &b_sTrueVertexRooVtxIndex);
402 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexRooVtxEntry", sTrueVertexRooVtxEntry, &b_sTrueVertexRooVtxEntry);
403 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexReacCode", sTrueVertexReacCode, &b_sTrueVertexReacCode);
404 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexNTrueTracks", sTrueVertexNTrueParticles, &b_sTrueVertexNTrueParticles);
408 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexDetector", sTrueVertexDetector, &b_sTrueVertexDetector);
409 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexLeptonPDG", sTrueVertexLeptonPDG, &b_sTrueVertexLeptonPDG);
410 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexTargetPDG", sTrueVertexTargetPDG, &b_sTrueVertexTargetPDG);
411 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexNuEnergy", sTrueVertexNuEnergy, &b_sTrueVertexNuEnergy);
413 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexPosition", sTrueVertexPosition, &b_sTrueVertexPosition);
414 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexNuParentPDG", sTrueVertexNuParentPDG, &b_sTrueVertexNuParentPDG);
415 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexNuParentDecPoint", sTrueVertexNuParentDecPoint, &b_sTrueVertexNuParentDecPoint);
416 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexNuDir", sTrueVertexNuDir, &b_sTrueVertexNuDir);
417 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexTargetDir", sTrueVertexTargetDir, &b_sTrueVertexTargetDir);
418 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexLeptonDir", sTrueVertexLeptonDir, &b_sTrueVertexLeptonDir);
419 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexProtonDir", sTrueVertexProtonDir, &b_sTrueVertexProtonDir);
420 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexPionDir", sTrueVertexPionDir, &b_sTrueVertexPionDir);
421 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexTargetMom", sTrueVertexTargetMom, &b_sTrueVertexTargetMom);
422 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexLeptonMom", sTrueVertexLeptonMom, &b_sTrueVertexLeptonMom);
423 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexProtonMom", sTrueVertexProtonMom, &b_sTrueVertexProtonMom);
424 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexPionMom", sTrueVertexPionMom, &b_sTrueVertexPionMom);
425 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexIsPauliBlocked", sTrueVertexIsPauliBlocked, &b_sTrueVertexIsPauliBlocked);
426 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexIsCohOnH", sTrueVertexIsCohOnH, &b_sTrueVertexIsCohOnH);
427 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueVertexNPrimaryParticles", sTrueVertexNPrimaryParticles, &b_sTrueVertexNPrimaryParticles);
429 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackPDG", sTrueParticlePDG, &b_sTrueParticlePDG);
430 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackParentPDG", sTrueParticleParentPDG, &b_sTrueParticleParentPDG);
431 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackGParentPDG", sTrueParticleGParentPDG, &b_sTrueParticleGParentPDG);
432 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackPrimaryID", sTrueParticlePrimaryID, &b_sTrueParticlePrimaryID);
433 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackParentID", sTrueParticleParentID, &b_sTrueParticleParentID);
435 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackMomentum", sTrueParticleMomentum, &b_sTrueParticleMomentum);
436 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackCharge", sTrueParticleCharge, &b_sTrueParticleCharge);
438 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackPosition", sTrueParticlePosition, &b_sTrueParticlePosition);
439 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackPositionEnd", sTrueParticlePositionEnd, &b_sTrueParticlePositionEnd);
440 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackDirection", sTrueParticleDirection, &b_sTrueParticleDirection);
441 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackNDetCrossings", sTrueParticleNDetCrossings, &b_sTrueParticleNDetCrossings);
442 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackEntrancePosition", sTrueParticleEntrancePosition, &b_sTrueParticleEntrancePosition);
443 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackEntranceMomentum", sTrueParticleEntranceMomentum, &b_sTrueParticleEntranceMomentum);
444 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackExitPosition", sTrueParticleExitPosition, &b_sTrueParticleExitPosition);
445 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackExitMomentum", sTrueParticleExitMomentum, &b_sTrueParticleExitMomentum);
446 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackInActive", sTrueParticleInActive, &b_sTrueParticleInActive);
447 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackDetector", sTrueParticleDetector, &b_sTrueParticleDetector);
448 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackIsTruePrimaryPi0DecayPhoton", sTrueParticleIsTruePrimaryPi0DecayPhoton, &b_sTrueParticleIsTruePrimaryPi0DecayPhoton);
449 anaUtils::ConfigureTreeBranch(
fChain,
"sTrueTrackIsTruePrimaryPi0DecayPhotonChild", sTrueParticleIsTruePrimaryPi0DecayPhotonChild, &b_sTrueParticleIsTruePrimaryPi0DecayPhotonChild);
450 anaUtils::ConfigureTreeBranch(
fChain,
"sFgdTimeBinMinTime", sFgdTimeBinMinTime, &b_sFgdTimeBinMinTime);
451 anaUtils::ConfigureTreeBranch(
fChain,
"sFgdTimeBinMaxTime", sFgdTimeBinMaxTime, &b_sFgdTimeBinMaxTime);
452 anaUtils::ConfigureTreeBranch(
fChain,
"sFgdTimeBinRawChargeSum1", sFgdTimeBinRawChargeSum1, &b_sFgdTimeBinRawChargeSum1);
453 anaUtils::ConfigureTreeBranch(
fChain,
"sFgdTimeBinRawChargeSum2", sFgdTimeBinRawChargeSum2, &b_sFgdTimeBinRawChargeSum2);
463 anaUtils::ConfigureTreeBranch(
fChain,
"vNReconTracks", &vNReconParticles, &b_vNReconParticles);
464 anaUtils::ConfigureTreeBranch(
fChain,
"vNTrueVerticesMatch", &vNTrueVerticesMatch, &b_vNTrueVerticesMatch);
465 anaUtils::ConfigureTreeBranch(
fChain,
"vTracksUniqueID", &vParticlesUniqueID, &b_vParticlesUniqueID);
466 anaUtils::ConfigureTreeBranch(
fChain,
"vTrueVertexIndex", &vTrueVertexIndex, &b_vTrueVertexIndex);
467 anaUtils::ConfigureTreeBranch(
fChain,
"vTrueVerticesClean", &vTrueVerticesClean, &b_vTrueVerticesClean);
468 anaUtils::ConfigureTreeBranch(
fChain,
"vTrueVerticesCompl", &vTrueVerticesCompl, &b_vTrueVerticesCompl);
471 anaUtils::ConfigureTreeBranch(
fChain,
"trReconPDG", trReconPDG, &b_trReconPDG);
474 anaUtils::ConfigureTreeBranch(
fChain,
"trDetectors", trDetectors, &b_trDetectors);
480 anaUtils::ConfigureTreeBranch(
fChain,
"trNTRACKERs", trNTRACKERs, &b_trNTRACKERs);
481 anaUtils::ConfigureTreeBranch(
fChain,
"trNHits", trNHits, &b_trNHits);
482 anaUtils::ConfigureTreeBranch(
fChain,
"trNNodes", trNNodes, &b_trNNodes);
483 anaUtils::ConfigureTreeBranch(
fChain,
"trNDOF", trNDOF, &b_trNDOF);
484 anaUtils::ConfigureTreeBranch(
fChain,
"trChi2", trChi2, &b_trChi2);
485 anaUtils::ConfigureTreeBranch(
fChain,
"trCharge", trCharge, &b_trCharge);
486 anaUtils::ConfigureTreeBranch(
fChain,
"trMomentum", trMomentum, &b_trMomentum);
488 anaUtils::ConfigureTreeBranch(
fChain,
"trMomentumMuon", trMomentumMuon, &b_trMomentumMuon);
490 anaUtils::ConfigureTreeBranch(
fChain,
"trMomentumProton", trMomentumProton, &b_trMomentumProton);
492 anaUtils::ConfigureTreeBranch(
fChain,
"trMomentumEle", trMomentumEle, &b_trMomentumEle);
496 anaUtils::ConfigureTreeBranch(
fChain,
"trLength", trLength, &b_trLength);
498 #if VERSION_HAS_REVERSED_REFITS 499 anaUtils::ConfigureTreeBranch(
fChain,
"trDirectionStartFlip", trDirectionStartFlip, &b_trDirectionStartFlip);
500 anaUtils::ConfigureTreeBranch(
fChain,
"trDirectionEndFlip", trDirectionEndFlip, &b_trDirectionEndFlip);
504 #if VERSION_HAS_PRANGE_ESTIMATES 506 anaUtils::ConfigureTreeBranch(
fChain,
"trRangeMomentumProton", trRangeMomentumProton, &b_trRangeMomentumProton);
511 anaUtils::ConfigureTreeBranch(
fChain,
"trMomentumAtVertex", trMomentumAtVertex, &b_trMomentumAtVertex);
512 anaUtils::ConfigureTreeBranch(
fChain,
"trDirectionAtVertex", trDirectionAtVertex, &b_trDirectionAtVertex);
513 anaUtils::ConfigureTreeBranch(
fChain,
"trDirectionStart", trDirectionStart, &b_trDirectionStart);
514 anaUtils::ConfigureTreeBranch(
fChain,
"trDirectionEnd", trDirectionEnd, &b_trDirectionEnd);
515 anaUtils::ConfigureTreeBranch(
fChain,
"trPositionStart", trPositionStart, &b_trPositionStart);
516 anaUtils::ConfigureTreeBranch(
fChain,
"trPositionEnd", trPositionEnd, &b_trPositionEnd);
517 anaUtils::ConfigureTreeBranch(
fChain,
"trTrueTrackID", trTrueParticleID, &b_trTrueParticleID);
519 #if VERSION_HAS_TIME_FITS 525 anaUtils::ConfigureTreeBranch(
fChain,
"trToFFGD1_FGD2", trToFFGD1_FGD2, &b_trToFFGD1_FGD2);
526 anaUtils::ConfigureTreeBranch(
fChain,
"trToFP0D_FGD1", trToFP0D_FGD1, &b_trToFP0D_FGD1);
527 anaUtils::ConfigureTreeBranch(
fChain,
"trToFECal_FGD1", trToFECal_FGD1, &b_trToFECal_FGD1);
528 anaUtils::ConfigureTreeBranch(
fChain,
"trToFECal_FGD2", trToFECal_FGD2, &b_trToFECal_FGD2);
529 anaUtils::ConfigureTreeBranch(
fChain,
"trToFFlag_FGD1_FGD2", trToFFlag_FGD1_FGD2, &b_trToFFlag_FGD1_FGD2);
530 anaUtils::ConfigureTreeBranch(
fChain,
"trToFFlag_P0D_FGD1", trToFFlag_P0D_FGD1, &b_trToFFlag_P0D_FGD1);
531 anaUtils::ConfigureTreeBranch(
fChain,
"trToFFlag_ECal_FGD1", trToFFlag_ECal_FGD1, &b_trToFFlag_ECal_FGD1);
532 anaUtils::ConfigureTreeBranch(
fChain,
"trToFFlag_ECal_FGD2", trToFFlag_ECal_FGD2, &b_trToFFlag_ECal_FGD2);
536 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcNHits", trTpcNHits, &b_trTpcNHits);
537 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcUniqueID", trTpcUniqueID, &b_trTpcUniqueID);
538 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcLength", trTpcLength, &b_trTpcLength);
539 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcDirectionStart", trTpcDirectionStart, &b_trTpcDirectionStart);
540 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcDirectionEnd", trTpcDirectionEnd, &b_trTpcDirectionEnd);
541 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcPositionStart", trTpcPositionStart, &b_trTpcPositionStart);
542 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcPositionEnd", trTpcPositionEnd, &b_trTpcPositionEnd);
543 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcCharge", trTpcCharge, &b_trTpcCharge);
544 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcMomentum", trTpcMomentum, &b_trTpcMomentum);
545 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcMomentumError", trTpcMomentumError, &b_trTpcMomentumError);
546 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcBackMomentum", trTpcBackMomentum, &b_trTpcBackMomentum);
547 #if VERSION_HAS_BFIELD_REFIT 548 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRefitMomentum", trTpcRefitMomentum, &b_trTpcRefitMomentum);
550 #if VERSION_HAS_BFIELD_REFIT_FULL 551 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRefitCharge", trTpcRefitCharge, &b_trTpcRefitCharge);
552 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRefitDirection",trTpcRefitDirection, &b_trTpcRefitDirection);
553 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRefitPosition", trTpcRefitPosition, &b_trTpcRefitPosition);
555 #if VERSION_HAS_EFIELD_REFIT 556 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcEFieldRefitMomentum", trTpcEFieldRefitMomentum, &b_trTpcEFieldRefitMomentum);
558 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcPullmu", trTpcPullmu, &b_trTpcPullmu);
559 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcPullele", trTpcPullele, &b_trTpcPullele);
560 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcPullp", trTpcPullp, &b_trTpcPullp);
561 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcPullpi", trTpcPullpi, &b_trTpcPullpi);
562 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcPullk", trTpcPullk, &b_trTpcPullk);
563 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxMeas", trTpcdEdxMeas, &b_trTpcdEdxMeas);
564 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxExpMu", trTpcdEdxExpMu, &b_trTpcdEdxExpMu);
565 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxExpEle", trTpcdEdxExpEle, &b_trTpcdEdxExpEle);
566 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxExpP", trTpcdEdxExpP, &b_trTpcdEdxExpP);
567 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxExpPi", trTpcdEdxExpPi, &b_trTpcdEdxExpPi);
568 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxExpK", trTpcdEdxExpK, &b_trTpcdEdxExpK);
569 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRawdEdxMeas", trTpcRawdEdxMeas, &b_trTpcRawdEdxMeas);
570 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRawdEdxExpMu", trTpcRawdEdxExpMu, &b_trTpcRawdEdxExpMu);
571 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRawdEdxExpEle", trTpcRawdEdxExpEle, &b_trTpcRawdEdxExpEle);
572 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRawdEdxExpP", trTpcRawdEdxExpP, &b_trTpcRawdEdxExpP);
573 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRawdEdxExpPi", trTpcRawdEdxExpPi, &b_trTpcRawdEdxExpPi);
574 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcRawdEdxExpK", trTpcRawdEdxExpK, &b_trTpcRawdEdxExpK);
575 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxSigmaMu", trTpcdEdxSigmaMu, &b_trTpcdEdxSigmaMu);
576 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxSigmaEle", trTpcdEdxSigmaEle, &b_trTpcdEdxSigmaEle);
577 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxSigmaP", trTpcdEdxSigmaP, &b_trTpcdEdxSigmaP);
578 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxSigmaPi", trTpcdEdxSigmaPi, &b_trTpcdEdxSigmaPi);
579 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcdEdxSigmaK", trTpcdEdxSigmaK, &b_trTpcdEdxSigmaK);
581 anaUtils::ConfigureTreeBranch(
fChain,
"trTpcTrueTrackID", trTpcTrueParticleID, &b_trTpcTrueParticleID);
582 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdDetector", trFgdDetector, &b_trFgdDetector);
583 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdNHits", trFgdNHits, &b_trFgdNHits);
584 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdNNodes", trFgdNNodes, &b_trFgdNNodes);
585 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdUniqueID", trFgdUniqueID, &b_trFgdUniqueID);
586 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdLength", trFgdLength, &b_trFgdLength);
587 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdDirectionStart", trFgdDirectionStart, &b_trFgdDirectionStart);
588 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdDirectionEnd", trFgdDirectionEnd, &b_trFgdDirectionEnd);
589 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdPositionStart", trFgdPositionStart, &b_trFgdPositionStart);
590 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdPositionEnd", trFgdPositionEnd, &b_trFgdPositionEnd);
591 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdX", trFgdX, &b_trFgdX);
592 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdE", trFgdE, &b_trFgdE);
593 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdPullmu", trFgdPullmu, &b_trFgdPullmu);
594 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdPullp", trFgdPullp, &b_trFgdPullp);
595 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdPullpi", trFgdPullpi, &b_trFgdPullpi);
596 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdPullno", trFgdPullno, &b_trFgdPullno);
597 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdContainment", trFgdContainment, &b_trFgdContainment);
600 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY 601 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdHasFgdVA", trFgdHasFgdVA, &b_trFgdHasFgdVA);
602 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdHasFgdVA_fmode", trFgdHasFgdVA_fmode, &b_trFgdHasFgdVA_fmode);
603 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdTypeVA", trFgdTypeVA, &b_trFgdTypeVA);
605 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdVertex1x1", trFgdVertex1x1, &b_trFgdVertex1x1);
606 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdVertex3x3", trFgdVertex3x3, &b_trFgdVertex3x3);
607 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdVertex5x5", trFgdVertex5x5, &b_trFgdVertex5x5);
608 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdVertex7x7", trFgdVertex7x7, &b_trFgdVertex7x7);
609 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdVertexLayer", trFgdVertexLayer, &b_trFgdVertexLayer);
611 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY 612 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdHasFgdEA", trFgdHasFgdEA, &b_trFgdHasFgdEA);
613 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdHasFgdEA_fmode", trFgdHasFgdEA_fmode, &b_trFgdHasFgdEA_fmode);
614 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdTypeEA", trFgdTypeEA, &b_trFgdTypeEA);
615 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdEnd0x0", trFgdEnd0x0, &b_trFgdEnd0x0);
616 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdEnd0x0", trFgdEnd0x0, &b_trFgdEnd0x0);
617 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdEnd1x1", trFgdEnd1x1, &b_trFgdEnd1x1);
618 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdEnd3x3", trFgdEnd3x3, &b_trFgdEnd3x3);
619 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdEnd5x5", trFgdEnd5x5, &b_trFgdEnd5x5);
620 anaUtils::ConfigureTreeBranch(
fChain,
"trFgdEnd7x7", trFgdEnd7x7, &b_trFgdEnd7x7);
624 anaUtils::ConfigureTreeBranch(
fChain,
"trECALNHits", trECALNHits, &b_trECALNHits);
626 anaUtils::ConfigureTreeBranch(
fChain,
"trECALUniqueID", trECALUniqueID, &b_trECALUniqueID);
628 anaUtils::ConfigureTreeBranch(
fChain,
"trECALDirectionStart", trECALDirectionStart, &b_trECALDirectionStart);
629 anaUtils::ConfigureTreeBranch(
fChain,
"trECALDirectionEnd", trECALDirectionEnd, &b_trECALDirectionEnd);
630 anaUtils::ConfigureTreeBranch(
fChain,
"trECALPositionStart", trECALPositionStart, &b_trECALPositionStart);
631 anaUtils::ConfigureTreeBranch(
fChain,
"trECALPositionEnd", trECALPositionEnd, &b_trECALPositionEnd);
633 anaUtils::ConfigureTreeBranch(
fChain,
"trECALEDeposit", trECALEDeposit, &b_trECALEDeposit);
634 anaUtils::ConfigureTreeBranch(
fChain,
"trECALIsShowerLike", trECALIsShowerLike, &b_trECALIsShowerLike);
635 anaUtils::ConfigureTreeBranch(
fChain,
"trECALAvgTime", trECALAvgTime, &b_trECALAvgTime);
637 anaUtils::ConfigureTreeBranch(
fChain,
"trECALPIDMipPion", trECALPIDMipPion, &b_trECALPIDMipPion);
640 anaUtils::ConfigureTreeBranch(
fChain,
"trECALContainment", trECALContainment, &b_trECALContainment);
653 anaUtils::ConfigureTreeBranch(
fChain,
"trSMRDEDeposit", trSMRDEDeposit, &b_trSMRDEDeposit);
659 anaUtils::ConfigureTreeBranch(
fChain,
"trP0DNNodes", trP0DNNodes, &b_trP0DNNodes);
667 #if VERSION_HAS_P0D_AVERAGED_TIME 668 anaUtils::ConfigureTreeBranch(
fChain,
"trP0DAvgTime", trP0DAvgTime, &b_trP0DAvgTime);
671 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERDetector", trTRACKERDetector, &b_trTRACKERDetector);
672 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERNHits", trTRACKERNHits, &b_trTRACKERNHits);
673 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERNNodes", trTRACKERNNodes, &b_trTRACKERNNodes);
674 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERUniqueID", trTRACKERUniqueID, &b_trTRACKERUniqueID);
675 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERLength", trTRACKERLength, &b_trTRACKERLength);
676 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERDirectionStart", trTRACKERDirectionStart, &b_trTRACKERDirectionStart);
677 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERDirectionEnd", trTRACKERDirectionEnd, &b_trTRACKERDirectionEnd);
678 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERPositionStart", trTRACKERPositionStart, &b_trTRACKERPositionStart);
679 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERPositionEnd", trTRACKERPositionEnd, &b_trTRACKERPositionEnd);
680 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERCharge", trTRACKERCharge, &b_trTRACKERCharge);
681 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERMomentum", trTRACKERMomentum, &b_trTRACKERMomentum);
682 anaUtils::ConfigureTreeBranch(
fChain,
"trTRACKERMomentumEnd", trTRACKERMomentumEnd, &b_trTRACKERMomentumEnd);
685 if(_isUsingReconDirTECAL){
687 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconAverageHitTime", tecalReconAverageHitTime, &b_tecalReconAverageHitTime );
688 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconAverageZPosition", tecalReconAverageZPosition, &b_tecalReconAverageZPosition );
689 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconContainment", tecalReconContainment, &b_tecalReconContainment );
690 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconEFitResult", tecalReconEFitResult, &b_tecalReconEFitResult );
691 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconEFitUncertainty", tecalReconEFitUncertainty, &b_tecalReconEFitUncertainty );
692 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconFirstLayer", tecalReconFirstLayer, &b_tecalReconFirstLayer );
693 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconIsShowerLike", tecalReconIsShowerLike, &b_tecalReconIsShowerLike );
694 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconIsTrackLike", tecalReconIsTrackLike, &b_tecalReconIsTrackLike );
695 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconLastLayer", tecalReconLastLayer, &b_tecalReconLastLayer );
696 #if VERSION_HAS_ECAL_LLR 697 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconLikeMIPEM", tecalReconLikeMIPEM, &b_tecalReconLikeMIPEM );
698 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconLikeMIPPion", tecalReconLikeMIPPion, &b_tecalReconLikeMIPPion );
699 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconLikeEMHIP", tecalReconLikeEMHIP, &b_tecalReconLikeEMHIP );
700 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconLikeMIPEMLow", tecalReconLikeMIPEMLow, &b_tecalReconLikeMIPEMLow );
702 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconMatchingLike", tecalReconMatchingLike, &b_tecalReconMatchingLike );
703 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconMichelTagNDelayedCluster",tecalReconMichelTagNDelayedCluster, &b_tecalReconMichelTagNDelayedCluster);
704 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconModule", tecalReconModule, &b_tecalReconModule );
705 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconMostDownStreamLayerHit", tecalReconMostDownStreamLayerHit, &b_tecalReconMostDownStreamLayerHit );
706 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconMostUpStreamLayerHit", tecalReconMostUpStreamLayerHit, &b_tecalReconMostUpStreamLayerHit );
707 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconNHits", tecalReconNHits, &b_tecalReconNHits );
708 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconNLayersHit", tecalReconNLayersHit, &b_tecalReconNLayersHit );
709 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconObjectLength", tecalReconObjectLength, &b_tecalReconObjectLength );
710 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDAMR", tecalReconPIDAMR, &b_tecalReconPIDAMR );
711 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDAngle", tecalReconPIDAngle, &b_tecalReconPIDAngle );
712 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDAsymmetry", tecalReconPIDAsymmetry, &b_tecalReconPIDAsymmetry );
713 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDCircularity", tecalReconPIDCircularity, &b_tecalReconPIDCircularity );
714 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDFBR", tecalReconPIDFBR, &b_tecalReconPIDFBR );
715 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDMaxRatio", tecalReconPIDMaxRatio, &b_tecalReconPIDMaxRatio );
716 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDMeanPos", tecalReconPIDMeanPos, &b_tecalReconPIDMeanPos );
717 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDShowerAngle", tecalReconPIDShowerAngle, &b_tecalReconPIDShowerAngle );
718 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDShowerWidth", tecalReconPIDShowerWidth, &b_tecalReconPIDShowerWidth );
719 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDTransverseChargeRatio",tecalReconPIDTransverseChargeRatio, &b_tecalReconPIDTransverseChargeRatio);
720 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPIDTruncatedMaxRatio", tecalReconPIDTruncatedMaxRatio, &b_tecalReconPIDTruncatedMaxRatio );
721 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconPointing", tecalReconPointing, &b_tecalReconPointing );
722 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconThrust", tecalReconThrust, &b_tecalReconThrust );
723 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconThrustAxis", tecalReconThrustAxis, &b_tecalReconThrustAxis );
724 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconThrustOrigin", tecalReconThrustOrigin, &b_tecalReconThrustOrigin );
725 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconTimeBunch", tecalReconTimeBunch, &b_tecalReconTimeBunch );
726 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconTotalHitCharge", tecalReconTotalHitCharge, &b_tecalReconTotalHitCharge );
727 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconTrueID", tecalReconTrueID, &b_tecalReconTrueID );
728 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconTrueIDPrimary", tecalReconTrueIDPrimary, &b_tecalReconTrueIDPrimary );
729 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconTrueIDRecursive", tecalReconTrueIDRecursive, &b_tecalReconTrueIDRecursive );
730 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconTrueIDSingle", tecalReconTrueIDSingle, &b_tecalReconTrueIDSingle );
731 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconUniqueID", tecalReconUniqueID, &b_tecalReconUniqueID );
732 anaUtils::ConfigureTreeBranch(
fChain,
"tecalReconBunch", tecalReconBunch, &b_tecalReconBunch );
737 FlatTreeConverter::~FlatTreeConverter(){
746 std::cout <<
"FlatTreeConverter::AddFileToTChain(). Adding file: " << inputString << std::endl;
751 TFile *f = TFile::Open(inputString.c_str());
760 if (_readRooTrackerVtx){
762 NRooTrackerVTX =
GetChain(
"NRooTrackerVtx");
763 NRooTrackerVTX->SetBranchAddress(
"RunID", &RunID);
764 NRooTrackerVTX->SetBranchAddress(
"SubrunID", &SubrunID);
765 NRooTrackerVTX->SetBranchAddress(
"EventID", &EventID);
766 NVtx =
new TClonesArray(
"ND::NRooTrackerVtx",100);
767 NRooTrackerVTX->SetBranchAddress(
"NVtx",&NNVtx);
768 NRooTrackerVTX->SetBranchAddress(
"Vtx",&NVtx);
769 std::cout <<
"FlatTreeConverter::AddFileToTChain(). NEUT RooTrackerVtx tree found !!" << std::endl;
772 GRooTrackerVTX =
GetChain(
"GRooTrackerVtx");
773 GRooTrackerVTX->SetBranchAddress(
"RunID", &RunID);
774 GRooTrackerVTX->SetBranchAddress(
"SubrunID", &SubrunID);
775 GRooTrackerVTX->SetBranchAddress(
"EventID", &EventID);
776 GVtx =
new TClonesArray(
"ND::GRooTrackerVtx",100);
777 GRooTrackerVTX->SetBranchAddress(
"NVtx",&NGVtx);
778 GRooTrackerVTX->SetBranchAddress(
"Vtx",&GVtx);
779 std::cout <<
"FlatTreeConverter::AddFileToTChain(). GENIE RooTrackerVtx tree found !!" << std::endl;
789 for (Long64_t i = 0; i<nentries; i++){
790 Int_t entry_temp = flattree->GetEntry(i);
791 if (entry_temp<=0)
continue;
793 if (!
header().SetIsMC(sIsMC))
return false;
811 Int_t entry_temp = flattree->GetEntry(entry);
814 if (!anaUtils::CheckSkimmedEvent(sRun,sSubrun,sEvt)){
819 if (_readRooTrackerVtx){
821 if (entry_temp>0 && sIsMC && (fGenie || fNeut) && sEvt>=0) {
825 if (NRooTrackerVTX) NRooTrackerVTX->GetEntry(_entry_roo);
826 else if (GRooTrackerVTX) GRooTrackerVTX->GetEntry(_entry_roo);
827 if ((RunID> sRun ) ||
828 (RunID==sRun && SubrunID> sSubrun ) ||
829 (RunID==sRun && SubrunID==sSubrun && EventID>sEvt )){
831 _RooVtxEntryInCurrentInputFile--;
835 _RooVtxEntryInCurrentInputFile++;
837 }
while(EventID!=sEvt || RunID!=sRun || SubrunID!=sSubrun);
844 TString filename(flattree->GetFile()->GetName());
845 if( filename != _currentFileName ) {
846 _RooVtxEntryInCurrentInputFile=0;
848 std::cout <<
" Running on file (" << _currentFileIndex <<
" ): " << filename << std::endl;
849 _currentFileName = filename;
861 Long64_t requested_first_entry = entry;
862 while (sEvt==evt_prev && entry>0){
864 entry_temp = flattree->GetEntry(entry);
868 entry_temp = flattree->GetEntry(entry);
874 entry = requested_first_entry;
875 entry_temp = flattree->GetEntry(entry);
893 while (sEvt==evt_prev && entry <
_nentries){
901 }
else if (Bunch>-1){
908 bunch =
static_cast<AnaBunch*
> (MakeBunch ());
910 _spill->
Bunches.push_back(bunch);
930 entry_temp = flattree->GetEntry(entry);
937 void FlatTreeConverter::FillInfo(
AnaSpillB* spillB){
940 RedoTreeConverter::FillInfo(spillB);
950 if ( fNeut || fGenie) {
952 spill->
RooVtxEntry = _RooVtxEntryInCurrentInputFile;
968 if ( ! fNeut && ! fGenie) {
971 FillNPrimaryParticles(vertex);
976 FillTriggerInfo(&spill->
Trigger);
984 RedoTreeConverter::FillBunchInfo(trueParticles, bunchB);
989 if(_isUsingReconDirTECAL){
992 FillTECALReconObjectInfo(i,anaTECAL,bunch);
999 void FlatTreeConverter::FillNotInBunchObjWithNullPointers(
AnaBunch* bunch){
1003 for (
int i=0; i<NParticles; i++) {
1005 for (
int j = track->
ReconVertices.size(); j < trNReconVertices[i]; j++){
1008 if ( ! suppress_err_msg)
1009 if ((
int)track->
ReconVertices.size() != trNReconVertices[i])
1010 std::cout <<
"minor error 01011" << std::endl;
1013 for (
int i=0; i<NVertices; i++) {
1016 for (
int j = bunch->
Vertices.at(i)->nParticles; j < vNReconParticles[i]; j++)
1017 bunch->
Vertices.at(i)->Particles[j] = NULL;
1018 if ( ! suppress_err_msg)
1019 if ((
int)bunch->
Vertices.at(i)->nParticles != vNReconParticles[i])
1020 std::cout <<
"minor error 01012" << std::endl;
1023 std::pair<AnaTrueVertex*, AnaRecTrueMatch> myMatch;
1024 myMatch.first = NULL;
1025 myMatch.second.Cleanliness = -999;
1026 myMatch.second.Completeness = -999;
1027 for (
int j = bunch->
Vertices.at(i)->TrueVerticesMatch.size(); j < vNTrueVerticesMatch[i]; j++)
1028 bunch->
Vertices.at(i)->TrueVerticesMatch.push_back(myMatch);
1029 if ( ! suppress_err_msg)
1030 if ((
int)bunch->
Vertices.at(i)->TrueVerticesMatch.size() != vNTrueVerticesMatch[i])
1031 std::cout<<
"minor error 01013"<<std::endl;
1037 void FlatTreeConverter::FillNotInBunchObjWithNullPointers(
AnaSpill* spill){
1042 for (
int j = 0; j < sTrueParticleNReconTracks[i] ; j++) static_cast<AnaTrueParticle*>(spill->
TrueParticles.at(i))->ReconParticles.push_back(NULL);
1046 for (
int i=0; i<(int) spill->
TrueVertices.size(); i++) {
1048 for (
int j = 0; j < sTrueVertexNReconVertices[i] ; j++) vertex->
ReconVertices.push_back(NULL);
1049 for (
int j = 0; j < sTrueVertexNReconTracks[i] ; j++) vertex->
ReconParticles.push_back(NULL);
1054 void FlatTreeConverter::CheckNotInBunchObjWithNullPointers(
AnaSpill* spill){
1060 if ( ! suppress_err_msg)
1061 if ((
int)thistrueobj->
ReconParticles.size() != sTrueParticleNReconTracks[i])
1062 std::cout <<
"minor error 0102" << std::endl;
1066 for (
int i=0; i<(int) spill->
TrueVertices.size(); i++) {
1068 if ( ! suppress_err_msg){
1069 if ((
int)thistrueobj->
ReconVertices.size() != sTrueVertexNReconVertices[i])
1070 std::cout <<
"minor error 0103" << std::endl;
1071 if ((
int)thistrueobj->
ReconParticles.size() != sTrueVertexNReconTracks[i])
1072 std::cout <<
"minor error 0104" << std::endl;
1078 void FlatTreeConverter::FillFgdTimeBinInfo(std::vector<AnaFgdTimeBinB*>& FgdTimeBins){
1081 RedoTreeConverter::FillFgdTimeBinInfo(FgdTimeBins);
1084 for(UInt_t ibin=0; ibin<FgdTimeBins.size(); ibin++) {
1088 abin->MaxTime = sFgdTimeBinMaxTime[ibin];
1089 abin->G4ID = sFgdTimeBinG4ID[ibin];
1097 RedoTreeConverter::FillDQInfo(dqB);
1104 for (
int i=0;i<7;i++)
1105 dq->
DetFlag[i] = sDQDetFlag[i];
1109 void FlatTreeConverter::FillBeamInfo(
AnaBeamB* beamB){
1112 RedoTreeConverter::FillBeamInfo(beamB);
1117 beam->
Spill = sBeamSpill;
1119 beam->
POT = sBeamPOT;
1120 #if !VERSION_HAS_OFFICIAL_POT 1121 beam->
POTCT4 = sBeamPOTCT4;
1127 void FlatTreeConverter::FillTriggerInfo(
AnaTrigger* trigger){
1135 void FlatTreeConverter::FillTrackInfo(std::vector<AnaTrueParticleB*>& trueParticles,
int itrk,
AnaTrackB* trackB){
1138 RedoTreeConverter::FillTrackInfo(trueParticles,itrk,trackB);
1142 track->
Status = (trStatus)[itrk];
1143 track->
ReconPDG = (trReconPDG)[itrk];
1144 track->
Bunch = (trBunch)[itrk];
1146 track->
NDOF = (trNDOF)[itrk];
1147 track->
Chi2 = (trChi2)[itrk];
1148 track->
Charge = (trCharge)[itrk];
1156 track->
Length = (trLength)[itrk];
1158 #if VERSION_HAS_REVERSED_REFITS 1160 anaUtils::CopyArray(trDirectionEndFlip[itrk], track->DirectionEndFlip, 3);
1163 #if VERSION_HAS_PRANGE_ESTIMATES 1164 track->RangeMomentumEle = (trRangeMomentumEle)[itrk];
1165 track->RangeMomentumProton = (trRangeMomentumProton)[itrk];
1166 track->RangeMomentumMuonFlip = (trRangeMomentumMuonFlip)[itrk];
1167 track->RangeMomentumProtonFlip = (trRangeMomentumProtonFlip)[itrk];
1174 #if VERSION_HAS_TIME_FITS 1175 if(trNTimeNodes[itrk]>0){
1176 for (Int_t i=0;i<trNTimeNodes[itrk];i++){
1180 node->
Detector = trTimeNodeDetector[itrk][i];
1181 node->
TimeStart = trTimeNodeTimeStart[itrk][i];
1182 node->
TimeEnd = trTimeNodeTimeEnd[itrk][i];
1184 track->TimeNodes.push_back(node);
1197 if ( ! suppress_err_msg)
1199 std::cout <<
"minor error 73731" << std::endl;
1210 if ( ! suppress_err_msg)
1212 std::cout <<
"minor error 73741" << std::endl;
1220 void FlatTreeConverter::FillSubdetectorInfo(std::vector<AnaTrueParticleB*>& trueParticles,
int itrk,
AnaTrackB* trackB){
1223 RedoTreeConverter::FillSubdetectorInfo(trueParticles,itrk,trackB);
1230 for (
int i = 0; i < SubDetId::kInvalidSubdetector; ++i){
1238 FillP0dInfo(itrk, p0d, seg);
1246 FillSmrdInfo(itrk, smrd, seg);
1251 int nTracker = std::min(trNTRACKERs[itrk], (
int)NMAXTRACKERS);
1252 for (
int j=0;j<nTracker;j++){
1254 FillTrackerInfo(itrk, j, seg);
1262 void FlatTreeConverter::FillTpcInfo(std::vector<AnaTrueParticleB*>& trueParticles,
int itrk,
int tpc,
AnaTPCParticleB* segB){
1265 RedoTreeConverter::FillTpcInfo(trueParticles,itrk, tpc, segB);
1269 seg->
NHits = (int)(trTpcNHits)[itrk][tpc];
1270 seg->
UniqueID = (int)(trTpcUniqueID)[itrk][tpc];
1271 seg->
MomentumEnd = (trTpcBackMomentum)[itrk][tpc];
1272 seg->
Length = (trTpcLength)[itrk][tpc];
1274 #if VERSION_HAS_BFIELD_REFIT 1277 #if VERSION_HAS_BFIELD_REFIT_FULL 1278 seg->RefitCharge = (trTpcRefitCharge)[itrk][tpc];
1279 anaUtils::VectorToArray(TLorentzVector((trTpcRefitPosition)[itrk][tpc][0],
1280 (trTpcRefitPosition)[itrk][tpc][1],
1281 (trTpcRefitPosition)[itrk][tpc][2],
1282 (trTpcRefitPosition)[itrk][tpc][3]), seg->RefitPosition);
1283 anaUtils::VectorToArray(TVector3((trTpcRefitDirection)[itrk][tpc][0],
1284 (trTpcRefitDirection)[itrk][tpc][1],
1285 (trTpcRefitDirection)[itrk][tpc][2]), seg->RefitDirection);
1287 #if VERSION_HAS_EFIELD_REFIT 1291 seg->
Pullmu = (trTpcPullmu)[itrk][tpc];
1292 seg->
Pullele = (trTpcPullele)[itrk][tpc];
1293 seg->
Pullp = (trTpcPullp)[itrk][tpc];
1294 seg->
Pullpi = (trTpcPullpi)[itrk][tpc];
1295 seg->
Pullk = (trTpcPullk)[itrk][tpc];
1297 if(_useCorrectedValues){
1298 seg->
dEdxMeas = (trTpcdEdxMeas)[itrk][tpc];
1300 seg->
dEdxexpEle = (trTpcdEdxExpEle)[itrk][tpc];
1306 seg->
dEdxMeas = (trTpcRawdEdxMeas)[itrk][tpc];
1307 seg->
dEdxexpMuon = (trTpcRawdEdxExpMu)[itrk][tpc];
1308 seg->
dEdxexpEle = (trTpcRawdEdxExpEle)[itrk][tpc];
1310 seg->
dEdxexpPion = (trTpcRawdEdxExpPi)[itrk][tpc];
1316 seg->
Purity = (trTpcPurity)[itrk][tpc];
1319 for (
int i=0;i<3;i++){
1320 seg->
DirectionEnd[i] = (trTpcDirectionEnd)[itrk][tpc][i];
1325 void FlatTreeConverter::FillFgdInfo(
int itrk,
int fgd,
AnaFGDParticleB* segB){
1328 RedoTreeConverter::FillFgdInfo(itrk, fgd, segB);
1332 seg->
NHits = (int)(trFgdNHits)[itrk][fgd];
1333 seg->
UniqueID = (int)(trFgdUniqueID)[itrk][fgd];
1334 seg->
Length = (trFgdLength)[itrk][fgd];
1336 seg->
E = (trFgdE)[itrk][fgd];
1338 seg->
AvgTime = (trFgdAvgTime)[itrk][fgd];
1340 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY 1341 seg->HasFgdVA = (trFgdHasFgdVA)[itrk][fgd];
1342 seg->HasFgdVA_fmode = (trFgdHasFgdVA_fmode)[itrk][fgd];
1343 seg->TypeVA = (trFgdTypeVA)[itrk][fgd];
1346 seg->
Vertex1x1 = (trFgdVertex1x1)[itrk][fgd];
1347 seg->Vertex3x3 = (trFgdVertex3x3)[itrk][fgd];
1348 seg->Vertex5x5 = (trFgdVertex5x5)[itrk][fgd];
1349 seg->Vertex7x7 = (trFgdVertex7x7)[itrk][fgd];
1350 seg->VertexLayer = (trFgdVertexLayer)[itrk][fgd];
1352 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY 1353 seg->HasFgdEA = (trFgdHasFgdEA)[itrk][fgd];
1354 seg->HasFgdEA_fmode = (trFgdHasFgdEA_fmode)[itrk][fgd];
1355 seg->TypeEA = (trFgdTypeEA)[itrk][fgd];
1357 seg->End0x0 = (trFgdEnd0x0)[itrk][fgd];
1358 seg->End1x1 = (trFgdEnd1x1)[itrk][fgd];
1359 seg->End3x3 = (trFgdEnd3x3)[itrk][fgd];
1360 seg->End5x5 = (trFgdEnd5x5)[itrk][fgd];
1361 seg->End7x7 = (trFgdEnd7x7)[itrk][fgd];
1364 for (
int i=0;i<3;i++){
1365 seg->
DirectionEnd[i] = (trFgdDirectionEnd)[itrk][fgd][i];
1370 void FlatTreeConverter::FillEcalInfo(
int itrk,
int ecal,
AnaECALParticleB* segB){
1373 RedoTreeConverter::FillEcalInfo(itrk, ecal, segB);
1377 seg->
NHits = (int)(trECALNHits)[itrk][ecal];
1378 seg->
UniqueID = (int)(trECALUniqueID)[itrk][ecal];
1379 seg->PIDMipPion = trECALPIDMipPion[itrk][ecal];
1380 seg->Containment = trECALContainment[itrk][ecal];
1381 seg->
EDeposit = (trECALEDeposit)[itrk][ecal];
1382 seg->
IsShowerLike = (int)(trECALIsShowerLike)[itrk][ecal];
1383 seg->
AvgTime = (int)(trECALAvgTime)[itrk][ecal];
1385 for (
int i = 0; i < 4; i++){
1386 seg->
PositionStart[i] = (trECALPositionStart)[itrk][ecal][i];
1387 seg->
PositionEnd[i] = (trECALPositionEnd)[itrk][ecal][i];
1390 for (
int i = 0; i < 3; i++){
1392 seg->
DirectionEnd[i] = (trECALDirectionEnd)[itrk][ecal][i];
1398 void FlatTreeConverter::FillSmrdInfo(
int itrk,
int smrd,
AnaSMRDParticleB* segB){
1401 RedoTreeConverter::FillSmrdInfo(itrk, smrd, segB);
1405 seg->
NHits = (int)(trSMRDNHits)[itrk][smrd];
1406 seg->
NNodes = (int)(trSMRDNNodes)[itrk][smrd];
1407 seg->
UniqueID = (int)(trSMRDUniqueID)[itrk][smrd];
1408 seg->
Length = (trSMRDLength)[itrk][smrd];
1410 seg->EDeposit = (trSMRDEDeposit)[itrk][smrd];
1412 for (
int i=0;i<3;i++){
1413 seg->
DirectionEnd[i] = (trSMRDDirectionEnd)[itrk][smrd][i];
1418 void FlatTreeConverter::FillP0dInfo(
int itrk,
int p0d,
AnaP0DParticleB* segB){
1421 RedoTreeConverter::FillP0dInfo(itrk, p0d, segB);
1425 seg->
NHits = (int)(trP0DNHits)[itrk][p0d];
1426 seg->
NNodes = (int)(trP0DNNodes)[itrk][p0d];
1427 seg->
UniqueID = (int)(trP0DUniqueID)[itrk][p0d];
1428 seg->Length = (trP0DLength)[itrk][p0d];
1430 for (
int i=0;i<3;i++){
1431 seg->
DirectionEnd[i] = (trP0DDirectionEnd)[itrk][p0d][i];
1435 #if VERSION_HAS_P0D_AVERAGED_TIME 1436 seg->
AvgTime = (trP0DAvgTime)[itrk][p0d];
1442 void FlatTreeConverter::FillTrackerInfo(
int itrk,
int tracker,
AnaTrackerTrack* seg){
1447 seg->
NHits = (int)(trTRACKERNHits)[itrk][tracker];
1448 seg->
NNodes = (int)(trTRACKERNNodes)[itrk][tracker];
1449 seg->
UniqueID = (int)(trTRACKERUniqueID)[itrk][tracker];
1450 seg->
Length = (trTRACKERLength)[itrk][tracker];
1451 seg->
Charge = (trTRACKERCharge)[itrk][tracker];
1452 seg->
Momentum = (trTRACKERMomentum)[itrk][tracker];
1453 seg->
MomentumEnd = (trTRACKERMomentumEnd)[itrk][tracker];
1455 for (
int i=0;i<4;i++){
1456 seg->
PositionStart[i] = (trTRACKERPositionStart)[itrk][tracker][i];
1457 seg->
PositionEnd[i] = (trTRACKERPositionEnd)[itrk][tracker][i];
1460 for (
int i=0;i<3;i++){
1461 seg->
DirectionStart[i] = (trTRACKERDirectionStart)[itrk][tracker][i];
1462 seg->
DirectionEnd[i] = (trTRACKERDirectionEnd)[itrk][tracker][i];
1467 void FlatTreeConverter::FillTrueParticleInfo(std::vector<AnaTrueVertexB*>& trueVertices,
int itrk,
AnaTrueParticleB* partB){
1470 RedoTreeConverter::FillTrueParticleInfo(trueVertices,itrk,partB);
1474 part->
Purity = (sTrueParticlePurity)[itrk];
1475 part->
Bunch = (sTrueParticleBunch)[itrk];
1476 part->
PrimaryID = (sTrueParticlePrimaryID)[itrk];
1477 part->
ParentID = (sTrueParticleParentID)[itrk];
1480 part->IsTruePrimaryPi0DecayPhotonChild = (sTrueParticleIsTruePrimaryPi0DecayPhotonChild)[itrk];
1484 anaUtils::CopyArray(sTrueParticleEntranceMomentum[itrk][i], cross->
EntranceMomentum, 3);
1485 anaUtils::CopyArray(sTrueParticleExitMomentum[itrk][i], cross->
ExitMomentum, 3);
1488 part->
VertexIndex = (sTrueParticleVertexIndex)[itrk];
1516 void FlatTreeConverter::FillTrueVertexInfo(
int ivtx,
AnaTrueVertexB* vertexB){
1519 RedoTreeConverter::FillTrueVertexInfo(ivtx,vertexB);
1523 vertex->
RooVtxEntry = _RooVtxEntryInCurrentInputFile;
1525 vertex->
ReacCode = (sTrueVertexReacCode)[ivtx];
1527 anaUtils::CopyArray(sTrueVertexPosition[ivtx], vertex->
Position, 4);
1529 vertex->
Q2 = (sTrueVertexQ2)[ivtx];
1530 vertex->
NuEnergy = (sTrueVertexNuEnergy)[ivtx];
1532 anaUtils::CopyArray(sTrueVertexNuDir[ivtx], vertex->
NuDir, 3);
1533 anaUtils::CopyArray(sTrueVertexLeptonDir[ivtx], vertex->
LeptonDir, 3);
1534 anaUtils::CopyArray(sTrueVertexPionDir[ivtx], vertex->
PionDir, 3);
1535 anaUtils::CopyArray(sTrueVertexTargetDir[ivtx], vertex->
TargetDir, 3);
1536 anaUtils::CopyArray(sTrueVertexProtonDir[ivtx], vertex->
ProtonDir, 3);
1538 vertex->
NuParentPDG = sTrueVertexNuParentPDG[ivtx];
1540 anaUtils::CopyArray(sTrueVertexNuParentDecPoint[ivtx], vertex->
NuParentDecPoint, 3);
1542 vertex->
NuPDG = (sTrueVertexNuPDG)[ivtx];
1543 vertex->
TargetPDG = (sTrueVertexTargetPDG)[ivtx];
1544 vertex->
LeptonPDG = (sTrueVertexLeptonPDG)[ivtx];
1545 vertex->
LeptonMom = sTrueVertexLeptonMom[ivtx];
1546 vertex->
ProtonMom = sTrueVertexProtonMom[ivtx];
1547 vertex->
PionMom = sTrueVertexPionMom[ivtx];
1548 vertex->
TargetMom = sTrueVertexTargetMom[ivtx];
1551 vertex->
Detector = (sTrueVertexDetector)[ivtx];
1552 vertex->
NBaryons = sTrueVertexNBaryons[ivtx];
1553 vertex->
Bunch = sTrueVertexBunch[ivtx];
1555 vertex->
RooVtxIndex = sTrueVertexRooVtxIndex[ivtx];
1556 vertex->
RooVtxEntry = sTrueVertexRooVtxEntry[ivtx];
1557 vertex->
ID = sTrueVertexID[ivtx];
1560 anaUtils::CreateArray(vertex->
TrueParticles, sNTrueParticles);
1564 vertex->IsCohOnH = sTrueVertexIsCohOnH[ivtx];
1566 for (
int j = 0; j < Int_t(ParticleId::kLast)+1; j++) {
1572 bool FlatTreeConverter::FillTrueVertexRooInfo(
AnaTrueVertexB* vertexB) {
1580 if (!_readRooTrackerVtx || (
fChain->FindLeaf(
"sTrueVertexIsPauliBlocked")))
return true;
1582 bool foundCohOnH,foundPauliBlocked;
1583 return anaUtils::FillTrueVertexRooInfo(vertexB,RunID,fNeut,fGenie,NNVtx,NVtx,NGVtx,GVtx,foundCohOnH,foundPauliBlocked);
1587 void FlatTreeConverter::FillNPrimaryParticles(
AnaTrueVertex* vertex){
1595 if(!trueTrack)
continue;
1599 int index = ParticleId::GetParticle(trueTrack->
PDG,
false);
1601 if (abs(trueTrack->
PDG) > 1000 && abs(trueTrack->
PDG) < 10000) vertex->
NPrimaryParticles[ParticleId::kBaryons]++;
1602 if (abs(trueTrack->
PDG) > 100 && abs(trueTrack->
PDG) < 1000) vertex->
NPrimaryParticles[ParticleId::kMesons]++;
1604 if (trueTrack->
PDG == +12 || trueTrack->
PDG == +14 || trueTrack->
PDG == +16) vertex->
NPrimaryParticles[ParticleId::kNeutrinos]++;
1605 if (trueTrack->
PDG == -12 || trueTrack->
PDG == -14 || trueTrack->
PDG == -16) vertex->
NPrimaryParticles[ParticleId::kAntiNeutrinos]++;
1649 RedoTreeConverter::FillVertexInfo(ivtx, vertexB, bunch);
1653 anaUtils::CopyArray(vVariance[ivtx], vertex->
Variance, 4);
1655 vertex->
Chi2 = (vChi2)[ivtx];
1656 vertex->
NDOF = (vNDOF)[ivtx];
1659 vertex->nParticles=0;
1661 anaUtils::CreateArray(vertex->
Particles, vNReconParticles[ivtx]);
1663 for (
int d = 0; d < vNReconParticles[ivtx]; d++) {
1665 if ( ! part)
continue;
1668 if (part->
Bunch != Bunch)
continue;
1669 vertex->
Particles[vertex->nParticles] = part;
1670 vertex->nParticles++;
1681 for (
int d = 0; d < vNTrueVerticesMatch[ivtx]; d++) {
1682 std::pair<AnaTrueVertex*, AnaRecTrueMatch> myMatch;
1683 int thisTrueVertexIndex = vTrueVertexIndex[ivtx][d];
1684 if (thisTrueVertexIndex == -1)
continue;
1685 if (thisTrueVertexIndex < -1) {
1687 std::cout <<
"The true vertex associated to this global vertex was not saved because NTrueVertices > NMAXTRUEVERTICES" << std::endl;
1689 std::cout <<
"global vertex error 6789" << std::endl;
1694 myMatch.second.Cleanliness = (vTrueVerticesClean)[ivtx][d];
1695 myMatch.second.Completeness = (vTrueVerticesCompl)[ivtx][d];
1699 myMatch.first->ReconVertices.insert(myMatch.first->ReconVertices.begin(),vertex);
1700 if ( ! suppress_err_msg)
1701 if (myMatch.first->ReconVertices.back())
1702 std::cout <<
"minor error 73751" << std::endl;
1703 if ( ! myMatch.first->ReconVertices.back()) myMatch.first->ReconVertices.pop_back();
1719 AnaParticleB* part = RedoTreeConverter::FindParticle(ID,bunch);
1720 if (!part)
return part;
1724 #if ! VERSION_HAS_TIME_FITS 1725 if (bunch->
Bunch != -1) {
1726 if ((
int)bunch->
Particles.size() == (int)NMAXPARTICLES) std::cout <<
"minor error: vertex constituent not found (UniqueID " << ID <<
"), likely because this event has too many tracks!" << std::endl;
1727 else if ( ! suppress_err_msg) std::cout <<
"minor error in oaAnalysisConverter (ref 6056)" << std::endl;
1733 std::vector<AnaBunchC*>::iterator itbunch;
1734 std::vector<AnaParticleB*>::iterator ittrack;
1735 for (itbunch = _spill->
Bunches.begin(); itbunch != _spill->
Bunches.end(); itbunch++) {
1737 for (ittrack = bunch0->
Particles.begin(); ittrack != bunch0->
Particles.end(); ittrack++) {
1738 if (ID == (*ittrack)->UniqueID) {
1739 if (bunch->
Bunch != -1) {
1740 std::cout <<
"INFO: this global vertex (in bunch " << bunch->
Bunch <<
") has a constituent stored in another bunch!" << std::endl;
1742 return static_cast<AnaTrack*
>(*ittrack);
1747 if ( ! suppress_err_msg) {
1748 if ((
int)bunch->
Particles.size() == (int)NMAXPARTICLES) std::cout <<
"minor error: vertex constituent not found (UniqueID " << ID <<
"), likely because this event has too many tracks!" << std::endl;
1749 else std::cout <<
"minor error: vertex constituent not found in bunch " << bunch->
Bunch <<
": in prod6 it should be a flipped track with start position in a bunch not yet loaded!" << std::endl;
1761 anaTECAL->AverageHitTime = tecalReconAverageHitTime [iObj];
1762 anaTECAL->AverageZPos = tecalReconAverageZPosition [iObj];
1763 anaTECAL->Containment = tecalReconContainment [iObj];
1764 anaTECAL->EFitResult = tecalReconEFitResult [iObj];
1765 anaTECAL->EFitUncertainty = tecalReconEFitUncertainty [iObj];
1766 anaTECAL->FirstLayer = tecalReconFirstLayer [iObj];
1767 anaTECAL->IsShowerLike = tecalReconIsShowerLike [iObj];
1768 anaTECAL->IsTrackLike = tecalReconIsTrackLike [iObj];
1769 anaTECAL->LastLayer = tecalReconLastLayer [iObj];
1771 #if VERSION_HAS_ECAL_LLR 1772 anaTECAL->LikeMIPEM = tecalReconLikeMIPEM [iObj];
1773 anaTECAL->LikeMIPPion = tecalReconLikeMIPPion [iObj];
1774 anaTECAL->LikeEMHIP = tecalReconLikeEMHIP [iObj];
1775 anaTECAL->LikeMIPEMLow = tecalReconLikeMIPEMLow [iObj];
1778 anaTECAL->MatchingLike = tecalReconMatchingLike [iObj];
1779 anaTECAL->MichelTagNDelayedCluster = tecalReconMichelTagNDelayedCluster[iObj];
1780 anaTECAL->Module = tecalReconModule [iObj];
1781 anaTECAL->MostDownStreamLayerHit = tecalReconMostDownStreamLayerHit [iObj];
1782 anaTECAL->MostUpStreamLayerHit = tecalReconMostUpStreamLayerHit [iObj];
1783 anaTECAL->NHits = tecalReconNHits [iObj];
1784 anaTECAL->NLayersHit = tecalReconNLayersHit [iObj];
1785 anaTECAL->ObjectLength = tecalReconObjectLength [iObj];
1786 anaTECAL->PIDAMR = tecalReconPIDAMR [iObj];
1787 anaTECAL->PIDAngle = tecalReconPIDAngle [iObj];
1788 anaTECAL->PIDAsymmetry = tecalReconPIDAsymmetry [iObj];
1789 anaTECAL->PIDCircularity = tecalReconPIDCircularity [iObj];
1790 anaTECAL->PIDFBR = tecalReconPIDFBR [iObj];
1791 anaTECAL->PIDMaxRatio = tecalReconPIDMaxRatio [iObj];
1792 anaTECAL->PIDMeanPos = tecalReconPIDMeanPos [iObj];
1793 anaTECAL->PIDShowerAngle = tecalReconPIDShowerAngle [iObj];
1794 anaTECAL->PIDShowerWidth = tecalReconPIDShowerWidth [iObj];
1795 anaTECAL->PIDTransverseChargeRatio = tecalReconPIDTransverseChargeRatio[iObj];
1796 anaTECAL->PIDTruncatedMaxRatio = tecalReconPIDTruncatedMaxRatio [iObj];
1797 anaTECAL->Thrust = tecalReconThrust [iObj];
1798 anaTECAL->TimeBunch = tecalReconTimeBunch [iObj];
1799 anaTECAL->TotalHitCharge = tecalReconTotalHitCharge [iObj];
1800 anaTECAL->TrueID = tecalReconTrueID [iObj];
1801 anaTECAL->TrueIDPrimary = tecalReconTrueIDPrimary [iObj];
1802 anaTECAL->TrueIDRecursive = tecalReconTrueIDRecursive [iObj];
1803 anaTECAL->TrueIDSingle = tecalReconTrueIDSingle [iObj];
1804 anaTECAL->UniqueID = tecalReconUniqueID [iObj];
1805 anaTECAL->Bunch = tecalReconBunch [iObj];
1807 anaUtils::CopyArray(tecalReconPointing [iObj], anaTECAL->Pointing, 3);
1808 anaUtils::CopyArray(tecalReconThrustAxis [iObj], anaTECAL->ThrustAxis, 3);
1809 anaUtils::CopyArray(tecalReconThrustOrigin[iObj], anaTECAL->ThrustOrigin, 3);
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.
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).
Representation of the beam quality and perhaps other beam information as needed.
Representation of a global track.
Float_t AvgTime
Average Time: using results from time vs distance fit.
AnaTrueVertexB * TrueVertex
Representation of the ND280 data quality flags.
AnaP0DParticleB * P0DSegments[NMAXP0DS]
The P0D segments that contributed to this global track.
Int_t InputFileIndex
Index of the input file producing this spill.
Int_t NuPDG
The PDG code of the incoming neutrino.
Int_t LeptonPDG
The PDG code of the primary outgoing electron/muon.
int nDetCrossings
The number of DetCrossing objects.
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
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?
int nTrueParticles
How many true particles are associated with this vertex.
Int_t NDOF
The number of degrees of freedom of the fit using a Kalman filter.
FlatTreeConverter(bool readRooTrackerVtx=false)
bool FGDCosmic
FGD cosmic trigger flag.
Float_t dEdxexpProton
Expected dE/dx for a proton, based on the reconstructed momentum.
Int_t NuParentPDG
Neutrino parent PDG code.
std::vector< std::pair< AnaTrueVertexB *, AnaRecTrueMatchB > > TrueVerticesMatch
The true vertices that are associated with this global vertex, with the related cleanliness and compl...
Int_t Status
The Status of the fit of this reconstructed object.
Float_t LeptonDir[3]
The direction of the primary outgoing electron/muon.
Representation of the ND280 trigger bits.
Int_t NDOF
The number of degrees of freedom when the track was fitted with a Kalman filter.
AnaSMRDParticleB * SMRDSegments[NMAXSMRDS]
The SMRD segments that contributed to this global track.
Float_t Variance[4]
The variance values of the fit using a Kalman filter.
Float_t NuParentDecPoint[4]
Decay point of the neutrino parent.
Int_t RooVtxIndex
The index of the associated RooTrackerVtx vertex from its position in the TClonesArray.
Representation of a true Monte Carlo vertex.
Float_t DirectionEnd[3]
The reconstructed end direction of the particle.
Float_t E
Input to the pull calculations. Needs to be documented properly in oaAnalysis.
Float_t Pullpi
Pion pull of the segment: (dEdxMeas-dEdxexpPion)/dEdxSigmaPion.
std::vector< AnaTrueVertexB * > TrueVertices
The true MC vertices used in this spill.
std::vector< AnaBunchC * > Bunches
The reconstructed objects, split into timing bunches.
static bool IsP0DDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a SMRDP0D or not.
Int_t NBaryons
The total number of primary baryons that were ejected.
Int_t NNodes
The number of nodes in the reconstructed object.
Float_t ProtonDir[3]
The direction of the primary outgoing protons listed first (likely the interacted one)...
Float_t TargetDir[3]
The direction of the target nucleus.
Representation of an ECAL segment of a global track.
Representation of the ND280 data quality flags.
Float_t Vertex1x1
Vertex activity variables.
Float_t AvgTime
Time charged averaged over hits.
Int_t Bunch
The bunch of the track, based on the PositionStart.T()
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.
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.
virtual bool Initialize()
bool _isUsingReconDirFGDOnly
Store whether AnaLocalReconBunch information is enabled in the parameters file.
AnaTrueParticleB ** TrueParticles
The true particles associated with this vertex.
This Ana* object is used to flatten TECALReconObjects from ReconDir/TrackerECal.
Float_t MomentumErrorProton
Error on momentum from refitting the track assuming the proton hypothesis.
Int_t GetSpill(Long64_t &entry, AnaSpillC *&spill)
Float_t AvgTime
Average Time for the iso FGD hits.
AnaBunchB * OutOfBunch
Reconstructed objects that didn't fit into one of the timing bunches.
Long64_t GetEntries()
Return the total number of entries in the chain.
Int_t TargetPDG
The PDG code of the target nucleus.
std::vector< AnaParticleB * > ReconParticles
Vector of pointers to AnaParticle's associated with this true particle.
Float_t Chi2
The chi2 value of the fit using a Kalman filter.
Float_t dEdxexpPion
Expected dE/dx for a pion, based on the reconstructed momentum.
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...
Int_t SubRun
The subrun number.
std::vector< AnaVertexB * > Vertices
Int_t Spill
Spill number from BeamSummaryDataModule::ND280Spill.
Float_t Chi2
The chi2 value when the track was fitted using a Kalman filter.
int nSMRDSegments
How many SMRD tracks are associated with this track.
Representation of detector time info.
Float_t POTCT4
The POT from CT4 for this spill. This is only needed for P5 files.
Float_t ProtonMom
The momentum of the primary outgoing protons listed first (likely the interacted one).
Float_t LeptonMom
The momentum of the primary outgoing electron/muon.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
Representation of a true Monte Carlo vertex.
Representation of a true Monte Carlo trajectory/particle.
Float_t NuEnergy
The true energy of the incoming neutrino.
Representation of an SMRD segment of a global track.
Float_t Position[4]
The position the true interaction happened at.
Float_t dEdxSigmaKaon
Expected error on the dE/dx measurement, for the proton hypothesis.
std::vector< AnaVertexB * > ReconVertices
Vector of pointers to AnaVertexB (global vertices) associated with this true vertex.
AnaDetCrossingB ** DetCrossings
Representation of a detector crossing info for a true particle (G4 trajectory).
SubDetEnum
Enumeration of all detector systems and subdetectors.
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 PDG
The PDG code of this particle.
Int_t SpillNumber
Spill number from BeamSummaryDataModule::BeamSummaryData::SpillNumber.
Float_t MomentumErrorMuon
Error on momentum from refitting the track assuming the muon hypothesis.
Int_t NHits
The number of hits in the particle.
Int_t ParentPDG
The PDG code of this particle'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.
Representation of a global track.
bool TripTCosmic
TripT cosmic trigger flag.
AnaTrueVertexB * GetMainTrueVertex(bool warning=true)
The main true vertex that is associated with this global vertex.
Float_t MomentumEnd
The reconstructed momentum of the particle, at the end position.
Int_t EventTime
The ND280 subrun number.
Representation of a TPC segment of a global track.
int GetLocalDetEnum(SubDetId::SubDetEnum det, SubDetId::SubDetEnum idet)
Get old local detector enumeration to find array index of Flat tree.
AnaParticleB ** Particles
Float_t ExitMomentum[3]
for each subdetector tell the exit momentum
Float_t Pullk
Kaon pull of the segment: (dEdxMeas-dEdxexpPion)/dEdxSigmaKaon.
std::vector< AnaTrackerTrackB * > TRACKERSegments
The TRACKER segments that contributed to this global track.
Float_t Pullp
Proton pull of the segment: (dEdxMeas-dEdxexpProton)/dEdxSigmaProton.
std::vector< AnaTrueParticleB * > TrueParticles
The true MC particles used in this spill.
Representation of a global vertex.
AnaVertexB * ReconVertex
The pointer to the most primary AnaVertexB (global vertex) associated with this track.
virtual void DefineBranches()
Define the branches to be read from the input tree.
Int_t RooVtxEntry
Not in the MiniTree for the Moment since it produces a seg fault.
virtual bool AddFileToTChain(const std::string &inputString)
Add the file specified to fChain, and any friend chains that were set up.
Float_t Length
The length of this global track.
Float_t MomentumError
The error on the reconstructed momentum.
Float_t DirectionStart[3]
The reconstructed start direction of the particle.
Representation of a FGD segment of a global track.
Int_t Bunch
The index of this bunch (0-7).
std::vector< AnaVertexB * > ReconVertices
Vector of pointers to AnaVertexB (global vertices) associated with this track.
Int_t tecalReconCounter
AnaLocalReconBunch information.
Int_t PrimaryIndex
Index of the global vertex.
Int_t GoodSpill
Good spill flag, as defined in Beam Summary Data. 0 is bad.
Float_t Pullele
Electron pull of the segment: (dEdxMeas-dEdxexpEle)/dEdxSigmaEle.
Float_t PionDir[3]
The direction of the primary outgoing pions listed first (likely the interacted one).
Float_t Q2
The Q2 of the true interaction.
AnaTrigger Trigger
Not in the MiniTree for the Moment since it produces a seg fault.
Int_t RooVtxEntry
Entry in the RooTrackerVtx tree (not set directly)
Int_t ParentID
The ID of this particle's immediate parent, or 0 if there is no parent.
virtual bool Initialize()
Float_t Purity
The purity with which this particle was matched to a reconstructed object.
std::vector< AnaParticleB * > Particles
Representation of a TPC segment of a global track.
void ConvertTrackerDetEnumToBitField(unsigned long &det, int DetUsed)
Convert the detector used array to the bit field used by psyche for tracker tracks.
Float_t TimeStart
Start time.
virtual void DefineBranches()
Define the branches to be read from the input tree.
Float_t NuDir[3]
The true (unit) direction of the incoming neutrino.
Representation of a P0D segment of a global track.
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
Representation of a reconstructed particle (track or shower).
Int_t ReconPDG
PDG of the most probable particle hypothesis used at reconstruction level.
bool IsMC
Says if the event is MC or data.
virtual void FillBunchInfo(std::vector< AnaTrueParticleB *> &trueParticles, AnaBunchB *bunch)
static bool ComparePrimaryIndex(const AnaVertexB *t1, const AnaVertexB *t2)
Function used to sort PrimaryIndex in increasing order.
Representation of a true Monte Carlo trajectory/particle.
Float_t MomentumMuon
Momentum from refitting the track assuming the muon hypothesis.
Representation of the beam information, including POT and quality.
Float_t POT
The POT for this spill. For data, this comes from the Beam Summary Data.
Float_t dEdxexpKaon
Expected dE/dx for a proton, based on the reconstructed momentum.
Float_t EntranceMomentum[3]
for each subdetector tell the entrance momentum
Float_t TargetMom
The momentum of the target nucleus.
virtual bool AddFileToTChain(const std::string &inputString)
Add the file specified to fChain, and any friend chains that were set up.
Float_t PionMom
The momentum of the primary outgoing pions listed first (likely the interacted one).
static bool IsSMRDDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a SMRD or not.
Int_t NPrimaryParticles[Int_t(ParticleId::kLast)+1]
Array to count the outgoing primary particles of each type (.
std::vector< AnaParticleB * > ReconParticles
Float_t PositionEnd[4]
The reconstructed end position of the particle.
Float_t RefitMomentum
Reconstructed momentum with the empirical distortion corrections.
Float_t MomentumProton
Momentum from refitting the track assuming the proton hypothesis.