CbmRoot
Loading...
Searching...
No Matches
CbmRichCorrection.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 CBMRICHCORRECTION_H
6#define CBMRICHCORRECTION_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 */
45 virtual ~CbmRichCorrection();
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 void ProjectionProducer();
68
69 /*
70 * Get pmt normal from 3 different points on the plane.
71 */
72 void GetPmtNormal(Int_t NofPMTPoints, vector<Double_t>& normalPMT, Double_t& normalCste);
73
74 /*
75 * Calculate mean sphere center coordinates from all the mirror tiles (to be used for the reconstruction step).
76 */
77 void GetMeanSphereCenter(TGeoNavigator* navi, vector<Double_t>& ptC);
78
79 /*
80 * Calculate intersection between incoming particle track (position given by ptR1 and direction by momR1) and sphere with center ptC (Cmean) and radius sphereRadius.
81 */
82 void GetMirrorIntersection(vector<Double_t>& ptM, vector<Double_t> ptR1, vector<Double_t> momR1, vector<Double_t> ptC,
83 Double_t sphereRadius);
84
85 /*
86 * Test to apply the misalignment information on the sphere center coordinates from an input file. The procedure is as follow: first translate the sphere
87 * center (using opposite values of the mirror center). Then apply the inverse transformation matrix on the point, apply the rotation matrix, which accounts
88 * for the correction. After that, apply the transformation matrix to the point and translate it back to its position (using the coordinates of the mirror
89 * tile center).
90 * The results haven't been conclusive so far. There seems to be a problem with the transformation matrix.
91 */
92 vector<Double_t> RotateSphereCenter(vector<Double_t> ptM, vector<Double_t> ptC, TGeoNavigator* navi);
93
94 /*
95 * Input matrix mat is inverted using the adjugate matrix (= transpose of the cofactor matrix) to give invMat. A test can be also run, to check that
96 * mat*invMat = Id.
97 */
98 void InvertMatrix(Double_t mat[3][3], Double_t invMat[3][3], TGeoNavigator* navi);
99
100 /*
101 * From point M and point C uncorrected (coordinates of C = theoretical coordinates of the sphere center) calculates new point M on the mirror.
102 * Indeed the fRichMirrorPoints->At(iMirr) gives the point on the rotated mirror and not on the ideally aligned mirror. Even though the correction
103 * is minimal, this gives a position more likely to be on the aligned mirror (no misalignment info used).
104 */
105 void CalculateMirrorIntersection(vector<Double_t> ptM, vector<Double_t> ptCUnCorr, vector<Double_t>& ptMNew);
106
107 /*
108 * 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.
109 * Then calculate point on sensitive plane from the reflected track extrapolated (ptR2 = reflection of ptR1, with reflection axis = normalMirr).
110 * ptR2Center uses ptC for the calculations, whereas ptR2Mirr uses ptM.
111 */
112 void ComputeR2(vector<Double_t>& ptR2Center, vector<Double_t>& ptR2Mirr, vector<Double_t> ptM, vector<Double_t> ptC,
113 vector<Double_t> ptR1, TGeoNavigator* navi, TString s);
114
115 /*
116 * Calculate the intersection point (P) between the track and the PMT plane, as if the track had been reflected by the mirror tile.
117 * ptPMirr is calculated using the mirror point (ptM) to define the line reflected by the mirror and towards the PMT plane.
118 * ptPR2 is calculated using ptR2Mirr (the reflection of point R1 on the sensitive plane, using ptM for the calculations -> see ComputeR2 method).
119 */
120 void ComputeP(vector<Double_t>& ptPMirr, vector<Double_t>& ptPR2, vector<Double_t> normalPMT, vector<Double_t> ptM,
121 vector<Double_t> ptR2Mirr, Double_t normalCste);
122
123 /*
124 * Function filling the diffX, diffY and distance histograms, from the outPos vector.
125 */
126 void FillHistProjection(TVector3 outPosIdeal, TVector3 outPosUnCorr, TVector3 outPos, Int_t NofGlobalTracks,
127 vector<Double_t> normalPMT, Double_t constantePMT);
128
129 /*
130 * Draw histograms projection producer method.
131 */
132 void DrawHistProjection();
133
134 /*
135 * Draw histograms from root file.
136 */
137 void DrawHistFromFile(TString fileName);
138
139 /*
140 * Set output directory for images.
141 */
142 void SetOutputDir(TString dir) { fOutputDir = dir; }
143
144 /*
145 * Set run title. It is also a part of the file name of image files.
146 */
147 void SetRunTitle(TString title) { fRunTitle = title; }
148
149 /*
150 * Set axis rotation title. It is also a part of the file name of image files.
151 */
152 void SetAxisRotTitle(TString title) { fAxisRotTitle = title; }
153
154 /*
155 * Set to TRUE if you want to draw histograms.
156 */
157 void SetDrawProjection(Bool_t b) { fDrawProjection = b; }
158
160
161 void SetNumbAxis(TString n) { fNumbAxis = n; }
162
163 void SetTileName(TString t) { fTile = t; }
164
165
166 private:
167 TClonesArray* fRichHits; // Array of RICH hits
168 TClonesArray* fRichRings; // Array of found RICH rings
169 TClonesArray* fRichMirrorPoints;
170 TClonesArray* fRichProjections;
171 TClonesArray* fRichMCPoints;
172 TClonesArray* fMCTracks;
173 TClonesArray* fRichRingMatches;
174 TClonesArray* fRichRefPlanePoints;
175 TClonesArray* fRichPoints;
176 TClonesArray* fGlobalTracks;
178 //CbmRichRecGeoPar* fGP;
179 vector<Float_t> fPhi;
180
181 TString fNumbAxis;
182 TString fTile;
183 UInt_t fEventNum; // Event counter
187
188 TString fOutputDir; // Output directory to store figures.
189 TString fRunTitle; // Title of the run.
190 TString fAxisRotTitle; // Rotation around which axis.
191
194
197
199};
200
201#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.
TClonesArray * fGlobalTracks
TClonesArray * fMCTracks
void InvertMatrix(Double_t mat[3][3], Double_t invMat[3][3], TGeoNavigator *navi)
void SetIsReconstruction(Bool_t b)
ClassDef(CbmRichCorrection, 1)
vector< Double_t > RotateSphereCenter(vector< Double_t > ptM, vector< Double_t > ptC, TGeoNavigator *navi)
vector< Float_t > fPhi
void SetTileName(TString t)
virtual void Finish()
Inherited from FairTask.
void FillHistProjection(TVector3 outPosIdeal, TVector3 outPosUnCorr, TVector3 outPos, Int_t NofGlobalTracks, vector< Double_t > normalPMT, Double_t constantePMT)
TClonesArray * fRichRingMatches
CbmRichCorrection(const CbmRichCorrection &)
TClonesArray * fRichPoints
TClonesArray * fRichMirrorPoints
TClonesArray * fRichHits
TClonesArray * fRichProjections
TClonesArray * fRichRefPlanePoints
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)
virtual void Exec(Option_t *option)
Inherited from FairTask.
TClonesArray * fRichRings
void CalculateMirrorIntersection(vector< Double_t > ptM, vector< Double_t > ptCUnCorr, vector< Double_t > &ptMNew)
void GetPmtNormal(Int_t NofPMTPoints, vector< Double_t > &normalPMT, Double_t &normalCste)
void GetMeanSphereCenter(TGeoNavigator *navi, vector< Double_t > &ptC)
virtual InitStatus Init()
Inherited from FairTask.
void SetAxisRotTitle(TString title)
void GetMirrorIntersection(vector< Double_t > &ptM, vector< Double_t > ptR1, vector< Double_t > momR1, vector< Double_t > ptC, Double_t sphereRadius)
void SetRunTitle(TString title)
void SetOutputDir(TString dir)
void SetNumbAxis(TString n)
void SetDrawProjection(Bool_t b)
void ComputeR2(vector< Double_t > &ptR2Center, vector< Double_t > &ptR2Mirr, vector< Double_t > ptM, vector< Double_t > ptC, vector< Double_t > ptR1, TGeoNavigator *navi, TString s)
CbmRichCorrection operator=(const CbmRichCorrection &)
CbmHistManager * fHM
static const int kMAX_NOF_HITS
CbmRichRingFitterCOP * fCopFit
void DrawHistFromFile(TString fileName)
TClonesArray * fRichMCPoints
CbmRichRingFitterEllipseTau * fTauFit
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.