CbmRoot
CbmRichRecGeoPar.h
Go to the documentation of this file.
1 
11 #ifndef CBM_RICH_REC_GEO_PAR
12 #define CBM_RICH_REC_GEO_PAR
13 
14 #include <RtypesCore.h> // for Double_t, Bool_t
15 #include <TMath.h> // for Pi, Abs, IsNaN, Min, Max
16 #include <TVector3.h> // for TVector3
17 
18 #include <FairLogger.h> // for LOG
19 #include <map> // for map
20 #include <string> // for string
21 
26 };
27 
37 public:
42  : fTheta(0.)
43  , fPhi(0.)
44  , fX(0.)
45  , fY(0.)
46  , fZ(0.)
47  , fPlaneX(0.)
48  , fPlaneY(0.)
49  , fPlaneZ(0.)
50  , fWidth(0.)
51  , fHeight(0.)
52  , fPmtPositionIndexX(0.) {
53  ;
54  }
55 
56 
57  Double_t fTheta; // angle by which photodetector was tilted around X-axis
58  Double_t fPhi; // angle by which photodetector was tilted around Y-axis
59 
60  //PMT position is used for rotation method
61  Double_t fX; // X-coordinate of photodetector
62  Double_t fY; // Y-coordinate of photodetector
63  Double_t fZ; // Z-coordinate of photodetector
64 
65  // PMt plane positions is used in projection producer (analytical)
66  Double_t fPlaneX; // X-coordinate of photodetector plane
67  Double_t fPlaneY; // Y-coordinate of photodetector plane
68  Double_t fPlaneZ; // Z-coordinate of photodetector plane
69 
70  Double_t fWidth; // TGeoBBox->GetDX(), half of the camera quater
71  Double_t fHeight; // TGeoBBox->GetDY(), half of the camera quater
72 
73  // needed for cylindrcal geometry
74  Int_t fPmtPositionIndexX; // index of the pmt block in X coordinate
75 };
76 
77 
88 
89 public:
94  : fPmt()
96  , fPmtMap()
97  , fPmtStripGap(0.)
98  , fNRefrac(0.)
99  , fMirrorX(0.)
100  , fMirrorY(0.)
101  , fMirrorZ(0.)
102  , fMirrorR(0.)
103  , fMirrorTheta(0.) {
104  ;
105  }
106 
111 
115  void Print() {
116  LOG(info) << "-I- RICH geometry parameters";
117 
119  LOG(info) << "Geometry type: CbmRichGeometryTypeTwoWings";
120  PrintTwoWings();
122  LOG(info) << "Geometry type: CbmRichGeometryTypeCylindrical";
124  } else {
125  LOG(info) << "ERROR, geometry type is not correct";
126  }
127 
128  PrintMirror();
129  }
130 
134  void PrintTwoWings() {
135  LOG(info) << "PMT position in (x,y,z) [cm]: " << fPmt.fX << " " << fPmt.fY
136  << " " << fPmt.fZ;
137  LOG(info) << "PMT plane position in (x,y,z) [cm]: " << fPmt.fPlaneX << " "
138  << fPmt.fPlaneY << " " << fPmt.fPlaneZ;
139  LOG(info) << "PMT width and height [cm]: " << fPmt.fWidth << " "
140  << fPmt.fHeight;
141  LOG(info) << "PMT was rotated around x (theta) by "
142  << fPmt.fTheta * 180. / TMath::Pi() << " degrees";
143  LOG(info) << "PMT was rotated around y (phi) by "
144  << fPmt.fPhi * 180. / TMath::Pi() << " degrees";
145  }
146 
151  LOG(info) << "PMT strip gap " << fPmtStripGap << " [cm]";
152 
153  typedef std::map<std::string, CbmRichRecGeoParPmt>::iterator it_type;
154  for (it_type iterator = fPmtMap.begin(); iterator != fPmtMap.end();
155  iterator++) {
156  LOG(info) << "Geo path:" << iterator->first;
157  LOG(info) << "PMT position in (x,y,z) [cm]: " << iterator->second.fX
158  << " " << iterator->second.fY << " " << iterator->second.fZ;
159  LOG(info) << "PMT plane position in (x,y,z) [cm]: "
160  << iterator->second.fPlaneX << " " << iterator->second.fPlaneY
161  << " " << iterator->second.fPlaneZ;
162  LOG(info) << "PMT width and height [cm]: " << iterator->second.fWidth
163  << " " << iterator->second.fHeight;
164  LOG(info) << "PMT was rotated around x (theta) by "
165  << iterator->second.fTheta * 180. / TMath::Pi() << " degrees";
166  LOG(info) << "PMT was rotated around y (phi) by "
167  << iterator->second.fPhi * 180. / TMath::Pi() << " degrees";
168  }
169  }
170 
171  void PrintMirror() {
172  LOG(info) << "Refractive index for lowest photon energies: " << fNRefrac
173  << ", (n-1)*10000: " << (fNRefrac - 1.0) * 10000.0;
174  LOG(info) << "Mirror center (x,y,z): " << fMirrorX << " " << fMirrorY << " "
175  << fMirrorZ;
176  LOG(info) << "Mirror radius: " << fMirrorR;
177  LOG(info) << "Mirror rotation angle: " << fMirrorTheta * 180. / TMath::Pi()
178  << " degrees";
179  }
180 
182  TVector3* pos) {
183  typedef std::map<std::string, CbmRichRecGeoParPmt>::iterator it_type;
184  for (it_type it = fPmtMap.begin(); it != fPmtMap.end(); it++) {
185  if (path.find(it->first) != std::string::npos) { return it->second; }
186  }
187 
188  // if nothing is found we search for the closest strip block
189  // closest we define by X position
190  if (TMath::IsNaN(pos->X()) || TMath::IsNaN(pos->Y())
191  || TMath::IsNaN(pos->Z())) {
193  return par;
194  }
195 
196  double minDist = 999999999.;
197  CbmRichRecGeoParPmt minPar;
198  for (it_type it = fPmtMap.begin(); it != fPmtMap.end(); it++) {
199  double x = it->second.fPlaneX;
200  double y = it->second.fPlaneY;
201  if ((pos->Y() > 0) == (y > 0)) {
202  double d = TMath::Abs(x - pos->X());
203  if (d < minDist) {
204  minDist = d;
205  minPar = it->second;
206  }
207  }
208  }
209  //LOG(info) << "minIt->first :" << minIt->first;
210  // LOG(info) << "pos:" << pos->X() << " " << pos->Y() << " " << pos->Z() << " plane:" << minIt->second.fPlaneX << " " << minIt->second.fPlaneY << " " << minIt->second.fPlaneZ;
211 
212  return minPar;
213  }
214 
215 
216 public:
218  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
225  fPmtStripGap; // [cm] Gap between pmt strips, only valid for CbmRichGeometryTypeCylindrical
226 
227 
228  Double_t fNRefrac; // refraction index
229 
230  Double_t fMirrorX; // X-coordinate of mirror center
231  Double_t fMirrorY; // Y-coordinate of mirror center
232  Double_t fMirrorZ; // Z-coordinate of mirror center
233  Double_t fMirrorR; // mirror radius
234 
235  Double_t fMirrorTheta; // mirror rotation angle around X-axis
236 };
237 
247 public:
249  : fMinPmtX(9999999.0)
250  , fMaxPmtX(-9999999.0)
251  , fMinPmtY(9999999.0)
252  , fMaxPmtY(-9999999.0)
253  , fMinPmtZ(9999999.0)
254  , fMaxPmtZ(-9999999.0) {}
255 
256  void AddPoint(Double_t x, Double_t y, Double_t z) {
257  fMinPmtX = TMath::Min(fMinPmtX, x);
258  fMaxPmtX = TMath::Max(fMaxPmtX, x);
259  fMinPmtY = TMath::Min(fMinPmtY, y);
260  fMaxPmtY = TMath::Max(fMaxPmtY, y);
261  fMinPmtZ = TMath::Min(fMinPmtZ, z);
262  fMaxPmtZ = TMath::Max(fMaxPmtZ, z);
263  }
264 
265  Double_t GetMeanX() { return (fMinPmtX + fMaxPmtX) / 2.; }
266 
267  Double_t GetMeanY() { return (fMinPmtY + fMaxPmtY) / 2.; }
268 
269  Double_t GetMeanZ() { return (fMinPmtZ + fMaxPmtZ) / 2.; }
270 
271 private:
272  Double_t fMinPmtX;
273  Double_t fMaxPmtX;
274  Double_t fMinPmtY;
275  Double_t fMaxPmtY;
276  Double_t fMinPmtZ;
277  Double_t fMaxPmtZ;
278 };
279 
280 
281 #endif
CbmRichRecGeoPar::fMirrorZ
Double_t fMirrorZ
Definition: CbmRichRecGeoPar.h:232
CbmRichRecGeoPar::fNRefrac
Double_t fNRefrac
Definition: CbmRichRecGeoPar.h:228
CbmRichRecGeoParPmt::fHeight
Double_t fHeight
Definition: CbmRichRecGeoPar.h:71
CbmRichGeometryTypeTwoWings
@ CbmRichGeometryTypeTwoWings
Definition: CbmRichRecGeoPar.h:24
CbmRichRecGeoParPmt::fPhi
Double_t fPhi
Definition: CbmRichRecGeoPar.h:58
CbmRichRecGeoParPmt::fPlaneY
Double_t fPlaneY
Definition: CbmRichRecGeoPar.h:67
CbmRichRecGeoParPmt::CbmRichRecGeoParPmt
CbmRichRecGeoParPmt()
Default constructor.
Definition: CbmRichRecGeoPar.h:41
CbmRichRecGeoPar::fPmtMap
std::map< std::string, CbmRichRecGeoParPmt > fPmtMap
Definition: CbmRichRecGeoPar.h:223
CbmRichRecGeoPar::fPmt
CbmRichRecGeoParPmt fPmt
Definition: CbmRichRecGeoPar.h:218
CbmRichRecGeoPar::fMirrorY
Double_t fMirrorY
Definition: CbmRichRecGeoPar.h:231
CbmRichPmtPlaneMinMax
This class is used to store pmt_pixel min and max positions.
Definition: CbmRichRecGeoPar.h:246
CbmRichRecGeoPar::fMirrorX
Double_t fMirrorX
Definition: CbmRichRecGeoPar.h:230
CbmRichGeometryTypeNotDefined
@ CbmRichGeometryTypeNotDefined
Definition: CbmRichRecGeoPar.h:23
CbmRichPmtPlaneMinMax::fMinPmtX
Double_t fMinPmtX
Definition: CbmRichRecGeoPar.h:272
CbmRichRecGeoPar::fGeometryType
CbmRichGeometryType fGeometryType
Definition: CbmRichRecGeoPar.h:220
CbmRichRecGeoParPmt::fTheta
Double_t fTheta
Definition: CbmRichRecGeoPar.h:57
CbmRichRecGeoParPmt
Definition: CbmRichRecGeoPar.h:36
CbmRichPmtPlaneMinMax::fMaxPmtZ
Double_t fMaxPmtZ
Definition: CbmRichRecGeoPar.h:277
CbmRichRecGeoPar::fMirrorTheta
Double_t fMirrorTheta
Definition: CbmRichRecGeoPar.h:235
CbmRichRecGeoParPmt::fY
Double_t fY
Definition: CbmRichRecGeoPar.h:62
CbmRichPmtPlaneMinMax::fMaxPmtY
Double_t fMaxPmtY
Definition: CbmRichRecGeoPar.h:275
CbmRichRecGeoParPmt::fPlaneX
Double_t fPlaneX
Definition: CbmRichRecGeoPar.h:66
CbmRichPmtPlaneMinMax::AddPoint
void AddPoint(Double_t x, Double_t y, Double_t z)
Definition: CbmRichRecGeoPar.h:256
CbmRichRecGeoPar::PrintCylindrical
void PrintCylindrical()
Print geometry parameters for cylindrical geometry.
Definition: CbmRichRecGeoPar.h:150
CbmRichRecGeoPar
PMT parameters for the RICH geometry.
Definition: CbmRichRecGeoPar.h:87
d
double d
Definition: P4_F64vec2.h:24
CbmRichPmtPlaneMinMax::GetMeanX
Double_t GetMeanX()
Definition: CbmRichRecGeoPar.h:265
CbmRichGeometryTypeCylindrical
@ CbmRichGeometryTypeCylindrical
Definition: CbmRichRecGeoPar.h:25
CbmRichPmtPlaneMinMax::fMinPmtY
Double_t fMinPmtY
Definition: CbmRichRecGeoPar.h:274
CbmRichRecGeoPar::CbmRichRecGeoPar
CbmRichRecGeoPar()
Default constructor.
Definition: CbmRichRecGeoPar.h:93
CbmRichPmtPlaneMinMax::fMaxPmtX
Double_t fMaxPmtX
Definition: CbmRichRecGeoPar.h:273
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmRichRecGeoPar::~CbmRichRecGeoPar
~CbmRichRecGeoPar()
Destructor.
Definition: CbmRichRecGeoPar.h:110
CbmRichPmtPlaneMinMax::GetMeanY
Double_t GetMeanY()
Definition: CbmRichRecGeoPar.h:267
CbmRichRecGeoParPmt::fX
Double_t fX
Definition: CbmRichRecGeoPar.h:61
CbmRichRecGeoParPmt::fZ
Double_t fZ
Definition: CbmRichRecGeoPar.h:63
CbmRichGeometryType
CbmRichGeometryType
Definition: CbmRichRecGeoPar.h:22
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmRichRecGeoPar::Print
void Print()
Print geometry parameters.
Definition: CbmRichRecGeoPar.h:115
CbmRichRecGeoPar::PrintTwoWings
void PrintTwoWings()
Print geometry parameters for two wings geometry.
Definition: CbmRichRecGeoPar.h:134
CbmRichRecGeoPar::fMirrorR
Double_t fMirrorR
Definition: CbmRichRecGeoPar.h:233
CbmRichPmtPlaneMinMax::fMinPmtZ
Double_t fMinPmtZ
Definition: CbmRichRecGeoPar.h:276
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmRichRecGeoParPmt::fWidth
Double_t fWidth
Definition: CbmRichRecGeoPar.h:70
CbmRichRecGeoParPmt::fPmtPositionIndexX
Int_t fPmtPositionIndexX
Definition: CbmRichRecGeoPar.h:74
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmRichRecGeoPar::PrintMirror
void PrintMirror()
Definition: CbmRichRecGeoPar.h:171
CbmRichPmtPlaneMinMax::CbmRichPmtPlaneMinMax
CbmRichPmtPlaneMinMax()
Definition: CbmRichRecGeoPar.h:248
CbmRichRecGeoPar::GetGeoRecPmtByBlockPathOrClosest
CbmRichRecGeoParPmt GetGeoRecPmtByBlockPathOrClosest(const std::string &path, TVector3 *pos)
Definition: CbmRichRecGeoPar.h:181
CbmRichRecGeoPar::fPmtStripGap
Double_t fPmtStripGap
Definition: CbmRichRecGeoPar.h:225
CbmRichPmtPlaneMinMax::GetMeanZ
Double_t GetMeanZ()
Definition: CbmRichRecGeoPar.h:269
CbmRichRecGeoParPmt::fPlaneZ
Double_t fPlaneZ
Definition: CbmRichRecGeoPar.h:68