CbmRoot
Loading...
Searching...
No Matches
CbmRichMCbmQaReal.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 UGiessen/JINR-LIT, Giessen/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev [committer], Adrian Amatus Weber, Florian Uhlig */
4
5#ifndef MCBM_RICH_QA_REAL
6#define MCBM_RICH_QA_REAL
7
8#include "CbmEvent.h"
9#include "CbmHistManager.h" // for ROOTCLING
11#include "CbmTsEventHeader.h"
12#include "FairTask.h"
13
14class TClonesArray;
15class CbmRichRing;
16class CbmRichHit;
17#include "CbmTofTracklet.h"
18class TVector3;
19class CbmDigiManager;
21#include "CbmTofDigi.h"
22
23#include <map>
24#include <vector>
25
26using namespace std;
27
28
29class CbmRichMCbmQaReal : public FairTask {
30
31 public:
36
40 virtual ~CbmRichMCbmQaReal(){};
41
45 virtual InitStatus Init();
46
50 virtual void Exec(Option_t* option);
51
55 virtual void Finish();
56
61 void SetOutputDir(const string& dir) { fOutputDir = dir; }
62
63
67 void DrawFromFile(const string& fileName, const string& outputDir);
68
73
74
78 void DoRestrictToFullAcc(bool val = true) { fRestrictToFullAcc = val; }
79
80
84 void DoDrawCanvas(bool val = true) { fDoDrawCanvas = val; }
85
89 void DoWriteHistToFile(bool val = true) { fDoWriteHistToFile = val; }
90
91
95 void XOffsetHistos(Double_t val = 0.) { fXOffsetHisto = val; }
96
100 void SetMaxNofDrawnEvents(Int_t val = 100) { fMaxNofDrawnEvents = val; }
101
105 void SetTriggerTofHits(Int_t val = 0) { fTriggerTofHits = val; }
106
110 void SetTriggerRichHits(Int_t val = 0) { fTriggerRichHits = val; }
111
112
116 void SetSEDisplayRingOnly(bool val = true) { bSeDisplayRingOnly = val; }
117
121 void ActivateTimeHistograms(bool val = true) { fDoTimePlots = val; }
122
126 void SetTotRich(Double_t min, Double_t max)
127 {
130 }
131
133 {
134
135 Double_t val = std::sqrt(tTrack->GetFitX(0.) * tTrack->GetFitX(0.) + tTrack->GetFitY(0.) * tTrack->GetFitY(0.));
136 if (val < 10.) return true;
137
138 return false;
139 }
140
141 private:
143
144 //TClonesArray* fBmonDigis;
145 const std::vector<CbmTofDigi>* fBmonDigis = nullptr;
146
147 TClonesArray* fRichHits;
148
149 TClonesArray* fRichRings;
150
151 TClonesArray* fTofHits;
152
153 TClonesArray* fTofTracks;
154
156
157 TClonesArray* fCbmEvent;
158
159
161
162
164
165 Double_t fTotRichMin;
166
167 Double_t fTotRichMax;
168
170
172
174
176
178
180
181 Int_t fTracksinRich = 0;
182
183 Int_t fRingsWithTrack[6] = {0, 0, 0, 0, 0, 0}; //rwt;ring;track;ringCut;trackCut;combinations;
184
185 Int_t fTracksinRichWithRichHits[4] = {0, 0, 0, 0};
186
187 uint64_t fTSMinTime = 0;
188
189 string fOutputDir; // output dir for results
190
191 bool fRestrictToAcc = false;
192 bool fRestrictToFullAcc = false;
193
195 bool fDoDrawCanvas = true;
196
197 bool bSeDisplayRingOnly = false;
198
200
201 bool fDoTimePlots = false;
202
204 bool RestrictToFullAcc(TVector3& pos);
205 bool RestrictToFullAcc(Double_t x, Double_t y);
206
207 TVector3 extrapolate(CbmTofHit* tofHit, Double_t Z);
208
209 Double_t fCbmEventStartTime = 0.;
210 CbmEvent* fEventPnt = nullptr;
211
212 std::array<Double_t, 2304> offset_read;
213 std::array<Double_t, 2304> offset;
214 std::array<uint32_t, 2304> offset_cnt;
215
217
219
223 void InitHistograms();
224
228 void DrawHist();
229
230 void RichRings();
231
232 void DrawRing(CbmRichRing* ring);
233
234 void DrawEvent(CbmEvent* ev, std::vector<int>& ringIndx, bool full);
235
236 void DrawRing(CbmRichRing* ring, std::vector<CbmTofTracklet*> track) { DrawRing(ring, track, false); };
237
238 void DrawRing(CbmRichRing* ring, std::vector<CbmTofTracklet*> track, bool full);
239
240 void DrawRichTofEv(const std::vector<int> richHitIndx, const std::vector<int> tofTrackIndx);
241
242 std::pair<int, double> FindClosestTrack(const CbmRichRing* ring, const std::vector<CbmTofTracklet*> track);
243
244 std::pair<int, double> FindClosestRing(CbmTofTracklet* track, std::vector<int>& ringIndx);
245
246 bool isAccmRICH(CbmTofTracklet* track);
247
248 template<typename T = CbmRichHit>
249 bool doToT(T* hit)
250 {
251 if ((hit->GetToT() > fTotRichMin) && (hit->GetToT() < fTotRichMax)) return true;
252 return false;
253 }
254
255 Double_t getBeta(CbmTofTracklet* track);
256
257 Double_t getBeta(const CbmRichRing* ring);
258
259 void analyseRing(const CbmRichRing* ring, CbmEvent* ev, std::pair<int, double>& clTrack);
260
261 Bool_t cutRadius(const CbmRichRing* ring);
262 Bool_t cutDistance(std::pair<int, double>& clTrack);
263
264
269
274
275
276 ClassDef(CbmRichMCbmQaReal, 1)
277};
278
279#endif
Histogram manager.
Ring finder implementation based on Hough Transform method.
friend fscal max(fscal x, fscal y)
friend fscal min(fscal x, fscal y)
CbmDigiManager.
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
Histogram manager.
bool isAccmRICH(CbmTofTracklet *track)
void DrawEvent(CbmEvent *ev, std::vector< int > &ringIndx, bool full)
void DoDrawCanvas(bool val=true)
void SetTriggerRichHits(Int_t val=0)
const std::vector< CbmTofDigi > * fBmonDigis
virtual void Finish()
Inherited from FairTask.
void SetTriggerTofHits(Int_t val=0)
void DoRestrictToFullAcc(bool val=true)
void SetOutputDir(const string &dir)
Set output directory where you want to write results (figures and json).
virtual ~CbmRichMCbmQaReal()
Standard destructor.
Int_t fTracksinRichWithRichHits[4]
CbmRichMCbmQaReal(const CbmRichMCbmQaReal &)
Copy constructor.
bool RestrictToFullAcc(CbmTofTracklet *track)
void DoWriteHistToFile(bool val=true)
Bool_t cutDistance(std::pair< int, double > &clTrack)
Double_t getBeta(CbmTofTracklet *track)
TClonesArray * fTofHits
std::pair< int, double > FindClosestTrack(const CbmRichRing *ring, const std::vector< CbmTofTracklet * > track)
void DrawRichTofEv(const std::vector< int > richHitIndx, const std::vector< int > tofTrackIndx)
void SetTotRich(Double_t min, Double_t max)
CbmDigiManager * fDigiMan
void DrawFromFile(const string &fileName, const string &outputDir)
Draw histogram from file.
virtual void Exec(Option_t *option)
Inherited from FairTask.
std::array< Double_t, 2304 > offset
std::array< Double_t, 2304 > offset_read
void DrawHist()
Draw histograms.
void InitHistograms()
Initialize histograms.
TClonesArray * fRichRings
CbmRichMCbmQaReal & operator=(const CbmRichMCbmQaReal &)
Assignment operator.
CbmHistManager * fHM
CbmRichMCbmQaReal()
Standard constructor.
void SetSEDisplayRingOnly(bool val=true)
TClonesArray * fRichHits
const CbmTsEventHeader * fTSHeader
TVector3 extrapolate(CbmTofHit *tofHit, Double_t Z)
void XOffsetHistos(Double_t val=0.)
CbmRichMCbmSEDisplay * fSeDisplay
void DrawRing(CbmRichRing *ring, std::vector< CbmTofTracklet * > track)
TClonesArray * fTofTracks
std::pair< int, double > FindClosestRing(CbmTofTracklet *track, std::vector< int > &ringIndx)
TClonesArray * fCbmEvent
std::array< uint32_t, 2304 > offset_cnt
void analyseRing(const CbmRichRing *ring, CbmEvent *ev, std::pair< int, double > &clTrack)
CbmRichMCbmSEDisplay * fSeDsply_TR
bool isOnTarget(CbmTofTracklet *tTrack)
void DrawRing(CbmRichRing *ring)
Bool_t cutRadius(const CbmRichRing *ring)
void ActivateTimeHistograms(bool val=true)
virtual InitStatus Init()
Inherited from FairTask.
void SetMaxNofDrawnEvents(Int_t val=100)
Provides information on attaching a TofHit to a TofTrack.
double GetFitY(double Z)
double GetFitX(double Z)
Hash for CbmL1LinkKey.