8 #ifndef FlatTreeConverter_h 9 #define FlatTreeConverter_h 11 #include "RedoTreeConverter.hxx" 12 #include "DataClassesIO.hxx" 13 #include "P0DDataClasses.hxx" 14 #include "InputConverter.hxx" 15 #include <TClonesArray.h> 16 #include "AnalysisTools/libReadoaAnalysis/libReadoaAnalysisProjectHeaders.h" 65 using RedoTreeConverter::FillInfo;
67 using RedoTreeConverter::FillBunchInfo;
69 virtual void FillNotInBunchObjWithNullPointers(
AnaSpill* spill);
70 virtual void CheckNotInBunchObjWithNullPointers(
AnaSpill* spill);
71 virtual void FillNotInBunchObjWithNullPointers(
AnaBunch* bunch);
72 using RedoTreeConverter::FillFgdTimeBinInfo;
73 virtual void FillFgdTimeBinInfo(std::vector<AnaFgdTimeBinB*>& AnaFgdTimeBins);
74 using RedoTreeConverter::FillTrackInfo;
75 virtual void FillTrackInfo(std::vector<AnaTrueParticleB*>& trueParticles,
int itrk,
AnaTrackB* track);
76 using RedoTreeConverter::FillTrueParticleInfo;
77 virtual void FillTrueParticleInfo(std::vector<AnaTrueVertexB*>& trueVertices,
int itrk,
AnaTrueParticleB* part);
78 using RedoTreeConverter::FillTpcInfo;
79 virtual void FillTpcInfo(std::vector<AnaTrueParticleB*>& trueParticles,
int itrk,
int tpc,
AnaTPCParticleB* track);
80 using RedoTreeConverter::FillFgdInfo;
82 using RedoTreeConverter::FillEcalInfo;
84 using RedoTreeConverter::FillSmrdInfo;
86 using RedoTreeConverter::FillP0dInfo;
88 virtual void FillTrackerInfo(
int itrk,
int tracker,
AnaTrackerTrack* seg);
90 using RedoTreeConverter::FillSubdetectorInfo;
91 virtual void FillSubdetectorInfo(std::vector<AnaTrueParticleB*>& trueParticles,
int itrk,
AnaTrackB* trackB);
93 using RedoTreeConverter::FillTrueVertexInfo;
95 using RedoTreeConverter::FillTrueVertexRooInfo;
99 using RedoTreeConverter::FillDQInfo;
101 using RedoTreeConverter::FillBeamInfo;
102 virtual void FillBeamInfo(
AnaBeamB* beam);
103 virtual void FillTriggerInfo(
AnaTrigger* trigger);
105 using RedoTreeConverter::FillVertexInfo;
116 bool _useCorrectedValues;
117 bool _readRooTrackerVtx;
122 Int_t _RooVtxEntryInCurrentInputFile;
129 bool _isUsingReconDirP0D;
130 bool _isUsingReconDirPECAL;
131 bool _isUsingReconDirTECAL;
146 Int_t sInputFileIndex;
147 Int_t sTrueVertexLeptonPDG[NMAXTRUEVERTICES];
148 Int_t sTrueVertexIsPauliBlocked[NMAXTRUEVERTICES];
149 Int_t sTrueVertexIsCohOnH[NMAXTRUEVERTICES];
150 Int_t sTrueVertexNPrimaryParticles[NMAXTRUEVERTICES][Int_t(ParticleId::kLast)+1];
151 Int_t trReconPDG[NMAXPARTICLES];
152 Int_t trNTimeNodes[NMAXPARTICLES];
153 Int_t trTimeNodeDetector[NMAXPARTICLES][NMAXTIMENODES];
154 Int_t trTpcUniqueID[NMAXPARTICLES][NMAXTPCS];
155 Int_t trFgdUniqueID[NMAXPARTICLES][NMAXTPCS];
156 Int_t trECALUniqueID[NMAXPARTICLES][NMAXTPCS];
157 Int_t trSMRDUniqueID[NMAXPARTICLES][NMAXTPCS];
158 Int_t trP0DUniqueID[NMAXPARTICLES][NMAXTPCS];
159 Int_t trNTRACKERs[NMAXPARTICLES];
160 Int_t trTRACKERDetector[NMAXPARTICLES][NMAXTRACKERS];
161 Int_t trTRACKERNHits[NMAXPARTICLES][NMAXTRACKERS];
162 Int_t trTRACKERNNodes[NMAXPARTICLES][NMAXTRACKERS];
163 Int_t trTRACKERUniqueID[NMAXPARTICLES][NMAXTRACKERS];
164 Int_t trFgdHasFgdVA[NMAXPARTICLES][NMAXFGDS];
165 Int_t trFgdHasFgdVA_fmode[NMAXPARTICLES][NMAXFGDS];
166 Int_t trFgdTypeVA[NMAXPARTICLES][NMAXFGDS];
167 Int_t trFgdHasFgdEA[NMAXPARTICLES][NMAXFGDS];
168 Int_t trFgdHasFgdEA_fmode[NMAXPARTICLES][NMAXFGDS];
169 Int_t trFgdTypeEA[NMAXPARTICLES][NMAXFGDS];
173 Float_t sTrueVertexTargetMom[NMAXTRUEVERTICES];
174 Float_t sTrueVertexTargetDir[NMAXTRUEVERTICES][3];
175 Float_t trTimeNodeTimeStart[NMAXPARTICLES][NMAXTIMENODES];
176 Float_t trTimeNodeTimeEnd[NMAXPARTICLES][NMAXTIMENODES];
177 Float_t sTrueVertexLeptonDir[NMAXTRUEVERTICES][3];
178 Float_t sTrueVertexProtonDir[NMAXTRUEVERTICES][3];
179 Float_t sTrueVertexPionDir[NMAXTRUEVERTICES][3];
180 Float_t sTrueVertexLeptonMom[NMAXTRUEVERTICES];
181 Float_t sTrueVertexProtonMom[NMAXTRUEVERTICES];
182 Float_t sTrueVertexPionMom[NMAXTRUEVERTICES];
183 Float_t trTpcPullmu[NMAXPARTICLES][NMAXTPCS];
184 Float_t trTpcPullele[NMAXPARTICLES][NMAXTPCS];
185 Float_t trTpcPullp[NMAXPARTICLES][NMAXTPCS];
186 Float_t trTpcPullpi[NMAXPARTICLES][NMAXTPCS];
187 Float_t trTpcPullk[NMAXPARTICLES][NMAXTPCS];
188 Float_t trTpcRawdEdxMeas[NMAXPARTICLES][NMAXTPCS];
189 Float_t trTpcRawdEdxExpMu[NMAXPARTICLES][NMAXTPCS];
190 Float_t trTpcRawdEdxExpEle[NMAXPARTICLES][NMAXTPCS];
191 Float_t trTpcRawdEdxExpP[NMAXPARTICLES][NMAXTPCS];
192 Float_t trTpcRawdEdxExpPi[NMAXPARTICLES][NMAXTPCS];
193 Float_t trTpcRawdEdxExpK[NMAXPARTICLES][NMAXTPCS];
194 Float_t trFgdEnd0x0[NMAXPARTICLES][NMAXFGDS];
195 Float_t trFgdEnd1x1[NMAXPARTICLES][NMAXFGDS];
196 Float_t trFgdEnd3x3[NMAXPARTICLES][NMAXFGDS];
197 Float_t trFgdEnd5x5[NMAXPARTICLES][NMAXFGDS];
198 Float_t trFgdEnd7x7[NMAXPARTICLES][NMAXFGDS];
200 Float_t trECALPIDMipPion[NMAXPARTICLES][NECALSUBDETS];
201 Float_t trECALContainment[NMAXPARTICLES][NECALSUBDETS];
204 Float_t trSMRDEDeposit[NMAXPARTICLES][NSMRDSUBDETS];
207 Float_t trP0DAvgTime[NMAXPARTICLES][NMAXP0DS];
208 Float_t trTRACKERLength[NMAXPARTICLES][NMAXTRACKERS];
209 Float_t trTRACKERDirectionStart[NMAXPARTICLES][NMAXTRACKERS][3];
210 Float_t trTRACKERDirectionEnd[NMAXPARTICLES][NMAXTRACKERS][3];
211 Float_t trTRACKERPositionStart[NMAXPARTICLES][NMAXTRACKERS][4];
212 Float_t trTRACKERPositionEnd[NMAXPARTICLES][NMAXTRACKERS][4];
213 Float_t trTRACKERCharge[NMAXPARTICLES][NMAXTRACKERS];
214 Float_t trTRACKERMomentum[NMAXPARTICLES][NMAXTRACKERS];
215 Float_t trTRACKERMomentumEnd[NMAXPARTICLES][NMAXTRACKERS];
216 Float_t trDirectionStartFlip[NMAXPARTICLES][3];
217 Float_t trDirectionEndFlip[NMAXPARTICLES][3];
218 Float_t trRangeMomentumMuonFlip[NMAXPARTICLES];
219 Float_t trRangeMomentumProtonFlip[NMAXPARTICLES];
220 Float_t trMomentumAtVertex[NMAXPARTICLES];
221 Float_t trDirectionAtVertex[NMAXPARTICLES][3];
222 Float_t trLength[NMAXPARTICLES];
227 Float_t tecalReconAverageHitTime [NMAXTECALRECONOBJECTS];
228 Float_t tecalReconAverageZPosition [NMAXTECALRECONOBJECTS];
229 Float_t tecalReconContainment [NMAXTECALRECONOBJECTS];
230 Float_t tecalReconEFitResult [NMAXTECALRECONOBJECTS];
231 Float_t tecalReconEFitUncertainty [NMAXTECALRECONOBJECTS];
232 Int_t tecalReconFirstLayer [NMAXTECALRECONOBJECTS];
233 Int_t tecalReconIsShowerLike [NMAXTECALRECONOBJECTS];
234 Int_t tecalReconIsTrackLike [NMAXTECALRECONOBJECTS];
235 Int_t tecalReconLastLayer [NMAXTECALRECONOBJECTS];
236 Float_t tecalReconLikeMIPEM [NMAXTECALRECONOBJECTS];
237 Float_t tecalReconLikeMIPPion [NMAXTECALRECONOBJECTS];
238 Float_t tecalReconLikeEMHIP [NMAXTECALRECONOBJECTS];
239 Float_t tecalReconLikeMIPEMLow [NMAXTECALRECONOBJECTS];
240 Float_t tecalReconMatchingLike [NMAXTECALRECONOBJECTS];
241 Int_t tecalReconMichelTagNDelayedCluster[NMAXTECALRECONOBJECTS];
242 Char_t tecalReconModule [NMAXTECALRECONOBJECTS];
243 Int_t tecalReconMostDownStreamLayerHit [NMAXTECALRECONOBJECTS];
244 Int_t tecalReconMostUpStreamLayerHit [NMAXTECALRECONOBJECTS];
245 Int_t tecalReconNHits [NMAXTECALRECONOBJECTS];
246 Int_t tecalReconNLayersHit [NMAXTECALRECONOBJECTS];
247 Float_t tecalReconObjectLength [NMAXTECALRECONOBJECTS];
248 Float_t tecalReconPIDAMR [NMAXTECALRECONOBJECTS];
249 Float_t tecalReconPIDAngle [NMAXTECALRECONOBJECTS];
250 Float_t tecalReconPIDAsymmetry [NMAXTECALRECONOBJECTS];
251 Float_t tecalReconPIDCircularity [NMAXTECALRECONOBJECTS];
252 Float_t tecalReconPIDFBR [NMAXTECALRECONOBJECTS];
253 Float_t tecalReconPIDMaxRatio [NMAXTECALRECONOBJECTS];
254 Float_t tecalReconPIDMeanPos [NMAXTECALRECONOBJECTS];
255 Float_t tecalReconPIDShowerAngle [NMAXTECALRECONOBJECTS];
256 Float_t tecalReconPIDShowerWidth [NMAXTECALRECONOBJECTS];
257 Float_t tecalReconPIDTransverseChargeRatio[NMAXTECALRECONOBJECTS];
258 Float_t tecalReconPIDTruncatedMaxRatio [NMAXTECALRECONOBJECTS];
259 Float_t tecalReconPointing [NMAXTECALRECONOBJECTS][3];
260 Float_t tecalReconThrust [NMAXTECALRECONOBJECTS];
261 Float_t tecalReconThrustAxis [NMAXTECALRECONOBJECTS][3];
262 Float_t tecalReconThrustOrigin [NMAXTECALRECONOBJECTS][3];
263 Int_t tecalReconTimeBunch [NMAXTECALRECONOBJECTS];
264 Float_t tecalReconTotalHitCharge [NMAXTECALRECONOBJECTS];
265 Int_t tecalReconTrueID [NMAXTECALRECONOBJECTS];
266 Int_t tecalReconTrueIDPrimary [NMAXTECALRECONOBJECTS];
267 Int_t tecalReconTrueIDRecursive [NMAXTECALRECONOBJECTS];
268 Int_t tecalReconTrueIDSingle [NMAXTECALRECONOBJECTS];
269 Int_t tecalReconUniqueID [NMAXTECALRECONOBJECTS];
270 Int_t tecalReconBunch [NMAXTECALRECONOBJECTS];
275 TBranch *b_sInputFileIndex;
276 TBranch *b_sRooVtxEntry;
278 TBranch *b_sBeamPOTCT4;
279 TBranch *b_sBeamSpill;
280 TBranch *b_sBeamSpillNumber;
281 TBranch *b_sBeamBeamRunNumber;
282 TBranch *b_sDQND280Flag;
283 TBranch *b_sDQDetFlag;
286 TBranch *b_sTrueVertexLeptonPDG;
287 TBranch *b_sTrueVertexLeptonDir;
288 TBranch *b_sTrueVertexProtonDir;
289 TBranch *b_sTrueVertexPionDir;
290 TBranch *b_sTrueVertexLeptonMom;
291 TBranch *b_sTrueVertexProtonMom;
292 TBranch *b_sTrueVertexPionMom;
293 TBranch *b_sTrueVertexTargetDir;
294 TBranch *b_sTrueVertexTargetMom;
295 TBranch *b_sTrueVertexIsPauliBlocked;
296 TBranch *b_sTrueVertexIsCohOnH;
297 TBranch *b_sTrueVertexNPrimaryParticles;
299 TBranch *b_trReconPDG;
300 TBranch *b_trDirectionAtVertex;
302 TBranch *b_trNTRACKERs;
304 TBranch *b_trTpcPullmu;
305 TBranch *b_trTpcPullele;
306 TBranch *b_trTpcPullp;
307 TBranch *b_trTpcPullpi;
308 TBranch *b_trTpcPullk;
309 TBranch *b_trNTimeNodes;
310 TBranch *b_trTimeNodeDetector;
311 TBranch *b_trTimeNodeTimeStart;
312 TBranch *b_trTimeNodeTimeEnd;
314 TBranch *b_trTpcUniqueID;
315 TBranch *b_trFgdUniqueID;
316 TBranch *b_trECALUniqueID;
317 TBranch *b_trSMRDUniqueID;
318 TBranch *b_trP0DUniqueID;
320 TBranch *b_trTpcRawdEdxMeas;
321 TBranch *b_trTpcRawdEdxExpMu;
322 TBranch *b_trTpcRawdEdxExpEle;
323 TBranch *b_trTpcRawdEdxExpP;
324 TBranch *b_trTpcRawdEdxExpPi;
325 TBranch *b_trTpcRawdEdxExpK;
327 TBranch *b_trFgdHasFgdVA;
328 TBranch *b_trFgdHasFgdVA_fmode;
329 TBranch *b_trFgdTypeVA;
330 TBranch *b_trFgdHasFgdEA;
331 TBranch *b_trFgdHasFgdEA_fmode;
332 TBranch *b_trFgdTypeEA;
333 TBranch *b_trFgdEnd0x0;
334 TBranch *b_trFgdEnd1x1;
335 TBranch *b_trFgdEnd3x3;
336 TBranch *b_trFgdEnd5x5;
337 TBranch *b_trFgdEnd7x7;
339 TBranch *b_trP0DAvgTime;
341 TBranch *b_trTRACKERDetector;
342 TBranch *b_trTRACKERNHits;
343 TBranch *b_trTRACKERNNodes;
344 TBranch *b_trTRACKERUniqueID;
345 TBranch *b_trTRACKERLength;
346 TBranch *b_trTRACKERDirectionStart;
347 TBranch *b_trTRACKERDirectionEnd;
348 TBranch *b_trTRACKERPositionStart;
349 TBranch *b_trTRACKERPositionEnd;
350 TBranch *b_trTRACKERCharge;
351 TBranch *b_trTRACKERMomentum;
352 TBranch *b_trTRACKERMomentumEnd;
354 TBranch *b_trDirectionStartFlip;
355 TBranch *b_trDirectionEndFlip;
356 TBranch *b_trRangeMomentumMuonFlip;
357 TBranch *b_trRangeMomentumProtonFlip;
358 TBranch *b_trMomentumAtVertex;
360 TBranch *b_trECALPIDMipPion;
361 TBranch *b_trECALContainment;
364 TBranch *b_trSMRDEDeposit;
367 TBranch *b_tecalReconCounter;
368 TBranch *b_tecalReconAverageHitTime;
369 TBranch *b_tecalReconAverageZPosition;
370 TBranch *b_tecalReconContainment;
371 TBranch *b_tecalReconEFitResult;
372 TBranch *b_tecalReconEFitUncertainty;
373 TBranch *b_tecalReconFirstLayer;
374 TBranch *b_tecalReconIsShowerLike;
375 TBranch *b_tecalReconIsTrackLike;
376 TBranch *b_tecalReconLastLayer;
377 TBranch *b_tecalReconLikeMIPEM;
378 TBranch *b_tecalReconLikeMIPPion;
379 TBranch *b_tecalReconLikeEMHIP;
380 TBranch *b_tecalReconLikeMIPEMLow;
381 TBranch *b_tecalReconMatchingLike;
382 TBranch *b_tecalReconMichelTagNDelayedCluster;
383 TBranch *b_tecalReconModule;
384 TBranch *b_tecalReconMostDownStreamLayerHit;
385 TBranch *b_tecalReconMostUpStreamLayerHit;
386 TBranch *b_tecalReconNHits;
387 TBranch *b_tecalReconNLayersHit;
388 TBranch *b_tecalReconObjectLength;
389 TBranch *b_tecalReconPIDAMR;
390 TBranch *b_tecalReconPIDAngle;
391 TBranch *b_tecalReconPIDAsymmetry;
392 TBranch *b_tecalReconPIDCircularity;
393 TBranch *b_tecalReconPIDFBR;
394 TBranch *b_tecalReconPIDMaxRatio;
395 TBranch *b_tecalReconPIDMeanPos;
396 TBranch *b_tecalReconPIDShowerAngle;
397 TBranch *b_tecalReconPIDShowerWidth;
398 TBranch *b_tecalReconPIDTransverseChargeRatio;
399 TBranch *b_tecalReconPIDTruncatedMaxRatio;
400 TBranch *b_tecalReconPointing;
401 TBranch *b_tecalReconThrust;
402 TBranch *b_tecalReconThrustAxis;
403 TBranch *b_tecalReconThrustOrigin;
404 TBranch *b_tecalReconTimeBunch;
405 TBranch *b_tecalReconTotalHitCharge;
406 TBranch *b_tecalReconTrueID;
407 TBranch *b_tecalReconTrueIDPrimary;
408 TBranch *b_tecalReconTrueIDRecursive;
409 TBranch *b_tecalReconTrueIDSingle;
410 TBranch *b_tecalReconUniqueID;
411 TBranch *b_tecalReconBunch;
Representation of the beam quality and perhaps other beam information as needed.
Representation of a global track.
Representation of the ND280 data quality flags.
FlatTreeConverter(bool readRooTrackerVtx=false)
Representation of the ND280 trigger bits.
Representation of a true Monte Carlo vertex.
Representation of an ECAL segment of a global track.
Representation of the ND280 data quality flags.
bool _isUsingReconDirFGDOnly
Store whether AnaLocalReconBunch information is enabled in the parameters file.
This Ana* object is used to flatten TECALReconObjects from ReconDir/TrackerECal.
Int_t GetSpill(Long64_t &entry, AnaSpillC *&spill)
int GetLocalDetEnum(SubDetId::SubDetEnum det, SubDetId::SubDetEnum i)
Get old local detector enumeration to find array index of Flat tree.
Representation of a true Monte Carlo vertex.
Representation of a true Monte Carlo trajectory/particle.
Representation of an SMRD segment of a global track.
Representation of a Tracker segment of a global track.
SubDetEnum
Enumeration of all detector systems and subdetectors.
Representation of a global track.
This Ana* object is used to flatten PECALReconObjects from ReconDir/P0DECal.
Representation of a TPC segment of a global track.
Representation of a global vertex.
virtual bool AddFileToTChain(const std::string &inputString)
Add the file specified to fChain, and any friend chains that were set up.
This is a base P0D object that shares the common attributes of Vertex, Particle, Track, Shower, Cluster, Hit.
Representation of a FGD segment of a global track.
This Ana* object is used to flatten TECALUnmatchedObjects from ReconDir/TrackerECal.
Int_t tecalReconCounter
AnaLocalReconBunch information.
virtual bool Initialize()
Representation of a TPC segment of a global track.
virtual void DefineBranches()
Define the branches to be read from the input tree.
Representation of a P0D segment of a global track.
Int_t GetSpill(Long64_t &entry, AnaSpillC *&spill)
Representation of a reconstructed particle (track or shower).
virtual void FillBunchInfo(std::vector< AnaTrueParticleB *> &trueParticles, AnaBunchB *bunch)
Representation of a true Monte Carlo trajectory/particle.
Representation of the beam information, including POT and quality.