CbmRoot
Loading...
Searching...
No Matches
CbmRichCorrectionVector.h
Go to the documentation of this file.
1/* Copyright (C) 2016 Justus-Liebig-Universitaet Giessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Jordan Bendarouach [committer] */
4
5#ifndef CbmRichCorrectionVector_H
6#define CbmRichCorrectionVector_H
7
8
9#include "CbmHistManager.h"
10#include "CbmRichPoint.h"
11#include "CbmRichRecGeoPar.h"
12#include "CbmRichRing.h"
15#include "CbmRichRingLight.h"
16#include "FairTask.h"
17#include "TGeoNavigator.h"
18#include "TString.h"
19
20#include <map>
21#include <vector>
22
23using namespace std;
24
25class TClonesArray;
26class TH1D;
27class TH2D;
28
29
31 public FairTask //CbmRichProjectionProducerBase
32{
33 private:
34 static const int kMAX_NOF_HITS = 100; // Maximum number of hits in ring
35
36 public:
37 /*
38 * Constructor.
39 */
41
42 /*
43 * Destructor.
44 */
46
50 virtual InitStatus Init();
51
55 virtual void Exec(Option_t* option);
56
60 virtual void Finish();
61
62 /*
63 * Histogram initialization for projection producer method.
64 */
65 void InitHistProjection();
66
67 /*
68 * Histogram initialization for alignment method.
69 */
70 void InitHistAlignment();
71
72 /*
73 *
74 */
76
77 /*
78 *
79 */
80 void GetTrackPosition(Double_t& x, Double_t& y);
81
82 /*
83 * Fill the PMT plane with hits, ONLY for event with SEVERAL particles.
84 */
85 void MatchFinder();
86
87 /*
88 *
89 */
90 void FillPMTMap(const Char_t* mirr_path, CbmRichPoint* pPoint);
91
92 /*
93 *
94 */
95 void FillPMTMapEllipse(const Char_t* mirr_path, Float_t CenterX, Float_t CenterY);
96
97 /*
98 * From incoming track on the mirrors, do reflection of its trajectory and extrapolation of its intersection on the PMT plane.
99 */
100 void ProjectionProducer(TClonesArray* projectedPoint);
101
102 /*
103 * Get pmt normal from 3 different points on the plane.
104 */
105 void GetPmtNormal(Int_t NofPMTPoints, vector<Double_t>& normalPMT, Double_t& normalCste);
106
107 /*
108 * Calculate mean sphere center coordinates from all the mirror tiles (to be used for the reconstruction step).
109 */
110 void GetMeanSphereCenter(TGeoNavigator* navi, vector<Double_t>& ptC);
111
112 /*
113 * Calculate intersection between incoming particle track (position given by ptR1 and direction by momR1) and sphere with center ptC (Cmean) and radius sphereRadius.
114 */
115 void GetMirrorIntersection(vector<Double_t>& ptM, vector<Double_t> ptR1, vector<Double_t> momR1, vector<Double_t> ptC,
116 Double_t sphereRadius);
117
118 /*
119 * Calculate the normal of the considered mirror tile, using the sphere center position of the tile (ptC) and the local reflection point on the mirror (ptM) => normalMirr.
120 * Then calculate point on sensitive plane from the reflected track extrapolated (ptR2 = reflection of ptR1, with reflection axis = normalMirr).
121 * ptR2Center uses ptC for the calculations, whereas ptR2Mirr uses ptM.
122 */
123 void ComputeR2(vector<Double_t>& ptR2Center, vector<Double_t>& ptR2Mirr, vector<Double_t> ptM, vector<Double_t> ptC,
124 vector<Double_t> ptR1);
125
126 /*
127 * Calculate the intersection point (P) between the track and the PMT plane, as if the track had been reflected by the mirror tile.
128 * ptPMirr is calculated using the mirror point (ptM) to define the line reflected by the mirror and towards the PMT plane.
129 * ptPR2 is calculated using ptR2Mirr (the reflection of point R1 on the sensitive plane, using ptM for the calculations -> see ComputeR2 method).
130 */
131 void ComputeP(vector<Double_t>& ptPMirr, vector<Double_t>& ptPR2, vector<Double_t> normalPMT, vector<Double_t> ptM,
132 vector<Double_t> ptR2Mirr, Double_t normalCste);
133
134 /*
135 *
136 */
137 void FillHistProjection(TVector3 outPos, TVector3 outPosUnCorr, Int_t NofGlobalTracks, vector<Double_t> normalPMT,
138 Double_t constantePMT);
139
141
142 /*
143 * Draw histograms for alignment method.
144 */
145 void DrawHistAlignment();
146
147 /*
148 *
149 */
150 void DrawFit(vector<Double_t>& outputFit, Int_t thresh);
151
152
153 /*
154 * Draw histograms for mapping.
155 */
156 void DrawHistMapping();
157
158 /*
159 * Draw histograms projection producer method.
160 */
161 void DrawHistProjection();
162
163 /*
164 * Draw histograms from root file.
165 */
166 void DrawHistFromFile(TString fileName);
167
168 /*
169 * Set output directory for images.
170 */
171 void SetOutputDir(TString dir) { fOutputDir = dir; }
172
173 /*
174 * Set run title. It is also a part of the file name of image files.
175 */
176 void SetRunTitle(TString title) { fRunTitle = title; }
177
178 /*
179 * Set axis rotation title. It is also a part of the file name of image files.
180 */
181 void SetAxisRotTitle(TString title) { fAxisRotTitle = title; }
182
183 /*
184 * Set to TRUE if you want to draw histograms.
185 */
186 void SetDrawAlignment(Bool_t b) { fDrawAlignment = b; }
187 void SetDrawMapping(Bool_t b) { fDrawMapping = b; }
188 void SetDrawProjection(Bool_t b) { fDrawProjection = b; }
189
191
192
193 private:
194 TClonesArray* fRichHits; // Array of RICH hits
195 TClonesArray* fRichRings; // Array of found RICH rings
196 TClonesArray* fRichMirrorPoints;
197 TClonesArray* fRichProjections;
198 TClonesArray* fRichMCPoints;
199 TClonesArray* fMCTracks;
200 TClonesArray* fRichRingMatches;
201 TClonesArray* fRichRefPlanePoints;
202 TClonesArray* fRichPoints;
203 TClonesArray* fGlobalTracks;
206 //CbmRichRecGeoPar* fGP;
207 vector<Float_t> fPhi;
208
209 UInt_t fEventNum; // Event counter
216 Double_t fArray[3];
217
218 std::map<string, string> fPathsMap;
219 std::map<string, string> fPathsMapEllipse;
220
221 TString fOutputDir; // Output directory to store figures.
222 TString fRunTitle; // Title of the run.
223 TString fAxisRotTitle; // Rotation around which axis.
224
227
230
232};
233
234#endif
Histogram manager.
RICH geometry parameters for the reconstruction. This class is used for convinient storing of the bas...
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.
Histogram manager.
void ComputeP(vector< Double_t > &ptPMirr, vector< Double_t > &ptPR2, vector< Double_t > normalPMT, vector< Double_t > ptM, vector< Double_t > ptR2Mirr, Double_t normalCste)
CbmRichCorrectionVector operator=(const CbmRichCorrectionVector &)
std::map< string, string > fPathsMapEllipse
std::map< string, string > fPathsMap
void DrawHistFromFile(TString fileName)
void GetTrackPosition(Double_t &x, Double_t &y)
virtual void Exec(Option_t *option)
Inherited from FairTask.
void FillPMTMapEllipse(const Char_t *mirr_path, Float_t CenterX, Float_t CenterY)
void FillHistProjection(TVector3 outPos, TVector3 outPosUnCorr, Int_t NofGlobalTracks, vector< Double_t > normalPMT, Double_t constantePMT)
CbmRichRingFitterCOP * fCopFit
void GetMeanSphereCenter(TGeoNavigator *navi, vector< Double_t > &ptC)
virtual InitStatus Init()
Inherited from FairTask.
ClassDef(CbmRichCorrectionVector, 1)
void ComputeR2(vector< Double_t > &ptR2Center, vector< Double_t > &ptR2Mirr, vector< Double_t > ptM, vector< Double_t > ptC, vector< Double_t > ptR1)
void SetAxisRotTitle(TString title)
CbmRichCorrectionVector(const CbmRichCorrectionVector &)
CbmRichRingFitterEllipseTau * fTauFit
virtual void Finish()
Inherited from FairTask.
void GetMirrorIntersection(vector< Double_t > &ptM, vector< Double_t > ptR1, vector< Double_t > momR1, vector< Double_t > ptC, Double_t sphereRadius)
void DrawFit(vector< Double_t > &outputFit, Int_t thresh)
void FillPMTMap(const Char_t *mirr_path, CbmRichPoint *pPoint)
void ProjectionProducer(TClonesArray *projectedPoint)
void GetPmtNormal(Int_t NofPMTPoints, vector< Double_t > &normalPMT, Double_t &normalCste)
void RotateAndCopyHitsToRingLight(const CbmRichRing *ring1, CbmRichRingLight *ring2)
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.
Hash for CbmL1LinkKey.