PandaRoot
PndMvdEventAnaTask.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndMvdEventAnaTask header file -----
15 // ----- Created 20/03/07 by R.Kliemt -----
16 // -------------------------------------------------------------------------
17 
24 #ifndef PNDMVDEVENTANATASK_H
25 #define PNDMVDEVENTANATASK_H
26 
27 // framework includes
28 #include "FairTask.h"
29 #include "FairHit.h"
30 #include "TH1.h"
31 #include "GFTrackCand.h"
32 
33 #include <vector>
34 #include <map>
35 
36 class TClonesArray;
37 class PndSdsCluster;
38 
39 class PndMvdEventAnaTask : public FairTask {
40  public:
43 
45  virtual ~PndMvdEventAnaTask();
46 
48  virtual void SetParContainers();
49  virtual InitStatus Init();
50 
52  virtual void Exec(Option_t *opt);
53 
54  virtual void Finish();
55 
56  void DrawTracksPerEvent(TString opt = "") { fHTracksPerEvent->DrawClone(opt); }
57  void DrawHitsPerTrack(TString opt = "") { fHHitsPerTrack->DrawClone(opt); }
58  void DrawEnergyPerHit(TString opt = "") { fHEnergyPerHit->DrawClone(opt); }
59 
60  void DrawPointRes(TString opt = "") { fHPointRes->DrawClone(opt); }
61  void DrawPointResS(TString opt = "") { fHPointResS->DrawClone(opt); }
62  void DrawPointResD(TString opt = "") { fHPointResD->DrawClone(opt); }
63  void DrawPointResM(TString opt = "") { fHPointResM->DrawClone(opt); }
64  void DrawEnergyRes(TString opt = "") { fHEnergyRes->DrawClone(opt); }
65  void DrawDigisPerCluster(TString opt = "") { fHDigisPerCluster->DrawClone(opt); }
66 
67  void DrawPointResStrip(TString opt = "") { fHPointResStrip->DrawClone(opt); }
68  void DrawEnergyResStrip(TString opt = "") { fHEnergyResStrip->DrawClone(opt); }
69  void DrawDigisPerClusterStrip(TString opt = "") { fHDigisPerClusterStrip->DrawClone(opt); }
70 
71  void DrawPtRes(TString opt = "") { fHPtRes->DrawClone(opt); }
72  void DrawPRes(TString opt = "") { fHPRes->DrawClone(opt); }
73 
74  void DrawRiemannRes(TString opt = "") { fHRiemannRes->DrawClone(opt); }
75  void DrawRiemannFakes(TString opt = "") { fHRiemannFakes->DrawClone(opt); }
76  void DrawRiemannTracksPerTrack(TString opt = "") { fHRiemannTracksPerTrack->DrawClone(opt); }
77  void DrawRiemannTracksPerTrackAdd(TString opt = "") { fHRiemannTracksPerTrackAdd->DrawClone(opt); }
78 
79  void DrawRiemannVertexResolutionX(TString opt = "") { fHRiemannVertexResolutionX->DrawClone(opt); }
80  void DrawRiemannVertexResolutionY(TString opt = "") { fHRiemannVertexResolutionY->DrawClone(opt); }
81  void DrawRiemannVertexResolutionZ(TString opt = "") { fHRiemannVertexResolutionZ->DrawClone(opt); }
82 
83  private:
84  TClonesArray *fMCTracks;
85  TClonesArray *fMCHits;
86  TClonesArray *fPixDigis;
87  TClonesArray *fStripDigis;
88  TClonesArray *fPixReco;
89  TClonesArray *fStripReco;
90  TClonesArray *fPixCluster;
91  TClonesArray *fStripCluster;
92  TClonesArray *fTrackCand;
93 
94  std::vector<int> fGhostCand;
95 
96  TH1 *fHTracksPerEvent;
97  TH1 *fHHitsPerTrack;
98  TH1 *fHEnergyPerHit;
99 
100  TH1 *fHPointRes;
101  TH1 *fHPointResS;
102  TH1 *fHPointResD;
103  TH1 *fHPointResM;
104  TH1 *fHDigisPerCluster;
105  TH1 *fHEnergyRes;
106  TH1 *fHPRes;
107  TH1 *fHPtRes;
108 
109  TH1 *fHPointResStrip;
110  TH1 *fHPointResSStrip;
111  TH1 *fHPointResDStrip;
112  TH1 *fHPointResMStrip;
113  TH1 *fHDigisPerClusterStrip;
114  TH1 *fHEnergyResStrip;
115 
116  TH1 *fHRiemannRes;
117  TH1 *fHRiemannFakes;
118  TH1 *fHRiemannTracksPerTrack;
119  TH1 *fHRiemannTracksPerTrackAdd;
120 
121  TH1 *fHRiemannVertexResolutionX;
122  TH1 *fHRiemannVertexResolutionY;
123  TH1 *fHRiemannVertexResolutionZ;
124 
125  bool fPrintTrack;
126  bool fPrintMCHit;
127  bool fPrintCluster;
128  bool fPrintPixDigis;
129  bool fPrintPixHit;
130  bool fPrintStripCluster;
131  bool fPrintStripDigis;
132  bool fPrintStripHit;
133  bool fPrintTrackMatch;
134  bool fPrintGhosts;
135 
136  int fNTracks;
137  int fNPossibleTracks;
138  int fNCompleteTracks;
139  int fNPartTracks;
140  int fNNotFoundPossibleTracks;
141  int fNNotFoundTracks;
142  int fNGhostTracks;
143 
144  int fEventNr;
145 
146  std::map<int, std::vector<int>> fTrackPixHitIdMap; // Track -> PixHitId
147  std::map<int, std::vector<int>> fTrackStripHitIdMap; // Track -> StripHitId
148 
149  bool MCHitBelongsToCluster(int HitIndex, PndSdsCluster *cluster, bool pixCluster);
150  void GetTrackCandsForMCTrack(std::vector<int> pixHitId, std::vector<int> stripHitId, std::vector<int> &matches, std::vector<int> &result);
151 
152  int GetRecoHit(int clIndex, bool pixel) const;
153  std::vector<int> GetClusters(int MCHit, bool pixel);
154 
155  void PrintClusterDigiInfo(int clIndex, std::vector<Int_t> digiInd, bool pixel);
156  void PrintRecoHitInfo(int hitInd, int digiSize, TVector3 MCPos, double MCEnergy, bool pixel) const;
157 
158  void PrintTrackCand(GFTrackCand *cand) const;
159  void Register();
160 
161  void Reset();
162 
163  void ProduceHits();
164 
165  FairHit *GetFairHit(Int_t detId, Int_t hitId);
166 
167  std::map<int, std::vector<int>> AssignHitsToTracks();
168 
169  ClassDef(PndMvdEventAnaTask, 1);
170 };
171 
172 #endif
void DrawPointRes(TString opt="")
void DrawRiemannTracksPerTrackAdd(TString opt="")
virtual InitStatus Init()
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndSdsCluster.h:30
void DrawPointResStrip(TString opt="")
virtual void Finish()
void DrawEnergyPerHit(TString opt="")
void DrawEnergyResStrip(TString opt="")
void DrawPRes(TString opt="")
void DrawTracksPerEvent(TString opt="")
void DrawDigisPerCluster(TString opt="")
void DrawRiemannRes(TString opt="")
void DrawPointResD(TString opt="")
Track candidate – a list of cluster indices.
Definition: GFTrackCand.h:67
void DrawPointResS(TString opt="")
void DrawEnergyRes(TString opt="")
void DrawRiemannFakes(TString opt="")
void DrawPointResM(TString opt="")
void DrawRiemannVertexResolutionX(TString opt="")
void DrawPtRes(TString opt="")
void DrawRiemannVertexResolutionY(TString opt="")
void DrawHitsPerTrack(TString opt="")
void DrawRiemannTracksPerTrack(TString opt="")
virtual ~PndMvdEventAnaTask()
void DrawDigisPerClusterStrip(TString opt="")
virtual void Exec(Option_t *opt)
void DrawRiemannVertexResolutionZ(TString opt="")
virtual void SetParContainers()