CbmRoot
Loading...
Searching...
No Matches
CbmStsFindTracksQa.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: Denis Bertini [committer], Sergey Gorbunov, Volker Friese */
4
5// -------------------------------------------------------------------------
6// ----- CbmStsFindTracksQa header file -----
7// ----- Created 11/01/06 by V. Friese -----
8// -------------------------------------------------------------------------
9
10
17#ifndef CBMSTSTRACKFINDERQA_H
18#define CBMSTSTRACKFINDERQA_H 1
19
20#include "CbmLink.h"
21
22#include <FairTask.h>
23
24#include <TFolder.h>
25#include <TStopwatch.h>
26#include <TVector3.h>
27
28class TClonesArray;
29class TH1;
30class TH1F;
31class CbmMCDataArray;
32class CbmStsSetup;
34class CbmTimeSlice;
35class FairRootManager;
36
37class CbmStsFindTracksQa : public FairTask {
38
39 public:
41 CbmStsFindTracksQa(Int_t iVerbose = 1);
42
48 CbmStsFindTracksQa(Int_t minHits, Double_t quota, Int_t iVerbose);
49
51 virtual ~CbmStsFindTracksQa();
52
54 virtual void SetParContainers();
55
57 virtual InitStatus Init();
58
60 virtual InitStatus ReInit();
61
63 virtual void Exec(Option_t* opt);
64
65 private:
67 virtual void Finish();
68
70 InitStatus GetGeometry();
71
73 void GetTargetPosition();
74
76 void CreateHistos();
77
79 void Reset();
80
81 // collect id's of MC events participating to the data
82 void CollectMcEvents(TClonesArray* Matches);
83
85 void FillHitMap();
86
92 void FillMatchMap(Int_t& nRec, Int_t& nGhosts, Int_t& nClones);
93
99 void DivideHistos(TH1* histo1, TH1* histo2, TH1* histo3);
100
101 struct McTrackInfo {
102 std::map<Int_t, Int_t> fHitMap = {};
103 Int_t fStsTrackMatch = -1;
104 Double_t fQuali = 0.;
107 };
108
110 {
111 assert(fMcTrackInfoMap.find(link) != fMcTrackInfoMap.end());
112 return fMcTrackInfoMap[link];
113 }
114
115 std::map<CbmLink, McTrackInfo> fMcTrackInfoMap = {};
116
118 FairRootManager* fManager = nullptr;
121
124
126 Bool_t fIsMvdActive = kTRUE; // is the Mvd module active
127 Int_t fMvdNstations = 0;
129 TClonesArray* fMvdCluster = nullptr;
130 TClonesArray* fMvdHits = nullptr;
131 TClonesArray* fMvdHitMatch = nullptr;
132
134 CbmStsSetup* fStsSetup = nullptr; // STS setup interface
135 Int_t fStsNstations = 0; // Number of STS stations
137 TClonesArray* fStsHits = nullptr;
138 TClonesArray* fStsHitMatch = nullptr;
139 TClonesArray* fStsClusterMatch = nullptr;
140 TClonesArray* fStsTracks = nullptr;
141 TClonesArray* fStsTrackMatches = nullptr;
142
144 TVector3 fTargetPos = {0., 0., 0.}; // Target centre position
145
148 Int_t fMinStations = 4; // Minimal number of stations with hits for considered MCTrack
149
150 Double_t fQuota = 0.7; // True/all hits for track to be considered reconstructed
151
152 TFolder fOutFolder = {"StsFindTracksQA", "StsFindTracksQA"};
153
156 // eff. vs. p, all
157 TH1F* fhMomAccAll = nullptr;
158 TH1F* fhMomRecAll = nullptr;
159 TH1F* fhMomEffAll = nullptr;
160
161 // eff. vs. p, vertex
162 TH1F* fhMomAccPrim = nullptr;
163 TH1F* fhMomRecPrim = nullptr;
164 TH1F* fhMomEffPrim = nullptr;
165
166 // eff. vs. p, non-vertex
167 TH1F* fhMomAccSec = nullptr;
168 TH1F* fhMomRecSec = nullptr;
169 TH1F* fhMomEffSec = nullptr;
170
171 // eff. vs. np, all
172 TH1F* fhNpAccAll = nullptr;
173 TH1F* fhNpRecAll = nullptr;
174 TH1F* fhNpEffAll = nullptr;
175
176 // eff. vs. np, vertex
177 TH1F* fhNpAccPrim = nullptr;
178 TH1F* fhNpRecPrim = nullptr;
179 TH1F* fhNpEffPrim = nullptr;
180
181 // eff. vs. np, non-vertex
182 TH1F* fhNpAccSec = nullptr;
183 TH1F* fhNpRecSec = nullptr;
184 TH1F* fhNpEffSec = nullptr;
185
186 // eff. vs. z, non-vertex
187 TH1F* fhZAccSec = nullptr;
188 TH1F* fhZRecSec = nullptr;
189 TH1F* fhZEffSec = nullptr;
190
191 // # hits of clones and ghosts
192 TH1F* fhNhClones = nullptr;
193 TH1F* fhNhGhosts = nullptr;
194
195
197 TList* fHistoList = nullptr;
198
199
201 Int_t fNAll = 0;
202 Int_t fNAccAll = 0;
203 Int_t fNAccPrim = 0;
204 Int_t fNAccRef = 0;
205 Int_t fNAccRefLong = 0;
206 Int_t fNAccSec = 0;
207 Int_t fNRecAll = 0;
208 Int_t fNRecPrim = 0;
209 Int_t fNRecRef = 0;
210 Int_t fNRecRefLong = 0;
211 Int_t fNRecSec = 0;
212 Int_t fNGhosts = 0;
213 Int_t fNClones = 0;
214 Int_t fNEvents = 0;
215 Int_t fNEventsFailed = 0;
216 Double_t fTime = 0.;
219 TStopwatch fTimer = {};
220
223
225};
226
227
228#endif
Access to a MC data branch for time-based analysis.
Task class creating and managing CbmMCDataArray objects.
TClonesArray * fMvdHitMatch
std::map< CbmLink, McTrackInfo > fMcTrackInfoMap
CbmStsFindTracksQa(Int_t iVerbose=1)
CbmMCDataArray * fStsPoints
CbmStsFindTracksQa(const CbmStsFindTracksQa &)
CbmMCDataArray * fMvdPoints
CbmStsFindTracksQa operator=(const CbmStsFindTracksQa &)
CbmMCDataManager * fMcManager
TClonesArray * fStsTracks
StsClusterMatch.
CbmStsSetup * fStsSetup
STS.
TVector3 fTargetPos
StsTrackMatch.
virtual InitStatus Init()
CbmTimeSlice * fTimeSlice
TClonesArray * fStsHits
StsPoints.
void FillMatchMap(Int_t &nRec, Int_t &nGhosts, Int_t &nClones)
CbmMCDataArray * fMCTracks
MC tracks.
TClonesArray * fStsClusterMatch
StsHitMatch.
virtual void Exec(Option_t *opt)
TClonesArray * fMvdCluster
TH1F * fhMomAccAll
output folder with histos and canvases
McTrackInfo & getMcTrackInfo(const CbmLink &link)
TClonesArray * fStsHitMatch
StsHits.
FairRootManager * fManager
map track link -> track info
virtual void SetParContainers()
TClonesArray * fStsTrackMatches
StsTrack.
Bool_t fIsMvdActive
MCtrack.
void CollectMcEvents(TClonesArray *Matches)
void DivideHistos(TH1 *histo1, TH1 *histo2, TH1 *histo3)
virtual InitStatus ReInit()
ClassDef(CbmStsFindTracksQa, 0)
Class representing the top level of the STS setup.
Definition CbmStsSetup.h:43
Bookkeeping of time-slice content.
Int_t fMatchedNHitsAll
percentage of matched hits
std::map< Int_t, Int_t > fHitMap
Int_t fStsTrackMatch
Mvd / Sts station -> number of attached hits.
Int_t fMatchedNHitsTrue
number of matched hits
Double_t fQuali
matched StsTrack index