CbmRoot
Loading...
Searching...
No Matches
CbmRichGeoTest.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2020 UGiessen/JINR-LIT, Giessen/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev, Semen Lebedev [committer] */
4
14#ifndef CBMRICHGEOTEST
15#define CBMRICHGEOTEST
16
17#include "FairTask.h"
18
19class TH1;
20class TH2;
21class TH3;
22class TH1D;
23class TH2D;
24class TH3D;
25class TClonesArray;
28class CbmRichRing;
30class CbmHistManager;
31class CbmMCDataArray;
32class CbmMCEventList;
33class CbmDigiManager;
34
35#include <string>
36#include <vector>
37
46class CbmRichGeoTest : public FairTask {
47
48 public:
53
57 virtual ~CbmRichGeoTest();
58
62 virtual InitStatus Init();
63
67 virtual void Exec(Option_t* option);
68
72 virtual void Finish();
73
78 void SetOutputDir(const std::string& dir) { fOutputDir = dir; }
79
83 void DrawFromFile(const std::string& fileName, const std::string& outputDir);
84
85 void SetDrawPmts(bool draw) { fDrawPmts = draw; }
86 void SetDrawEventDisplay(bool draw) { fDrawEventDisplay = draw; }
87
88 private:
92 void InitHistograms();
93
94
98 void ProcessMc();
99
100 CbmRichRingLight CreateRingLightWithPoints(int fileId, int mcEventId, int mcTrackId);
101
105 void RingParameters();
106
113 void FitAndFillHistEllipse(int histIndex, CbmRichRingLight* ring, double momentum);
114
121 void FitAndFillHistCircle(int histIndex, CbmRichRingLight* ring, double momentum);
122
131
140
144 void ProcessHits();
145
151
155 void DrawHist();
156
162 void DrawRing(CbmRichRingLight* ringHit, CbmRichRingLight* ringPoint);
163
164
165 void DrawH2MeanRms(TH2* hist, const std::string& canvasName);
166
170 void DrawPmts();
171
172 void DrawPmtPoint(const std::string& coordOpt, const std::vector<int>& ids, bool isDrawPixel);
173
179 std::string CalcEfficiency(TH1* histRec, TH1* histAcc);
180
185
190
191 std::string fOutputDir = ""; // output directory for results
192
193 TClonesArray* fRichHits = nullptr;
194 TClonesArray* fRichRings = nullptr;
199 TClonesArray* fRichRingMatches = nullptr;
201
202 // rings will be fitted on a fly
205
206 CbmHistManager* fHM = nullptr; // Histogram manager
207
208 int fEventNum = 0;
209 int fMinNofHits = 7; // Min number of hits in ring for detector acceptance calculation.
210
211 // fitting efficiency
212 double fMinAaxis = 3.;
213 double fMaxAaxis = 7.;
214 double fMinBaxis = 3.;
215 double fMaxBaxis = 7.;
216 double fMinRadius = 3.;
217 double fMaxRadius = 7.;
218
219 int fNofDrawnRings = 0; // store number of drawn rings
220 bool fDrawPmts = true; // draw pixels and PMTs to test rotation procedure
221 bool fDrawEventDisplay = true;
222
223 ClassDef(CbmRichGeoTest, 1)
224};
225
226#endif
CbmDigiManager.
Histogram manager.
Access to a MC data branch for time-based analysis.
Container class for MC events with number, file and start time.
RICH geometry checking and testing.
CbmDigiManager * fDigiMan
virtual ~CbmRichGeoTest()
Standard destructor.
TClonesArray * fRichHits
CbmMCEventList * fEventList
TH1D * CreateAccVsMinNofHitsHist()
Create histogram: RICH detector acceptance vs. minimum required number of hits in ring.
void FillMcVsHitFitCircle(CbmRichRingLight *ring, CbmRichRingLight *ringMc)
Calculate difference between circle parameters for two fittings using hits and MC points for fit and ...
void RingParameters()
Loop over all rings in array and fill ring parameters histograms.
CbmMCDataArray * fMcTracks
CbmMCDataArray * fRichPoints
std::string CalcEfficiency(TH1 *histRec, TH1 *histAcc)
Calculate efficiency.
void InitHistograms()
Initialize histograms.
void SetOutputDir(const std::string &dir)
Set output directory where you want to write results (figures and json).
virtual void Finish()
Inherited from FairTask.
void ProcessHits()
Calculate residuals between hits and MC points and fill histograms.
CbmRichGeoTest()
Standard constructor.
void FillMcVsHitFitEllipse(CbmRichRingLight *ring, CbmRichRingLight *ringMc)
Calculate difference between ellipse parameters for two fitting using hits and MC points for fit and ...
CbmRichGeoTest(const CbmRichGeoTest &)
Copy constructor.
TClonesArray * fRichRings
void ProcessMc()
Fill MC histogram for detector acceptance calculation.
void FitAndFillHistCircle(int histIndex, CbmRichRingLight *ring, double momentum)
Fit ring using circle fitter and fill histograms.
void DrawPmtPoint(const std::string &coordOpt, const std::vector< int > &ids, bool isDrawPixel)
TClonesArray * fRichRingMatches
CbmRichRingFitterEllipseTau * fTauFit
void DrawH2MeanRms(TH2 *hist, const std::string &canvasName)
CbmHistManager * fHM
virtual InitStatus Init()
Inherited from FairTask.
void DrawHist()
Draw histograms.
std::string fOutputDir
virtual void Exec(Option_t *option)
Inherited from FairTask.
void DrawPmts()
DrawPmts.
void SetDrawEventDisplay(bool draw)
void FitAndFillHistEllipse(int histIndex, CbmRichRingLight *ring, double momentum)
Fit ring using ellipse fitter and fill histograms.
CbmRichGeoTest & operator=(const CbmRichGeoTest &)
Assignment operator.
CbmRichRingFitterCOP * fCopFit
CbmRichRingLight CreateRingLightWithPoints(int fileId, int mcEventId, int mcTrackId)
void DrawRing(CbmRichRingLight *ringHit, CbmRichRingLight *ringPoint)
Draw ring in separate TCanvas.
void DrawFromFile(const std::string &fileName, const std::string &outputDir)
Draw histogram from file.
CbmMCDataArray * fRichRefPlanePoints
void SetDrawPmts(bool draw)
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.