CbmRoot
Loading...
Searching...
No Matches
CbmRichRonchiAna.h
Go to the documentation of this file.
1/* Copyright (C) 2018-2019 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev, Andrey Lebedev [committer] */
4
5#ifndef RICH_MIRRORS_CBMRICHRONCHIANA_H_
6#define RICH_MIRRORS_CBMRICHRONCHIANA_H_
7
8#include "TObject.h"
9#include "TVector3.h"
10
11#include <cmath>
12#include <string>
13#include <vector>
14
15using namespace std;
16
17class TH2;
18
20 public:
22 : fPixelX(0)
23 , fPixelY(0)
24 , fLineX(0)
25 , fLineY(0)
26 , fNormalRadX(0.)
27 , fNormalRadY(0.)
28 , fOrderedLineX(0)
29 , fOrderedLineY(0)
30 , fCcdV()
31 , fRulingV()
32 , fMirrorV()
33 ,
34
35 fTL()
36 , fTR()
37 , fBL()
38 , fBR()
39 ,
40
41 fTLRot()
42 , fTRRot()
43 , fBLRot()
44 , fBRRot()
45 ,
46
47 fTLSph()
48 , fTRSph()
49 , fBLSph()
50 , fBRSph()
51 ,
52
53 fDeviation(0.)
54 , fRLoc(0.)
55 {
56 }
57
60 int fLineX;
61 int fLineY;
62
63 double fNormalRadX; // Normal X in radians
65
68
69 TVector3 fCcdV; // XYZ positions CCD in microns
70 TVector3 fRulingV; // XYZ positions ronchi ruling in microns
71 TVector3 fMirrorV; // XYZ positions of mirror in microns
72
73 TVector3 fTL; // corners of segment BEFORE rotation
74 TVector3 fTR;
75 TVector3 fBL;
76 TVector3 fBR;
77
78 TVector3 fTLRot; // corners of segment AFTER rotation
79 TVector3 fTRRot;
80 TVector3 fBLRot;
81 TVector3 fBRRot;
82
83 TVector3 fTLSph; // corners of segment after 'DoSphere'
84 TVector3 fTRSph;
85 TVector3 fBLSph;
86 TVector3 fBRSph;
87
88
89 std::vector<double>
90 fVecTL; // vectors that point from center of a segment to the corners (for calculation of rotations) --CAN BE DELETED!?
91 std::vector<double> fVecTR;
92 std::vector<double> fVecBL;
93 std::vector<double> fVecBR;
94
95 double fDeviation;
96 double fRLoc;
97};
98
108
109class CbmRichRonchiAna : public TObject {
110 public:
112
113 virtual ~CbmRichRonchiAna();
114
115 void Run();
116
117 void SetTiffFileNameV(const string& fileName) { fTiffFileNameV = fileName; }
118 void SetTiffFileNameH(const string& fileName) { fTiffFileNameH = fileName; }
119
120 private:
123
124 // constant values
125 double fPi;
126 double fRadiusMirror; // in microns
127 double fEdgeLengthCCD; // in microns
128 double fCcdPixelSize; // in microns
129 double fPitchGrid; // in microns; distance of lines
130 double fImageWidth; // in pixels
131
132 // values to be measured first
133 double fDistRulingCCD; // in microns
134 double fDistMirrorCCD; // in microns
136 double fOffsetCCDOptAxisX; // in microns; horizontal distance of center of CCD to optical axis of mirror
137 double fOffsetCCDOptAxisY; // in microns; vertical distance of center of CCD to optical axis of mirror
138 double fOffsetLEDOpticalAxisX; // in microns; horizontal distance of light source to optical axis of mirror
140 double fCorrection; // correction value; defines center of mirror at exactly 3,000,000 mum in z dircetion
141
142 // values that will be determined by function
143 double fCenterCcdX; // in pixels; approximate center of image on CCD, will be defined in 'DoLocalNormal' function
144 double fCenterCcdY; // in pixels
145 double fImageCenterMirrorX; // in pixels; approximate center of image on mirror (NEEDED??)
146 double fImageCenterMirrorY; // in pixels
147
148 vector<vector<double>> ReadTiffFile(const string& fileName);
149
150 void DoRotation(vector<vector<double>>& data);
151
152 void FillH2WithVector(TH2* hist, const vector<vector<double>>& data);
153
154 void DoMeanIntensityY(vector<vector<double>>& data);
155
156 void DoPeakFinderY(vector<vector<double>>& data);
157
158 void DoSmoothLines(vector<vector<double>>& data);
159
160 void DoLineSearch(vector<vector<double>>& data);
161
162 vector<vector<double>> DoSuperpose(const vector<vector<double>>& dataH, const vector<vector<double>>& dataV);
163
164 vector<CbmRichRonchiIntersectionData> DoIntersection(vector<vector<double>>& dataH,
165 const vector<vector<double>>& dataV);
166
167 void DoOrderLines(vector<CbmRichRonchiIntersectionData>& intersections, const string& option);
169 void UpdateIntersectionLineInd(vector<CbmRichRonchiIntersectionData>& intersections, CbmRichRonchiLineData* line1,
170 CbmRichRonchiLineData* line2, const string& option);
171
172 void DoLocalNormal(vector<CbmRichRonchiIntersectionData>& data);
173 void DrawXYMum(vector<CbmRichRonchiIntersectionData>& data);
174 void DrawXZProjection(vector<CbmRichRonchiIntersectionData>& data, int orderedLineY, double scale);
175 void DrawMirrorSegments(vector<CbmRichRonchiIntersectionData>& data, int orderedLineX, int orderedLineY);
176 void DrawMirrorSegmentsSphereAll(vector<CbmRichRonchiIntersectionData>& data);
177 void DrawMirrorSegmentsSphere(vector<CbmRichRonchiIntersectionData>& data, int orderedLineX, int orderedLineY);
178 void DrawOneMirrorSegment(const TVector3& tl, const TVector3& tr, const TVector3& bl, const TVector3& br, int color);
179 void DrawSphere(vector<CbmRichRonchiIntersectionData>& data);
180 void DrawRLocMum(vector<CbmRichRonchiIntersectionData>& data);
181
182 void DoHeight(vector<CbmRichRonchiIntersectionData>& intersections);
183
184 void DoSphere(vector<CbmRichRonchiIntersectionData>& intersections);
185
186 int GetIndexForLineXLineY(int lineX, int lineY, vector<CbmRichRonchiIntersectionData>& data);
187 int GetMinIndexForLineX(int lineX, vector<CbmRichRonchiIntersectionData>& data);
188 int GetMinIndexForLineY(int lineY, vector<CbmRichRonchiIntersectionData>& data);
189
190 void DoHeightCorners(vector<CbmRichRonchiIntersectionData>& intersections);
191
192 void DoScanLineHeight(vector<CbmRichRonchiIntersectionData>& intersections);
193
194 void DoCalculateRemaining(vector<CbmRichRonchiIntersectionData>& intersections);
195
196 void DoIntegrate(vector<CbmRichRonchiIntersectionData>& intersections);
197
198 void DoAverageSurroundings(vector<CbmRichRonchiIntersectionData>& intersections);
199
200 void RotatePointImpl(TVector3* inPos, TVector3* outPos, Double_t rotX, Double_t rotY, TVector3* cV);
201
202 void DoDeviation(vector<CbmRichRonchiIntersectionData>& data);
203
204 void DoRLoc(vector<CbmRichRonchiIntersectionData>& data);
205
210
215
216 ClassDef(CbmRichRonchiAna, 1)
217};
218
219#endif /* RICH_MIRRORS_CBMRICHRONCHIANA_H_ */
void DoSphere(vector< CbmRichRonchiIntersectionData > &intersections)
void DoIntegrate(vector< CbmRichRonchiIntersectionData > &intersections)
CbmRichRonchiAna & operator=(const CbmRichRonchiAna &)
Assignment operator.
void DrawRLocMum(vector< CbmRichRonchiIntersectionData > &data)
void RotatePointImpl(TVector3 *inPos, TVector3 *outPos, Double_t rotX, Double_t rotY, TVector3 *cV)
void DoPeakFinderY(vector< vector< double > > &data)
void DoSmoothLines(vector< vector< double > > &data)
CbmRichRonchiAna(const CbmRichRonchiAna &)
Copy constructor.
void DrawOneMirrorSegment(const TVector3 &tl, const TVector3 &tr, const TVector3 &bl, const TVector3 &br, int color)
void DoHeight(vector< CbmRichRonchiIntersectionData > &intersections)
int GetMinIndexForLineX(int lineX, vector< CbmRichRonchiIntersectionData > &data)
void DrawXYMum(vector< CbmRichRonchiIntersectionData > &data)
vector< CbmRichRonchiIntersectionData > DoIntersection(vector< vector< double > > &dataH, const vector< vector< double > > &dataV)
void DoDeviation(vector< CbmRichRonchiIntersectionData > &data)
void DrawMirrorSegments(vector< CbmRichRonchiIntersectionData > &data, int orderedLineX, int orderedLineY)
void DoLocalNormal(vector< CbmRichRonchiIntersectionData > &data)
void DoAverageSurroundings(vector< CbmRichRonchiIntersectionData > &intersections)
void DrawXZProjection(vector< CbmRichRonchiIntersectionData > &data, int orderedLineY, double scale)
bool AreTwoSegmentsSameLine(const CbmRichRonchiLineData *line1, const CbmRichRonchiLineData *line2)
void DoLineSearch(vector< vector< double > > &data)
void SetTiffFileNameH(const string &fileName)
void FillH2WithVector(TH2 *hist, const vector< vector< double > > &data)
void DrawMirrorSegmentsSphere(vector< CbmRichRonchiIntersectionData > &data, int orderedLineX, int orderedLineY)
void DoHeightCorners(vector< CbmRichRonchiIntersectionData > &intersections)
vector< vector< double > > ReadTiffFile(const string &fileName)
void DoMeanIntensityY(vector< vector< double > > &data)
void DoScanLineHeight(vector< CbmRichRonchiIntersectionData > &intersections)
void DoCalculateRemaining(vector< CbmRichRonchiIntersectionData > &intersections)
void DrawMirrorSegmentsSphereAll(vector< CbmRichRonchiIntersectionData > &data)
void DoRotation(vector< vector< double > > &data)
void DrawSphere(vector< CbmRichRonchiIntersectionData > &data)
void UpdateIntersectionLineInd(vector< CbmRichRonchiIntersectionData > &intersections, CbmRichRonchiLineData *line1, CbmRichRonchiLineData *line2, const string &option)
vector< vector< double > > DoSuperpose(const vector< vector< double > > &dataH, const vector< vector< double > > &dataV)
void SetTiffFileNameV(const string &fileName)
void DoRLoc(vector< CbmRichRonchiIntersectionData > &data)
int GetMinIndexForLineY(int lineY, vector< CbmRichRonchiIntersectionData > &data)
void DoOrderLines(vector< CbmRichRonchiIntersectionData > &intersections, const string &option)
int GetIndexForLineXLineY(int lineX, int lineY, vector< CbmRichRonchiIntersectionData > &data)
std::vector< double > fVecTR
std::vector< double > fVecBL
std::vector< double > fVecBR
std::vector< double > fVecTL
Hash for CbmL1LinkKey.