CbmRoot
Loading...
Searching...
No Matches
CbmTrackingTrdQa.h
Go to the documentation of this file.
1/* Copyright (C) 2006-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmTrackingTrdQa header file -----
7// ----- Created 15/08/22 -----
8// -------------------------------------------------------------------------
9
10
17#ifndef CbmTrackingTrdQa_H
18#define CbmTrackingTrdQa_H 1
19
20#include "CbmLink.h"
21#include "CbmQaHist.h"
22#include "Riostream.h"
23#include "TH2F.h"
24#include "TProfile2D.h"
25
26#include <FairTask.h>
27
28#include <TFolder.h>
29#include <TStopwatch.h>
30#include <TVector3.h>
31
32class TH1F;
33class CbmMCDataArray;
35class CbmTimeSlice;
36class FairRootManager;
37
38class CbmTrackingTrdQa : public FairTask {
39
40 public:
42 CbmTrackingTrdQa(Int_t iVerbose = 1);
43
49 CbmTrackingTrdQa(Int_t minHits, Double_t quota, Int_t iVerbose);
52 virtual ~CbmTrackingTrdQa();
53
55 void SetYcm(double ycm) { fYCM = ycm; }
56
58 virtual void SetParContainers();
59
61 virtual InitStatus Init();
62
64 virtual InitStatus ReInit();
65
67 virtual void Exec(Option_t* opt);
68
69 private:
71 virtual void Finish();
72
74 InitStatus GetGeometry();
75
77 void GetTargetPosition();
78
80 static const int fgkNpdg = 6;
81 static const char* fgkIdxName[fgkNpdg];
82 static const char* fgkIdxSymb[fgkNpdg];
83 static int Pdg2Idx(int pdg);
84 static int Idx2Pdg(int idx);
85 static const char* Idx2Name(int idx);
86 static const char* Idx2Symb(int idx);
87
89 void CreateHistos();
90
92 void Reset();
93
94 // collect id's of MC events participating to the data
95 void CollectMcEvents(TClonesArray* Matches);
96
98 void FillHitMap();
99
105 void FillTrackMatchMap(Int_t& nRec, Int_t& nGhosts, Int_t& nClones);
106
113 void DivideHistos(TH1* histo1, TH1* histo2, TH1* histo3, Option_t* opt = "");
114
115 struct McTrackInfo {
116 std::map<Int_t, Int_t> fHitMap = {};
117 Int_t fGlobalTrackMatch = -1;
118 Int_t fTrdTrackMatch = -1;
119 Int_t fStsTrackMatch = -1;
120 Double_t fQuali = 0.;
123 Bool_t fIsAccepted{0};
125 Bool_t fIsPrimary{0};
126 Bool_t fIsFast{0};
127 Bool_t fIsLong{0};
128 Double_t fPt{0.};
129 Double_t fP{0.};
130 Int_t fPdg = 0;
131 Double_t fY = 0.;
132 };
133
135 {
136 assert(fMcTrackInfoMap.find(link) != fMcTrackInfoMap.end());
137 return fMcTrackInfoMap[link];
138 }
139
140 std::map<CbmLink, McTrackInfo> fMcTrackInfoMap = {};
141
143 FairRootManager* fManager = nullptr;
146
149
151 Int_t fTrdNstations = 0; // Number of Trd stations
153 TClonesArray* fTrdHits = nullptr;
154 TClonesArray* fTrdHitMatch = nullptr;
155 TClonesArray* fGlobalTracks = nullptr;
156 //TClonesArray* fGlobalTrackMatches = nullptr; //! GlobalTrackMatch
157 TClonesArray* fTrdTracks = nullptr;
158 TClonesArray* fTrdTrackMatches = nullptr;
159 TClonesArray* fStsTracks = nullptr;
160 TClonesArray* fStsTrackMatches = nullptr;
161
163 TVector3 fTargetPos = {0., 0., 0.}; // Target centre position
164
167 Int_t fMinStations = 4; // Minimal number of stations with hits for considered MCTrack
168
169 Double_t fQuota = 0.7; // True/all hits for track to be considered reconstructed
170 float fYCM = 0.; // rapidity of CM
171
172 TFolder fOutFolder = {"TrackingTrdQa", "TrackingTrdQa"};
173
176 // eff. vs. XY
177 std::vector<CbmQaHist<TProfile2D>> fhStationEffXY;
178 std::array<TH2F*, fgkNpdg> fhPidXY;
179 // eff. vs. pT - Y
180 std::map<const char*, std::array<TH2F*, fgkNpdg>> fhPidPtY;
181
182 // eff. vs. pt, all
183 TH1F* fhPtAccAll = nullptr;
184 TH1F* fhPtRecAll = nullptr;
185 TH1F* fhPtEffAll = nullptr;
186
187 // eff. vs. pt, vertex
188 TH1F* fhPtAccPrim = nullptr;
189 TH1F* fhPtRecPrim = nullptr;
190 TH1F* fhPtEffPrim = nullptr;
191
192 // eff. vs. pt, non-vertex
193 TH1F* fhPtAccSec = nullptr;
194 TH1F* fhPtRecSec = nullptr;
195 TH1F* fhPtEffSec = nullptr;
196
197 // eff. vs. np, all
198 TH1F* fhNpAccAll = nullptr;
199 TH1F* fhNpRecAll = nullptr;
200 TH1F* fhNpEffAll = nullptr;
201
202 // eff. vs. np, vertex
203 TH1F* fhNpAccPrim = nullptr;
204 TH1F* fhNpRecPrim = nullptr;
205 TH1F* fhNpEffPrim = nullptr;
206
207 // eff. vs. np, non-vertex
208 TH1F* fhNpAccSec = nullptr;
209 TH1F* fhNpRecSec = nullptr;
210 TH1F* fhNpEffSec = nullptr;
211
212 // eff. vs. z, non-vertex
213 TH1F* fhZAccSec = nullptr;
214 TH1F* fhZRecSec = nullptr;
215 TH1F* fhZEffSec = nullptr;
216
217 // # hits of clones and ghosts
218 TH1F* fhNhClones = nullptr;
219 TH1F* fhNhGhosts = nullptr;
220
221 // Pt resolution
222 TH1F* fhPtResPrim = nullptr;
223
224 // P resolution
225 TH1F* fhPResPrim = nullptr;
226 TH1F* fhPResPrimSts0 = nullptr;
227 TH1F* fhPResPrimSts1 = nullptr;
228 TH1F* fhPResPrimSts2 = nullptr;
229 TH1F* fhPResPrimSts3 = nullptr;
230
232 TList* fHistoList = nullptr;
233
234
236 Int_t fNAll = 0;
237 Int_t fNAccAll = 0;
238 Int_t fNAccPrim = 0;
239 Int_t fNAccFast = 0;
240 Int_t fNAccFastLong = 0;
241 Int_t fNAccSec = 0;
242 Int_t fNRecAll = 0;
243 Int_t fNRecPrim = 0;
244 Int_t fNRecFast = 0;
245 Int_t fNRecFastLong = 0;
246 Int_t fNRecSec = 0;
247 Int_t fNGhosts = 0;
248 Int_t fNClones = 0;
249 Int_t fNEvents = 0;
250 Int_t fNEventsFailed = 0;
251 Double_t fTime = 0.;
254 TStopwatch fTimer = {};
255
258
260};
261
262
263#endif
Definition of the CbmQaHist class.
Access to a MC data branch for time-based analysis.
Task class creating and managing CbmMCDataArray objects.
Bookkeeping of time-slice content.
TClonesArray * fTrdHitMatch
TrdHits.
std::array< TH2F *, fgkNpdg > fhPidXY
CbmMCDataArray * fMCTracks
MC tracks.
static const int fgkNpdg
static int Pdg2Idx(int pdg)
TClonesArray * fTrdHits
TrdPoints.
McTrackInfo & getMcTrackInfo(const CbmLink &link)
std::map< const char *, std::array< TH2F *, fgkNpdg > > fhPidPtY
ClassDef(CbmTrackingTrdQa, 0)
FairRootManager * fManager
map track link -> track info
Int_t fTrdNstations
MCtrack.
TClonesArray * fStsTrackMatches
StsTrack.
TClonesArray * fTrdTracks
GlobalTrack.
std::map< CbmLink, McTrackInfo > fMcTrackInfoMap
static const char * Idx2Symb(int idx)
CbmMCDataArray * fTrdPoints
static const char * fgkIdxName[fgkNpdg]
virtual void Finish()
TClonesArray * fTrdTrackMatches
TrdTrack.
std::vector< CbmQaHist< TProfile2D > > fhStationEffXY
output folder with histos and canvases
virtual void Exec(Option_t *opt)
static int Idx2Pdg(int idx)
CbmTrackingTrdQa(const CbmTrackingTrdQa &)
static const char * Idx2Name(int idx)
virtual InitStatus Init()
virtual void SetParContainers()
CbmMCDataManager * fMcManager
TClonesArray * fStsTracks
TrdTrackMatch.
TClonesArray * fGlobalTracks
TrdHitMatch.
CbmTrackingTrdQa operator=(const CbmTrackingTrdQa &)
void DivideHistos(TH1 *histo1, TH1 *histo2, TH1 *histo3, Option_t *opt="")
void SetYcm(double ycm)
TVector3 fTargetPos
StsTrackMatch.
CbmTrackingTrdQa(Int_t iVerbose=1)
CbmTimeSlice * fTimeSlice
static const char * fgkIdxSymb[fgkNpdg]
virtual InitStatus ReInit()
void FillTrackMatchMap(Int_t &nRec, Int_t &nGhosts, Int_t &nClones)
void CollectMcEvents(TClonesArray *Matches)
Int_t fStsTrackMatch
matched TrdTrack index
Int_t fMatchedNHitsTrue
number of matched hits
Double_t fQuali
matched StsTrack index
std::map< Int_t, Int_t > fHitMap
Int_t fMatchedNHitsAll
percentage of matched hits
Int_t fTrdTrackMatch
matched GlobalTrack index
Bool_t fIsAccepted
number of matched hits
Int_t fGlobalTrackMatch
Trd station -> number of attached hits.