CbmRoot
CbmRichCorrection.h
Go to the documentation of this file.
1 #ifndef CBMRICHCORRECTION_H
2 #define CBMRICHCORRECTION_H
3 
4 
5 #include "CbmHistManager.h"
6 #include "CbmRichPoint.h"
7 #include "CbmRichRecGeoPar.h"
8 #include "CbmRichRing.h"
9 #include "CbmRichRingFitterCOP.h"
11 #include "CbmRichRingLight.h"
12 #include "FairTask.h"
13 #include "TGeoNavigator.h"
14 #include "TString.h"
15 #include <map>
16 #include <vector>
17 
18 using namespace std;
19 
20 class TClonesArray;
21 class TH1D;
22 class TH2D;
23 
24 
26  public FairTask //CbmRichProjectionProducerBase
27 {
28 private:
29  static const int kMAX_NOF_HITS = 100; // Maximum number of hits in ring
30 
31 public:
32  /*
33  * Constructor.
34  */
36 
37  /*
38  * Destructor.
39  */
40  virtual ~CbmRichCorrection();
41 
45  virtual InitStatus Init();
46 
50  virtual void Exec(Option_t* option);
51 
55  virtual void Finish();
56 
57  /*
58  * Histogram initialization for projection producer method.
59  */
60  void InitHistProjection();
61 
62  void ProjectionProducer();
63 
64  /*
65  * Get pmt normal from 3 different points on the plane.
66  */
67  void GetPmtNormal(Int_t NofPMTPoints,
68  vector<Double_t>& normalPMT,
69  Double_t& normalCste);
70 
71  /*
72  * Calculate mean sphere center coordinates from all the mirror tiles (to be used for the reconstruction step).
73  */
74  void GetMeanSphereCenter(TGeoNavigator* navi, vector<Double_t>& ptC);
75 
76  /*
77  * Calculate intersection between incoming particle track (position given by ptR1 and direction by momR1) and sphere with center ptC (Cmean) and radius sphereRadius.
78  */
79  void GetMirrorIntersection(vector<Double_t>& ptM,
80  vector<Double_t> ptR1,
81  vector<Double_t> momR1,
82  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,
93  vector<Double_t> ptC,
94  TGeoNavigator* navi);
95 
96  /*
97  * 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
98  * mat*invMat = Id.
99  */
100  void
101  InvertMatrix(Double_t mat[3][3], Double_t invMat[3][3], TGeoNavigator* navi);
102 
103  /*
104  * From point M and point C uncorrected (coordinates of C = theoretical coordinates of the sphere center) calculates new point M on the mirror.
105  * Indeed the fRichMirrorPoints->At(iMirr) gives the point on the rotated mirror and not on the ideally aligned mirror. Even though the correction
106  * is minimal, this gives a position more likely to be on the aligned mirror (no misalignment info used).
107  */
108  void CalculateMirrorIntersection(vector<Double_t> ptM,
109  vector<Double_t> ptCUnCorr,
110  vector<Double_t>& ptMNew);
111 
112  /*
113  * 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.
114  * Then calculate point on sensitive plane from the reflected track extrapolated (ptR2 = reflection of ptR1, with reflection axis = normalMirr).
115  * ptR2Center uses ptC for the calculations, whereas ptR2Mirr uses ptM.
116  */
117  void ComputeR2(vector<Double_t>& ptR2Center,
118  vector<Double_t>& ptR2Mirr,
119  vector<Double_t> ptM,
120  vector<Double_t> ptC,
121  vector<Double_t> ptR1,
122  TGeoNavigator* navi,
123  TString s);
124 
125  /*
126  * Calculate the intersection point (P) between the track and the PMT plane, as if the track had been reflected by the mirror tile.
127  * ptPMirr is calculated using the mirror point (ptM) to define the line reflected by the mirror and towards the PMT plane.
128  * ptPR2 is calculated using ptR2Mirr (the reflection of point R1 on the sensitive plane, using ptM for the calculations -> see ComputeR2 method).
129  */
130  void ComputeP(vector<Double_t>& ptPMirr,
131  vector<Double_t>& ptPR2,
132  vector<Double_t> normalPMT,
133  vector<Double_t> ptM,
134  vector<Double_t> ptR2Mirr,
135  Double_t normalCste);
136 
137  /*
138  * Function filling the diffX, diffY and distance histograms, from the outPos vector.
139  */
140  void FillHistProjection(TVector3 outPosIdeal,
141  TVector3 outPosUnCorr,
142  TVector3 outPos,
143  Int_t NofGlobalTracks,
144  vector<Double_t> normalPMT,
145  Double_t constantePMT);
146 
147  /*
148  * Draw histograms projection producer method.
149  */
150  void DrawHistProjection();
151 
152  /*
153  * Draw histograms from root file.
154  */
155  void DrawHistFromFile(TString fileName);
156 
157  /*
158  * Set output directory for images.
159  */
160  void SetOutputDir(TString dir) { fOutputDir = dir; }
161 
162  /*
163  * Set run title. It is also a part of the file name of image files.
164  */
165  void SetRunTitle(TString title) { fRunTitle = title; }
166 
167  /*
168  * Set axis rotation title. It is also a part of the file name of image files.
169  */
170  void SetAxisRotTitle(TString title) { fAxisRotTitle = title; }
171 
172  /*
173  * Set to TRUE if you want to draw histograms.
174  */
175  void SetDrawProjection(Bool_t b) { fDrawProjection = b; }
176 
177  void SetIsReconstruction(Bool_t b) { fIsReconstruction = b; }
178 
179  void SetNumbAxis(TString n) { fNumbAxis = n; }
180 
181  void SetTileName(TString t) { fTile = t; }
182 
183 
184 private:
185  TClonesArray* fRichHits; // Array of RICH hits
186  TClonesArray* fRichRings; // Array of found RICH rings
187  TClonesArray* fRichMirrorPoints;
188  TClonesArray* fRichProjections;
189  TClonesArray* fRichMCPoints;
190  TClonesArray* fMCTracks;
191  TClonesArray* fRichRingMatches;
192  TClonesArray* fRichRefPlanePoints;
193  TClonesArray* fRichPoints;
194  TClonesArray* fGlobalTracks;
196  //CbmRichRecGeoPar* fGP;
197  vector<Float_t> fPhi;
198 
199  TString fNumbAxis;
200  TString fTile;
201  UInt_t fEventNum; // Event counter
205 
206  TString fOutputDir; // Output directory to store figures.
207  TString fRunTitle; // Title of the run.
208  TString fAxisRotTitle; // Rotation around which axis.
209 
212 
215 
217 };
218 
219 #endif
CbmRichCorrection::fTile
TString fTile
Definition: CbmRichCorrection.h:200
CbmRichPoint.h
CbmRichCorrection::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmRichCorrection.h:191
CbmRichCorrection::SetRunTitle
void SetRunTitle(TString title)
Definition: CbmRichCorrection.h:165
CbmRichCorrection::fRunTitle
TString fRunTitle
Definition: CbmRichCorrection.h:207
CbmRichCorrection::SetAxisRotTitle
void SetAxisRotTitle(TString title)
Definition: CbmRichCorrection.h:170
CbmRichCorrection::fAxisRotTitle
TString fAxisRotTitle
Definition: CbmRichCorrection.h:208
CbmRichCorrection::fOutputDir
TString fOutputDir
Definition: CbmRichCorrection.h:206
CbmRichRingFitterEllipseTau
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Definition: CbmRichRingFitterEllipseTau.h:35
CbmRichCorrection::SetDrawProjection
void SetDrawProjection(Bool_t b)
Definition: CbmRichCorrection.h:175
CbmRichRingFitterEllipseTau.h
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
CbmRichCorrection::SetNumbAxis
void SetNumbAxis(TString n)
Definition: CbmRichCorrection.h:179
CbmRichRecGeoPar.h
RICH geometry parameters for the reconstruction. This class is used for convinient storing of the bas...
CbmRichCorrection::fRichPoints
TClonesArray * fRichPoints
Definition: CbmRichCorrection.h:193
CbmRichCorrection::SetOutputDir
void SetOutputDir(TString dir)
Definition: CbmRichCorrection.h:160
CbmRichCorrection::fRichMirrorPoints
TClonesArray * fRichMirrorPoints
Definition: CbmRichCorrection.h:187
CbmRichCorrection::fTauFit
CbmRichRingFitterEllipseTau * fTauFit
Definition: CbmRichCorrection.h:211
CbmRichCorrection::fNumbAxis
TString fNumbAxis
Definition: CbmRichCorrection.h:199
CbmRichRing.h
CbmRichCorrection::fRichMCPoints
TClonesArray * fRichMCPoints
Definition: CbmRichCorrection.h:189
CbmHistManager.h
Histogram manager.
CbmRichCorrection::fRichProjections
TClonesArray * fRichProjections
Definition: CbmRichCorrection.h:188
CbmRichCorrection::fIsReconstruction
Bool_t fIsReconstruction
Definition: CbmRichCorrection.h:204
CbmRichCorrection::SetIsReconstruction
void SetIsReconstruction(Bool_t b)
Definition: CbmRichCorrection.h:177
CbmRichRingFitterCOP
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Definition: CbmRichRingFitterCOP.h:28
CbmRichCorrection
Definition: CbmRichCorrection.h:27
CbmRichCorrection::fEventNum
UInt_t fEventNum
Definition: CbmRichCorrection.h:201
CbmRichCorrection::CbmRichCorrection
CbmRichCorrection(const CbmRichCorrection &)
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmRichCorrection::fRichHits
TClonesArray * fRichHits
Definition: CbmRichCorrection.h:185
CbmRichCorrection::fRichRings
TClonesArray * fRichRings
Definition: CbmRichCorrection.h:186
CbmRichRingLight.h
CbmRichCorrection::fCopFit
CbmRichRingFitterCOP * fCopFit
Definition: CbmRichCorrection.h:210
CbmRichCorrection::fMCTracks
TClonesArray * fMCTracks
Definition: CbmRichCorrection.h:190
CbmRichRingFitterCOP.h
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
CbmRichCorrection::SetTileName
void SetTileName(TString t)
Definition: CbmRichCorrection.h:181
CbmRichCorrection::ClassDef
ClassDef(CbmRichCorrection, 1)
CbmRichCorrection::fRichRefPlanePoints
TClonesArray * fRichRefPlanePoints
Definition: CbmRichCorrection.h:192
CbmRichCorrection::fPhi
vector< Float_t > fPhi
Definition: CbmRichCorrection.h:197
CbmRichCorrection::fDrawProjection
Bool_t fDrawProjection
Definition: CbmRichCorrection.h:202
CbmRichCorrection::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmRichCorrection.h:194
CbmRichCorrection::operator=
CbmRichCorrection operator=(const CbmRichCorrection &)
CbmRichCorrection::fHM
CbmHistManager * fHM
Definition: CbmRichCorrection.h:195
CbmRichCorrection::fIsMeanCenter
Bool_t fIsMeanCenter
Definition: CbmRichCorrection.h:203