CbmRoot
CbmRichCorrectionVector.h
Go to the documentation of this file.
1 #ifndef CbmRichCorrectionVector_H
2 #define CbmRichCorrectionVector_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 ~CbmRichCorrectionVector();
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  /*
63  * Histogram initialization for alignment method.
64  */
65  void InitHistAlignment();
66 
67  /*
68  *
69  */
70  void CalculateAnglesAndDrawDistrib();
71 
72  /*
73  *
74  */
75  void GetTrackPosition(Double_t& x, Double_t& y);
76 
77  /*
78  * Fill the PMT plane with hits, ONLY for event with SEVERAL particles.
79  */
80  void MatchFinder();
81 
82  /*
83  *
84  */
85  void FillPMTMap(const Char_t* mirr_path, CbmRichPoint* pPoint);
86 
87  /*
88  *
89  */
90  void
91  FillPMTMapEllipse(const Char_t* mirr_path, Float_t CenterX, Float_t CenterY);
92 
93  /*
94  * From incoming track on the mirrors, do reflection of its trajectory and extrapolation of its intersection on the PMT plane.
95  */
96  void ProjectionProducer(TClonesArray* projectedPoint);
97 
98  /*
99  * Get pmt normal from 3 different points on the plane.
100  */
101  void GetPmtNormal(Int_t NofPMTPoints,
102  vector<Double_t>& normalPMT,
103  Double_t& normalCste);
104 
105  /*
106  * Calculate mean sphere center coordinates from all the mirror tiles (to be used for the reconstruction step).
107  */
108  void GetMeanSphereCenter(TGeoNavigator* navi, vector<Double_t>& ptC);
109 
110  /*
111  * Calculate intersection between incoming particle track (position given by ptR1 and direction by momR1) and sphere with center ptC (Cmean) and radius sphereRadius.
112  */
113  void GetMirrorIntersection(vector<Double_t>& ptM,
114  vector<Double_t> ptR1,
115  vector<Double_t> momR1,
116  vector<Double_t> ptC,
117  Double_t sphereRadius);
118 
119  /*
120  * 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.
121  * Then calculate point on sensitive plane from the reflected track extrapolated (ptR2 = reflection of ptR1, with reflection axis = normalMirr).
122  * ptR2Center uses ptC for the calculations, whereas ptR2Mirr uses ptM.
123  */
124  void ComputeR2(vector<Double_t>& ptR2Center,
125  vector<Double_t>& ptR2Mirr,
126  vector<Double_t> ptM,
127  vector<Double_t> ptC,
128  vector<Double_t> ptR1);
129 
130  /*
131  * Calculate the intersection point (P) between the track and the PMT plane, as if the track had been reflected by the mirror tile.
132  * ptPMirr is calculated using the mirror point (ptM) to define the line reflected by the mirror and towards the PMT plane.
133  * ptPR2 is calculated using ptR2Mirr (the reflection of point R1 on the sensitive plane, using ptM for the calculations -> see ComputeR2 method).
134  */
135  void ComputeP(vector<Double_t>& ptPMirr,
136  vector<Double_t>& ptPR2,
137  vector<Double_t> normalPMT,
138  vector<Double_t> ptM,
139  vector<Double_t> ptR2Mirr,
140  Double_t normalCste);
141 
142  /*
143  *
144  */
145  void FillHistProjection(TVector3 outPos,
146  TVector3 outPosUnCorr,
147  Int_t NofGlobalTracks,
148  vector<Double_t> normalPMT,
149  Double_t constantePMT);
150 
151  void RotateAndCopyHitsToRingLight(const CbmRichRing* ring1,
152  CbmRichRingLight* ring2);
153 
154  /*
155  * Draw histograms for alignment method.
156  */
157  void DrawHistAlignment();
158 
159  /*
160  *
161  */
162  void DrawFit(vector<Double_t>& outputFit, Int_t thresh);
163 
164 
165  /*
166  * Draw histograms for mapping.
167  */
168  void DrawHistMapping();
169 
170  /*
171  * Draw histograms projection producer method.
172  */
173  void DrawHistProjection();
174 
175  /*
176  * Draw histograms from root file.
177  */
178  void DrawHistFromFile(TString fileName);
179 
180  /*
181  * Set output directory for images.
182  */
183  void SetOutputDir(TString dir) { fOutputDir = dir; }
184 
185  /*
186  * Set run title. It is also a part of the file name of image files.
187  */
188  void SetRunTitle(TString title) { fRunTitle = title; }
189 
190  /*
191  * Set axis rotation title. It is also a part of the file name of image files.
192  */
193  void SetAxisRotTitle(TString title) { fAxisRotTitle = title; }
194 
195  /*
196  * Set to TRUE if you want to draw histograms.
197  */
198  void SetDrawAlignment(Bool_t b) { fDrawAlignment = b; }
199  void SetDrawMapping(Bool_t b) { fDrawMapping = b; }
200  void SetDrawProjection(Bool_t b) { fDrawProjection = b; }
201 
202  void SetIsReconstruction(Bool_t b) { fIsReconstruction = b; }
203 
204 
205 private:
206  TClonesArray* fRichHits; // Array of RICH hits
207  TClonesArray* fRichRings; // Array of found RICH rings
208  TClonesArray* fRichMirrorPoints;
209  TClonesArray* fRichProjections;
210  TClonesArray* fRichMCPoints;
211  TClonesArray* fMCTracks;
212  TClonesArray* fRichRingMatches;
213  TClonesArray* fRichRefPlanePoints;
214  TClonesArray* fRichPoints;
215  TClonesArray* fGlobalTracks;
218  //CbmRichRecGeoPar* fGP;
219  vector<Float_t> fPhi;
220 
221  UInt_t fEventNum; // Event counter
222  UInt_t fMirrCounter;
224  Bool_t fDrawMapping;
228  Double_t fArray[3];
229 
230  std::map<string, string> fPathsMap;
231  std::map<string, string> fPathsMapEllipse;
232 
233  TString fOutputDir; // Output directory to store figures.
234  TString fRunTitle; // Title of the run.
235  TString fAxisRotTitle; // Rotation around which axis.
236 
239 
242 
244 };
245 
246 #endif
CbmRichPoint.h
CbmRichCorrectionVector::fDrawAlignment
Bool_t fDrawAlignment
Definition: CbmRichCorrectionVector.h:223
CbmRichCorrectionVector::SetAxisRotTitle
void SetAxisRotTitle(TString title)
Definition: CbmRichCorrectionVector.h:193
CbmRichCorrectionVector::fMirrCounter
UInt_t fMirrCounter
Definition: CbmRichCorrectionVector.h:222
CbmRichCorrectionVector::operator=
CbmRichCorrectionVector operator=(const CbmRichCorrectionVector &)
CbmRichCorrectionVector::fPathsMap
std::map< string, string > fPathsMap
Definition: CbmRichCorrectionVector.h:230
CbmRichCorrectionVector::SetDrawAlignment
void SetDrawAlignment(Bool_t b)
Definition: CbmRichCorrectionVector.h:198
CbmRichRingFitterEllipseTau
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
Definition: CbmRichRingFitterEllipseTau.h:35
CbmRichRingFitterEllipseTau.h
Here the ring is fitted with Taubin algorithm from A. Ayriyan, G. Ososkov, N. Chernov.
CbmRichCorrectionVector::fRichProjections
TClonesArray * fRichProjections
Definition: CbmRichCorrectionVector.h:209
CbmRichRecGeoPar.h
RICH geometry parameters for the reconstruction. This class is used for convinient storing of the bas...
CbmRichCorrectionVector::fDrawProjection
Bool_t fDrawProjection
Definition: CbmRichCorrectionVector.h:225
CbmRichRing
Definition: CbmRichRing.h:17
CbmRichRing.h
CbmRichCorrectionVector::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmRichCorrectionVector.h:215
CbmRichCorrectionVector::fPhi
vector< Float_t > fPhi
Definition: CbmRichCorrectionVector.h:219
CbmHistManager.h
Histogram manager.
CbmRichCorrectionVector
Definition: CbmRichCorrectionVector.h:27
CbmRichCorrectionVector::fAxisRotTitle
TString fAxisRotTitle
Definition: CbmRichCorrectionVector.h:235
CbmRichRingFitterCOP
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Definition: CbmRichRingFitterCOP.h:28
CbmRichCorrectionVector::ClassDef
ClassDef(CbmRichCorrectionVector, 1)
CbmRichCorrectionVector::SetIsReconstruction
void SetIsReconstruction(Bool_t b)
Definition: CbmRichCorrectionVector.h:202
CbmRichCorrectionVector::fRichHits
TClonesArray * fRichHits
Definition: CbmRichCorrectionVector.h:206
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmRichCorrectionVector::SetDrawMapping
void SetDrawMapping(Bool_t b)
Definition: CbmRichCorrectionVector.h:199
CbmRichCorrectionVector::SetOutputDir
void SetOutputDir(TString dir)
Definition: CbmRichCorrectionVector.h:183
CbmRichCorrectionVector::fTauFit
CbmRichRingFitterEllipseTau * fTauFit
Definition: CbmRichCorrectionVector.h:238
CbmRichCorrectionVector::CbmRichCorrectionVector
CbmRichCorrectionVector(const CbmRichCorrectionVector &)
CbmRichRingLight.h
CbmRichCorrectionVector::fRichMirrorPoints
TClonesArray * fRichMirrorPoints
Definition: CbmRichCorrectionVector.h:208
CbmRichCorrectionVector::fRichMCPoints
TClonesArray * fRichMCPoints
Definition: CbmRichCorrectionVector.h:210
CbmRichCorrectionVector::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmRichCorrectionVector.h:212
CbmRichRingFitterCOP.h
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
CbmRichCorrectionVector::fRichRings
TClonesArray * fRichRings
Definition: CbmRichCorrectionVector.h:207
CbmRichCorrectionVector::fPathsMapEllipse
std::map< string, string > fPathsMapEllipse
Definition: CbmRichCorrectionVector.h:231
CbmRichCorrectionVector::fRunTitle
TString fRunTitle
Definition: CbmRichCorrectionVector.h:234
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmRichCorrectionVector::fIsReconstruction
Bool_t fIsReconstruction
Definition: CbmRichCorrectionVector.h:227
CbmRichCorrectionVector::SetDrawProjection
void SetDrawProjection(Bool_t b)
Definition: CbmRichCorrectionVector.h:200
CbmRichCorrectionVector::fHM2
CbmHistManager * fHM2
Definition: CbmRichCorrectionVector.h:217
CbmRichCorrectionVector::fMCTracks
TClonesArray * fMCTracks
Definition: CbmRichCorrectionVector.h:211
CbmRichCorrectionVector::fHM
CbmHistManager * fHM
Definition: CbmRichCorrectionVector.h:216
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmRichCorrectionVector::fRichRefPlanePoints
TClonesArray * fRichRefPlanePoints
Definition: CbmRichCorrectionVector.h:213
CbmRichPoint
Definition: CbmRichPoint.h:24
CbmRichCorrectionVector::fIsMeanCenter
Bool_t fIsMeanCenter
Definition: CbmRichCorrectionVector.h:226
CbmRichCorrectionVector::fRichPoints
TClonesArray * fRichPoints
Definition: CbmRichCorrectionVector.h:214
CbmRichCorrectionVector::fCopFit
CbmRichRingFitterCOP * fCopFit
Definition: CbmRichCorrectionVector.h:237
CbmRichRingLight
Definition: CbmRichRingLight.h:39
CbmRichCorrectionVector::fDrawMapping
Bool_t fDrawMapping
Definition: CbmRichCorrectionVector.h:224
CbmRichCorrectionVector::SetRunTitle
void SetRunTitle(TString title)
Definition: CbmRichCorrectionVector.h:188
CbmRichCorrectionVector::fOutputDir
TString fOutputDir
Definition: CbmRichCorrectionVector.h:233
CbmRichCorrectionVector::fEventNum
UInt_t fEventNum
Definition: CbmRichCorrectionVector.h:221