CbmRoot
Loading...
Searching...
No Matches
CbmRichPmt.cxx
Go to the documentation of this file.
1/* Copyright (C) 2015-2020 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev, Andrey Lebedev [committer] */
4
5/*
6 * CbmRichPmt.cxx
7 *
8 * Created on: Dec 16, 2015
9 * Author: slebedev
10 */
11
12#include "CbmRichPmt.h"
13
14#include "CbmRichGeoManager.h" // for CbmRichGeoManager
15#include "CbmRichPmtType.h" // for CbmRichPmtTypeEnum, CbmRichPmtTypeCer...
16#include "CbmRichRecGeoPar.h" // for CbmRichRecGeoPar
17
18#include <Logger.h> // for LOG, Logger
19
20#include <TAxis.h> // for TAxis
21#include <TGraph.h> // for TGraph
22#include <TRandom.h> // for TRandom, gRandom
23
24#include <utility> // for pair
25
26#include <stddef.h> // for size_t
27
28using namespace std;
29
30const Double_t CbmRichPmt::c = 2.998E8; // speed of light
31const Double_t CbmRichPmt::h = 6.626E-34; // Planck constant
32const Double_t CbmRichPmt::e = 1.6022E-19; // elementary charge
33
34CbmRichPmt::CbmRichPmt() : fCollectionEfficiency(1.), fPmtDataMap(), fRefractiveIndex(-1.) { InitQE(); }
35
37
38Double_t CbmRichPmt::getLambda(Double_t momentum)
39{
40 Double_t refractiveIndex = CbmRichGeoManager::GetInstance().fGP->fNRefrac;
41 Double_t lambda = c / refractiveIndex * h / e / momentum; // wavelength in nm
42 return lambda;
43}
44
45Bool_t CbmRichPmt::isPhotonDetected(CbmRichPmtTypeEnum detType, Double_t momentum)
46{
47 map<CbmRichPmtTypeEnum, CbmRichPmtQEData*>::iterator it = fPmtDataMap.find(detType);
48 if (it == fPmtDataMap.end()) {
49 LOG(error) << "CbmRichPmt::isPhotonDetected - Wrong detector type :" << detType;
50 ;
51 return false;
52 }
53
54 CbmRichPmtQEData* pmtData = it->second;
55 if (nullptr == pmtData) {
56 LOG(error) << "CbmRichPmt::isPhotonDetected - data is nullptr for detType :" << detType;
57 return false;
58 }
59
61 Double_t lambda = c / fRefractiveIndex * h / e / momentum; // wavelength in nm
62
63 if (lambda >= pmtData->fLambdaMin && lambda < pmtData->fLambdaMax) {
64 Int_t ilambda = (Int_t)((lambda - pmtData->fLambdaMin) / pmtData->fLambdaStep);
65 Double_t rand = gRandom->Rndm();
66 if (ilambda < 0 || static_cast<size_t>(ilambda) >= pmtData->fEfficiency.size()) {
67 LOG(error) << "CbmRichPmt::isPhotonDetected ilambda out of range.";
68 return false;
69 }
70 else {
71 if (pmtData->fEfficiency[ilambda] * fCollectionEfficiency > rand) return true;
72 }
73 }
74 return false;
75}
76
78{
79 map<CbmRichPmtTypeEnum, CbmRichPmtQEData*>::iterator it = fPmtDataMap.find(detType);
80 if (it == fPmtDataMap.end()) {
81 LOG(info) << "HRich700Pmt::getQEGraph - Wrong detector type :" << detType;
82 return nullptr;
83 }
84 CbmRichPmtQEData* pmtData = it->second;
85 if (nullptr == pmtData) {
86 LOG(info) << "CbmRichPmt::getQEGraph - data is nullptr for detType :" << detType;
87 return nullptr;
88 }
89
90 const Int_t n = pmtData->fEfficiency.size();
91 Double_t x[n], y[n];
92 for (Int_t i = 0; i < n; i++) {
93 x[i] = pmtData->fLambdaMin + i * pmtData->fLambdaStep;
94 y[i] = pmtData->fEfficiency[i];
95 }
96 TGraph* gr = new TGraph(n, x, y);
97 gr->GetXaxis()->SetTitle("Wavelangth [nm]");
98 gr->GetYaxis()->SetTitle("QE");
99 gr->SetTitle("");
100 return gr;
101}
102
104{
105 for (map<CbmRichPmtTypeEnum, CbmRichPmtQEData*>::iterator it = fPmtDataMap.begin(); it != fPmtDataMap.end(); it++) {
106 if (nullptr != it->second) { delete it->second; }
107 }
108 fPmtDataMap.clear();
109}
110
112{
113 // See CbmRichPmtType.h for on details about each Pmt detector type
114
115 LOG(debug) << "CbmRichPmt init QE";
116
117
118 ClearMap();
119
120 {
123 data->fLambdaMin = 170.;
124 data->fLambdaMax = 800.;
125 data->fLambdaStep = 10.;
126
127 data->fEfficiency = {
128 0., 0.0373, 0.0768, 0.104238, 0.130168, 0.162537, 0.196098, 0.219972,
129 0.238386, 0.257846, 0.27616, 0.300536, 0.315942, 0.323639, 0.327806, 0.329745,
130 0.330278, 0.330734, 0.330734, 0.327052, 0.325578, 0.320677, 0.316751, 0.309921,
131 0.301695, 0.294525, 0.284986, 0.272276, 0.255125, 0.23644, 0.223164, 0.210214,
132 0.200552, 0.183554, 0.14927, 0.118152, 0.10057, 0.0880096, 0.0707358, 0.0612509,
133 0.0527653, 0.0464113, 0.0378286, 0.0296114, 0.022314, 0.0150159, 0.00877741, 0.003258,
134 0.00178254, 0.00248491, 0.00353476, 0.00327258, 0.00367864, 0.00352639, 0.00288406, 0.00317378,
135 0.00255156, 0.0024984, 0.00256586, 0.00174571, 0.00201436, 0.00212824, 0.00221443, 0.00254726};
136
137 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
138 }
139
140 {
143 data->fLambdaMin = 170.;
144 data->fLambdaMax = 800.;
145 data->fLambdaStep = 10.;
146
147 data->fEfficiency = {
148 0.15, 0.1873, 0.2268, 0.281283, 0.319146, 0.318419, 0.322942, 0.310789,
149 0.296113, 0.308306, 0.320059, 0.33156, 0.338313, 0.332637, 0.335656, 0.334134,
150 0.332542, 0.329217, 0.329217, 0.329065, 0.324032, 0.317459, 0.306133, 0.307902,
151 0.300078, 0.293836, 0.28501, 0.27188, 0.254544, 0.237351, 0.225093, 0.213887,
152 0.203469, 0.184299, 0.149514, 0.120047, 0.105304, 0.0954967, 0.0765149, 0.0673676,
153 0.0601531, 0.0536015, 0.0442024, 0.0359242, 0.0276292, 0.0193571, 0.0113956, 0.00387145,
154 0.00455862, 0.00264693, 0.00440582, 0.00444134, 0.00523567, 0.00505885, 0.00397938, 0.00436081,
155 0.0035522, 0.00354125, 0.00355477, 0.00232293, 0.0030541, 0.00306825, 0.00311562, 0.00358131};
156
157 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
158 }
159
160 {
163 data->fLambdaMin = 100.;
164 data->fLambdaMax = 700.;
165 data->fLambdaStep = 20.;
166
167 data->fEfficiency = {0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216, 0.216,
168 0.216, 0.227, 0.23, 0.227, 0.216, 0.2, 0.176, 0.15, 0.138, 0.1,
169 0.082, 0.06, 0.044, 0.032, 0.022, 0.015, 0.01, 0.006, 0.004};
170
171 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
172 }
173
174 {
177 data->fLambdaMin = 130.;
178 data->fLambdaMax = 210.;
179 data->fLambdaStep = 10.;
180
181 data->fEfficiency = {0.45, 0.4, 0.35, 0.32, 0.25, 0.2, 0.1, 0.03};
182
183 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
184 }
185
186 {
189 data->fLambdaMin = 260.;
190 data->fLambdaMax = 740.;
191 data->fLambdaStep = 20.;
192
193
194 data->fEfficiency = {0.06, 0.12, 0.2, 0.22, 0.22, 0.22, 0.21, 0.2, 0.18, 0.16, 0.14, 0.11,
195 0.1, 0.06, 0.047, 0.03, 0.021, 0.012, 0.006, 0.0023, 0.0008, 0.00022, 0.00007, 0.00002};
196
197 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
198 }
199
200 {
203 data->fLambdaMin = 200.;
204 data->fLambdaMax = 640.;
205 data->fLambdaStep = 20.;
206
207 data->fEfficiency = {0.095, 0.13, 0.16, 0.2, 0.23, 0.24, 0.25, 0.25, 0.24, 0.24, 0.23,
208 0.22, 0.2, 0.16, 0.14, 0.1, 0.065, 0.045, 0.02, 0.017, 0.007, 0.0033};
209
210 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
211 }
212
213 {
216 data->fLambdaMin = 160.;
217 data->fLambdaMax = 640.;
218 data->fLambdaStep = 20.;
219
220 data->fEfficiency = {0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.23, 0.24, 0.25, 0.25, 0.24, 0.24,
221 0.23, 0.22, 0.2, 0.16, 0.14, 0.1, 0.065, 0.045, 0.02, 0.017, 0.007, 0.0033};
222
223 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
224 }
225
226 {
229 data->fLambdaMin = 160.;
230 data->fLambdaMax = 700.;
231 data->fLambdaStep = 10.;
232
233 data->fEfficiency = {0.0, 0.0, 0.0324, 0.0586, 0.0945, 0.1061, 0.1265, 0.1482, 0.1668, 0.1887, 0.2093,
234 0.2134, 0.2303, 0.2482, 0.2601, 0.2659, 0.2702, 0.283, 0.2863, 0.2863, 0.2884, 0.286,
235 0.2811, 0.2802, 0.272, 0.2638, 0.2562, 0.2472, 0.2368, 0.2218, 0.2032, 0.186, 0.1735,
236 0.1661, 0.1483, 0.121, 0.0959, 0.0782, 0.0647, 0.0538, 0.0372, 0.0296, 0.0237, 0.0176,
237 0.0123, 0.0083, 0.005, 0.003, 0.0017, 0.0008, 0.0006, 0.0003, 0.0003, 0.0002, 0.0001};
238
239 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
240 }
241
242 {
245 data->fLambdaMin = 180.;
246 data->fLambdaMax = 640.;
247 data->fLambdaStep = 10.;
248
249 data->fEfficiency = {0.178, 0.200, 0.218, 0.222, 0.226, 0.228, 0.214, 0.210, 0.229, 0.231, 0.244, 0.253,
250 0.259, 0.263, 0.266, 0.277, 0.280, 0.274, 0.275, 0.270, 0.264, 0.263, 0.254, 0.246,
251 0.239, 0.229, 0.219, 0.207, 0.193, 0.179, 0.161, 0.149, 0.135, 0.117, 0.103, 0.082,
252 0.065, 0.056, 0.036, 0.030, 0.024, 0.018, 0.013, 0.009, 0.006, 0.004, 0.002};
253
254 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
255 }
256
257 {
260 data->fLambdaMin = 180.;
261 data->fLambdaMax = 640.;
262 data->fLambdaStep = 10.;
263
264 data->fEfficiency = {0.202, 0.207, 0.210, 0.214, 0.218, 0.219, 0.206, 0.202, 0.220, 0.222, 0.235, 0.243,
265 0.249, 0.253, 0.256, 0.266, 0.270, 0.264, 0.265, 0.260, 0.254, 0.253, 0.244, 0.237,
266 0.229, 0.221, 0.210, 0.199, 0.186, 0.172, 0.155, 0.143, 0.129, 0.113, 0.099, 0.079,
267 0.063, 0.054, 0.035, 0.028, 0.023, 0.018, 0.013, 0.009, 0.006, 0.004, 0.002};
268
269 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
270 }
271
272 {
275 data->fLambdaMin = 180.;
276 data->fLambdaMax = 640.;
277 data->fLambdaStep = 10.;
278
279
280 data->fEfficiency = {0.060, 0.080, 0.096, 0.109, 0.130, 0.152, 0.172, 0.194, 0.214, 0.218, 0.235, 0.253,
281 0.265, 0.271, 0.275, 0.288, 0.291, 0.292, 0.294, 0.292, 0.287, 0.286, 0.278, 0.269,
282 0.262, 0.252, 0.242, 0.227, 0.208, 0.178, 0.170, 0.155, 0.129, 0.102, 0.083, 0.069,
283 0.058, 0.041, 0.033, 0.027, 0.020, 0.015, 0.010, 0.006, 0.004, 0.002, 0.001};
284
285 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
286 }
287
288 {
291 data->fLambdaMin = 180.;
292 data->fLambdaMax = 640.;
293 data->fLambdaStep = 10.;
294
295 data->fEfficiency = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.315, 0.344,
296 0.366, 0.378, 0.384, 0.400, 0.403, 0.404, 0.407, 0.403, 0.396, 0.395, 0.383, 0.370,
297 0.359, 0.347, 0.331, 0.310, 0.285, 0.263, 0.244, 0.232, 0.213, 0.182, 0.151, 0.126,
298 0.106, 0.092, 0.069, 0.060, 0.051, 0.042, 0.034, 0.026, 0.019, 0.014, 0.009};
299
300 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
301 }
302
303 {
306 data->fLambdaMin = 180.;
307 data->fLambdaMax = 640.;
308 data->fLambdaStep = 10.;
309
310 data->fEfficiency = {0.239, 0.294, 0.332, 0.351, 0.352, 0.338, 0.303, 0.286, 0.307, 0.307, 0.324, 0.340,
311 0.354, 0.364, 0.371, 0.390, 0.389, 0.392, 0.395, 0.393, 0.388, 0.388, 0.378, 0.367,
312 0.358, 0.347, 0.333, 0.310, 0.384, 0.265, 0.248, 0.238, 0.220, 0.188, 0.150, 0.123,
313 0.104, 0.089, 0.068, 0.058, 0.050, 0.041, 0.033, 0.025, 0.018, 0.013, 0.008};
314
315 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
316 }
317
318 {
321 data->fLambdaMin = 180.;
322 data->fLambdaMax = 640.;
323 data->fLambdaStep = 10.;
324
325 data->fEfficiency = {0.037, 0.063, 0.103, 0.110, 0.131, 0.153, 0.172, 0.195, 0.215, 0.217, 0.232, 0.249,
326 0.261, 0.267, 0.271, 0.285, 0.286, 0.285, 0.287, 0.285, 0.280, 0.279, 0.272, 0.264,
327 0.256, 0.248, 0.239, 0.223, 0.204, 0.189, 0.177, 0.170, 0.155, 0.130, 0.105, 0.087,
328 0.073, 0.060, 0.041, 0.033, 0.027, 0.020, 0.015, 0.010, 0.006, 0.004, 0.003};
329
330 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
331 }
332
333 {
336 data->fLambdaMin = 180.;
337 data->fLambdaMax = 640.;
338 data->fLambdaStep = 10.;
339
340 data->fEfficiency = {0.202, 0.240, 0.269, 0.277, 0.279, 0.273, 0.245, 0.228, 0.243, 0.243, 0.253, 0.259,
341 0.262, 0.263, 0.265, 0.278, 0.279, 0.281, 0.283, 0.281, 0.277, 0.275, 0.267, 0.260,
342 0.253, 0.245, 0.234, 0.219, 0.201, 0.187, 0.175, 0.167, 0.150, 0.124, 0.098, 0.080,
343 0.066, 0.055, 0.040, 0.033, 0.026, 0.020, 0.014, 0.010, 0.006, 0.004, 0.002};
344
345 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
346 }
347
348 {
351 data->fLambdaMin = 180.;
352 data->fLambdaMax = 640.;
353 data->fLambdaStep = 10.;
354
355 data->fEfficiency = {0.007, 0.040, 0.085, 0.103, 0.130, 0.160, 0.186, 0.215, 0.244, 0.256, 0.281, 0.310,
356 0.332, 0.344, 0.355, 0.376, 0.382, 0.386, 0.390, 0.390, 0.387, 0.386, 0.376, 0.365,
357 0.356, 0.345, 0.328, 0.302, 0.278, 0.257, 0.241, 0.227, 0.191, 0.153, 0.128, 0.112,
358 0.098, 0.085, 0.064, 0.055, 0.047, 0.039, 0.030, 0.023, 0.017, 0.011, 0.007};
359
360 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
361 }
362
363 {
366 data->fLambdaMin = 180.;
367 data->fLambdaMax = 640.;
368 data->fLambdaStep = 10.;
369
370 data->fEfficiency = {0.241, 0.304, 0.351, 0.364, 0.368, 0.357, 0.311, 0.279, 0.299, 0.304, 0.321, 0.329,
371 0.336, 0.342, 0.350, 0.370, 0.374, 0.379, 0.383, 0.384, 0.381, 0.382, 0.372, 0.362,
372 0.354, 0.344, 0.327, 0.300, 0.275, 0.259, 0.244, 0.231, 0.195, 0.155, 0.130, 0.113,
373 0.097, 0.083, 0.065, 0.055, 0.046, 0.038, 0.030, 0.022, 0.016, 0.011, 0.007};
374
375 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
376 }
377
378 {
381 data->fLambdaMin = 160.;
382 data->fLambdaMax = 640.;
383 data->fLambdaStep = 20.;
384
385 data->fEfficiency = {0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99,
386 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99};
387
388 fPmtDataMap.insert(pair<CbmRichPmtTypeEnum, CbmRichPmtQEData*>(data->fDetectorType, data));
389 }
390}
ClassImp(CbmConverterManager)
Char_t * gr
CbmRichPmtTypeEnum
@ CbmRichPmtTypeCern11H8500_10
@ CbmRichPmtTypeCern12H8500_15
@ CbmRichPmtTypeH8500_03
@ CbmRichPmtTypeCern11H8500_11
@ CbmRichPmtTypeCern12H10966A_18
@ CbmRichPmtTypeCern11H8500_12
@ CbmRichPmtTypeCern11H8500_6
@ CbmRichPmtTypeCsi
@ CbmRichPmtTypeIdeal
@ CbmRichPmtTypeProtvino
@ CbmRichPmtTypeCern12H8500_16
@ CbmRichPmtTypeR11265_14
@ CbmRichPmtTypeCosy17NoWls
@ CbmRichPmtTypeR11265_13
@ CbmRichPmtTypeCosy17WithWls
@ CbmRichPmtTypeH8500
@ CbmRichPmtTypeH8500WithWls
@ CbmRichPmtTypeCern12H10966A_17
RICH geometry parameters for the reconstruction. This class is used for convinient storing of the bas...
Generates beam ions for transport simulation.
CbmRichRecGeoPar * fGP
static CbmRichGeoManager & GetInstance()
std::vector< Double_t > fEfficiency
Definition CbmRichPmt.h:32
CbmRichPmtTypeEnum fDetectorType
Definition CbmRichPmt.h:28
Double_t fLambdaMax
Definition CbmRichPmt.h:30
Double_t fLambdaStep
Definition CbmRichPmt.h:31
Double_t fLambdaMin
Definition CbmRichPmt.h:29
virtual ~CbmRichPmt()
std::map< CbmRichPmtTypeEnum, CbmRichPmtQEData * > fPmtDataMap
Definition CbmRichPmt.h:59
void InitQE()
static Double_t getLambda(Double_t momentum)
static const Double_t h
Definition CbmRichPmt.h:62
TGraph * getQEGraph(CbmRichPmtTypeEnum detType)
static const Double_t c
Definition CbmRichPmt.h:61
Bool_t isPhotonDetected(CbmRichPmtTypeEnum detType, Double_t momentum)
static const Double_t e
Definition CbmRichPmt.h:63
void ClearMap()
Double_t fCollectionEfficiency
Definition CbmRichPmt.h:58
Double_t fRefractiveIndex
Definition CbmRichPmt.h:64
Hash for CbmL1LinkKey.