CMS 3D CMS Logo

CMTRawAnalyzer.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CMTRawAnalyzer
4 #ifndef CMTRawAnalyzer_h
5 #define CMTRawAnalyzer_h
6 #include <fstream>
7 #include <iostream>
8 #include <cmath>
9 #include <iosfwd>
10 #include <bitset>
11 #include <memory>
12 //using namespace std;
22 //using namespace edm;
23 // this line is to retrieve HCAL RecHitCollections:
64 #include "TFile.h"
65 #include "TTree.h"
66 #include "TH1.h"
67 #include "TH2.h"
68 #include "TF1.h"
69 
70 #define NUMADCS 256
71 // very preliminary, NEEDS UPDATING
72 double adc2fC_QIE10[NUMADCS] = {
73  // - - - - - - - range 0 - - - - - - - -
74  //subrange0
75  1.58,
76  4.73,
77  7.88,
78  11.0,
79  14.2,
80  17.3,
81  20.5,
82  23.6,
83  26.8,
84  29.9,
85  33.1,
86  36.2,
87  39.4,
88  42.5,
89  45.7,
90  48.8,
91  //subrange1
92  53.6,
93  60.1,
94  66.6,
95  73.0,
96  79.5,
97  86.0,
98  92.5,
99  98.9,
100  105,
101  112,
102  118,
103  125,
104  131,
105  138,
106  144,
107  151,
108  //subrange2
109  157,
110  164,
111  170,
112  177,
113  186,
114  199,
115  212,
116  225,
117  238,
118  251,
119  264,
120  277,
121  289,
122  302,
123  315,
124  328,
125  //subrange3
126  341,
127  354,
128  367,
129  380,
130  393,
131  406,
132  418,
133  431,
134  444,
135  464,
136  490,
137  516,
138  542,
139  568,
140  594,
141  620,
142 
143  // - - - - - - - range 1 - - - - - - - -
144  //subrange0
145  569,
146  594,
147  619,
148  645,
149  670,
150  695,
151  720,
152  745,
153  771,
154  796,
155  821,
156  846,
157  871,
158  897,
159  922,
160  947,
161  //subrange1
162  960,
163  1010,
164  1060,
165  1120,
166  1170,
167  1220,
168  1270,
169  1320,
170  1370,
171  1430,
172  1480,
173  1530,
174  1580,
175  1630,
176  1690,
177  1740,
178  //subrange2
179  1790,
180  1840,
181  1890,
182  1940,
183  2020,
184  2120,
185  2230,
186  2330,
187  2430,
188  2540,
189  2640,
190  2740,
191  2850,
192  2950,
193  3050,
194  3150,
195  //subrange3
196  3260,
197  3360,
198  3460,
199  3570,
200  3670,
201  3770,
202  3880,
203  3980,
204  4080,
205  4240,
206  4450,
207  4650,
208  4860,
209  5070,
210  5280,
211  5490,
212 
213  // - - - - - - - range 2 - - - - - - - -
214  //subrange0
215  5080,
216  5280,
217  5480,
218  5680,
219  5880,
220  6080,
221  6280,
222  6480,
223  6680,
224  6890,
225  7090,
226  7290,
227  7490,
228  7690,
229  7890,
230  8090,
231  //subrange1
232  8400,
233  8810,
234  9220,
235  9630,
236  10000,
237  10400,
238  10900,
239  11300,
240  11700,
241  12100,
242  12500,
243  12900,
244  13300,
245  13700,
246  14100,
247  14500,
248  //subrange2
249  15000,
250  15400,
251  15800,
252  16200,
253  16800,
254  17600,
255  18400,
256  19300,
257  20100,
258  20900,
259  21700,
260  22500,
261  23400,
262  24200,
263  25000,
264  25800,
265  //subrange3
266  26600,
267  27500,
268  28300,
269  29100,
270  29900,
271  30700,
272  31600,
273  32400,
274  33200,
275  34400,
276  36100,
277  37700,
278  39400,
279  41000,
280  42700,
281  44300,
282 
283  // - - - - - - - range 3 - - - - - - - - -
284  //subrange0
285  41100,
286  42700,
287  44300,
288  45900,
289  47600,
290  49200,
291  50800,
292  52500,
293  54100,
294  55700,
295  57400,
296  59000,
297  60600,
298  62200,
299  63900,
300  65500,
301  //subrange1
302  68000,
303  71300,
304  74700,
305  78000,
306  81400,
307  84700,
308  88000,
309  91400,
310  94700,
311  98100,
312  101000,
313  105000,
314  108000,
315  111000,
316  115000,
317  118000,
318  //subrange2
319  121000,
320  125000,
321  128000,
322  131000,
323  137000,
324  145000,
325  152000,
326  160000,
327  168000,
328  176000,
329  183000,
330  191000,
331  199000,
332  206000,
333  214000,
334  222000,
335  //subrange3
336  230000,
337  237000,
338  245000,
339  253000,
340  261000,
341  268000,
342  276000,
343  284000,
344  291000,
345  302000,
346  316000,
347  329000,
348  343000,
349  356000,
350  370000,
351  384000
352 
353 };
354 
355 //shunt1
356 double const adc2fC_QIE11_shunt1[NUMADCS] = {
357  1.89, 5.07, 8.25, 11.43, 14.61, 17.78, 20.96, 24.14, 27.32, 30.50, 33.68,
358  36.86, 40.04, 43.22, 46.40, 49.58, 54.35, 60.71, 67.07, 73.43, 79.79, 86.15,
359  92.51, 98.87, 105.2, 111.6, 117.9, 124.3, 130.7, 137.0, 143.4, 149.7, 156.1,
360  162.5, 168.8, 175.2, 184.7, 197.4, 210.2, 222.9, 235.6, 248.3, 261.0, 273.7,
361  286.5, 299.2, 311.9, 324.6, 337.3, 350.1, 362.8, 375.5, 388.2, 400.9, 413.6,
362  426.4, 439.1, 458.2, 483.6, 509.0, 534.5, 559.9, 585.3, 610.8, 558.9, 584.2,
363  609.5, 634.7, 660.0, 685.3, 710.6, 735.9, 761.2, 786.5, 811.8, 837.1, 862.4,
364  887.7, 913.0, 938.3, 976.2, 1026.8, 1077.4, 1128.0, 1178.6, 1229.1, 1279.7, 1330.3,
365  1380.9, 1431.5, 1482.1, 1532.7, 1583.3, 1633.8, 1684.4, 1735.0, 1785.6, 1836.2, 1886.8,
366  1937.4, 2013.2, 2114.4, 2215.6, 2316.8, 2417.9, 2519.1, 2620.3, 2721.5, 2822.6, 2923.8,
367  3025.0, 3126.2, 3227.3, 3328.5, 3429.7, 3530.9, 3632.0, 3733.2, 3834.4, 3935.5, 4036.7,
368  4188.5, 4390.8, 4593.2, 4795.5, 4997.9, 5200.2, 5402.6, 5057.5, 5262.3, 5467.1, 5671.8,
369  5876.6, 6081.4, 6286.2, 6491.0, 6695.8, 6900.6, 7105.3, 7310.1, 7514.9, 7719.7, 7924.5,
370  8129.3, 8436.4, 8846.0, 9255.6, 9665.1, 10074.7, 10484.3, 10893.9, 11303.4, 11713.0, 12122.6,
371  12532.1, 12941.7, 13351.3, 13760.8, 14170.4, 14580.0, 14989.5, 15399.1, 15808.7, 16218.2, 16832.6,
372  17651.7, 18470.9, 19290.0, 20109.2, 20928.3, 21747.4, 22566.6, 23385.7, 24204.8, 25024.0, 25843.1,
373  26662.3, 27481.4, 28300.5, 29119.7, 29938.8, 30757.9, 31577.1, 32396.2, 33215.4, 34444.1, 36082.3,
374  37720.6, 39358.9, 40997.2, 42635.4, 44273.7, 40908.7, 42542.6, 44176.5, 45810.4, 47444.3, 49078.3,
375  50712.2, 52346.1, 53980.0, 55613.9, 57247.8, 58881.8, 60515.7, 62149.6, 63783.5, 65417.4, 67868.3,
376  71136.1, 74404.0, 77671.8, 80939.7, 84207.5, 87475.3, 90743.2, 94011.0, 97278.8, 100546.7, 103814.5,
377  107082.3, 110350.2, 113618.0, 116885.8, 120153.7, 123421.5, 126689.3, 129957.2, 134858.9, 141394.6, 147930.3,
378  154465.9, 161001.6, 167537.3, 174072.9, 180608.6, 187144.3, 193679.9, 200215.6, 206751.3, 213287.0, 219822.6,
379  226358.3, 232894.0, 239429.6, 245965.3, 252501.0, 259036.6, 265572.3, 275375.8, 288447.2, 301518.5, 314589.8,
380  327661.2, 340732.5, 353803.8};
381 //shunt6
382 double const adc2fC_QIE11_shunt6[NUMADCS] = {
383  9.56, 28.24, 46.91, 65.59, 84.27, 102.9, 121.6, 140.3, 159.0, 177.7,
384  196.3, 215.0, 233.7, 252.4, 271.0, 289.7, 317.7, 355.1, 392.4, 429.8,
385  467.1, 504.5, 541.9, 579.2, 616.6, 653.9, 691.3, 728.6, 766.0, 803.3,
386  840.7, 878.0, 915.4, 952.8, 990.1, 1027.5, 1083.5, 1158.2, 1232.9, 1307.6,
387  1382.3, 1457.0, 1531.7, 1606.4, 1681.2, 1755.9, 1830.6, 1905.3, 1980.0, 2054.7,
388  2129.4, 2204.1, 2278.8, 2353.5, 2428.2, 2502.9, 2577.7, 2689.7, 2839.1, 2988.6,
389  3138.0, 3287.4, 3436.8, 3586.2, 3263.0, 3411.3, 3559.6, 3707.9, 3856.2, 4004.5,
390  4152.9, 4301.2, 4449.5, 4597.8, 4746.1, 4894.4, 5042.7, 5191.0, 5339.4, 5487.7,
391  5710.1, 6006.8, 6303.4, 6600.0, 6896.6, 7193.3, 7489.9, 7786.5, 8083.1, 8379.8,
392  8676.4, 8973.0, 9269.6, 9566.3, 9862.9, 10159.5, 10456.2, 10752.8, 11049.4, 11346.0,
393  11791.0, 12384.2, 12977.5, 13570.7, 14164.0, 14757.2, 15350.5, 15943.7, 16537.0, 17130.2,
394  17723.5, 18316.7, 18910.0, 19503.2, 20096.5, 20689.7, 21283.0, 21876.2, 22469.5, 23062.8,
395  23656.0, 24545.9, 25732.4, 26918.9, 28105.4, 29291.9, 30478.4, 31664.9, 29399.4, 30590.1,
396  31780.9, 32971.7, 34162.4, 35353.2, 36544.0, 37734.7, 38925.5, 40116.3, 41307.0, 42497.8,
397  43688.5, 44879.3, 46070.1, 47260.8, 49047.0, 51428.5, 53810.1, 56191.6, 58573.1, 60954.6,
398  63336.2, 65717.7, 68099.2, 70480.8, 72862.3, 75243.8, 77625.4, 80006.9, 82388.4, 84769.9,
399  87151.5, 89533.0, 91914.5, 94296.1, 97868.4, 102631.4, 107394.5, 112157.5, 116920.6, 121683.7,
400  126446.7, 131209.8, 135972.8, 140735.9, 145499.0, 150262.0, 155025.1, 159788.2, 164551.2, 169314.3,
401  174077.3, 178840.4, 183603.5, 188366.5, 193129.6, 200274.2, 209800.3, 219326.4, 228852.5, 238378.7,
402  247904.8, 257430.9, 237822.7, 247326.7, 256830.7, 266334.8, 275838.8, 285342.9, 294846.9, 304351.0,
403  313855.0, 323359.1, 332863.1, 342367.1, 351871.2, 361375.2, 370879.3, 380383.3, 394639.4, 413647.5,
404  432655.6, 451663.6, 470671.7, 489679.8, 508687.9, 527696.0, 546704.1, 565712.2, 584720.3, 603728.3,
405  622736.4, 641744.5, 660752.6, 679760.7, 698768.8, 717776.9, 736785.0, 755793.0, 784305.2, 822321.3,
406  860337.5, 898353.7, 936369.9, 974386.0, 1012402.2, 1050418.4, 1088434.6, 1126450.7, 1164466.9, 1202483.1,
407  1240499.3, 1278515.4, 1316531.6, 1354547.8, 1392564.0, 1430580.1, 1468596.3, 1506612.5, 1544628.7, 1601652.9,
408  1677685.3, 1753717.6, 1829750.0, 1905782.3, 1981814.7, 2057847.0};
409 // for HPD:
410 static const float adc2fC[128] = {
411  -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5,
412  12.5, 13.5, 15., 17., 19., 21., 23., 25., 27., 29.5, 32.5, 35.5, 38.5,
413  42., 46., 50., 54.5, 59.5, 64.5, 59.5, 64.5, 69.5, 74.5, 79.5, 84.5, 89.5,
414  94.5, 99.5, 104.5, 109.5, 114.5, 119.5, 124.5, 129.5, 137., 147., 157., 167., 177.,
415  187., 197., 209.5, 224.5, 239.5, 254.5, 272., 292., 312., 334.5, 359.5, 384.5, 359.5,
416  384.5, 409.5, 434.5, 459.5, 484.5, 509.5, 534.5, 559.5, 584.5, 609.5, 634.5, 659.5, 684.5,
417  709.5, 747., 797., 847., 897., 947., 997., 1047., 1109.5, 1184.5, 1259.5, 1334.5, 1422.,
418  1522., 1622., 1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5, 2234.5, 2359.5, 2484.5, 2609.5, 2734.5,
419  2859.5, 2984.5, 3109.5, 3234.5, 3359.5, 3484.5, 3609.5, 3797., 4047., 4297., 4547., 4797., 5047.,
420  5297., 5609.5, 5984.5, 6359.5, 6734.5, 7172., 7672., 8172., 8734.5, 9359.5, 9984.5};
421 const int nsub = 4;
422 const int ndepth = 7;
423 const int neta = 82;
424 const int nphi = 72;
425 float bphi = 72.;
426 const int zneta = 22;
427 const int znphi = 18;
428 float zbphi = 18.;
429 const int npfit = 220;
430 float anpfit = 220.; // for SiPM:
431 
433 // SERVICE FUNCTIONS --------------------------------------------------------
434 /*
435 double CMTRawAnalyzer::dR(double eta1, double phi1, double eta2, double phi2) {
436  double PI = 3.1415926535898;
437  double deltaphi = phi1 - phi2;
438  if (phi2 > phi1) {
439  deltaphi = phi2 - phi1;
440  }
441  if (deltaphi > PI) {
442  deltaphi = 2. * PI - deltaphi;
443  }
444  double deltaeta = eta2 - eta1;
445  double tmp = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
446  return tmp;
447 }
448 
449 double CMTRawAnalyzer::phi12(double phi1, double en1, double phi2, double en2) {
450  // weighted mean value of phi1 and phi2
451 
452  double tmp;
453  double PI = 3.1415926535898;
454  double a1 = phi1;
455  double a2 = phi2;
456 
457  if (a1 > 0.5 * PI && a2 < 0.)
458  a2 += 2 * PI;
459  if (a2 > 0.5 * PI && a1 < 0.)
460  a1 += 2 * PI;
461  tmp = (a1 * en1 + a2 * en2) / (en1 + en2);
462  if (tmp > PI)
463  tmp -= 2. * PI;
464 
465  return tmp;
466 }
467 
468 double CMTRawAnalyzer::dPhiWsign(double phi1, double phi2) {
469  // clockwise phi2 w.r.t phi1 means "+" phi distance
470  // anti-clockwise phi2 w.r.t phi1 means "-" phi distance
471 
472  double PI = 3.1415926535898;
473  double a1 = phi1;
474  double a2 = phi2;
475  double tmp = a2 - a1;
476  if (a1 * a2 < 0.) {
477  if (a1 > 0.5 * PI)
478  tmp += 2. * PI;
479  if (a2 > 0.5 * PI)
480  tmp -= 2. * PI;
481  }
482  return tmp;
483 }
484 */
486 
487 #endif
FEDNumbering.h
HcalQIEShape.h
HFDataFrame.h
neta
const int neta
Definition: CMTRawAnalyzer.h:423
znphi
const int znphi
Definition: CMTRawAnalyzer.h:427
HcalCalibrations.h
MessageLogger.h
L1GtTriggerMaskAlgoTrigRcd.h
ESHandle.h
HcalCalibrationEventTypes.h
zbphi
float zbphi
Definition: CMTRawAnalyzer.h:428
HODataFrame.h
L1GtTriggerMaskTechTrigRcd.h
HcalGenericDetId.h
HcalRecNumberingRecord.h
npfit
const int npfit
Definition: CMTRawAnalyzer.h:429
EDAnalyzer.h
adc2fC
static const float adc2fC[128]
Definition: CMTRawAnalyzer.h:410
HcalGeometry.h
HcalCoderDb.h
nphi
const int nphi
Definition: CMTRawAnalyzer.h:424
MakerMacros.h
HcalQIECoder.h
zneta
const int zneta
Definition: CMTRawAnalyzer.h:426
Service.h
HcalDigiCollections.h
nsub
const int nsub
Definition: CMTRawAnalyzer.h:421
HcalCalibDetId.h
HcalDbRecord.h
anpfit
float anpfit
Definition: CMTRawAnalyzer.h:430
bphi
float bphi
Definition: CMTRawAnalyzer.h:425
HcalLogicalMapGenerator.h
CaloGeometryRecord.h
CaloSubdetectorGeometry.h
Event.h
ndepth
const int ndepth
Definition: CMTRawAnalyzer.h:422
HcalQIESample.h
HcalDetId.h
QIE10DataFrame.h
ModuleDef.h
FEDRawDataCollection.h
NUMADCS
#define NUMADCS
Definition: CMTRawAnalyzer.h:70
IdealGeometryRecord.h
adc2fC_QIE10
double adc2fC_QIE10[256]
Definition: CMTRawAnalyzer.h:72
HcalLogicalMap.h
HcalSubdetector.h
HcalElectronicsId.h
adc2fC_QIE11_shunt1
const double adc2fC_QIE11_shunt1[256]
Definition: CMTRawAnalyzer.h:356
HcalTopology.h
CaloCellGeometry.h
Frameworkfwd.h
adc2fC_QIE11_shunt6
const double adc2fC_QIE11_shunt6[256]
Definition: CMTRawAnalyzer.h:382
CaloGeometry.h
HcalDDDRecConstants.h
QIE11DataFrame.h
HcalRecHitCollections.h
HcalDbService.h
HcalDCCHeader.h
ParameterSet.h
HcalGeometryRecord.h
FEDHeader.h
L1GlobalTriggerReadoutRecord.h
HBHEDataFrame.h
FEDTrailer.h