HighLAND
DataClasses.cxx
1 #define DataClasses_C
2 
3 #include "DataClasses.hxx"
4 #include "BasicUtils.hxx"
5 #include "TMath.h"
6 
7 // define a constant value for uninitialised parameters
8 const Float_t kFloatUnassigned = -999.;
9 const UInt_t kUnassigned = 0xDEADBEEF;
10 const short kShortUnassigned = 0xFF;
11 
12 
13 //********************************************************************
14 AnaSubTrack::AnaSubTrack(){
15 //********************************************************************
16 // NHits = -999;
17  Length = -999;
18  // anaUtils::ReserveArray(DirectionEnd, 3);
19  // UniqueID = -999;
20 }
21 
22 //********************************************************************
23 AnaSubTrack::AnaSubTrack(const AnaSubTrack& seg){
24 //********************************************************************
25 // NHits = seg.NHits;
26  Length = seg.Length;
27  // anaUtils::CopyArray(seg.DirectionEnd, DirectionEnd, 3);
28  // UniqueID = seg.UniqueID;
29 }
30 
31 //********************************************************************
32 void AnaSubTrack::Print() const{
33 //********************************************************************
34 
35  std::cout << "-------- AnaSubTrack --------- " << std::endl;
36 
37  // std::cout << "NHits: " << NHits << std::endl;
38  std::cout << "Length: " << Length << std::endl;
39  // std::cout << "UniqueID: " << UniqueID << std::endl;
40 }
41 
42 //********************************************************************
43 AnaParticleE::AnaParticleE(){
44 //********************************************************************
45 
46  MomentumError = -999;
47 
48  NDOF = -999;
49  Chi2 = -999;
50  Bunch = -999;
51  ReconPDG = -999;
52 
53  for (int i=0; i<2; i++) {
54  UpstreamHits_Position[i] = TVector3(-999, -999, -999);
55  DownstreamHits_Position[i] = TVector3(-999, -999, -999);
56  UpstreamHits_Charge[i] = -999;
57  DownstreamHits_Charge[i] = -999;
58  }
59 
60  MomentumEle = -999;
61  MomentumMuon = -999;
62  MomentumProton = -999;
63  MomentumErrorEle = -999;
64  MomentumErrorMuon = -999;
65  MomentumErrorProton = -999;
66 
67 #if VERSION_HAS_REVERSED_REFITS
68  anaUtils::ReserveArray(PositionStartFlip, 4);
69  anaUtils::ReserveArray(DirectionStartFlip, 3);
70  anaUtils::ReserveArray(DirectionEndFlip, 3);
71 #endif
72 
73 
74 #if VERSION_HAS_PRANGE_ESTIMATES
75  RangeMomentumEle = -999;
76  RangeMomentumProton = -999;
77  RangeMomentumMuonFlip = -999;
78  RangeMomentumProtonFlip = -999;
79 #endif
80 
81  ReconVertex = NULL;
82  ReconVertices.clear();
83  anaUtils::ReserveArray(DirectionAtVertex, 3);
84  MomentumAtVertex = -999;
85 
86 #if VERSION_HAS_TIME_FITS
87  TimeNodes.clear();
88 #endif
89 }
90 
91 //********************************************************************
92 AnaParticleE::~AnaParticleE(){
93 //********************************************************************
94 
95 
96 #if VERSION_HAS_TIME_FITS
97  for (UInt_t i=0;i<TimeNodes.size();i++)
98  delete TimeNodes[i];
99 
100  TimeNodes.clear();
101 #endif
102 
103 }
104 
105 //********************************************************************
106 AnaParticleE::AnaParticleE(const AnaParticleE& track){
107 //********************************************************************
108 
109  MomentumError = track.MomentumError;
110 
111  NDOF = track.NDOF;
112  Chi2 = track.Chi2;
113  Bunch = track.Bunch;
114  ReconPDG = track.ReconPDG;
115 
116  for (int i=0; i<2; i++) {
117  UpstreamHits_Position[i] = track.UpstreamHits_Position[i];
118  DownstreamHits_Position[i] = track.DownstreamHits_Position[i];
119  UpstreamHits_Charge[i] = track.UpstreamHits_Charge[i];
120  DownstreamHits_Charge[i] = track.DownstreamHits_Charge[i];
121  }
122 
123  MomentumEle = track.MomentumEle;
124  MomentumMuon = track.MomentumMuon;
125  MomentumProton = track.MomentumProton;
126  MomentumErrorEle = track.MomentumErrorEle;
127  MomentumErrorMuon = track.MomentumErrorMuon;
128  MomentumErrorProton = track.MomentumErrorProton;
129 
130 #if VERSION_HAS_REVERSED_REFITS
131  anaUtils::CopyArray(track.PositionStartFlip, PositionStartFlip, 4);
132  anaUtils::CopyArray(track.DirectionStartFlip, DirectionStartFlip, 3);
133  anaUtils::CopyArray(track.DirectionEndFlip, DirectionEndFlip, 3);
134 #endif
135 
136 #if VERSION_HAS_PRANGE_ESTIMATES
137  RangeMomentumEle = track.RangeMomentumEle;
138  RangeMomentumProton = track.RangeMomentumProton;
139  RangeMomentumMuonFlip = track.RangeMomentumMuonFlip;
140  RangeMomentumProtonFlip = track.RangeMomentumProtonFlip;
141 #endif
142 
143  // The most lower PrimaryIndex associated global vertex (if it exists).
144  ReconVertex = NULL;//track.ReconVertex;
145 
146  ReconVertices.clear();
147  /*
148  for (UInt_t i=0;i<track.ReconVertices.size();i++)
149  ReconVertices.push_back(track.ReconVertices[i]);
150  */
151  anaUtils::CopyArray(track.DirectionAtVertex, DirectionAtVertex, 3);
152  MomentumAtVertex = track.MomentumAtVertex;
153 
154 
155 #if VERSION_HAS_TIME_FITS
156  TimeNodes.clear();
157  for (UInt_t i=0;i<track.TimeNodes.size();i++)
158  TimeNodes.push_back(track.TimeNodes[i]->Clone());
159 #endif
160 
161 }
162 
163 //********************************************************************
164 void AnaParticleE::Print() const{
165 //********************************************************************
166 
167  std::cout << "-------- AnaParticleE --------- " << std::endl;
168 
169  std::cout << "Chi2: " << Chi2 << std::endl;
170  std::cout << "MomentumMuon: " << MomentumMuon << std::endl;
171  std::cout << "MomentumEle: " << MomentumEle << std::endl;
172  std::cout << "MomentumProton: " << MomentumProton << std::endl;
173 
174 #if VERSION_HAS_PRANGE_ESTIMATES
175  std::cout << "RangeMomentumEle: " << RangeMomentumEle << std::endl;
176  std::cout << "RangeMomentumProton: " << RangeMomentumProton << std::endl;
177  std::cout << "RangeMomentumMuonFlip: " << RangeMomentumMuonFlip << std::endl;
178  std::cout << "RangeMomentumProtonFlip: " << RangeMomentumProtonFlip << std::endl;
179 #endif
180 
181 #if VERSION_HAS_REVERSED_REFITS
182  dump_array4(PositionStartFlip);
183  dump_array3(DirectionStartFlip);
184  dump_array3(DirectionEndFlip);
185 #endif
186 
187  std::cout << "Bunch: " << Bunch << std::endl;
188  std::cout << "NReconVertices: " << (int)ReconVertices.size() << std::endl;
189  std::cout << "MomentumAtVertex: " << MomentumAtVertex << std::endl;
190  std::cout << "DirectionAtVertex: " << DirectionAtVertex[0] << " " << DirectionAtVertex[1] << " " << DirectionAtVertex[2] << std::endl;
191 }
192 
193 
194 
195 
196 //********************************************************************
197 AnaTrueVertex::AnaTrueVertex(): AnaTrueVertexB(){
198 //********************************************************************
199 
200  RooVtxIndex = -999;
201  RooVtxEntry = -999;
202  ReacCode = -999;
203  TargetPDG = -999;
204  anaUtils::ReserveArray(NuDir, 3);
205  NuParentPDG = -999;
206  anaUtils::ReserveArray(NuParentDecPoint, 4);
207 
208  NBaryons = -999;
209  Q2 = -999;
210  LeptonPDG = -999;
211  anaUtils::ReserveArray(TargetDir, 3);
212  anaUtils::ReserveArray(LeptonDir, 3);
213  anaUtils::ReserveArray(ProtonDir, 3);
214  anaUtils::ReserveArray(PionDir, 3);
215  TargetMom = -999;
216  LeptonMom = -999;
217  ProtonMom = -999;
218  PionMom = -999;
219 
220  IsPauliBlocked = false;
221  IsCohOnH = false;
222 
223  for (UInt_t i=0; i<(ParticleId::kLast+1); i++)
224  NPrimaryParticles[i]=0;
225 
226  AccumLevel.clear();
227 
228  ReconParticles.clear();
229  ReconVertices.clear();
230 }
231 
232 //********************************************************************
233 AnaTrueVertex::AnaTrueVertex(const AnaTrueVertex& vertex):AnaTrueVertexB(vertex){
234 //********************************************************************
235 
236  RooVtxIndex = vertex.RooVtxIndex;
237  RooVtxEntry = vertex.RooVtxEntry;
238  ReacCode = vertex.ReacCode;
239  TargetPDG = vertex.TargetPDG;
240  anaUtils::CopyArray(vertex.NuDir, NuDir, 3);
241  NuParentPDG = vertex.NuParentPDG;
242  anaUtils::CopyArray(vertex.NuParentDecPoint, NuParentDecPoint, 3);
243 
244  NBaryons = vertex.NBaryons;
245  Q2 = vertex.Q2;
246  LeptonPDG = vertex.LeptonPDG;
247  anaUtils::CopyArray(vertex.TargetDir, TargetDir, 3);
248  anaUtils::CopyArray(vertex.LeptonDir, LeptonDir, 3);
249  anaUtils::CopyArray(vertex.ProtonDir, ProtonDir, 3);
250  anaUtils::CopyArray(vertex.PionDir, PionDir, 3);
251  TargetMom = vertex.TargetMom;
252  LeptonMom = vertex.LeptonMom;
253  ProtonMom = vertex.ProtonMom;
254  PionMom = vertex.PionMom;
255 
257  IsCohOnH = vertex.IsCohOnH;
258 
259  for (UInt_t i=0; i<(ParticleId::kLast+1); i++)
261 /*
262  PreFSIParticles.clear();
263  for (UInt_t i=0;i<vertex.PreFSIParticles.size();i++)
264  PreFSIParticles.push_back(vertex.PreFSIParticles[i]);
265 */
266  AccumLevel.resize(vertex.AccumLevel.size());
267  for (UInt_t i=0;i<vertex.AccumLevel.size();i++){
268  AccumLevel[i].resize(vertex.AccumLevel[i].size());
269  for (UInt_t j=0;j<vertex.AccumLevel[i].size();j++){
270  AccumLevel[i][j]=vertex.AccumLevel[i][j];
271  }
272  }
273 
274  ReconParticles.clear();
275  /*
276  for (UInt_t i=0;i<vertex.ReconParticles.size();i++)
277  ReconParticles.push_back(vertex.ReconParticles[i]);
278  */
279  ReconVertices.clear();
280  /*
281  for (UInt_t i=0;i<vertex.ReconVertices.size();i++)
282  ReconVertices.push_back(vertex.ReconVertices[i]);
283  */
284 }
285 
286 //********************************************************************
287 void AnaTrueVertex::Print() const{
288 //********************************************************************
289 
290  std::cout << "-------- AnaTrueVertex --------- " << std::endl;
291 
293 
294  std::cout << "RooVtxIndex: " << RooVtxIndex << std::endl;
295  std::cout << "RooVtxEntry: " << RooVtxEntry << std::endl;
296  std::cout << "ReacCode: " << ReacCode << std::endl;
297  std::cout << "TargetPDG: " << TargetPDG << std::endl;
298 
299 
300  std::cout << "NuDir: " << NuDir[0] << " " << NuDir[1] << " " << NuDir[2] << std::endl;
301 
302  std::cout << "NuParentPDG: " << NuParentPDG << std::endl;
303  std::cout << "NuParentDecPoint: " << NuParentDecPoint[0] << " " << NuParentDecPoint[1] << " " << NuParentDecPoint[2] << " " << NuParentDecPoint[3] << std::endl;
304 
305 
306  std::cout << "NBaryons: " << NBaryons << std::endl;
307  std::cout << "LeptonPDG: " << LeptonPDG << std::endl;
308  std::cout << "Q2: " << Q2 << std::endl;
309 
310  std::cout << "TargetDir: " << TargetDir[0] << " " << TargetDir[1] << " " << TargetDir[2] << std::endl;
311  std::cout << "LeptonDir: " << LeptonDir[0] << " " << LeptonDir[1] << " " << LeptonDir[2] << std::endl;
312  std::cout << "ProtonDir: " << ProtonDir[0] << " " << ProtonDir[1] << " " << ProtonDir[2] << std::endl;
313  std::cout << "PionDir: " << PionDir[0] << " " << PionDir[1] << " " << PionDir[2] << std::endl;
314 
315  std::cout << "TargetMom: " << TargetMom << std::endl;
316  std::cout << "LeptonMom: " << LeptonMom << std::endl;
317  std::cout << "ProtonMom: " << ProtonMom << std::endl;
318  std::cout << "PionMom: " << PionMom << std::endl;
319 
320  std::cout << "NReconParticles: " << (int)ReconParticles.size() << std::endl;
321  std::cout << "NReconVertices: " << (int)ReconVertices.size() << std::endl;
322 }
323 
324 //********************************************************************
325 AnaTrueParticle::AnaTrueParticle(): AnaTrueParticleB(){
326 //********************************************************************
327 
328  PrimaryID = -999;
329  Purity = -999;
330  Bunch = -999;
331  VertexIndex = -999;
332  IsTruePrimaryPi0DecayPhoton = false;
333  IsTruePrimaryPi0DecayPhotonChild = false;
334 
335  ReconParticles.clear();
336 }
337 
338 //********************************************************************
339 AnaTrueParticle::AnaTrueParticle(const AnaTrueParticle& truePart):AnaTrueParticleB(truePart){
340 //********************************************************************
341 
342  PrimaryID = truePart.PrimaryID;
343  Purity = truePart.Purity;
344  Bunch = truePart.Bunch;
345  VertexIndex = truePart.VertexIndex;
347  IsTruePrimaryPi0DecayPhotonChild = truePart.IsTruePrimaryPi0DecayPhotonChild;
348 
349 
350  ReconParticles.clear();
351  /*
352  for (UInt_t i=0;i<truePart.ReconParticles.size();i++)
353  ReconParticles.push_back(truePart.ReconParticles[i]);
354  */
355 }
356 
357 //********************************************************************
359 //********************************************************************
360 
361  std::cout << "-------- AnaTrueParticle --------- \n";
362 
364 
365  std::cout << "NReconParticles: " << (int)ReconParticles.size() << "\n"
366  << "VertexIndex: " << VertexIndex << "\n"
367  << "IsTruePrimaryPi0DecayPhoton: " << IsTruePrimaryPi0DecayPhoton << "\n"
368  << "IsTruePrimaryPi0DecayPhotonChild: " << IsTruePrimaryPi0DecayPhotonChild << std::endl;
369 }
370 
371 
372 //********************************************************************
373 AnaTPCParticle::AnaTPCParticle():AnaTPCParticleB(),AnaSubTrack() {
374 //********************************************************************
375 
376 #if VERSION_HAS_BFIELD_REFIT_FULL
377  RefitCharge = -999;
378  anaUtils::ReserveArray(RefitDirection,3);
379  anaUtils::ReserveArray(RefitPosition,4);
380 #endif
381  Pullmu = -999;
382  Pullele = -999;
383  Pullp = -999;
384  Pullpi = -999;
385  Pullk = -999;
386  dEdxexpKaon = -999;
387  dEdxSigmaKaon = -999;
388 }
389 
390 //********************************************************************
391 AnaTPCParticle::AnaTPCParticle(const AnaTPCParticle& seg):AnaTPCParticleB(seg),AnaSubTrack(seg){
392 //********************************************************************
393 
394 #if VERSION_HAS_BFIELD_REFIT_FULL
395  RefitCharge = seg.RefitCharge;
396  anaUtils::CopyArray(seg.RefitDirection, RefitDirection,3);
397  anaUtils::CopyArray(seg.RefitPosition, RefitPosition,4);
398 #endif
399  Pullmu = seg.Pullmu;
400  Pullele = seg.Pullele;
401  Pullp = seg.Pullp;
402  Pullpi = seg.Pullpi;
403  Pullk = seg.Pullk;
404  dEdxexpKaon = seg.dEdxexpKaon;
406 }
407 
408 //********************************************************************
410 //********************************************************************
411 
412  std::cout << "-------- AnaTPCParticle --------- " << std::endl;
413 
415  std::cout << "Pullmu: " << Pullmu << std::endl;
416  std::cout << "Pullele: " << Pullele << std::endl;
417  std::cout << "Pullp: " << Pullp << std::endl;
418  std::cout << "Pullpi: " << Pullpi << std::endl;
419  std::cout << "Pullk: " << Pullk << std::endl;
420 }
421 
422 //********************************************************************
423 AnaTPCParticle::~AnaTPCParticle(){
424 //********************************************************************
425 }
426 
427 
428 //********************************************************************
429 AnaFGDParticle::AnaFGDParticle():AnaFGDParticleB(),AnaSubTrack() {
430 //********************************************************************
431 
432  E = -999;
433  AvgTime = -999;
434 
435 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY
436  HasFgdVA = false;
437  HasFgdVA_fmode = -999;
438  TypeVA = -999;
439 #endif
440 
441  Vertex1x1 = -999;
442  Vertex3x3 = -999;
443  Vertex5x5 = -999;
444  Vertex7x7 = -999;
445  VertexLayer = -999;
446 
447 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY
448  HasFgdEA = false;
449  HasFgdEA_fmode = -999;
450  TypeEA = -999;
451 
452  End0x0 = -999;
453  End1x1 = -999;
454  End3x3 = -999;
455  End5x5 = -999;
456  End7x7 = -999;
457 #endif
458 
459 }
460 
461 //********************************************************************
462 AnaFGDParticle::AnaFGDParticle(const AnaFGDParticle& seg):AnaFGDParticleB(seg),AnaSubTrack(seg){
463 //********************************************************************
464 
465  E = seg.E;
466  AvgTime = seg.AvgTime;
467 
468 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY
469  HasFgdVA = seg.HasFgdVA;
470  HasFgdVA_fmode = seg.HasFgdVA_fmode;
471  TypeVA = seg.TypeVA;
472 #endif
473 
474  Vertex1x1 = seg.Vertex1x1;
475  Vertex3x3 = seg.Vertex3x3;
476  Vertex5x5 = seg.Vertex5x5;
477  Vertex7x7 = seg.Vertex7x7;
478  VertexLayer = seg.VertexLayer;
479 
480 #if VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY
481  HasFgdEA = seg.HasFgdEA;
482  HasFgdEA_fmode = seg.HasFgdEA_fmode;
483  TypeEA = seg.TypeEA;
484  End0x0 = seg.End0x0;
485  End1x1 = seg.End1x1;
486  End3x3 = seg.End3x3;
487  End5x5 = seg.End5x5;
488  End7x7 = seg.End7x7;
489 #endif
490 }
491 
492 //********************************************************************
493 AnaECALParticle::AnaECALParticle():AnaECALParticleB(){
494 //********************************************************************
495 
496  PIDMipPion = -9999;
497  Containment = -9999;
498 
499 
500 }
501 
502 //********************************************************************
503 AnaECALParticle::AnaECALParticle(const AnaECALParticle& seg):AnaECALParticleB(seg){
504 //********************************************************************
505 
506  PIDMipPion = seg.PIDMipPion;
507  Containment = seg.Containment;
508 
509 }
510 
511 //********************************************************************
512 AnaSMRDParticle::AnaSMRDParticle():AnaSMRDParticleB(),AnaSubTrack() {
513 //********************************************************************
514 
515  EDeposit = -9999;
516 
517 }
518 
519 //********************************************************************
520 AnaSMRDParticle::AnaSMRDParticle(const AnaSMRDParticle& seg):AnaSMRDParticleB(seg),AnaSubTrack(seg){
521 //********************************************************************
522 
523  EDeposit = seg.EDeposit;
524 
525 }
526 
527 //********************************************************************
528 AnaTrackerTrack::AnaTrackerTrack():AnaTrackerTrackB(),AnaSubTrack() {
529 //********************************************************************
530 
531 }
532 
533 //********************************************************************
534 AnaTrackerTrack::AnaTrackerTrack(const AnaTrackerTrack& seg):AnaTrackerTrackB(seg),AnaSubTrack(seg){
535 //********************************************************************
536 
537 
538 }
539 
540 //********************************************************************
541 AnaTrack::AnaTrack():AnaTrackB(){
542 //********************************************************************
543 
544  Length = -999;
545  Detectors = -999;
546 
547  TRACKERSegments.clear();
548 }
549 
550 //********************************************************************
551 AnaTrack::~AnaTrack(){
552 //********************************************************************
553 
554  for (UInt_t i=0;i<TRACKERSegments.size();i++)
555  delete TRACKERSegments[i];
556 
557  TRACKERSegments.clear();
558 
559 }
560 
561 //********************************************************************
562 AnaTrack::AnaTrack(const AnaTrack& track):AnaTrackB(track),AnaParticleE(track){
563 //********************************************************************
564 
565  Length = track.Length;
566  Detectors = track.Detectors;
567 
568  TRACKERSegments.clear();
569  for (UInt_t i=0;i<track.TRACKERSegments.size();i++)
570  TRACKERSegments.push_back(track.TRACKERSegments[i]->Clone());
571 
572 }
573 
574 //********************************************************************
575 void AnaTrack::Print() const{
576 //********************************************************************
577 
578  std::cout << "-------- AnaTrack --------- " << std::endl;
579 
582 
583  std::cout << "Length: " << Length << std::endl;
584  std::cout << "NTRACKERs: " << (int)TRACKERSegments.size() << std::endl;
585 }
586 
587 
588 //********************************************************************
589 AnaTimeNode::AnaTimeNode(){
590 //********************************************************************
591 
592  Detector = -999;
593  TimeStart = -999;
594  TimeEnd = -999;
595 }
596 
597 //********************************************************************
598 AnaTimeNode::AnaTimeNode(const AnaTimeNode& anaTime){
599 //********************************************************************
600 
601  Detector = anaTime.Detector;
602  TimeStart = anaTime.TimeStart;
603  TimeEnd = anaTime.TimeEnd;
604 }
605 
606 //********************************************************************
607 AnaBunch::AnaBunch(){
608 //********************************************************************
609 
610 }
611 
612 //********************************************************************
613 AnaBunch::~AnaBunch(){
614 //********************************************************************
615 
616 }
617 
618 //********************************************************************
619 AnaBunch::AnaBunch(const AnaBunch& bunch):AnaBunchB(bunch){
620  //AnaBunch::AnaBunch(const AnaBunch& bunch){
621 //********************************************************************
622 
623 /*
624  Bunch = bunch.Bunch;
625  Weight = bunch.Weight;
626 
627  Tracks.clear();
628  for (UInt_t i=0;i<bunch.Tracks.size();i++){
629  AnaTrackB* clonedTrack = bunch.Tracks[i]->Clone();
630  (static_cast<AnaTrack*>(clonedTrack))->ReconVertices.clear();
631  Tracks.push_back(clonedTrack);
632  }
633 
634  Vertices.clear();
635  for (UInt_t i=0;i<bunch.Vertices.size();i++){
636  AnaVertexB* clonedVertex = bunch.Vertices[i]->Clone();
637  Vertices.push_back(clonedVertex);
638  for (Int_t j=0;j<clonedVertex->nTracks;j++){
639  for (UInt_t k=0;k<Tracks.size();k++){
640  if (clonedVertex->Tracks[j] == bunch.Tracks[k]){
641  clonedVertex->Tracks[j] = Tracks[k];
642  (static_cast<AnaTrack*>(Tracks[k]))->ReconVertices.push_back(clonedVertex);
643  }
644  }
645  }
646  }
647 */
648 }
649 
650 //********************************************************************
651 void AnaBunch::Print() const{
652 //********************************************************************
653 
655 
656 }
657 
658 //********************************************************************
659 AnaFgdTimeBin::AnaFgdTimeBin():AnaFgdTimeBinB(){
660 //********************************************************************
661 
662  MaxTime = -999;
663  G4ID = -999;
664 }
665 
666 //********************************************************************
667 AnaFgdTimeBin::AnaFgdTimeBin(const AnaFgdTimeBin& bin):AnaFgdTimeBinB(bin){
668 //********************************************************************
669 
670  MaxTime = bin.MaxTime;
671  G4ID = bin.G4ID;
672 }
673 
674 //********************************************************************
675 void AnaFgdTimeBin::Print() const{
676 //********************************************************************
677 
678  std::cout << "-------- AnaFgdTimeBin --------- " << std::endl;
679 
681 
682  std::cout << "MaxTime: " << MaxTime << std::endl;
683 }
684 
685 //********************************************************************
686 AnaSpill::AnaSpill():AnaSpillB(){
687 //********************************************************************
688 
689  InputFileIndex=-999;
690  RooVtxEntry = -999;
691 }
692 
693 //********************************************************************
694 AnaSpill::~AnaSpill(){
695 //********************************************************************
696 }
697 
698 //********************************************************************
699 AnaSpill::AnaSpill(const AnaSpill& spill):AnaSpillB(spill){
700 //********************************************************************
701 
702  RooVtxEntry = spill.RooVtxEntry;
704  Trigger = spill.Trigger;
705 }
706 
707 //********************************************************************
709 //********************************************************************
710 
711  // Reset the true->Reco links since truth is not cloned and the vectors of ReconParticles and ReconVertices are already filled
712  for (UInt_t i=0;i<TrueVertices.size();i++){
713  (static_cast<AnaTrueVertex*>(TrueVertices[i]))->ReconParticles.clear();
714  (static_cast<AnaTrueVertex*>(TrueVertices[i]))->ReconVertices.clear();
715  }
716  for (UInt_t i=0;i<TrueParticles.size();i++)
717  (static_cast<AnaTrueParticle*>(TrueParticles[i]))->ReconParticles.clear();
718 
719  // Redo the links
721 }
722 
723 //********************************************************************
725 //********************************************************************
726 
727  // TODO. IS the dynamic_cast OK here ?
728 // if (!SubDetId::TrackUsesOnlyDet(particle->Detector,SubDetId::kP0D))
729  // (static_cast<AnaParticleE*>(particle))->ReconVertices.push_back(vertex);
730  AnaTrack* track = dynamic_cast<AnaTrack*>(particle);
731  if (track){
732  track->ReconVertices.push_back(vertex);
733  return;
734  }
735  AnaParticle* part = dynamic_cast<AnaParticle*>(particle);
736  if (part){
737  part->ReconVertices.push_back(vertex);
738  return;
739  }
740 
741 
742 }
743 
744 //********************************************************************
746 //********************************************************************
747 
748  if (vertex->TrueVertex)
749  (static_cast<AnaTrueVertex*>(vertex->TrueVertex))->ReconVertices.push_back(vertex);
750 }
751 
752 //********************************************************************
754 //********************************************************************
755 
756  if (particle->TrueObject){
757  (static_cast<AnaTrueParticle*>(particle->TrueObject))->ReconParticles.push_back(particle);
758  if (particle->GetTrueParticle()->TrueVertex)
759  (static_cast<AnaTrueVertex*>(particle->GetTrueParticle()->TrueVertex))->ReconParticles.push_back(particle);
760  }
761 }
762 
763 //********************************************************************
764 void AnaSpill::Print() const{
765 //********************************************************************
766 
767  std::cout << "-------- AnaSpill --------- " << std::endl;
768 
770 }
771 
772 
773 //********************************************************************
774 AnaEvent::AnaEvent():AnaEventB(){
775 //********************************************************************
776 
777 }
778 
779 //********************************************************************
780 AnaEvent::~AnaEvent(){
781 //********************************************************************
782 
783 }
784 
785 //********************************************************************
786 AnaEvent::AnaEvent(const AnaEvent& event):AnaEventB(event){
787 //********************************************************************
788 
789  Trigger = event.Trigger;
790 
791 }
792 
793 //*****************************************************************************
794 AnaEvent::AnaEvent(const AnaSpill& spill, const AnaBunch& bunch):AnaEventB(spill,bunch) {
795 //*****************************************************************************
796 
797  Trigger = spill.Trigger;
798 }
799 
800 //********************************************************************
801 void AnaEvent::Print() const{
802 //********************************************************************
803 
804  std::cout << "-------- AnaEvent --------- " << std::endl;
805 
807  Trigger.Print();
808 }
809 
810 //********************************************************************
811 AnaLocalReconEvent::AnaLocalReconEvent():AnaEvent(){
812 //********************************************************************
813  TECALReconObjects .clear();
814  TECALUnmatchedObjects.clear();
815  PECALReconObjects .clear();
816  PECALUnmatchedObjects.clear();
817  FGDOnlyReconObjects .clear();
818  P0DReconVertices .clear();
819  P0DReconParticles .clear();
820  P0DReconClusters .clear();
821 }
822 
823 //********************************************************************
824 AnaLocalReconEvent::~AnaLocalReconEvent(){
825 //********************************************************************
826  for (std::vector<AnaTECALReconObject*>::iterator it = TECALReconObjects.begin();
827  it != TECALReconObjects.end(); ++it) {
828  delete (*it);
829  }
830  TECALReconObjects.clear();
831 
832  for (std::vector<AnaTECALUnmatchedObject*>::iterator it = TECALUnmatchedObjects.begin();
833  it != TECALUnmatchedObjects.end(); ++it) {
834  delete (*it);
835  }
836  TECALUnmatchedObjects.clear();
837 
838  for (std::vector<AnaPECALReconObject*>::iterator it = PECALReconObjects.begin();
839  it != PECALReconObjects.end(); ++it) {
840  delete (*it);
841  }
842  PECALReconObjects.clear();
843 
844  for (std::vector<AnaPECALUnmatchedObject*>::iterator it = PECALUnmatchedObjects.begin();
845  it != PECALUnmatchedObjects.end(); ++it) {
846  delete (*it);
847  }
848  PECALUnmatchedObjects.clear();
849 
850  for (std::vector<AnaP0DReconVertex*>::iterator it = P0DReconVertices.begin();
851  it != P0DReconVertices.end(); ++it) {
852  delete (*it);
853  }
854  P0DReconVertices.clear();
855 
856  for (std::vector<AnaP0DReconParticle*>::iterator it = P0DReconParticles.begin();
857  it != P0DReconParticles.end(); ++it) {
858  delete (*it);
859  }
860  P0DReconParticles.clear();
861 
862  for (std::vector<AnaP0DReconCluster*>::iterator it = P0DReconClusters.begin();
863  it != P0DReconClusters.end(); ++it) {
864  delete (*it);
865  }
866  P0DReconClusters.clear();
867 
868  for (std::vector<AnaFGDOnlyReconObject*>::iterator it = FGDOnlyReconObjects.begin();
869  it != FGDOnlyReconObjects.end(); ++it) {
870  delete (*it);
871  }
872  FGDOnlyReconObjects.clear();
873 }
874 
875 //********************************************************************
876 AnaLocalReconEvent::AnaLocalReconEvent(const AnaLocalReconEvent& event):AnaEvent(event){
877 //********************************************************************
878 
879  TECALReconObjects.clear();
880  for (std::vector<AnaTECALReconObject*>::const_iterator it = event.TECALReconObjects.begin();
881  it != event.TECALReconObjects.end(); ++it) {
882  TECALReconObjects.push_back((*it)->Clone());
883  }
884 
885  TECALUnmatchedObjects.clear();
886  for (std::vector<AnaTECALUnmatchedObject*>::const_iterator it = event.TECALUnmatchedObjects.begin();
887  it != event.TECALUnmatchedObjects.end(); ++it) {
888  TECALUnmatchedObjects.push_back((*it)->Clone());
889  }
890 
891  PECALReconObjects.clear();
892  for (std::vector<AnaPECALReconObject*>::const_iterator it = event.PECALReconObjects.begin();
893  it != event.PECALReconObjects.end(); ++it) {
894  PECALReconObjects.push_back((*it)->Clone());
895  }
896 
897  PECALUnmatchedObjects.clear();
898  for (std::vector<AnaPECALUnmatchedObject*>::const_iterator it = event.PECALUnmatchedObjects.begin();
899  it != event.PECALUnmatchedObjects.end(); ++it) {
900  PECALUnmatchedObjects.push_back((*it)->Clone());
901  }
902 
903  FGDOnlyReconObjects.clear();
904  for (std::vector<AnaFGDOnlyReconObject*>::const_iterator it = event.FGDOnlyReconObjects.begin();
905  it != event.FGDOnlyReconObjects.end(); ++it) {
906  FGDOnlyReconObjects.push_back((*it)->Clone());
907  }
908 
909  P0DReconVertices.clear();
910  for (std::vector<AnaP0DReconVertex*>::const_iterator it = event.P0DReconVertices.begin();
911  it != event.P0DReconVertices.end(); ++it) {
912  P0DReconVertices.push_back((*it)->Clone());
913  }
914 
915  P0DReconParticles.clear();
916  for (std::vector<AnaP0DReconParticle*>::const_iterator it = event.P0DReconParticles.begin();
917  it != event.P0DReconParticles.end(); ++it) {
918  P0DReconParticles.push_back((*it)->Clone());
919  }
920 
921  P0DReconClusters.clear();
922  for (std::vector<AnaP0DReconCluster*>::const_iterator it = event.P0DReconClusters.begin();
923  it != event.P0DReconClusters.end(); ++it) {
924  P0DReconClusters.push_back((*it)->Clone());
925  }
926 }
927 
928 //*****************************************************************************
929 AnaLocalReconEvent::AnaLocalReconEvent(const AnaSpill& spill, const AnaLocalReconBunch& bunch):AnaEvent(spill,bunch) {
930 //*****************************************************************************
931 
932  TECALReconObjects.clear();
933  for (std::vector<AnaTECALReconObject*>::const_iterator it = bunch.TECALReconObjects.begin();
934  it != bunch.TECALReconObjects.end(); ++it) {
935  TECALReconObjects.push_back((*it)->Clone());
936  }
937 
938  TECALUnmatchedObjects.clear();
939  for (std::vector<AnaTECALUnmatchedObject*>::const_iterator it = bunch.TECALUnmatchedObjects.begin();
940  it != bunch.TECALUnmatchedObjects.end(); ++it) {
941  TECALUnmatchedObjects.push_back((*it)->Clone());
942  }
943 
944  PECALReconObjects.clear();
945  for (std::vector<AnaPECALReconObject*>::const_iterator it = bunch.PECALReconObjects.begin();
946  it != bunch.PECALReconObjects.end(); ++it) {
947  PECALReconObjects.push_back((*it)->Clone());
948  }
949 
950  PECALUnmatchedObjects.clear();
951  for (std::vector<AnaPECALUnmatchedObject*>::const_iterator it = bunch.PECALUnmatchedObjects.begin();
952  it != bunch.PECALUnmatchedObjects.end(); ++it) {
953  PECALUnmatchedObjects.push_back((*it)->Clone());
954  }
955 
956  FGDOnlyReconObjects.clear();
957  for (std::vector<AnaFGDOnlyReconObject*>::const_iterator it = bunch.FGDOnlyReconObjects.begin();
958  it != bunch.FGDOnlyReconObjects.end(); ++it) {
959  FGDOnlyReconObjects.push_back((*it)->Clone());
960  }
961 
962  P0DReconVertices.clear();
963  for (std::vector<AnaP0DReconVertex*>::const_iterator it = bunch.P0DReconVertices.begin();
964  it != bunch.P0DReconVertices.end(); ++it) {
965  P0DReconVertices.push_back((*it)->Clone());
966  }
967 
968  P0DReconParticles.clear();
969  for (std::vector<AnaP0DReconParticle*>::const_iterator it = bunch.P0DReconParticles.begin();
970  it != bunch.P0DReconParticles.end(); ++it) {
971  P0DReconParticles.push_back((*it)->Clone());
972  }
973 
974  P0DReconClusters.clear();
975  for (std::vector<AnaP0DReconCluster*>::const_iterator it = bunch.P0DReconClusters.begin();
976  it != bunch.P0DReconClusters.end(); ++it) {
977  P0DReconClusters.push_back((*it)->Clone());
978  }
979 }
980 
981 //********************************************************************
982 AnaVertex::AnaVertex():AnaVertexB(){
983 //********************************************************************
984 
985  Bunch = -999;
986  anaUtils::ReserveArray(Variance, 4);
987  NDOF = -999;
988  Chi2 = -999;
989 }
990 
991 //********************************************************************
992 AnaVertex::AnaVertex(const AnaVertex& vertex):AnaVertexB(vertex){
993 //********************************************************************
994 
995  Bunch = vertex.Bunch;
996  anaUtils::CopyArray(vertex.Variance, Variance, 4);
997  NDOF = vertex.NDOF;
998  Chi2 = vertex.Chi2;
999 }
1000 
1001 //********************************************************************
1002 void AnaVertex::Print() const{
1003 //********************************************************************
1004 
1005  std::cout << "-------- AnaVertex --------- " << std::endl;
1006 
1008 
1009  std::cout << "Bunch: " << Bunch << std::endl;
1010  std::cout << "Variance: " << Variance[0] << " " << Variance[1] << " " << Variance[2] << " " << Variance[3] << std::endl;
1011  std::cout << "NDOF: " << NDOF << std::endl;
1012  std::cout << "Chi2: " << Chi2 << std::endl;
1013 }
1014 
1015 //********************************************************************
1016 AnaEventInfo::AnaEventInfo():AnaEventInfoB(){
1017 //********************************************************************
1018 
1019  EventTime = -999;
1020 }
1021 
1022 //********************************************************************
1023 AnaEventInfo::AnaEventInfo(const AnaEventInfo& spill):AnaEventInfoB(spill){
1024 //********************************************************************
1025 
1026  EventTime = spill.EventTime;
1027 }
1028 
1029 //********************************************************************
1030 void AnaEventInfo::Print() const{
1031 //********************************************************************
1032 
1033  std::cout << "-------- AnaEventInfo --------- " << std::endl;
1034 
1036 
1037  std::cout << "EventTime: " << EventTime << std::endl;
1038 }
1039 
1040 //********************************************************************
1041 AnaDataQuality::AnaDataQuality(){
1042 //********************************************************************
1043 
1044  ND280Flag = -999;
1045  for (UInt_t i=0;i<7;i++){
1046  DetFlag[i] = -999;
1047  }
1048 }
1049 
1050 //********************************************************************
1051 AnaDataQuality::AnaDataQuality(const AnaDataQuality& dq):AnaDataQualityB(dq){
1052 //********************************************************************
1053 
1054  ND280Flag = dq.ND280Flag;
1055  for (UInt_t i=0;i<7;i++)
1056  DetFlag[i] = dq.DetFlag[i];
1057 }
1058 
1059 //********************************************************************
1060 AnaBeam::AnaBeam(){
1061 //********************************************************************
1062 
1063  POT = -999;
1064 #if !VERSION_HAS_OFFICIAL_POT
1065  POTCT4 = -999;
1066 #endif
1067  Spill = -999;
1068  SpillNumber = -999;
1069  BeamRunNumber = -999;
1070 }
1071 
1072 //********************************************************************
1073 AnaBeam::AnaBeam(const AnaBeam& beam):AnaBeamB(beam){
1074 //********************************************************************
1075 
1076  POT = beam.POT;
1077 #if !VERSION_HAS_OFFICIAL_POT
1078  POTCT4 = beam.POTCT4;
1079 #endif
1080  Spill = beam.Spill;
1081  SpillNumber = beam.SpillNumber;
1083 }
1084 
1085 //********************************************************************
1086 AnaTrigger::AnaTrigger() {
1087 //********************************************************************
1088  FGDCosmic = false;
1089  TripTCosmic = false;
1090 }
1091 
1092 //********************************************************************
1093 AnaTrigger::AnaTrigger(const AnaTrigger& tr) {
1094 //********************************************************************
1095  FGDCosmic = tr.FGDCosmic;
1096  TripTCosmic = tr.TripTCosmic;
1097 }
1098 
1099 //********************************************************************
1100 void AnaTrigger::Print() const{
1101 //********************************************************************
1102 
1103  if (FGDCosmic)
1104  std::cout << "Trigger: FGDCosmic" << std::endl;
1105  else if (TripTCosmic)
1106  std::cout << "Trigger: TripTCosmic" << std::endl;
1107  else
1108  std::cout << "Trigger: Unknown" << std::endl;
1109 }
1110 
1111 //********************************************************************
1112 AnaTECALReconObject::AnaTECALReconObject(){
1113 //********************************************************************
1114 
1115  AverageHitTime = kUnassigned;
1116  AverageZPos = kUnassigned;
1117  Containment = kUnassigned;
1118  EFitResult = kUnassigned;
1119  EFitUncertainty = kUnassigned;
1120  FirstLayer = kUnassigned;
1121  IsShowerLike = kUnassigned;
1122  IsTrackLike = kUnassigned;
1123  LastLayer = kUnassigned;
1124  LikeMIPEM = kUnassigned;
1125  LikeMIPPion = kUnassigned;
1126  LikeEMHIP = kUnassigned;
1127  LikeMIPEMLow = kUnassigned;
1128  MatchingLike = kUnassigned;
1129  MichelTagNDelayedCluster = kUnassigned;
1130  Module = "UNKOWN";
1131  MostDownStreamLayerHit = kUnassigned;
1132  MostUpStreamLayerHit = kUnassigned;
1133  NHits = kUnassigned;
1134  NLayersHit = kUnassigned;
1135  ObjectLength = kUnassigned;
1136  PIDAMR = kUnassigned;
1137  PIDAngle = kUnassigned;
1138  PIDAsymmetry = kUnassigned;
1139  PIDCircularity = kUnassigned;
1140  PIDFBR = kUnassigned;
1141  PIDMaxRatio = kUnassigned;
1142  PIDMeanPos = kUnassigned;
1143  PIDShowerAngle = kUnassigned;
1144  PIDShowerWidth = kUnassigned;
1145  PIDTransverseChargeRatio = kUnassigned;
1146  PIDTruncatedMaxRatio = kUnassigned;
1147  anaUtils::VectorToArray (TVector3(0,0,0), Pointing );
1148  Thrust = kUnassigned;
1149  anaUtils::VectorToArray (TVector3(0,0,0), ThrustAxis );
1150  anaUtils::VectorToArray (TVector3(0,0,0), ThrustOrigin);
1151  TimeBunch = kUnassigned;
1152  TotalHitCharge = kUnassigned;
1153  TrueID = kUnassigned;
1154  TrueIDPrimary = kUnassigned;
1155  TrueIDRecursive = kUnassigned;
1156  TrueIDSingle = kUnassigned;
1157  UniqueID = kUnassigned;
1158 
1159  Bunch = kUnassigned;
1160 
1161 }
1162 
1163 //********************************************************************
1164 AnaTECALReconObject::AnaTECALReconObject(const AnaTECALReconObject& tecalRecon) {
1165 //********************************************************************
1166 
1167  AverageHitTime = tecalRecon.AverageHitTime;
1168  AverageZPos = tecalRecon.AverageZPos;
1169  Containment = tecalRecon.Containment;
1170  EFitResult = tecalRecon.EFitResult;
1171  EFitUncertainty = tecalRecon.EFitUncertainty;
1172  FirstLayer = tecalRecon.FirstLayer;
1173  IsShowerLike = tecalRecon.IsShowerLike;
1174  IsTrackLike = tecalRecon.IsTrackLike;
1175  LastLayer = tecalRecon.LastLayer;
1176  LikeMIPEM = tecalRecon.LikeMIPEM;
1177  LikeMIPPion = tecalRecon.LikeMIPPion;
1178  LikeEMHIP = tecalRecon.LikeEMHIP;
1179  LikeMIPEMLow = tecalRecon.LikeMIPEMLow;
1180  MatchingLike = tecalRecon.MatchingLike;
1181  MichelTagNDelayedCluster = tecalRecon.MichelTagNDelayedCluster;
1182  Module = tecalRecon.Module;
1183  MostDownStreamLayerHit = tecalRecon.MostDownStreamLayerHit;
1184  MostUpStreamLayerHit = tecalRecon.MostUpStreamLayerHit;
1185  NHits = tecalRecon.NHits;
1186  NLayersHit = tecalRecon.NLayersHit;
1187  ObjectLength = tecalRecon.ObjectLength;
1188  PIDAMR = tecalRecon.PIDAMR;
1189  PIDAngle = tecalRecon.PIDAngle;
1190  PIDAsymmetry = tecalRecon.PIDAsymmetry;
1191  PIDCircularity = tecalRecon.PIDCircularity;
1192  PIDFBR = tecalRecon.PIDFBR;
1193  PIDMaxRatio = tecalRecon.PIDMaxRatio;
1194  PIDMeanPos = tecalRecon.PIDMeanPos;
1195  PIDShowerAngle = tecalRecon.PIDShowerAngle;
1196  PIDShowerWidth = tecalRecon.PIDShowerWidth;
1197  PIDTransverseChargeRatio = tecalRecon.PIDTransverseChargeRatio;
1198  PIDTruncatedMaxRatio = tecalRecon.PIDTruncatedMaxRatio;
1199  anaUtils::CopyArray (tecalRecon.Pointing, Pointing, 3);
1200  Thrust = tecalRecon.Thrust;
1201  anaUtils::CopyArray (tecalRecon.ThrustAxis, ThrustAxis, 3);
1202  anaUtils::CopyArray (tecalRecon.ThrustOrigin, ThrustOrigin, 3);
1203  TimeBunch = tecalRecon.TimeBunch;
1204  TotalHitCharge = tecalRecon.TotalHitCharge;
1205  TrueID = tecalRecon.TrueID;
1206  TrueIDPrimary = tecalRecon.TrueIDPrimary;
1207  TrueIDRecursive = tecalRecon.TrueIDRecursive;
1208  TrueIDSingle = tecalRecon.TrueIDSingle;
1209  UniqueID = tecalRecon.UniqueID;
1210 
1211  Bunch = tecalRecon.Bunch;
1212 
1213 }
1214 
1215 //********************************************************************
1217 //********************************************************************
1218 
1219  std::cout<<"-- AnaTECALReconObject.Print() --\n"
1220  <<"NHits : "<<NHits <<"\n"
1221  <<"Bunch : "<<Bunch <<"\n"
1222  <<"FirstLayer : "<<FirstLayer <<"\n"
1223  <<"LastLayer : "<<LastLayer <<"\n"
1224  <<"EFitResult : "<<EFitResult <<"\n"
1225  <<"TotalHitCharge : "<<TotalHitCharge<<"\n"
1226  <<"IsTrack(Shower)Like : "<<IsTrackLike<<"("<<IsShowerLike<<")"
1227  <<std::endl;
1228 
1229 }
1230 
1231 //********************************************************************
1232 AnaTECALUnmatchedObject::AnaTECALUnmatchedObject(){
1233 //********************************************************************
1234 
1235  AverageHitTime = kUnassigned;
1236  anaUtils::VectorToArray (TVector3(0,0,0), BackPos );
1237  anaUtils::VectorToArray (TVector3(0,0,0), FrontPos);
1238  MostDownStreamLayerHit = kUnassigned;
1239  MostUpStreamLayerHit = kUnassigned;
1240  NHits = kUnassigned;
1241  TotalHitCharge = kUnassigned;
1242  TrueID = kUnassigned;
1243  TrueIDPrimary = kUnassigned;
1244  TrueIDRecursive = kUnassigned;
1245  TrueIDSingle = kUnassigned;
1246  View = kUnassigned;
1247 
1248  Bunch = kUnassigned;
1249 
1250 }
1251 
1252 //********************************************************************
1253 AnaTECALUnmatchedObject::AnaTECALUnmatchedObject(const AnaTECALUnmatchedObject& tecalUnmatched){
1254 //********************************************************************
1255 
1256  AverageHitTime = tecalUnmatched.AverageHitTime;
1257  anaUtils::CopyArray (tecalUnmatched.BackPos, BackPos, 3);
1258  anaUtils::CopyArray (tecalUnmatched.FrontPos, FrontPos, 3);
1259  MostDownStreamLayerHit = tecalUnmatched.MostDownStreamLayerHit;
1260  MostUpStreamLayerHit = tecalUnmatched.MostUpStreamLayerHit;
1261  NHits = tecalUnmatched.NHits;
1262  TotalHitCharge = tecalUnmatched.TotalHitCharge;
1263  TrueID = tecalUnmatched.TrueID;
1264  TrueIDPrimary = tecalUnmatched.TrueIDPrimary;
1265  TrueIDRecursive = tecalUnmatched.TrueIDRecursive;
1266  TrueIDSingle = tecalUnmatched.TrueIDSingle;
1267  View = tecalUnmatched.View;
1268 
1269  Bunch = tecalUnmatched.Bunch;
1270 
1271 }
1272 
1273 //********************************************************************
1275 //********************************************************************
1276 
1277  std::cout<<"-- AnaTECALUnmatchedObject.Print() --\n"
1278  <<"NHits : "<<NHits <<"\n"
1279  <<"Bunch : "<<Bunch <<"\n"
1280  <<"MostUpStreamLayerHit : "<<MostUpStreamLayerHit <<"\n"
1281  <<"MostDownStreamLayerHit : "<<MostDownStreamLayerHit <<"\n"
1282  <<"TotalHitCharge : "<<TotalHitCharge <<"\n"
1283  <<"View : "<<View
1284  <<std::endl;
1285 
1286 }
1287 
1288 //********************************************************************
1289 AnaP0DReconObject::AnaP0DReconObject(){
1290 //********************************************************************
1291 
1292  VerticesP .clear();
1293  ParticlesP .clear();
1294  ClustersP .clear();
1295 
1296  Vertices .clear();
1297  Particles .clear();
1298  Tracks .clear();
1299  Showers .clear();
1300  Clusters .clear();
1301  Nodes .clear();
1302  Hits .clear();
1303  AlgorithmName = "";
1304  Cycle = kShortUnassigned;
1305  NHits = kShortUnassigned;
1306  UniqueID = kUnassigned;
1307  Bunch = kUnassigned;
1308  ValidDimensions = kShortUnassigned;
1309 
1310  Truth_PrimaryTrajIDs .clear();
1311  Truth_TrajIDs .clear();
1312  Truth_HitCount .clear();
1313  Truth_ChargeShare .clear();
1314  anaUtils::VectorToArray (TLorentzVector(0,0,0,0), Position );
1315  anaUtils::VectorToArray (TLorentzVector(0,0,0,0), PosVariance);
1316 
1317 }
1318 
1319 //********************************************************************
1320 AnaP0DReconObject::AnaP0DReconObject(const AnaP0DReconObject& p0dObject){
1321 //********************************************************************
1322 
1323  VerticesP = p0dObject.VerticesP;
1324  ParticlesP = p0dObject.ParticlesP;
1325  ClustersP = p0dObject.ClustersP;
1326 
1327  Vertices = p0dObject.Vertices;
1328  Particles = p0dObject.Particles;
1329  Tracks = p0dObject.Tracks;
1330  Showers = p0dObject.Showers;
1331  Clusters = p0dObject.Clusters;
1332  Nodes = p0dObject.Nodes;
1333  Hits = p0dObject.Hits;
1334  AlgorithmName = p0dObject.AlgorithmName;
1335  Cycle = p0dObject.Cycle;
1336  NHits = p0dObject.NHits;
1337  UniqueID = p0dObject.UniqueID;
1338  Bunch = p0dObject.Bunch;
1339 
1340  ValidDimensions = p0dObject.ValidDimensions;
1341  Truth_PrimaryTrajIDs = p0dObject.Truth_PrimaryTrajIDs;
1342  Truth_TrajIDs = p0dObject.Truth_TrajIDs;
1343  Truth_HitCount = p0dObject.Truth_HitCount;
1344  Truth_ChargeShare = p0dObject.Truth_ChargeShare;
1345  anaUtils::CopyArray (p0dObject.Position, Position, 4);
1346  anaUtils::CopyArray (p0dObject.PosVariance, PosVariance, 4);
1347 
1348 }
1349 
1350 //********************************************************************
1352 //********************************************************************
1353 
1354  std::cout<<"-- AnaP0DReconObject.Print() --\n"
1355  <<"Vertices .size() : "<<Vertices .size()<<"\n"
1356  <<"Particles .size() : "<<Particles.size()<<"\n"
1357  <<"Tracks .size() : "<<Tracks .size()<<"\n"
1358  <<"Showers .size() : "<<Showers .size()<<"\n"
1359  <<"Clusters .size() : "<<Clusters .size()<<"\n"
1360  <<"Nodes .size() : "<<Nodes .size()<<"\n"
1361  <<"Hits .size() : "<<Hits .size()<<"\n"
1362  <<"AlgorithmName : "<<AlgorithmName <<"\n"
1363  <<"Cycle : "<<Cycle <<"\n"
1364  <<"NHits : "<<NHits <<"\n"
1365  <<"UniqueID : "<<UniqueID <<"\n"
1366  <<"Bunch : "<<Bunch <<std::endl;
1367 
1368 }
1369 
1370 //********************************************************************
1371 AnaP0DReconVertex::AnaP0DReconVertex(){
1372 //********************************************************************
1373  Status = kUnassigned;
1374  Quality = kFloatUnassigned;
1375  NDOF = kUnassigned;
1376  Fiducial = kFloatUnassigned;
1377 
1378 }
1379 
1380 //********************************************************************
1381 AnaP0DReconVertex::AnaP0DReconVertex(const AnaP0DReconVertex& p0dVertex):AnaP0DReconObject(p0dVertex){
1382 //********************************************************************
1383 
1384  Status = p0dVertex.Status;
1385  Quality = p0dVertex.Quality;
1386  NDOF = p0dVertex.NDOF;
1387  Fiducial = p0dVertex.Fiducial;
1388 
1389 }
1390 
1391 //********************************************************************
1392 AnaP0DReconParticle::AnaP0DReconParticle(){
1393 //********************************************************************
1394 
1395  Status = kUnassigned;
1396  Quality = kFloatUnassigned;
1397  NDOF = kUnassigned;
1398  SideDeposit = kFloatUnassigned;
1399  EndDeposit = kFloatUnassigned;
1400  anaUtils::VectorToArray (TVector3(0,0,0),Direction );
1401  anaUtils::VectorToArray (TVector3(0,0,0),DirVariance);
1402  Momentum = kFloatUnassigned;
1403  Charge = kFloatUnassigned;
1404  Length = kFloatUnassigned;
1405  EDeposit = kFloatUnassigned;
1406  realPIDNames .clear();
1407  realPIDValues .clear();
1408  integerPIDNames .clear();
1409  integerPIDValues .clear();
1410  PID .clear();
1411  PID_weight .clear();
1412 
1413 
1414  TrueParticle = NULL;
1415 }
1416 
1417 //********************************************************************
1418 AnaP0DReconParticle::AnaP0DReconParticle(const AnaP0DReconParticle& p0dParticle):AnaP0DReconObject(p0dParticle){
1419 //********************************************************************
1420 
1421  Status = p0dParticle.Status;
1422  Quality = p0dParticle.Quality;
1423  NDOF = p0dParticle.NDOF;
1424  SideDeposit = p0dParticle.SideDeposit;
1425  EndDeposit = p0dParticle.EndDeposit;
1426  anaUtils::CopyArray (p0dParticle.Direction, Direction, 3);
1427  anaUtils::CopyArray (p0dParticle.DirVariance, DirVariance, 3);
1428  Momentum = p0dParticle.Momentum;
1429  Charge = p0dParticle.Charge;
1430  Length = p0dParticle.Length;
1431  EDeposit = p0dParticle.EDeposit;
1432  realPIDNames = p0dParticle.realPIDNames;
1433  realPIDValues = p0dParticle.realPIDValues;
1434  integerPIDNames = p0dParticle.integerPIDNames;
1435  integerPIDValues = p0dParticle.integerPIDValues;
1436  PID = p0dParticle.PID;
1437  PID_weight = p0dParticle.PID_weight;
1438 
1439  TrueParticle = p0dParticle.TrueParticle;
1440 }
1441 
1442 //********************************************************************
1443 AnaP0DReconCluster::AnaP0DReconCluster(){
1444 //********************************************************************
1445 
1446  NFiducialHits = kShortUnassigned;
1447  EDeposit = kFloatUnassigned;
1448 
1449 }
1450 
1451 //********************************************************************
1452 AnaP0DReconCluster::AnaP0DReconCluster(const AnaP0DReconCluster& p0dCluster):AnaP0DReconObject(p0dCluster){
1453 //********************************************************************
1454 
1455  NFiducialHits = p0dCluster.NFiducialHits;
1456  EDeposit = p0dCluster.EDeposit;
1457 
1458 }
1459 
1460 //********************************************************************
1461 AnaLocalReconBunch::AnaLocalReconBunch(){
1462 //********************************************************************
1463 
1464  TECALReconObjects .clear();
1465  TECALUnmatchedObjects.clear();
1466  PECALReconObjects .clear();
1467  PECALUnmatchedObjects.clear();
1468  FGDOnlyReconObjects .clear();
1469  P0DReconVertices .clear();
1470  P0DReconParticles .clear();
1471  P0DReconClusters .clear();
1472 }
1473 
1474 //********************************************************************
1475 AnaLocalReconBunch::~AnaLocalReconBunch(){
1476 //********************************************************************
1477  for (std::vector<AnaTECALReconObject*>::iterator it = TECALReconObjects.begin();
1478  it != TECALReconObjects.end(); ++it) {
1479  delete (*it);
1480  }
1481  TECALReconObjects.clear();
1482 
1483  for (std::vector<AnaTECALUnmatchedObject*>::iterator it = TECALUnmatchedObjects.begin();
1484  it != TECALUnmatchedObjects.end(); ++it) {
1485  delete (*it);
1486  }
1487  TECALUnmatchedObjects.clear();
1488 
1489  for (std::vector<AnaPECALReconObject*>::iterator it = PECALReconObjects.begin();
1490  it != PECALReconObjects.end(); ++it) {
1491  delete (*it);
1492  }
1493  PECALReconObjects.clear();
1494 
1495  for (std::vector<AnaPECALUnmatchedObject*>::iterator it = PECALUnmatchedObjects.begin();
1496  it != PECALUnmatchedObjects.end(); ++it) {
1497  delete (*it);
1498  }
1499  PECALUnmatchedObjects.clear();
1500 
1501  for (std::vector<AnaP0DReconVertex*>::iterator it = P0DReconVertices.begin();
1502  it != P0DReconVertices.end(); ++it) {
1503  delete (*it);
1504  }
1505  P0DReconVertices.clear();
1506 
1507  for (std::vector<AnaP0DReconParticle*>::iterator it = P0DReconParticles.begin();
1508  it != P0DReconParticles.end(); ++it) {
1509  delete (*it);
1510  }
1511  P0DReconParticles.clear();
1512 
1513  for (std::vector<AnaP0DReconCluster*>::iterator it = P0DReconClusters.begin();
1514  it != P0DReconClusters.end(); ++it) {
1515  delete (*it);
1516  }
1517  P0DReconClusters.clear();
1518 
1519  for (std::vector<AnaFGDOnlyReconObject*>::iterator it = FGDOnlyReconObjects.begin();
1520  it != FGDOnlyReconObjects.end(); ++it) {
1521  delete (*it);
1522  }
1523  FGDOnlyReconObjects.clear();
1524 }
1525 
1526 //********************************************************************
1527 AnaLocalReconBunch::AnaLocalReconBunch(const AnaLocalReconBunch& bunch):AnaBunch(bunch){
1528 //********************************************************************
1529  TECALReconObjects.clear();
1530  for (std::vector<AnaTECALReconObject*>::const_iterator it = bunch.TECALReconObjects.begin();
1531  it != bunch.TECALReconObjects.end(); ++it) {
1532  TECALReconObjects.push_back((*it)->Clone());
1533  }
1534 
1535  TECALUnmatchedObjects.clear();
1536  for (std::vector<AnaTECALUnmatchedObject*>::const_iterator it = bunch.TECALUnmatchedObjects.begin();
1537  it != bunch.TECALUnmatchedObjects.end(); ++it) {
1538  TECALUnmatchedObjects.push_back((*it)->Clone());
1539  }
1540 
1541  PECALReconObjects.clear();
1542  for (std::vector<AnaPECALReconObject*>::const_iterator it = bunch.PECALReconObjects.begin();
1543  it != bunch.PECALReconObjects.end(); ++it) {
1544  PECALReconObjects.push_back((*it)->Clone());
1545  }
1546 
1547  PECALUnmatchedObjects.clear();
1548  for (std::vector<AnaPECALUnmatchedObject*>::const_iterator it = bunch.PECALUnmatchedObjects.begin();
1549  it != bunch.PECALUnmatchedObjects.end(); ++it) {
1550  PECALUnmatchedObjects.push_back((*it)->Clone());
1551  }
1552 
1553  FGDOnlyReconObjects.clear();
1554  for (std::vector<AnaFGDOnlyReconObject*>::const_iterator it = bunch.FGDOnlyReconObjects.begin();
1555  it != bunch.FGDOnlyReconObjects.end(); ++it) {
1556  FGDOnlyReconObjects.push_back((*it)->Clone());
1557  }
1558 
1559  P0DReconVertices.clear();
1560  for (std::vector<AnaP0DReconVertex*>::const_iterator it = bunch.P0DReconVertices.begin();
1561  it != bunch.P0DReconVertices.end(); ++it) {
1562  P0DReconVertices.push_back((*it)->Clone());
1563  }
1564 
1565  P0DReconParticles.clear();
1566  for (std::vector<AnaP0DReconParticle*>::const_iterator it = bunch.P0DReconParticles.begin();
1567  it != bunch.P0DReconParticles.end(); ++it) {
1568  P0DReconParticles.push_back((*it)->Clone());
1569  }
1570 
1571  P0DReconClusters.clear();
1572  for (std::vector<AnaP0DReconCluster*>::const_iterator it = bunch.P0DReconClusters.begin();
1573  it != bunch.P0DReconClusters.end(); ++it) {
1574  P0DReconClusters.push_back((*it)->Clone());
1575  }
1576 }
1577 
1578 //********************************************************************
1580 //********************************************************************
1581 
1582  AnaBunch::Print();
1583 
1584 }
1585 
1586 //********************************************************************
1588 //********************************************************************
1589  return (Particles.empty() &&
1590  Vertices.empty() &&
1591  TECALReconObjects.empty() &&
1592  TECALUnmatchedObjects.empty() &&
1593  PECALReconObjects.empty() &&
1594  PECALUnmatchedObjects.empty() &&
1595  P0DReconVertices.empty() &&
1596  P0DReconParticles.empty() &&
1597  P0DReconClusters.empty() &&
1598  FGDOnlyReconObjects.empty());
1599 }
virtual void Print() const
Dump the object to screen.
virtual void Print() const
Dump the object to screen.
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.
void Print() const
Dump the object to screen.
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.
AnaTrueVertexB * TrueVertex
Representation of the ND280 data quality flags.
unsigned long Detector
Int_t InputFileIndex
Index of the input file producing this spill.
virtual void RedoLinks()
Redo reco-reco and reco-truth after cloning or reading MiniTree.
Int_t LeptonPDG
The PDG code of the primary outgoing electron/muon.
void Print() const
Dump the object to screen.
Float_t MomentumEle
Momentum from refitting the track assuming the electron hypothesis.
virtual void Print() const
Dump the object to screen.
virtual void Print() const
Dump the object to screen.
bool IsTruePrimaryPi0DecayPhoton
Is this a true primary pi0 decay photon or the child of one?
Int_t NDOF
The number of degrees of freedom of the fit using a Kalman filter.
virtual void Print() const
Dump the object to screen.
Int_t Detector
Definition: DataClasses.hxx:40
bool FGDCosmic
FGD cosmic trigger flag.
virtual bool IsEmpty() const
Returns true if the bunch is completely empty.
Int_t DetFlag[7]
Int_t NuParentPDG
Neutrino parent PDG code.
Definition: DataClasses.hxx:88
P0DRecon Vertex.
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.
Float_t Variance[4]
The variance values of the fit using a Kalman filter.
Float_t NuParentDecPoint[4]
Decay point of the neutrino parent.
Definition: DataClasses.hxx:91
Int_t RooVtxIndex
The index of the associated RooTrackerVtx vertex from its position in the TClonesArray.
Definition: DataClasses.hxx:75
Representation of a true Monte Carlo vertex.
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< std::vector< Int_t > > AccumLevel
Accumulated cut level for all selections and cut branches. Tell us if a true vertex has been selected...
Definition: DataClasses.hxx:94
std::vector< AnaTrueVertexB * > TrueVertices
The true MC vertices used in this spill.
Int_t NBaryons
The total number of primary baryons that were ejected.
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.
virtual void Print() const
Dump the object to screen.
virtual void Print() const
Dump the object to screen.
virtual void Print() const
Dump the object to screen.
Int_t Bunch
The bunch of the track, based on the PositionStart.T()
virtual void Print() const
Dump the object to screen.
P0DRecon Particle.
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.
void Print() const
Dump the object to screen.
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.
Float_t AvgTime
Average Time for the iso FGD hits.
Int_t Bunch
The bunch of the global vertex, based on the Position.T()
Int_t TargetPDG
The PDG code of the target nucleus.
Definition: DataClasses.hxx:85
std::vector< AnaParticleB * > ReconParticles
Vector of pointers to AnaParticle&#39;s associated with this true particle.
Float_t Chi2
The chi2 value of the fit using a Kalman filter.
virtual void Print() const
Dump the object to screen.
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.
virtual void Print() const
Dump the object to screen.
Representation of detector time info.
Definition: DataClasses.hxx:11
Float_t POTCT4
The POT from CT4 for this spill. This is only needed for P5 files.
virtual void Print() const
Dump the object to screen.
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.
void Print() const
Dump the object to screen.
Representation of a true Monte Carlo vertex.
Definition: DataClasses.hxx:50
virtual void Print() const
Dump the object to screen.
virtual void associateParticleToTrueParticle(AnaParticleB *) const
Add to a true particle a given associated reconstructed particle (not in the base class) ...
Representation of a true Monte Carlo trajectory/particle.
TVector3 UpstreamHits_Position[2]
virtual void Print() const
Dump the object to screen.
Representation of an SMRD segment of a global track.
Representation of a Tracker segment of a global track.
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.
virtual AnaParticleE * Clone()
Clone this object.
Float_t DirectionAtVertex[3]
The reconstructed direction of the track at the most primary global vertex (if exists).
virtual void associateVertexToTrueVertex(AnaVertexB *) const
Add to a true vertex a given associated reconstructed vertex (not in the base class) ...
Int_t SpillNumber
Spill number from BeamSummaryDataModule::BeamSummaryData::SpillNumber.
Float_t MomentumErrorMuon
Error on momentum from refitting the track assuming the muon hypothesis.
virtual void Print() const
Dump the object to screen.
Int_t Detectors
Int_t BeamRunNumber
Float_t MomentumErrorEle
Error on momentum from refitting the track assuming the electron hypothesis.
void Print() const
Dump the object to screen.
Float_t TimeEnd
End time.
Definition: DataClasses.hxx:46
Representation of a global track.
bool TripTCosmic
TripT cosmic trigger flag.
Int_t Bunch
The index of this bunch (0-7).
Int_t EventTime
The ND280 subrun number.
Representation of a TPC segment of a global track.
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.
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.
This is a base P0D object that shares the common attributes of Vertex, Particle, Track, Shower, Cluster, Hit.
Float_t MomentumError
The error on the reconstructed momentum.
Representation of a FGD segment of a global track.
std::vector< AnaVertexB * > ReconVertices
Vector of pointers to AnaVertexB (global vertices) associated with this track.
This Ana* object is used to flatten TECALUnmatchedObjects from ReconDir/TrackerECal.
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.
Definition: DataClasses.hxx:97
AnaTrigger Trigger
Not in the MiniTree for the Moment since it produces a seg fault.
virtual void Print() const
Dump the object to screen.
Int_t RooVtxEntry
Entry in the RooTrackerVtx tree (not set directly)
Definition: DataClasses.hxx:72
virtual void Print() const
Dump the object to screen.
Float_t Purity
The purity with which this particle was matched to a reconstructed object.
Int_t Containment
Containment flag required for proper PID analysis.
virtual void RedoLinks()
Redo reco-reco and reco-truth after cloning or reading MiniTree.
std::vector< AnaParticleB * > Particles
Representation of a TPC segment of a global track.
Float_t TimeStart
Start time.
Definition: DataClasses.hxx:43
void Print() const
Dump the object to screen.
Float_t NuDir[3]
The true (unit) direction of the incoming neutrino.
Definition: DataClasses.hxx:82
virtual void associateVertexToParticle(AnaParticleB *, AnaVertexB *) const
Add to a particle a given associated vertex (not in the base class)
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
AnaParticle.
Representation of a reconstructed particle (track or shower).
Int_t ReconPDG
PDG of the most probable particle hypothesis used at reconstruction level.
virtual void Print() const
Dump the object to screen.
Definition: DataClasses.cxx:32
void Print() const
Dump the object to screen.
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.
AnaTrigger Trigger
The trigger flags for this event.
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 TargetMom
The momentum of the target nucleus.
Float_t PionMom
The momentum of the primary outgoing pions listed first (likely the interacted one).
virtual void Print() const
Dump the object to screen.
Extension to AnaParticleB to be used by aggregation.
Int_t NPrimaryParticles[Int_t(ParticleId::kLast)+1]
Array to count the outgoing primary particles of each type (.
std::vector< AnaParticleB * > ReconParticles
virtual void Print() const
Dump the object to screen.
Float_t MomentumProton
Momentum from refitting the track assuming the proton hypothesis.