CbmRoot
Loading...
Searching...
No Matches
CbmRichRecGeoPar.h
Go to the documentation of this file.
1/* Copyright (C) 2013-2020 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev, Andrey Lebedev [committer], Florian Uhlig */
4
15#ifndef CBM_RICH_REC_GEO_PAR
16#define CBM_RICH_REC_GEO_PAR
17
18#include <Logger.h> // for LOG
19
20#include <RtypesCore.h> // for Double_t, Bool_t
21#include <TMath.h> // for Pi, Abs, IsNaN, Min, Max
22#include <TVector3.h> // for TVector3
23
24#include <map> // for map
25#include <string> // for string
26
33
43public:
48 : fTheta(0.)
49 , fPhi(0.)
50 , fX(0.)
51 , fY(0.)
52 , fZ(0.)
53 , fPlaneX(0.)
54 , fPlaneY(0.)
55 , fPlaneZ(0.)
56 , fWidth(0.)
57 , fHeight(0.)
59 {
60 ;
61 }
62
63
64 Double_t fTheta; // angle by which photodetector was tilted around X-axis
65 Double_t fPhi; // angle by which photodetector was tilted around Y-axis
66
67 //PMT position is used for rotation method
68 Double_t fX; // X-coordinate of photodetector
69 Double_t fY; // Y-coordinate of photodetector
70 Double_t fZ; // Z-coordinate of photodetector
71
72 // PMt plane positions is used in projection producer (analytical)
73 Double_t fPlaneX; // X-coordinate of photodetector plane
74 Double_t fPlaneY; // Y-coordinate of photodetector plane
75 Double_t fPlaneZ; // Z-coordinate of photodetector plane
76
77 Double_t fWidth; // TGeoBBox->GetDX(), half of the camera quater
78 Double_t fHeight; // TGeoBBox->GetDY(), half of the camera quater
79
80 // needed for cylindrcal geometry
81 Int_t fPmtPositionIndexX; // index of the pmt block in X coordinate
82};
83
84
95
96public:
101 : fPmt()
103 , fPmtMap()
104 , fPmtStripGap(0.)
105 , fNRefrac(0.)
106 , fMirrorX(0.)
107 , fMirrorY(0.)
108 , fMirrorZ(0.)
109 , fMirrorR(0.)
110 , fMirrorTheta(0.)
111 {
112 ;
113 }
114
119
123 void Print()
124 {
125 LOG(info) << "-I- RICH geometry parameters";
126
128 LOG(info) << "Geometry type: CbmRichGeometryTypeTwoWings";
130 }
132 LOG(info) << "Geometry type: CbmRichGeometryTypeCylindrical";
134 }
135 else {
136 LOG(info) << "ERROR, geometry type is not correct";
137 }
138
139 PrintMirror();
140 }
141
146 {
147 LOG(info) << "PMT position in (x,y,z) [cm]: " << fPmt.fX << " " << fPmt.fY << " " << fPmt.fZ;
148 LOG(info) << "PMT plane position in (x,y,z) [cm]: " << fPmt.fPlaneX << " " << fPmt.fPlaneY << " " << fPmt.fPlaneZ;
149 LOG(info) << "PMT width and height [cm]: " << fPmt.fWidth << " " << fPmt.fHeight;
150 LOG(info) << "PMT was rotated around x (theta) by " << fPmt.fTheta * 180. / TMath::Pi() << " degrees";
151 LOG(info) << "PMT was rotated around y (phi) by " << fPmt.fPhi * 180. / TMath::Pi() << " degrees";
152 }
153
158 {
159 LOG(info) << "PMT strip gap " << fPmtStripGap << " [cm]";
160
161 typedef std::map<std::string, CbmRichRecGeoParPmt>::iterator it_type;
162 for (it_type iterator = fPmtMap.begin(); iterator != fPmtMap.end(); iterator++) {
163 LOG(info) << "Geo path:" << iterator->first;
164 LOG(info) << "PMT position in (x,y,z) [cm]: " << iterator->second.fX << " " << iterator->second.fY << " "
165 << iterator->second.fZ;
166 LOG(info) << "PMT plane position in (x,y,z) [cm]: " << iterator->second.fPlaneX << " "
167 << iterator->second.fPlaneY << " " << iterator->second.fPlaneZ;
168 LOG(info) << "PMT width and height [cm]: " << iterator->second.fWidth << " " << iterator->second.fHeight;
169 LOG(info) << "PMT was rotated around x (theta) by " << iterator->second.fTheta * 180. / TMath::Pi() << " degrees";
170 LOG(info) << "PMT was rotated around y (phi) by " << iterator->second.fPhi * 180. / TMath::Pi() << " degrees";
171 }
172 }
173
175 {
176 LOG(info) << "Refractive index for lowest photon energies: " << fNRefrac
177 << ", (n-1)*10000: " << (fNRefrac - 1.0) * 10000.0;
178 LOG(info) << "Mirror center (x,y,z): " << fMirrorX << " " << fMirrorY << " " << fMirrorZ;
179 LOG(info) << "Mirror radius: " << fMirrorR;
180 LOG(info) << "Mirror rotation angle: " << fMirrorTheta * 180. / TMath::Pi() << " degrees";
181 }
182
183 CbmRichRecGeoParPmt GetGeoRecPmtByBlockPathOrClosest(const std::string& path, TVector3* pos)
184 {
185 typedef std::map<std::string, CbmRichRecGeoParPmt>::iterator it_type;
186 for (it_type it = fPmtMap.begin(); it != fPmtMap.end(); it++) {
187 if (path.find(it->first) != std::string::npos) { return it->second; }
188 }
189
190 // if nothing is found we search for the closest strip block
191 // closest we define by X position
192 if (TMath::IsNaN(pos->X()) || TMath::IsNaN(pos->Y()) || TMath::IsNaN(pos->Z())) {
194 return par;
195 }
196
197 double minDist = 999999999.;
198 CbmRichRecGeoParPmt minPar;
199 for (it_type it = fPmtMap.begin(); it != fPmtMap.end(); it++) {
200 double x = it->second.fPlaneX;
201 double y = it->second.fPlaneY;
202 if ((pos->Y() > 0) == (y > 0)) {
203 double d = TMath::Abs(x - pos->X());
204 if (d < minDist) {
205 minDist = d;
206 minPar = it->second;
207 }
208 }
209 }
210 //LOG(info) << "minIt->first :" << minIt->first;
211 // LOG(info) << "pos:" << pos->X() << " " << pos->Y() << " " << pos->Z() << " plane:" << minIt->second.fPlaneX << " " << minIt->second.fPlaneY << " " << minIt->second.fPlaneZ;
212
213 return minPar;
214 }
215
216
217public:
218 CbmRichRecGeoParPmt fPmt; // PMT parameters for 2-wings geometry CbmRichGeometryTypeTwoWings
219
221
222 std::map<std::string, CbmRichRecGeoParPmt>
223 fPmtMap; // PMT parameter map for CbmRichGeometryTypeCylindrical, string is geo path to PMT block
224 Double_t fPmtStripGap; // [cm] Gap between pmt strips, only valid for CbmRichGeometryTypeCylindrical
225
226
227 Double_t fNRefrac; // refraction index
228
229 Double_t fMirrorX; // X-coordinate of mirror center
230 Double_t fMirrorY; // Y-coordinate of mirror center
231 Double_t fMirrorZ; // Z-coordinate of mirror center
232 Double_t fMirrorR; // mirror radius
233
234 Double_t fMirrorTheta; // mirror rotation angle around X-axis
235};
236
246public:
248 : fMinPmtX(9999999.0)
249 , fMaxPmtX(-9999999.0)
250 , fMinPmtY(9999999.0)
251 , fMaxPmtY(-9999999.0)
252 , fMinPmtZ(9999999.0)
253 , fMaxPmtZ(-9999999.0)
254 {
255 }
256
257 void AddPoint(Double_t x, Double_t y, Double_t z)
258 {
259 fMinPmtX = TMath::Min(fMinPmtX, x);
260 fMaxPmtX = TMath::Max(fMaxPmtX, x);
261 fMinPmtY = TMath::Min(fMinPmtY, y);
262 fMaxPmtY = TMath::Max(fMaxPmtY, y);
263 fMinPmtZ = TMath::Min(fMinPmtZ, z);
264 fMaxPmtZ = TMath::Max(fMaxPmtZ, z);
265 }
266
267 Double_t GetMeanX() { return (fMinPmtX + fMaxPmtX) / 2.; }
268
269 Double_t GetMeanY() { return (fMinPmtY + fMaxPmtY) / 2.; }
270
271 Double_t GetMeanZ() { return (fMinPmtZ + fMaxPmtZ) / 2.; }
272
273private:
274 Double_t fMinPmtX;
275 Double_t fMaxPmtX;
276 Double_t fMinPmtY;
277 Double_t fMaxPmtY;
278 Double_t fMinPmtZ;
279 Double_t fMaxPmtZ;
280};
281
282
283#endif
CbmRichGeometryType
@ CbmRichGeometryTypeNotDefined
@ CbmRichGeometryTypeTwoWings
@ CbmRichGeometryTypeCylindrical
This class is used to store pmt_pixel min and max positions.
void AddPoint(Double_t x, Double_t y, Double_t z)
CbmRichRecGeoParPmt()
Default constructor.
PMT parameters for the RICH geometry.
CbmRichRecGeoParPmt fPmt
void PrintCylindrical()
Print geometry parameters for cylindrical geometry.
void Print()
Print geometry parameters.
~CbmRichRecGeoPar()
Destructor.
CbmRichRecGeoParPmt GetGeoRecPmtByBlockPathOrClosest(const std::string &path, TVector3 *pos)
CbmRichGeometryType fGeometryType
void PrintTwoWings()
Print geometry parameters for two wings geometry.
CbmRichRecGeoPar()
Default constructor.
std::map< std::string, CbmRichRecGeoParPmt > fPmtMap