CMS 3D CMS Logo

CMTRawAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 //
4 // Package: CMTRawAnalyzer
5 //
6 #include <fstream>
7 #include <iostream>
8 #include <cmath>
9 #include <iosfwd>
10 #include <bitset>
11 #include <memory>
12 
21 
63 #include "TFile.h"
64 #include "TTree.h"
65 #include "TH1.h"
66 #include "TH2.h"
67 #include "TF1.h"
68 
69 #define NUMADCS 256
70 double adc2fC_QIE10[NUMADCS] = {
71  // - - - - - - - range 0 - - - - - - - -
72  //subrange0
73  1.58,
74  4.73,
75  7.88,
76  11.0,
77  14.2,
78  17.3,
79  20.5,
80  23.6,
81  26.8,
82  29.9,
83  33.1,
84  36.2,
85  39.4,
86  42.5,
87  45.7,
88  48.8,
89  //subrange1
90  53.6,
91  60.1,
92  66.6,
93  73.0,
94  79.5,
95  86.0,
96  92.5,
97  98.9,
98  105,
99  112,
100  118,
101  125,
102  131,
103  138,
104  144,
105  151,
106  //subrange2
107  157,
108  164,
109  170,
110  177,
111  186,
112  199,
113  212,
114  225,
115  238,
116  251,
117  264,
118  277,
119  289,
120  302,
121  315,
122  328,
123  //subrange3
124  341,
125  354,
126  367,
127  380,
128  393,
129  406,
130  418,
131  431,
132  444,
133  464,
134  490,
135  516,
136  542,
137  568,
138  594,
139  620,
140 
141  // - - - - - - - range 1 - - - - - - - -
142  //subrange0
143  569,
144  594,
145  619,
146  645,
147  670,
148  695,
149  720,
150  745,
151  771,
152  796,
153  821,
154  846,
155  871,
156  897,
157  922,
158  947,
159  //subrange1
160  960,
161  1010,
162  1060,
163  1120,
164  1170,
165  1220,
166  1270,
167  1320,
168  1370,
169  1430,
170  1480,
171  1530,
172  1580,
173  1630,
174  1690,
175  1740,
176  //subrange2
177  1790,
178  1840,
179  1890,
180  1940,
181  2020,
182  2120,
183  2230,
184  2330,
185  2430,
186  2540,
187  2640,
188  2740,
189  2850,
190  2950,
191  3050,
192  3150,
193  //subrange3
194  3260,
195  3360,
196  3460,
197  3570,
198  3670,
199  3770,
200  3880,
201  3980,
202  4080,
203  4240,
204  4450,
205  4650,
206  4860,
207  5070,
208  5280,
209  5490,
210 
211  // - - - - - - - range 2 - - - - - - - -
212  //subrange0
213  5080,
214  5280,
215  5480,
216  5680,
217  5880,
218  6080,
219  6280,
220  6480,
221  6680,
222  6890,
223  7090,
224  7290,
225  7490,
226  7690,
227  7890,
228  8090,
229  //subrange1
230  8400,
231  8810,
232  9220,
233  9630,
234  10000,
235  10400,
236  10900,
237  11300,
238  11700,
239  12100,
240  12500,
241  12900,
242  13300,
243  13700,
244  14100,
245  14500,
246  //subrange2
247  15000,
248  15400,
249  15800,
250  16200,
251  16800,
252  17600,
253  18400,
254  19300,
255  20100,
256  20900,
257  21700,
258  22500,
259  23400,
260  24200,
261  25000,
262  25800,
263  //subrange3
264  26600,
265  27500,
266  28300,
267  29100,
268  29900,
269  30700,
270  31600,
271  32400,
272  33200,
273  34400,
274  36100,
275  37700,
276  39400,
277  41000,
278  42700,
279  44300,
280 
281  // - - - - - - - range 3 - - - - - - - - -
282  //subrange0
283  41100,
284  42700,
285  44300,
286  45900,
287  47600,
288  49200,
289  50800,
290  52500,
291  54100,
292  55700,
293  57400,
294  59000,
295  60600,
296  62200,
297  63900,
298  65500,
299  //subrange1
300  68000,
301  71300,
302  74700,
303  78000,
304  81400,
305  84700,
306  88000,
307  91400,
308  94700,
309  98100,
310  101000,
311  105000,
312  108000,
313  111000,
314  115000,
315  118000,
316  //subrange2
317  121000,
318  125000,
319  128000,
320  131000,
321  137000,
322  145000,
323  152000,
324  160000,
325  168000,
326  176000,
327  183000,
328  191000,
329  199000,
330  206000,
331  214000,
332  222000,
333  //subrange3
334  230000,
335  237000,
336  245000,
337  253000,
338  261000,
339  268000,
340  276000,
341  284000,
342  291000,
343  302000,
344  316000,
345  329000,
346  343000,
347  356000,
348  370000,
349  384000
350 
351 };
352 
353 //shunt1
354 double const adc2fC_QIE11_shunt1[NUMADCS] = {
355  1.89, 5.07, 8.25, 11.43, 14.61, 17.78, 20.96, 24.14, 27.32, 30.50, 33.68,
356  36.86, 40.04, 43.22, 46.40, 49.58, 54.35, 60.71, 67.07, 73.43, 79.79, 86.15,
357  92.51, 98.87, 105.2, 111.6, 117.9, 124.3, 130.7, 137.0, 143.4, 149.7, 156.1,
358  162.5, 168.8, 175.2, 184.7, 197.4, 210.2, 222.9, 235.6, 248.3, 261.0, 273.7,
359  286.5, 299.2, 311.9, 324.6, 337.3, 350.1, 362.8, 375.5, 388.2, 400.9, 413.6,
360  426.4, 439.1, 458.2, 483.6, 509.0, 534.5, 559.9, 585.3, 610.8, 558.9, 584.2,
361  609.5, 634.7, 660.0, 685.3, 710.6, 735.9, 761.2, 786.5, 811.8, 837.1, 862.4,
362  887.7, 913.0, 938.3, 976.2, 1026.8, 1077.4, 1128.0, 1178.6, 1229.1, 1279.7, 1330.3,
363  1380.9, 1431.5, 1482.1, 1532.7, 1583.3, 1633.8, 1684.4, 1735.0, 1785.6, 1836.2, 1886.8,
364  1937.4, 2013.2, 2114.4, 2215.6, 2316.8, 2417.9, 2519.1, 2620.3, 2721.5, 2822.6, 2923.8,
365  3025.0, 3126.2, 3227.3, 3328.5, 3429.7, 3530.9, 3632.0, 3733.2, 3834.4, 3935.5, 4036.7,
366  4188.5, 4390.8, 4593.2, 4795.5, 4997.9, 5200.2, 5402.6, 5057.5, 5262.3, 5467.1, 5671.8,
367  5876.6, 6081.4, 6286.2, 6491.0, 6695.8, 6900.6, 7105.3, 7310.1, 7514.9, 7719.7, 7924.5,
368  8129.3, 8436.4, 8846.0, 9255.6, 9665.1, 10074.7, 10484.3, 10893.9, 11303.4, 11713.0, 12122.6,
369  12532.1, 12941.7, 13351.3, 13760.8, 14170.4, 14580.0, 14989.5, 15399.1, 15808.7, 16218.2, 16832.6,
370  17651.7, 18470.9, 19290.0, 20109.2, 20928.3, 21747.4, 22566.6, 23385.7, 24204.8, 25024.0, 25843.1,
371  26662.3, 27481.4, 28300.5, 29119.7, 29938.8, 30757.9, 31577.1, 32396.2, 33215.4, 34444.1, 36082.3,
372  37720.6, 39358.9, 40997.2, 42635.4, 44273.7, 40908.7, 42542.6, 44176.5, 45810.4, 47444.3, 49078.3,
373  50712.2, 52346.1, 53980.0, 55613.9, 57247.8, 58881.8, 60515.7, 62149.6, 63783.5, 65417.4, 67868.3,
374  71136.1, 74404.0, 77671.8, 80939.7, 84207.5, 87475.3, 90743.2, 94011.0, 97278.8, 100546.7, 103814.5,
375  107082.3, 110350.2, 113618.0, 116885.8, 120153.7, 123421.5, 126689.3, 129957.2, 134858.9, 141394.6, 147930.3,
376  154465.9, 161001.6, 167537.3, 174072.9, 180608.6, 187144.3, 193679.9, 200215.6, 206751.3, 213287.0, 219822.6,
377  226358.3, 232894.0, 239429.6, 245965.3, 252501.0, 259036.6, 265572.3, 275375.8, 288447.2, 301518.5, 314589.8,
378  327661.2, 340732.5, 353803.8};
379 //shunt6
380 double const adc2fC_QIE11_shunt6[NUMADCS] = {
381  9.56, 28.24, 46.91, 65.59, 84.27, 102.9, 121.6, 140.3, 159.0, 177.7,
382  196.3, 215.0, 233.7, 252.4, 271.0, 289.7, 317.7, 355.1, 392.4, 429.8,
383  467.1, 504.5, 541.9, 579.2, 616.6, 653.9, 691.3, 728.6, 766.0, 803.3,
384  840.7, 878.0, 915.4, 952.8, 990.1, 1027.5, 1083.5, 1158.2, 1232.9, 1307.6,
385  1382.3, 1457.0, 1531.7, 1606.4, 1681.2, 1755.9, 1830.6, 1905.3, 1980.0, 2054.7,
386  2129.4, 2204.1, 2278.8, 2353.5, 2428.2, 2502.9, 2577.7, 2689.7, 2839.1, 2988.6,
387  3138.0, 3287.4, 3436.8, 3586.2, 3263.0, 3411.3, 3559.6, 3707.9, 3856.2, 4004.5,
388  4152.9, 4301.2, 4449.5, 4597.8, 4746.1, 4894.4, 5042.7, 5191.0, 5339.4, 5487.7,
389  5710.1, 6006.8, 6303.4, 6600.0, 6896.6, 7193.3, 7489.9, 7786.5, 8083.1, 8379.8,
390  8676.4, 8973.0, 9269.6, 9566.3, 9862.9, 10159.5, 10456.2, 10752.8, 11049.4, 11346.0,
391  11791.0, 12384.2, 12977.5, 13570.7, 14164.0, 14757.2, 15350.5, 15943.7, 16537.0, 17130.2,
392  17723.5, 18316.7, 18910.0, 19503.2, 20096.5, 20689.7, 21283.0, 21876.2, 22469.5, 23062.8,
393  23656.0, 24545.9, 25732.4, 26918.9, 28105.4, 29291.9, 30478.4, 31664.9, 29399.4, 30590.1,
394  31780.9, 32971.7, 34162.4, 35353.2, 36544.0, 37734.7, 38925.5, 40116.3, 41307.0, 42497.8,
395  43688.5, 44879.3, 46070.1, 47260.8, 49047.0, 51428.5, 53810.1, 56191.6, 58573.1, 60954.6,
396  63336.2, 65717.7, 68099.2, 70480.8, 72862.3, 75243.8, 77625.4, 80006.9, 82388.4, 84769.9,
397  87151.5, 89533.0, 91914.5, 94296.1, 97868.4, 102631.4, 107394.5, 112157.5, 116920.6, 121683.7,
398  126446.7, 131209.8, 135972.8, 140735.9, 145499.0, 150262.0, 155025.1, 159788.2, 164551.2, 169314.3,
399  174077.3, 178840.4, 183603.5, 188366.5, 193129.6, 200274.2, 209800.3, 219326.4, 228852.5, 238378.7,
400  247904.8, 257430.9, 237822.7, 247326.7, 256830.7, 266334.8, 275838.8, 285342.9, 294846.9, 304351.0,
401  313855.0, 323359.1, 332863.1, 342367.1, 351871.2, 361375.2, 370879.3, 380383.3, 394639.4, 413647.5,
402  432655.6, 451663.6, 470671.7, 489679.8, 508687.9, 527696.0, 546704.1, 565712.2, 584720.3, 603728.3,
403  622736.4, 641744.5, 660752.6, 679760.7, 698768.8, 717776.9, 736785.0, 755793.0, 784305.2, 822321.3,
404  860337.5, 898353.7, 936369.9, 974386.0, 1012402.2, 1050418.4, 1088434.6, 1126450.7, 1164466.9, 1202483.1,
405  1240499.3, 1278515.4, 1316531.6, 1354547.8, 1392564.0, 1430580.1, 1468596.3, 1506612.5, 1544628.7, 1601652.9,
406  1677685.3, 1753717.6, 1829750.0, 1905782.3, 1981814.7, 2057847.0};
407 // for HPD:
408 static const float adc2fC[128] = {
409  -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,
410  12.5, 13.5, 15., 17., 19., 21., 23., 25., 27., 29.5, 32.5, 35.5, 38.5,
411  42., 46., 50., 54.5, 59.5, 64.5, 59.5, 64.5, 69.5, 74.5, 79.5, 84.5, 89.5,
412  94.5, 99.5, 104.5, 109.5, 114.5, 119.5, 124.5, 129.5, 137., 147., 157., 167., 177.,
413  187., 197., 209.5, 224.5, 239.5, 254.5, 272., 292., 312., 334.5, 359.5, 384.5, 359.5,
414  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,
415  709.5, 747., 797., 847., 897., 947., 997., 1047., 1109.5, 1184.5, 1259.5, 1334.5, 1422.,
416  1522., 1622., 1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5, 2234.5, 2359.5, 2484.5, 2609.5, 2734.5,
417  2859.5, 2984.5, 3109.5, 3234.5, 3359.5, 3484.5, 3609.5, 3797., 4047., 4297., 4547., 4797., 5047.,
418  5297., 5609.5, 5984.5, 6359.5, 6734.5, 7172., 7672., 8172., 8734.5, 9359.5, 9984.5};
419 const int nsub = 4;
420 const int ndepth = 7;
421 const int neta = 82;
422 const int nphi = 72;
423 const float bphi = 72.;
424 const int zneta = 22;
425 const int znphi = 18;
426 const int npfit = 220;
427 const float anpfit = 220.; // for SiPM:
428 
429 //
430 class CMTRawAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
431 public:
432  explicit CMTRawAnalyzer(const edm::ParameterSet&);
433  ~CMTRawAnalyzer() override;
434  void beginJob() override;
435  void analyze(const edm::Event&, const edm::EventSetup&) override;
436  void endJob() override;
437  void beginRun(const edm::Run& r, const edm::EventSetup& iSetup) override;
438  void endRun(const edm::Run& r, const edm::EventSetup& iSetup) override;
439  virtual void fillMAP();
440 
441 private:
442  double phi12(double phi1, double en1, double phi2, double en2);
443  double dR(double eta1, double phi1, double eta2, double phi2);
444  double dPhiWsign(double phi1, double phi2);
445 
456 
484  bool useADCfC_;
488  double ratioHBMin_;
489  double ratioHBMax_;
490  double ratioHEMin_;
491  double ratioHEMax_;
492  double ratioHFMin_;
493  double ratioHFMax_;
494  double ratioHOMin_;
495  double ratioHOMax_;
522  //
547 
556 
565 
574 
585  double rmsHBMin_;
586  double rmsHBMax_;
587  double rmsHEMin_;
588  double rmsHEMax_;
589  double rmsHFMin_;
590  double rmsHFMax_;
591  double rmsHOMin_;
592  double rmsHOMax_;
594  double TSpeakHBMin_;
595  double TSpeakHBMax_;
596  double TSpeakHEMin_;
597  double TSpeakHEMax_;
598  double TSpeakHFMin_;
599  double TSpeakHFMax_;
600  double TSpeakHOMin_;
601  double TSpeakHOMax_;
602  double TSmeanHBMin_;
603  double TSmeanHBMax_;
604  double TSmeanHEMin_;
605  double TSmeanHEMax_;
606  double TSmeanHFMin_;
607  double TSmeanHFMax_;
608  double TSmeanHOMin_;
609  double TSmeanHOMax_;
610  int lsmin_;
611  int lsmax_;
662  int nevent;
663  int nevent50;
664  int nnnnnn;
670  int nnnnnn1;
671  int nnnnnn2;
672  int nnnnnn3;
673  int nnnnnn4;
674  int nnnnnn5;
675  int nnnnnn6;
755  TH1F* h_error1;
756  TH1F* h_error2;
757  TH1F* h_error3;
758  TH1F* h_amplError;
759  TH1F* h_amplFine;
761  TH1F* h_error1_HB;
762  TH1F* h_error2_HB;
763  TH1F* h_error3_HB;
764  TH1F* h_error4_HB;
765  TH1F* h_error5_HB;
766  TH1F* h_error6_HB;
767  TH1F* h_error7_HB;
774  TH1F* h_fiber0_HB;
775  TH1F* h_fiber1_HB;
776  TH1F* h_fiber2_HB;
779  TH1F* h_error1_HE;
780  TH1F* h_error2_HE;
781  TH1F* h_error3_HE;
782  TH1F* h_error4_HE;
783  TH1F* h_error5_HE;
784  TH1F* h_error6_HE;
785  TH1F* h_error7_HE;
795  TH1F* h_fiber0_HE;
796  TH1F* h_fiber1_HE;
797  TH1F* h_fiber2_HE;
800  TH1F* h_error1_HF;
801  TH1F* h_error2_HF;
802  TH1F* h_error3_HF;
803  TH1F* h_error4_HF;
804  TH1F* h_error5_HF;
805  TH1F* h_error6_HF;
806  TH1F* h_error7_HF;
813  TH1F* h_fiber0_HF;
814  TH1F* h_fiber1_HF;
815  TH1F* h_fiber2_HF;
818  TH1F* h_error1_HO;
819  TH1F* h_error2_HO;
820  TH1F* h_error3_HO;
821  TH1F* h_error4_HO;
822  TH1F* h_error5_HO;
823  TH1F* h_error6_HO;
824  TH1F* h_error7_HO;
828  TH1F* h_fiber0_HO;
829  TH1F* h_fiber1_HO;
830  TH1F* h_fiber2_HO;
882  TH1F* h_TSmaxA_HB;
900  TH1F* h_Ampl_HB;
939 
956 
979  TH1F* h_TSmaxA_HF;
997  TH1F* h_Ampl_HF;
1031  TH1F* h_Ampl_HO;
1207  TH1F* h_Ampl_HE;
1264  TH2F* h_map_HB;
1281  TH2F* h_map_HE;
1298  TH2F* h_map_HO;
1315  TH2F* h_map_HF;
1781  TH1F* h_gain_HB;
1790  TH1F* h_gain_HE;
1795  TH1F* h_gain_HF;
1800  TH1F* h_gain_HO;
2076  // phy-symmetry, phi-symmetry:
2077  // Reco:
2084  //HB:
2109  //HE:
2152  //HF:
2165 
2178 
2224 
2261  double caliba[ndepth][neta][nphi];
2262  double calibw[ndepth][neta][nphi];
2263  double calib0[ndepth][neta][nphi];
2264  double signal[ndepth][neta][nphi];
2265  double calib3[ndepth][neta][nphi];
2267  double calib2[ndepth][neta][nphi];
2277 
2278  // phi-symmetry monitoring for calibration group:
2284 
2288 
2292 
2293  float TS_data[100];
2294  float TS_cal[100];
2302  long int Nevent;
2303  int Run;
2304  int run0;
2307  long int orbitNum;
2308  int bcn;
2309  int lumi;
2310  int ls0;
2335  double maxxSUM1;
2336  double maxxSUM2;
2337  double maxxSUM3;
2338  double maxxSUM4;
2339  double maxxOCCUP1;
2340  double maxxOCCUP2;
2341  double maxxOCCUP3;
2342  double maxxOCCUP4;
2343  TTree* myTree;
2344  TFile* hOutputFile;
2345  std::ofstream MAPfile;
2347  // Get RBX number from 1-35 for Calibration box
2348  int getRBX(int& i, int& j, int& k);
2352  // upgrade:
2353  void fillDigiErrorsHFQIE10(QIE10DataFrame qie10df);
2354  void fillDigiErrorsQIE11(QIE11DataFrame qie11df);
2358  // upgrade:
2360  void fillDigiAmplitudeQIE11(QIE11DataFrame qie11df);
2363  int numOfTS;
2366  float alsmin;
2367  float blsmax;
2369 };
2370 
2371 //
2373 //
2375  if (verbosity > 0)
2376  std::cout << "============== endJob ===================================" << std::endl;
2377 
2378  std::cout << " --------------------------------------- " << std::endl;
2379  std::cout << " for Run = " << run0 << " with runcounter = " << runcounter << " #ev = " << eventcounter << std::endl;
2380  std::cout << " #LS = " << lscounterrun << " #LS10 = " << lscounterrun10 << " Last LS = " << ls0 << std::endl;
2381  std::cout << " --------------------------------------------- " << std::endl;
2382  h_nls_per_run->Fill(float(lscounterrun));
2383  h_nls_per_run10->Fill(float(lscounterrun10));
2384 
2386  std::cout << "===== full number of events = " << nevent << std::endl;
2387  std::cout << "===== possible max number of events in ntuple(each 50th recorded) = " << nevent50 << std::endl;
2388  std::cout << "===== but limited by maxNeventsInNtuple = " << maxNeventsInNtuple_ << std::endl;
2389  std::cout << "===== full number of events*HBHEdigis and qie11 = " << nnnnnnhbhe << " and " << nnnnnnhbheqie11
2390  << std::endl;
2391  std::cout << "===== full number of events*HBHEdigis = " << nnnnnn << std::endl;
2392  std::cout << "===== full number of events*HFdigis and qie10 = " << counterhf << " and " << counterhfqie10
2393  << std::endl;
2394  std::cout << "===== full number of events*HOdigis = " << counterho << std::endl;
2395 
2396  std::cout << "===== Start writing user histograms =====" << std::endl;
2399 }
2400 //
2401 
2402 //
2403 //
2406  usesResource(TFileService::kSharedResource);
2407  verbosity = iConfig.getUntrackedParameter<int>("Verbosity");
2408  MAPcreation = iConfig.getUntrackedParameter<int>("MapCreation");
2409  recordNtuples_ = iConfig.getUntrackedParameter<bool>("recordNtuples");
2410  maxNeventsInNtuple_ = iConfig.getParameter<int>("maxNeventsInNtuple");
2411  tok_calib_ = consumes<HcalCalibDigiCollection>(iConfig.getParameter<edm::InputTag>("hcalCalibDigiCollectionTag")); //
2412  tok_hbhe_ = consumes<HBHEDigiCollection>(iConfig.getParameter<edm::InputTag>("hbheDigiCollectionTag"));
2413  tok_ho_ = consumes<HODigiCollection>(iConfig.getParameter<edm::InputTag>("hoDigiCollectionTag"));
2414  tok_hf_ = consumes<HFDigiCollection>(iConfig.getParameter<edm::InputTag>("hfDigiCollectionTag")); //
2415  tok_qie11_ = consumes<QIE11DigiCollection>(iConfig.getParameter<edm::InputTag>("hbheQIE11DigiCollectionTag"));
2416  tok_qie10_ = consumes<QIE10DigiCollection>(iConfig.getParameter<edm::InputTag>("hbheQIE10DigiCollectionTag"));
2417  // phi-symmetry monitoring for calibration group:
2418  tok_hbheSignal_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("hbheInputSignalTag"));
2419  tok_hbheNoise_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("hbheInputNoiseTag"));
2420  tok_hfSignal_ = consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("hfInputSignalTag"));
2421  tok_hfNoise_ = consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("hfInputNoiseTag"));
2422  recordHistoes_ = iConfig.getUntrackedParameter<bool>("recordHistoes");
2423  studyRunDependenceHist_ = iConfig.getUntrackedParameter<bool>("studyRunDependenceHist");
2424  studyCapIDErrorsHist_ = iConfig.getUntrackedParameter<bool>("studyCapIDErrorsHist");
2425  studyRMSshapeHist_ = iConfig.getUntrackedParameter<bool>("studyRMSshapeHist");
2426  studyRatioShapeHist_ = iConfig.getUntrackedParameter<bool>("studyRatioShapeHist");
2427  studyTSmaxShapeHist_ = iConfig.getUntrackedParameter<bool>("studyTSmaxShapeHist");
2428  studyTSmeanShapeHist_ = iConfig.getUntrackedParameter<bool>("studyTSmeanShapeHist");
2429  studyDiffAmplHist_ = iConfig.getUntrackedParameter<bool>("studyDiffAmplHist");
2430  studyCalibCellsHist_ = iConfig.getUntrackedParameter<bool>("studyCalibCellsHist");
2431  studyADCAmplHist_ = iConfig.getUntrackedParameter<bool>("studyADCAmplHist");
2432  studyPedestalsHist_ = iConfig.getUntrackedParameter<bool>("studyPedestalsHist");
2433  studyPedestalCorrelations_ = iConfig.getUntrackedParameter<bool>("studyPedestalCorrelations");
2434  useADCmassive_ = iConfig.getUntrackedParameter<bool>("useADCmassive");
2435  useADCfC_ = iConfig.getUntrackedParameter<bool>("useADCfC");
2436  useADCcounts_ = iConfig.getUntrackedParameter<bool>("useADCcounts");
2437  usePedestalSubtraction_ = iConfig.getUntrackedParameter<bool>("usePedestalSubtraction");
2438  usecontinuousnumbering_ = iConfig.getUntrackedParameter<bool>("usecontinuousnumbering");
2439  flagLaserRaddam_ = iConfig.getParameter<int>("flagLaserRaddam");
2440  flagToUseDigiCollectionsORNot_ = iConfig.getParameter<int>("flagToUseDigiCollectionsORNot");
2441  flagIterativeMethodCalibrationGroupDigi_ = iConfig.getParameter<int>("flagIterativeMethodCalibrationGroupDigi");
2442  flagIterativeMethodCalibrationGroupReco_ = iConfig.getParameter<int>("flagIterativeMethodCalibrationGroupReco");
2443  flagfitshunt1pedorledlowintensity_ = iConfig.getParameter<int>("flagfitshunt1pedorledlowintensity");
2444  flagabortgaprejected_ = iConfig.getParameter<int>("flagabortgaprejected");
2445  bcnrejectedlow_ = iConfig.getParameter<int>("bcnrejectedlow");
2446  bcnrejectedhigh_ = iConfig.getParameter<int>("bcnrejectedhigh");
2447  ratioHBMin_ = iConfig.getParameter<double>("ratioHBMin");
2448  ratioHBMax_ = iConfig.getParameter<double>("ratioHBMax");
2449  ratioHEMin_ = iConfig.getParameter<double>("ratioHEMin");
2450  ratioHEMax_ = iConfig.getParameter<double>("ratioHEMax");
2451  ratioHFMin_ = iConfig.getParameter<double>("ratioHFMin");
2452  ratioHFMax_ = iConfig.getParameter<double>("ratioHFMax");
2453  ratioHOMin_ = iConfig.getParameter<double>("ratioHOMin");
2454  ratioHOMax_ = iConfig.getParameter<double>("ratioHOMax");
2455  flagtodefinebadchannel_ = iConfig.getParameter<int>("flagtodefinebadchannel");
2456  howmanybinsonplots_ = iConfig.getParameter<int>("howmanybinsonplots");
2457  splashesUpperLimit_ = iConfig.getParameter<int>("splashesUpperLimit");
2458  flagtoaskrunsorls_ = iConfig.getParameter<int>("flagtoaskrunsorls");
2459  flagestimatornormalization_ = iConfig.getParameter<int>("flagestimatornormalization");
2460  flagcpuoptimization_ = iConfig.getParameter<int>("flagcpuoptimization");
2461  flagupgradeqie1011_ = iConfig.getParameter<int>("flagupgradeqie1011");
2462  flagsipmcorrection_ = iConfig.getParameter<int>("flagsipmcorrection");
2463  flaguseshunt_ = iConfig.getParameter<int>("flaguseshunt");
2464  lsdep_cut1_peak_HBdepth1_ = iConfig.getParameter<int>("lsdep_cut1_peak_HBdepth1");
2465  lsdep_cut1_peak_HBdepth2_ = iConfig.getParameter<int>("lsdep_cut1_peak_HBdepth2");
2466  lsdep_cut1_peak_HEdepth1_ = iConfig.getParameter<int>("lsdep_cut1_peak_HEdepth1");
2467  lsdep_cut1_peak_HEdepth2_ = iConfig.getParameter<int>("lsdep_cut1_peak_HEdepth2");
2468  lsdep_cut1_peak_HEdepth3_ = iConfig.getParameter<int>("lsdep_cut1_peak_HEdepth3");
2469  lsdep_cut1_peak_HFdepth1_ = iConfig.getParameter<int>("lsdep_cut1_peak_HFdepth1");
2470  lsdep_cut1_peak_HFdepth2_ = iConfig.getParameter<int>("lsdep_cut1_peak_HFdepth2");
2471  lsdep_cut1_peak_HOdepth4_ = iConfig.getParameter<int>("lsdep_cut1_peak_HOdepth4");
2472  lsdep_cut3_max_HBdepth1_ = iConfig.getParameter<int>("lsdep_cut3_max_HBdepth1");
2473  lsdep_cut3_max_HBdepth2_ = iConfig.getParameter<int>("lsdep_cut3_max_HBdepth2");
2474  lsdep_cut3_max_HEdepth1_ = iConfig.getParameter<int>("lsdep_cut3_max_HEdepth1");
2475  lsdep_cut3_max_HEdepth2_ = iConfig.getParameter<int>("lsdep_cut3_max_HEdepth2");
2476  lsdep_cut3_max_HEdepth3_ = iConfig.getParameter<int>("lsdep_cut3_max_HEdepth3");
2477  lsdep_cut3_max_HFdepth1_ = iConfig.getParameter<int>("lsdep_cut3_max_HFdepth1");
2478  lsdep_cut3_max_HFdepth2_ = iConfig.getParameter<int>("lsdep_cut3_max_HFdepth2");
2479  lsdep_cut3_max_HOdepth4_ = iConfig.getParameter<int>("lsdep_cut3_max_HOdepth4");
2480  lsdep_estimator1_HBdepth1_ = iConfig.getParameter<double>("lsdep_estimator1_HBdepth1");
2481  lsdep_estimator1_HBdepth2_ = iConfig.getParameter<double>("lsdep_estimator1_HBdepth2");
2482  lsdep_estimator1_HEdepth1_ = iConfig.getParameter<double>("lsdep_estimator1_HEdepth1");
2483  lsdep_estimator1_HEdepth2_ = iConfig.getParameter<double>("lsdep_estimator1_HEdepth2");
2484  lsdep_estimator1_HEdepth3_ = iConfig.getParameter<double>("lsdep_estimator1_HEdepth3");
2485  lsdep_estimator1_HFdepth1_ = iConfig.getParameter<double>("lsdep_estimator1_HFdepth1");
2486  lsdep_estimator1_HFdepth2_ = iConfig.getParameter<double>("lsdep_estimator1_HFdepth2");
2487  lsdep_estimator1_HOdepth4_ = iConfig.getParameter<double>("lsdep_estimator1_HOdepth4");
2488  lsdep_estimator1_HEdepth4_ = iConfig.getParameter<double>("lsdep_estimator1_HEdepth4");
2489  lsdep_estimator1_HEdepth5_ = iConfig.getParameter<double>("lsdep_estimator1_HEdepth5");
2490  lsdep_estimator1_HEdepth6_ = iConfig.getParameter<double>("lsdep_estimator1_HEdepth6");
2491  lsdep_estimator1_HEdepth7_ = iConfig.getParameter<double>("lsdep_estimator1_HEdepth7");
2492  lsdep_estimator1_HFdepth3_ = iConfig.getParameter<double>("lsdep_estimator1_HFdepth3");
2493  lsdep_estimator1_HFdepth4_ = iConfig.getParameter<double>("lsdep_estimator1_HFdepth4");
2494  lsdep_estimator1_HBdepth3_ = iConfig.getParameter<double>("lsdep_estimator1_HBdepth3");
2495  lsdep_estimator1_HBdepth4_ = iConfig.getParameter<double>("lsdep_estimator1_HBdepth4");
2496  lsdep_estimator2_HBdepth1_ = iConfig.getParameter<double>("lsdep_estimator2_HBdepth1");
2497  lsdep_estimator2_HBdepth2_ = iConfig.getParameter<double>("lsdep_estimator2_HBdepth2");
2498  lsdep_estimator2_HEdepth1_ = iConfig.getParameter<double>("lsdep_estimator2_HEdepth1");
2499  lsdep_estimator2_HEdepth2_ = iConfig.getParameter<double>("lsdep_estimator2_HEdepth2");
2500  lsdep_estimator2_HEdepth3_ = iConfig.getParameter<double>("lsdep_estimator2_HEdepth3");
2501  lsdep_estimator2_HFdepth1_ = iConfig.getParameter<double>("lsdep_estimator2_HFdepth1");
2502  lsdep_estimator2_HFdepth2_ = iConfig.getParameter<double>("lsdep_estimator2_HFdepth2");
2503  lsdep_estimator2_HOdepth4_ = iConfig.getParameter<double>("lsdep_estimator2_HOdepth4");
2504  lsdep_estimator3_HBdepth1_ = iConfig.getParameter<double>("lsdep_estimator3_HBdepth1");
2505  lsdep_estimator3_HBdepth2_ = iConfig.getParameter<double>("lsdep_estimator3_HBdepth2");
2506  lsdep_estimator3_HEdepth1_ = iConfig.getParameter<double>("lsdep_estimator3_HEdepth1");
2507  lsdep_estimator3_HEdepth2_ = iConfig.getParameter<double>("lsdep_estimator3_HEdepth2");
2508  lsdep_estimator3_HEdepth3_ = iConfig.getParameter<double>("lsdep_estimator3_HEdepth3");
2509  lsdep_estimator3_HFdepth1_ = iConfig.getParameter<double>("lsdep_estimator3_HFdepth1");
2510  lsdep_estimator3_HFdepth2_ = iConfig.getParameter<double>("lsdep_estimator3_HFdepth2");
2511  lsdep_estimator3_HOdepth4_ = iConfig.getParameter<double>("lsdep_estimator3_HOdepth4");
2512  lsdep_estimator4_HBdepth1_ = iConfig.getParameter<double>("lsdep_estimator4_HBdepth1");
2513  lsdep_estimator4_HBdepth2_ = iConfig.getParameter<double>("lsdep_estimator4_HBdepth2");
2514  lsdep_estimator4_HEdepth1_ = iConfig.getParameter<double>("lsdep_estimator4_HEdepth1");
2515  lsdep_estimator4_HEdepth2_ = iConfig.getParameter<double>("lsdep_estimator4_HEdepth2");
2516  lsdep_estimator4_HEdepth3_ = iConfig.getParameter<double>("lsdep_estimator4_HEdepth3");
2517  lsdep_estimator4_HFdepth1_ = iConfig.getParameter<double>("lsdep_estimator4_HFdepth1");
2518  lsdep_estimator4_HFdepth2_ = iConfig.getParameter<double>("lsdep_estimator4_HFdepth2");
2519  lsdep_estimator4_HOdepth4_ = iConfig.getParameter<double>("lsdep_estimator4_HOdepth4");
2520  lsdep_estimator5_HBdepth1_ = iConfig.getParameter<double>("lsdep_estimator5_HBdepth1");
2521  lsdep_estimator5_HBdepth2_ = iConfig.getParameter<double>("lsdep_estimator5_HBdepth2");
2522  lsdep_estimator5_HEdepth1_ = iConfig.getParameter<double>("lsdep_estimator5_HEdepth1");
2523  lsdep_estimator5_HEdepth2_ = iConfig.getParameter<double>("lsdep_estimator5_HEdepth2");
2524  lsdep_estimator5_HEdepth3_ = iConfig.getParameter<double>("lsdep_estimator5_HEdepth3");
2525  lsdep_estimator5_HFdepth1_ = iConfig.getParameter<double>("lsdep_estimator5_HFdepth1");
2526  lsdep_estimator5_HFdepth2_ = iConfig.getParameter<double>("lsdep_estimator5_HFdepth2");
2527  lsdep_estimator5_HOdepth4_ = iConfig.getParameter<double>("lsdep_estimator5_HOdepth4");
2528  forallestimators_amplitude_bigger_ = iConfig.getParameter<double>("forallestimators_amplitude_bigger");
2529  rmsHBMin_ = iConfig.getParameter<double>("rmsHBMin");
2530  rmsHBMax_ = iConfig.getParameter<double>("rmsHBMax");
2531  rmsHEMin_ = iConfig.getParameter<double>("rmsHEMin");
2532  rmsHEMax_ = iConfig.getParameter<double>("rmsHEMax");
2533  rmsHFMin_ = iConfig.getParameter<double>("rmsHFMin");
2534  rmsHFMax_ = iConfig.getParameter<double>("rmsHFMax");
2535  rmsHOMin_ = iConfig.getParameter<double>("rmsHOMin");
2536  rmsHOMax_ = iConfig.getParameter<double>("rmsHOMax");
2537  ADCAmplHBMin_ = iConfig.getParameter<double>("ADCAmplHBMin");
2538  ADCAmplHEMin_ = iConfig.getParameter<double>("ADCAmplHEMin");
2539  ADCAmplHOMin_ = iConfig.getParameter<double>("ADCAmplHOMin");
2540  ADCAmplHFMin_ = iConfig.getParameter<double>("ADCAmplHFMin");
2541  ADCAmplHBMax_ = iConfig.getParameter<double>("ADCAmplHBMax");
2542  ADCAmplHEMax_ = iConfig.getParameter<double>("ADCAmplHEMax");
2543  ADCAmplHOMax_ = iConfig.getParameter<double>("ADCAmplHOMax");
2544  ADCAmplHFMax_ = iConfig.getParameter<double>("ADCAmplHFMax");
2545  pedestalwHBMax_ = iConfig.getParameter<double>("pedestalwHBMax");
2546  pedestalwHEMax_ = iConfig.getParameter<double>("pedestalwHEMax");
2547  pedestalwHFMax_ = iConfig.getParameter<double>("pedestalwHFMax");
2548  pedestalwHOMax_ = iConfig.getParameter<double>("pedestalwHOMax");
2549  pedestalHBMax_ = iConfig.getParameter<double>("pedestalHBMax");
2550  pedestalHEMax_ = iConfig.getParameter<double>("pedestalHEMax");
2551  pedestalHFMax_ = iConfig.getParameter<double>("pedestalHFMax");
2552  pedestalHOMax_ = iConfig.getParameter<double>("pedestalHOMax");
2553  calibrADCHBMin_ = iConfig.getParameter<double>("calibrADCHBMin");
2554  calibrADCHEMin_ = iConfig.getParameter<double>("calibrADCHEMin");
2555  calibrADCHOMin_ = iConfig.getParameter<double>("calibrADCHOMin");
2556  calibrADCHFMin_ = iConfig.getParameter<double>("calibrADCHFMin");
2557  calibrADCHBMax_ = iConfig.getParameter<double>("calibrADCHBMax");
2558  calibrADCHEMax_ = iConfig.getParameter<double>("calibrADCHEMax");
2559  calibrADCHOMax_ = iConfig.getParameter<double>("calibrADCHOMax");
2560  calibrADCHFMax_ = iConfig.getParameter<double>("calibrADCHFMax");
2561  calibrRatioHBMin_ = iConfig.getParameter<double>("calibrRatioHBMin");
2562  calibrRatioHEMin_ = iConfig.getParameter<double>("calibrRatioHEMin");
2563  calibrRatioHOMin_ = iConfig.getParameter<double>("calibrRatioHOMin");
2564  calibrRatioHFMin_ = iConfig.getParameter<double>("calibrRatioHFMin");
2565  calibrRatioHBMax_ = iConfig.getParameter<double>("calibrRatioHBMax");
2566  calibrRatioHEMax_ = iConfig.getParameter<double>("calibrRatioHEMax");
2567  calibrRatioHOMax_ = iConfig.getParameter<double>("calibrRatioHOMax");
2568  calibrRatioHFMax_ = iConfig.getParameter<double>("calibrRatioHFMax");
2569  calibrTSmaxHBMin_ = iConfig.getParameter<double>("calibrTSmaxHBMin");
2570  calibrTSmaxHEMin_ = iConfig.getParameter<double>("calibrTSmaxHEMin");
2571  calibrTSmaxHOMin_ = iConfig.getParameter<double>("calibrTSmaxHOMin");
2572  calibrTSmaxHFMin_ = iConfig.getParameter<double>("calibrTSmaxHFMin");
2573  calibrTSmaxHBMax_ = iConfig.getParameter<double>("calibrTSmaxHBMax");
2574  calibrTSmaxHEMax_ = iConfig.getParameter<double>("calibrTSmaxHEMax");
2575  calibrTSmaxHOMax_ = iConfig.getParameter<double>("calibrTSmaxHOMax");
2576  calibrTSmaxHFMax_ = iConfig.getParameter<double>("calibrTSmaxHFMax");
2577  calibrTSmeanHBMin_ = iConfig.getParameter<double>("calibrTSmeanHBMin");
2578  calibrTSmeanHEMin_ = iConfig.getParameter<double>("calibrTSmeanHEMin");
2579  calibrTSmeanHOMin_ = iConfig.getParameter<double>("calibrTSmeanHOMin");
2580  calibrTSmeanHFMin_ = iConfig.getParameter<double>("calibrTSmeanHFMin");
2581  calibrTSmeanHBMax_ = iConfig.getParameter<double>("calibrTSmeanHBMax");
2582  calibrTSmeanHEMax_ = iConfig.getParameter<double>("calibrTSmeanHEMax");
2583  calibrTSmeanHOMax_ = iConfig.getParameter<double>("calibrTSmeanHOMax");
2584  calibrTSmeanHFMax_ = iConfig.getParameter<double>("calibrTSmeanHFMax");
2585  calibrWidthHBMin_ = iConfig.getParameter<double>("calibrWidthHBMin");
2586  calibrWidthHEMin_ = iConfig.getParameter<double>("calibrWidthHEMin");
2587  calibrWidthHOMin_ = iConfig.getParameter<double>("calibrWidthHOMin");
2588  calibrWidthHFMin_ = iConfig.getParameter<double>("calibrWidthHFMin");
2589  calibrWidthHBMax_ = iConfig.getParameter<double>("calibrWidthHBMax");
2590  calibrWidthHEMax_ = iConfig.getParameter<double>("calibrWidthHEMax");
2591  calibrWidthHOMax_ = iConfig.getParameter<double>("calibrWidthHOMax");
2592  calibrWidthHFMax_ = iConfig.getParameter<double>("calibrWidthHFMax");
2593  TSpeakHBMin_ = iConfig.getParameter<double>("TSpeakHBMin");
2594  TSpeakHBMax_ = iConfig.getParameter<double>("TSpeakHBMax");
2595  TSpeakHEMin_ = iConfig.getParameter<double>("TSpeakHEMin");
2596  TSpeakHEMax_ = iConfig.getParameter<double>("TSpeakHEMax");
2597  TSpeakHFMin_ = iConfig.getParameter<double>("TSpeakHFMin");
2598  TSpeakHFMax_ = iConfig.getParameter<double>("TSpeakHFMax");
2599  TSpeakHOMin_ = iConfig.getParameter<double>("TSpeakHOMin");
2600  TSpeakHOMax_ = iConfig.getParameter<double>("TSpeakHOMax");
2601  TSmeanHBMin_ = iConfig.getParameter<double>("TSmeanHBMin");
2602  TSmeanHBMax_ = iConfig.getParameter<double>("TSmeanHBMax");
2603  TSmeanHEMin_ = iConfig.getParameter<double>("TSmeanHEMin");
2604  TSmeanHEMax_ = iConfig.getParameter<double>("TSmeanHEMax");
2605  TSmeanHFMin_ = iConfig.getParameter<double>("TSmeanHFMin");
2606  TSmeanHFMax_ = iConfig.getParameter<double>("TSmeanHFMax");
2607  TSmeanHOMin_ = iConfig.getParameter<double>("TSmeanHOMin");
2608  TSmeanHOMax_ = iConfig.getParameter<double>("TSmeanHOMax");
2609  lsmin_ = iConfig.getParameter<int>("lsmin");
2610  lsmax_ = iConfig.getParameter<int>("lsmax");
2611  alsmin = lsmin_;
2612  blsmax = lsmax_;
2613  nlsminmax = lsmax_ - lsmin_ + 1;
2614  numOfLaserEv = 0;
2615  local_event = 0;
2616  numOfTS = 10;
2617  run0 = -1;
2618  runcounter = 0;
2619  eventcounter = 0;
2620  lumi = 0;
2621  ls0 = -1;
2622  lscounter = 0;
2623  lscounterM1 = 0;
2624  lscounter10 = 0;
2625  nevcounter = 0;
2626  lscounterrun = 0;
2627  lscounterrun10 = 0;
2628  nevcounter0 = 0;
2629  nevcounter00 = 0;
2630  for (int k0 = 0; k0 < nsub; k0++) {
2631  for (int k1 = 0; k1 < ndepth; k1++) {
2632  for (int k2 = 0; k2 < neta; k2++) {
2633  if (k0 == 1) {
2634  mapRADDAM_HED2[k1][k2] = 0.;
2635  mapRADDAM_HED20[k1][k2] = 0.;
2636  }
2637  for (int k3 = 0; k3 < nphi; k3++) {
2638  sumEstimator0[k0][k1][k2][k3] = 0.;
2639  sumEstimator1[k0][k1][k2][k3] = 0.;
2640  sumEstimator2[k0][k1][k2][k3] = 0.;
2641  sumEstimator3[k0][k1][k2][k3] = 0.;
2642  sumEstimator4[k0][k1][k2][k3] = 0.;
2643  sumEstimator5[k0][k1][k2][k3] = 0.;
2644  sumEstimator6[k0][k1][k2][k3] = 0.;
2645  sum0Estimator[k0][k1][k2][k3] = 0.;
2646  if (k0 == 1) {
2647  mapRADDAM_HE[k1][k2][k3] = 0.;
2648  mapRADDAM0_HE[k1][k2][k3] = 0;
2649  }
2650  }
2651  }
2652  }
2653  }
2670  maxxSUM1 = 0.;
2671  maxxSUM2 = 0.;
2672  maxxSUM3 = 0.;
2673  maxxSUM4 = 0.;
2674  maxxOCCUP1 = 0.;
2675  maxxOCCUP2 = 0.;
2676  maxxOCCUP3 = 0.;
2677  maxxOCCUP4 = 0.;
2678  testmetka = 0;
2679 }
2682  conditions = &iSetup.getData(tokDB_);
2683  topo = &iSetup.getData(tokTopo_);
2684  if (MAPcreation > 0) {
2685  if (flagupgradeqie1011_ == 1)
2686  fillMAP();
2687  MAPcreation = 0;
2688  }
2689  nevent++;
2690  nevent50 = nevent / 50;
2691  Run = iEvent.id().run();
2692  Nevent = iEvent.id().event(); // event number = global_event
2693  lumi = iEvent.luminosityBlock(); // lumi section
2694  bcn = iEvent.bunchCrossing();
2695  orbitNum = iEvent.orbitNumber();
2696  int outabortgap = 1;
2697  if (bcn >= bcnrejectedlow_ && bcn <= bcnrejectedhigh_)
2698  outabortgap = 0; // if(bcn>=3446 && bcn<=3564)
2699 
2700  if ((flagabortgaprejected_ == 1 && outabortgap == 1) || (flagabortgaprejected_ == 0 && outabortgap == 0) ||
2701  flagabortgaprejected_ == 2) {
2702  if (run0 != Run) {
2703  ++runcounter;
2704  if (runcounter != 1) {
2706  std::cout << " --------------------------------------- " << std::endl;
2707  std::cout << " for Run = " << run0 << " with runcounter = " << runcounter - 1 << " #ev = " << eventcounter
2708  << std::endl;
2709  std::cout << " #LS = " << lscounterrun << " #LS10 = " << lscounterrun10 << " Last LS = " << ls0 << std::endl;
2710  std::cout << " --------------------------------------------- " << std::endl;
2711  h_nls_per_run->Fill(float(lscounterrun));
2712  h_nls_per_run10->Fill(float(lscounterrun10));
2713  lscounterrun = 0;
2714  lscounterrun10 = 0;
2715  } // runcounter > 1
2716  std::cout << " ---------***********************------------- " << std::endl;
2717  std::cout << " New Run = " << Run << " runcounter = " << runcounter << std::endl;
2718  std::cout << " ------- " << std::endl;
2719  run0 = Run;
2720  eventcounter = 0;
2721  ls0 = -1;
2722  } // new run
2723  else {
2724  nevcounter00 = 0;
2725  } //else new run
2726  ++eventcounter;
2727  if (ls0 != lumi) {
2728  if (ls0 != -1) {
2729  h_nevents_per_eachLS->Fill(float(lscounter), float(nevcounter)); //
2731  } // ls0>-1
2732  lscounter++;
2733  lscounterrun++;
2735  lscounterM1 = lscounter - 1;
2736  } else {
2737  lscounterM1 = ls0;
2738  }
2739  if (ls0 != -1)
2740  h_nevents_per_eachRealLS->Fill(float(lscounterM1), float(nevcounter)); //
2741  h_lsnumber_per_eachLS->Fill(float(lscounter), float(lumi));
2742  if (nevcounter > 10.) {
2743  ++lscounter10;
2744  ++lscounterrun10;
2745  }
2746  h_nevents_per_LS->Fill(float(nevcounter));
2747  h_nevents_per_LSzoom->Fill(float(nevcounter));
2748  nevcounter = 0;
2749  ls0 = lumi;
2750  } // new lumi
2751  else {
2752  nevcounter0 = 0;
2753  } //else new lumi
2754  ++nevcounter; // #ev in LS
2756  if (flagtoaskrunsorls_ == 0) {
2759  }
2760  if (nevcounter0 != 0 || nevcounter > 99999) {
2761  if (nevcounter > 99999)
2762  nevcounter0 = 1;
2766  unsigned long int pcountall1 = 0;
2767  unsigned long int pcountall3 = 0;
2768  unsigned long int pcountall6 = 0;
2769  unsigned long int pcountall8 = 0;
2770  int pcountmin1 = 0;
2771  int pcountmin3 = 0;
2772  int pcountmin6 = 0;
2773  int pcountmin8 = 0;
2774  unsigned long int mcountall1 = 0;
2775  unsigned long int mcountall3 = 0;
2776  unsigned long int mcountall6 = 0;
2777  unsigned long int mcountall8 = 0;
2778  int mcountmin1 = 0;
2779  int mcountmin3 = 0;
2780  int mcountmin6 = 0;
2781  int mcountmin8 = 0;
2782  int pnnbins1 = 0;
2783  int pnnbins3 = 0;
2784  int pnnbins6 = 0;
2785  int pnnbins8 = 0;
2786  int pnnmin1 = 999999999;
2787  int pnnmin3 = 999999999;
2788  int pnnmin6 = 999999999;
2789  int pnnmin8 = 999999999;
2790  int mnnbins1 = 0;
2791  int mnnbins3 = 0;
2792  int mnnbins6 = 0;
2793  int mnnbins8 = 0;
2794  int mnnmin1 = 999999999;
2795  int mnnmin3 = 999999999;
2796  int mnnmin6 = 999999999;
2797  int mnnmin8 = 999999999;
2798  for (int k0 = 0; k0 < nsub; k0++) {
2799  for (int k1 = 0; k1 < ndepth; k1++) {
2800  for (int k3 = 0; k3 < nphi; k3++) {
2801  for (int k2 = 0; k2 < neta; k2++) {
2802  int ieta = k2 - 41;
2803  // ------------------------------------------------------------sumEstimator0
2804  if (sumEstimator0[k0][k1][k2][k3] != 0.) {
2805  // fill histoes:
2806  double bbbc = 0.;
2807  if (flagestimatornormalization_ == 0)
2808  bbbc = sumEstimator0[k0][k1][k2][k3] / nevcounter0;
2809  if (flagestimatornormalization_ == 1)
2810  bbbc = sumEstimator0[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
2811  double bbb1 = 1.;
2812  if (flagestimatornormalization_ == 2) {
2813  bbbc = sumEstimator0[k0][k1][k2][k3];
2814  bbb1 = sum0Estimator[k0][k1][k2][k3];
2815  }
2816 
2817  // HB:
2818  if (k0 == 0) {
2819  // HBdepth1
2820  if (k1 + 1 == 1) {
2821  h_sumPedestalLS1->Fill(bbbc / bbb1);
2822  h_2DsumPedestalLS1->Fill(double(ieta), double(k3), bbbc);
2823  h_2D0sumPedestalLS1->Fill(double(ieta), double(k3), bbb1);
2824  h_sumPedestalperLS1->Fill(float(lscounterM1), bbbc);
2825  h_sum0PedestalperLS1->Fill(float(lscounterM1), bbb1);
2826  }
2827  if (k1 + 1 == 2) {
2828  h_sumPedestalLS2->Fill(bbbc / bbb1);
2829  h_2DsumPedestalLS2->Fill(double(ieta), double(k3), bbbc);
2830  h_2D0sumPedestalLS2->Fill(double(ieta), double(k3), bbb1);
2831  h_sumPedestalperLS2->Fill(float(lscounterM1), bbbc);
2832  h_sum0PedestalperLS2->Fill(float(lscounterM1), bbb1);
2833  }
2834  }
2835  // HE:
2836  if (k0 == 1) {
2837  // HEdepth1
2838  if (k1 + 1 == 1) {
2839  h_sumPedestalLS3->Fill(bbbc / bbb1);
2840  h_2DsumPedestalLS3->Fill(double(ieta), double(k3), bbbc);
2841  h_2D0sumPedestalLS3->Fill(double(ieta), double(k3), bbb1);
2842  h_sumPedestalperLS3->Fill(float(lscounterM1), bbbc);
2843  h_sum0PedestalperLS3->Fill(float(lscounterM1), bbb1);
2844  }
2845  if (k1 + 1 == 2) {
2846  h_sumPedestalLS4->Fill(bbbc / bbb1);
2847  h_2DsumPedestalLS4->Fill(double(ieta), double(k3), bbbc);
2848  h_2D0sumPedestalLS4->Fill(double(ieta), double(k3), bbb1);
2849  h_sumPedestalperLS4->Fill(float(lscounterM1), bbbc);
2850  h_sum0PedestalperLS4->Fill(float(lscounterM1), bbb1);
2851  }
2852  if (k1 + 1 == 3) {
2853  h_sumPedestalLS5->Fill(bbbc / bbb1);
2854  h_2DsumPedestalLS5->Fill(double(ieta), double(k3), bbbc);
2855  h_2D0sumPedestalLS5->Fill(double(ieta), double(k3), bbb1);
2856  h_sumPedestalperLS5->Fill(float(lscounterM1), bbbc);
2857  h_sum0PedestalperLS5->Fill(float(lscounterM1), bbb1);
2858  }
2859  }
2860  // HF:
2861  if (k0 == 3) {
2862  // HFdepth1
2863  if (k1 + 1 == 1) {
2864  h_sumPedestalLS6->Fill(bbbc / bbb1);
2865  h_2DsumPedestalLS6->Fill(double(ieta), double(k3), bbbc);
2866  h_2D0sumPedestalLS6->Fill(double(ieta), double(k3), bbb1);
2867  h_sumPedestalperLS6->Fill(float(lscounterM1), bbbc);
2868  h_sum0PedestalperLS6->Fill(float(lscounterM1), bbb1);
2869  }
2870  if (k1 + 1 == 2) {
2871  h_sumPedestalLS7->Fill(bbbc / bbb1);
2872  h_2DsumPedestalLS7->Fill(double(ieta), double(k3), bbbc);
2873  h_2D0sumPedestalLS7->Fill(double(ieta), double(k3), bbb1);
2874  h_sumPedestalperLS7->Fill(float(lscounterM1), bbbc);
2875  h_sum0PedestalperLS7->Fill(float(lscounterM1), bbb1);
2876  }
2877  }
2878  // HO:
2879  if (k0 == 2) {
2880  // HOdepth4
2881  if (k1 + 1 == 4) {
2882  h_sumPedestalLS8->Fill(bbbc / bbb1);
2883  h_2DsumPedestalLS8->Fill(double(ieta), double(k3), bbbc);
2884  h_2D0sumPedestalLS8->Fill(double(ieta), double(k3), bbb1);
2885  h_sumPedestalperLS8->Fill(float(lscounterM1), bbbc);
2886  h_sum0PedestalperLS8->Fill(float(lscounterM1), bbb1);
2887  }
2888  }
2889  } //if(sumEstimator0[k0][k1][k2][k3] != 0.
2890 
2891  // ------------------------------------------------------------------------------------- sumEstimator1
2892  if (sumEstimator1[k0][k1][k2][k3] != 0.) {
2893  // fill histoes:
2894  double bbbc = 0.;
2895  if (flagestimatornormalization_ == 0)
2896  bbbc = sumEstimator1[k0][k1][k2][k3] / nevcounter0;
2897  if (flagestimatornormalization_ == 1)
2898  bbbc = sumEstimator1[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
2899  double bbb1 = 1.;
2900  if (flagestimatornormalization_ == 2) {
2901  bbbc = sumEstimator1[k0][k1][k2][k3];
2902  bbb1 = sum0Estimator[k0][k1][k2][k3];
2903  }
2904  //flag for ask type of Normalization for CMT estimators:
2905  //=0-normalizationOn#evOfLS; =1-averagedMeanChannelVariable; =2-averageVariable-normalizationOn#entriesInLS;
2906  //flagestimatornormalization = cms.int32(2), !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2907  // zhokin 18.10.2018 STUDY: CALL HFF2 (ID,NID,X,Y,W)
2908  if (lscounterM1 >= lsmin_ && lscounterM1 < lsmax_) {
2909  // INDEXIES:
2910  int kkkk2 = (k2 - 1) / 4;
2911  if (k2 == 0)
2912  kkkk2 = 1.;
2913  else
2914  kkkk2 += 2; //kkkk2= 1-22
2915  int kkkk3 = (k3) / 4 + 1; //kkkk3= 1-18
2916  // PACKING
2917  //kkkk2= 1-22 ;kkkk3= 1-18
2918  int ietaphi = 0;
2919  ietaphi = ((kkkk2)-1) * znphi + (kkkk3);
2920  // Outout is ietaphi = 1 - 396 ( # =396; in histo,booking is: 1 - 397 )
2921 
2922  double bbb3 = 0.;
2923  if (bbb1 != 0.)
2924  bbb3 = bbbc / bbb1;
2925  // very very wrong if below:
2926  // if(bbb3 != 0.) {
2927 
2928  if (k0 == 0) {
2929  h_2DsumADCAmplEtaPhiLs0->Fill(float(lscounterM1), float(ietaphi), bbbc); //HB
2930  h_2DsumADCAmplEtaPhiLs00->Fill(float(lscounterM1), float(ietaphi), bbb1); //HB
2931  }
2932  if (k0 == 1) {
2933  h_2DsumADCAmplEtaPhiLs1->Fill(float(lscounterM1), float(ietaphi), bbbc); //HE
2934  h_2DsumADCAmplEtaPhiLs10->Fill(float(lscounterM1), float(ietaphi), bbb1); //HE
2935  }
2936  if (k0 == 2) {
2937  h_2DsumADCAmplEtaPhiLs2->Fill(float(lscounterM1), float(ietaphi), bbbc); //HO
2938  h_2DsumADCAmplEtaPhiLs20->Fill(float(lscounterM1), float(ietaphi), bbb1); //HO
2939  }
2940  if (k0 == 3) {
2941  h_2DsumADCAmplEtaPhiLs3->Fill(float(lscounterM1), float(ietaphi), bbbc); //HF
2942  h_2DsumADCAmplEtaPhiLs30->Fill(float(lscounterM1), float(ietaphi), bbb1); //HF
2943  }
2944 
2945  h_sumADCAmplEtaPhiLs->Fill(bbb3);
2946  h_sumADCAmplEtaPhiLs_bbbc->Fill(bbbc);
2947  h_sumADCAmplEtaPhiLs_bbb1->Fill(bbb1);
2949  h_sumADCAmplEtaPhiLs_orbitNum->Fill(float(orbitNum), 1.);
2951  h_sumADCAmplEtaPhiLs_ietaphi->Fill(float(ietaphi));
2952 
2953  // }// bb3
2954  } // lscounterM1 >= lsmin_ && lscounterM1 < lsmax_
2955 
2956  // HB:
2957  if (k0 == 0) {
2958  // HBdepth1
2959  if (k1 + 1 == 1) {
2960  h_sumADCAmplLS1copy1->Fill(bbbc / bbb1);
2961  h_sumADCAmplLS1copy2->Fill(bbbc / bbb1);
2962  h_sumADCAmplLS1copy3->Fill(bbbc / bbb1);
2963  h_sumADCAmplLS1copy4->Fill(bbbc / bbb1);
2964  h_sumADCAmplLS1copy5->Fill(bbbc / bbb1);
2965  h_sumADCAmplLS1->Fill(bbbc / bbb1);
2966  if (bbbc / bbb1 > lsdep_estimator1_HBdepth1_)
2967  h_2DsumADCAmplLS1->Fill(double(ieta), double(k3), bbbc);
2968  if (bbbc / bbb1 > 2. * lsdep_estimator1_HBdepth1_)
2969  h_2DsumADCAmplLS1_LSselected->Fill(double(ieta), double(k3), bbbc);
2970 
2971  h_2D0sumADCAmplLS1->Fill(double(ieta), double(k3), bbb1);
2972 
2973  h_sumADCAmplperLS1->Fill(float(lscounterM1), bbbc);
2974  if (bbbc / bbb1 > lsdep_estimator1_HBdepth1_)
2975  h_sumCutADCAmplperLS1->Fill(float(lscounterM1), bbbc);
2976  h_sum0ADCAmplperLS1->Fill(float(lscounterM1), bbb1);
2977 
2978  if (ieta > 0) {
2979  if (k3 < 36) {
2980  h_sumADCAmplperLS1_P1->Fill(float(lscounterM1), bbbc);
2981  h_sum0ADCAmplperLS1_P1->Fill(float(lscounterM1), bbb1);
2982  } else {
2983  h_sumADCAmplperLS1_P2->Fill(float(lscounterM1), bbbc);
2984  h_sum0ADCAmplperLS1_P2->Fill(float(lscounterM1), bbb1);
2985  }
2987  if (bbbc / bbb1 > 25.) {
2988  pcountall1 += bbb1;
2989  pcountmin1 += bbb1;
2990  }
2992 
2993  } else {
2994  if (k3 < 36) {
2995  h_sumADCAmplperLS1_M1->Fill(float(lscounterM1), bbbc);
2996  h_sum0ADCAmplperLS1_M1->Fill(float(lscounterM1), bbb1);
2997  } else {
2998  h_sumADCAmplperLS1_M2->Fill(float(lscounterM1), bbbc);
2999  h_sum0ADCAmplperLS1_M2->Fill(float(lscounterM1), bbb1);
3000  }
3002  if (bbbc / bbb1 > 25.) {
3003  mcountall1 += bbb1;
3004  mcountmin1 += bbb1;
3005  }
3007  }
3008  }
3009  // HBdepth2
3010  if (k1 + 1 == 2) {
3011  h_sumADCAmplLS2->Fill(bbbc / bbb1);
3012  if (bbbc / bbb1 > lsdep_estimator1_HBdepth2_)
3013  h_2DsumADCAmplLS2->Fill(double(ieta), double(k3), bbbc);
3014  if (bbbc / bbb1 > 2. * lsdep_estimator1_HBdepth2_)
3015  h_2DsumADCAmplLS2_LSselected->Fill(double(ieta), double(k3), bbbc);
3016  h_2D0sumADCAmplLS2->Fill(double(ieta), double(k3), bbb1);
3017  h_sumADCAmplperLS2->Fill(float(lscounterM1), bbbc);
3018  if (bbbc / bbb1 > lsdep_estimator1_HBdepth2_)
3019  h_sumCutADCAmplperLS2->Fill(float(lscounterM1), bbbc);
3020  h_sum0ADCAmplperLS2->Fill(float(lscounterM1), bbb1);
3021  if (ieta > 0) {
3022  if (k3 < 36) {
3023  h_sumADCAmplperLS1_P1->Fill(float(lscounterM1), bbbc);
3024  h_sum0ADCAmplperLS1_P1->Fill(float(lscounterM1), bbb1);
3025  } else {
3026  h_sumADCAmplperLS1_P2->Fill(float(lscounterM1), bbbc);
3027  h_sum0ADCAmplperLS1_P2->Fill(float(lscounterM1), bbb1);
3028  }
3029  } else {
3030  if (k3 < 36) {
3031  h_sumADCAmplperLS1_M1->Fill(float(lscounterM1), bbbc);
3032  h_sum0ADCAmplperLS1_M1->Fill(float(lscounterM1), bbb1);
3033  } else {
3034  h_sumADCAmplperLS1_M2->Fill(float(lscounterM1), bbbc);
3035  h_sum0ADCAmplperLS1_M2->Fill(float(lscounterM1), bbb1);
3036  }
3037  }
3038  }
3039  // HBdepth3 upgrade
3040  if (k1 + 1 == 3) {
3041  h_sumADCAmplperLSdepth3HBu->Fill(float(lscounterM1), bbbc);
3042  if (bbbc / bbb1 > lsdep_estimator1_HBdepth3_)
3043  h_sumCutADCAmplperLSdepth3HBu->Fill(float(lscounterM1), bbbc);
3044  h_sum0ADCAmplperLSdepth3HBu->Fill(float(lscounterM1), bbb1);
3045 
3046  if (bbbc / bbb1 > lsdep_estimator1_HBdepth3_)
3047  h_2DsumADCAmplLSdepth3HBu->Fill(double(ieta), double(k3), bbbc);
3048  h_2D0sumADCAmplLSdepth3HBu->Fill(double(ieta), double(k3), bbb1);
3049  } //if(k1+1 ==3)
3050 
3051  // HBdepth4 upgrade
3052  if (k1 + 1 == 4) {
3053  h_sumADCAmplperLSdepth4HBu->Fill(float(lscounterM1), bbbc);
3054  if (bbbc / bbb1 > lsdep_estimator1_HBdepth4_)
3055  h_sumCutADCAmplperLSdepth4HBu->Fill(float(lscounterM1), bbbc);
3056  h_sum0ADCAmplperLSdepth4HBu->Fill(float(lscounterM1), bbb1);
3057 
3058  if (bbbc / bbb1 > lsdep_estimator1_HBdepth4_)
3059  h_2DsumADCAmplLSdepth4HBu->Fill(double(ieta), double(k3), bbbc);
3060  h_2D0sumADCAmplLSdepth4HBu->Fill(double(ieta), double(k3), bbb1);
3061  } //if(k1+1 ==4)
3062  }
3063 
3064  // HE:
3065  if (k0 == 1) {
3066  // HEdepth1
3067  if (k1 + 1 == 1) {
3068  h_sumADCAmplLS3->Fill(bbbc / bbb1);
3069  if (bbbc / bbb1 > lsdep_estimator1_HEdepth1_)
3070  h_2DsumADCAmplLS3->Fill(double(ieta), double(k3), bbbc);
3071  if (bbbc / bbb1 > 2. * lsdep_estimator1_HEdepth1_)
3072  h_2DsumADCAmplLS3_LSselected->Fill(double(ieta), double(k3), bbbc);
3073  h_2D0sumADCAmplLS3->Fill(double(ieta), double(k3), bbb1);
3074  h_sumADCAmplperLS3->Fill(float(lscounterM1), bbbc);
3075  if (bbbc / bbb1 > lsdep_estimator1_HEdepth1_)
3076  h_sumCutADCAmplperLS3->Fill(float(lscounterM1), bbbc);
3077  h_sum0ADCAmplperLS3->Fill(float(lscounterM1), bbb1);
3078  if (ieta > 0) {
3079  if (k3 < 36) {
3080  h_sumADCAmplperLS3_P1->Fill(float(lscounterM1), bbbc);
3081  h_sum0ADCAmplperLS3_P1->Fill(float(lscounterM1), bbb1);
3082  } else {
3083  h_sumADCAmplperLS3_P2->Fill(float(lscounterM1), bbbc);
3084  h_sum0ADCAmplperLS3_P2->Fill(float(lscounterM1), bbb1);
3085  }
3087  if (bbbc / bbb1 > 15. && k3 % 2 == 0) {
3088  pcountall3 += bbb1;
3089  pcountmin3 += bbb1;
3090  }
3092  } else {
3093  if (k3 < 36) {
3094  h_sumADCAmplperLS3_M1->Fill(float(lscounterM1), bbbc);
3095  h_sum0ADCAmplperLS3_M1->Fill(float(lscounterM1), bbb1);
3096  } else {
3097  h_sumADCAmplperLS3_M2->Fill(float(lscounterM1), bbbc);
3098  h_sum0ADCAmplperLS3_M2->Fill(float(lscounterM1), bbb1);
3099  }
3101  if (bbbc / bbb1 > 15. && k3 % 2 == 0) {
3102  mcountall3 += bbb1;
3103  mcountmin3 += bbb1;
3104  }
3106  }
3107  }
3108  // HEdepth2
3109  if (k1 + 1 == 2) {
3110  h_sumADCAmplLS4->Fill(bbbc / bbb1);
3111  if (bbbc / bbb1 > lsdep_estimator1_HEdepth2_)
3112  h_2DsumADCAmplLS4->Fill(double(ieta), double(k3), bbbc);
3113  if (bbbc / bbb1 > 2. * lsdep_estimator1_HEdepth2_)
3114  h_2DsumADCAmplLS4_LSselected->Fill(double(ieta), double(k3), bbbc);
3115  h_2D0sumADCAmplLS4->Fill(double(ieta), double(k3), bbb1);
3116  h_sumADCAmplperLS4->Fill(float(lscounterM1), bbbc);
3117  if (bbbc / bbb1 > lsdep_estimator1_HEdepth2_)
3118  h_sumCutADCAmplperLS4->Fill(float(lscounterM1), bbbc);
3119  h_sum0ADCAmplperLS4->Fill(float(lscounterM1), bbb1);
3120  if (ieta > 0) {
3121  if (k3 < 36) {
3122  h_sumADCAmplperLS3_P1->Fill(float(lscounterM1), bbbc);
3123  h_sum0ADCAmplperLS3_P1->Fill(float(lscounterM1), bbb1);
3124  } else {
3125  h_sumADCAmplperLS3_P2->Fill(float(lscounterM1), bbbc);
3126  h_sum0ADCAmplperLS3_P2->Fill(float(lscounterM1), bbb1);
3127  }
3128  } else {
3129  if (k3 < 36) {
3130  h_sumADCAmplperLS3_M1->Fill(float(lscounterM1), bbbc);
3131  h_sum0ADCAmplperLS3_M1->Fill(float(lscounterM1), bbb1);
3132  } else {
3133  h_sumADCAmplperLS3_M2->Fill(float(lscounterM1), bbbc);
3134  h_sum0ADCAmplperLS3_M2->Fill(float(lscounterM1), bbb1);
3135  }
3136  }
3137  }
3138  // HEdepth3
3139  if (k1 + 1 == 3) {
3140  h_sumADCAmplLS5->Fill(bbbc / bbb1);
3141  if (bbbc / bbb1 > lsdep_estimator1_HEdepth3_)
3142  h_2DsumADCAmplLS5->Fill(double(ieta), double(k3), bbbc);
3143  if (bbbc / bbb1 > 2. * lsdep_estimator1_HEdepth3_)
3144  h_2DsumADCAmplLS5_LSselected->Fill(double(ieta), double(k3), bbbc);
3145  h_2D0sumADCAmplLS5->Fill(double(ieta), double(k3), bbb1);
3146  h_sumADCAmplperLS5->Fill(float(lscounterM1), bbbc);
3147  if (bbbc / bbb1 > lsdep_estimator1_HEdepth3_)
3148  h_sumCutADCAmplperLS5->Fill(float(lscounterM1), bbbc);
3149  h_sum0ADCAmplperLS5->Fill(float(lscounterM1), bbb1);
3150  if (ieta > 0) {
3151  if (k3 < 36) {
3152  h_sumADCAmplperLS3_P1->Fill(float(lscounterM1), bbbc);
3153  h_sum0ADCAmplperLS3_P1->Fill(float(lscounterM1), bbb1);
3154  } else {
3155  h_sumADCAmplperLS3_P2->Fill(float(lscounterM1), bbbc);
3156  h_sum0ADCAmplperLS3_P2->Fill(float(lscounterM1), bbb1);
3157  }
3158  } else {
3159  if (k3 < 36) {
3160  h_sumADCAmplperLS3_M1->Fill(float(lscounterM1), bbbc);
3161  h_sum0ADCAmplperLS3_M1->Fill(float(lscounterM1), bbb1);
3162  } else {
3163  h_sumADCAmplperLS3_M2->Fill(float(lscounterM1), bbbc);
3164  h_sum0ADCAmplperLS3_M2->Fill(float(lscounterM1), bbb1);
3165  }
3166  }
3167  } //if(k1+1 ==3
3168  // HEdepth4 upgrade
3169  if (k1 + 1 == 4) {
3170  h_sumADCAmplperLSdepth4HEu->Fill(float(lscounterM1), bbbc);
3171  if (bbbc / bbb1 > lsdep_estimator1_HEdepth4_)
3172  h_sumCutADCAmplperLSdepth4HEu->Fill(float(lscounterM1), bbbc);
3173  h_sum0ADCAmplperLSdepth4HEu->Fill(float(lscounterM1), bbb1);
3174 
3175  if (bbbc / bbb1 > lsdep_estimator1_HEdepth4_)
3176  h_2DsumADCAmplLSdepth4HEu->Fill(double(ieta), double(k3), bbbc);
3177  h_2D0sumADCAmplLSdepth4HEu->Fill(double(ieta), double(k3), bbb1);
3178  } //if(k1+1 ==4)
3179 
3180  // HEdepth5 upgrade
3181  if (k1 + 1 == 5) {
3182  h_sumADCAmplperLSdepth5HEu->Fill(float(lscounterM1), bbbc);
3183  if (bbbc / bbb1 > lsdep_estimator1_HEdepth5_)
3184  h_sumCutADCAmplperLSdepth5HEu->Fill(float(lscounterM1), bbbc);
3185  h_sum0ADCAmplperLSdepth5HEu->Fill(float(lscounterM1), bbb1);
3186 
3187  if (bbbc / bbb1 > lsdep_estimator1_HEdepth5_)
3188  h_2DsumADCAmplLSdepth5HEu->Fill(double(ieta), double(k3), bbbc);
3189  h_2D0sumADCAmplLSdepth5HEu->Fill(double(ieta), double(k3), bbb1);
3190  } //if(k1+1 ==5)
3191 
3192  // HEdepth6 upgrade
3193  if (k1 + 1 == 6) {
3194  h_sumADCAmplperLSdepth6HEu->Fill(float(lscounterM1), bbbc);
3195  if (bbbc / bbb1 > lsdep_estimator1_HEdepth6_)
3196  h_sumCutADCAmplperLSdepth6HEu->Fill(float(lscounterM1), bbbc);
3197  h_sum0ADCAmplperLSdepth6HEu->Fill(float(lscounterM1), bbb1);
3198 
3199  if (bbbc / bbb1 > lsdep_estimator1_HEdepth6_)
3200  h_2DsumADCAmplLSdepth6HEu->Fill(double(ieta), double(k3), bbbc);
3201  h_2D0sumADCAmplLSdepth6HEu->Fill(double(ieta), double(k3), bbb1);
3202  } //if(k1+1 ==6)
3203 
3204  // HEdepth7 upgrade
3205  if (k1 + 1 == 7) {
3206  h_sumADCAmplperLSdepth7HEu->Fill(float(lscounterM1), bbbc);
3207  if (bbbc / bbb1 > lsdep_estimator1_HEdepth7_)
3208  h_sumCutADCAmplperLSdepth7HEu->Fill(float(lscounterM1), bbbc);
3209  h_sum0ADCAmplperLSdepth7HEu->Fill(float(lscounterM1), bbb1);
3210 
3211  if (bbbc / bbb1 > lsdep_estimator1_HEdepth7_)
3212  h_2DsumADCAmplLSdepth7HEu->Fill(double(ieta), double(k3), bbbc);
3213  h_2D0sumADCAmplLSdepth7HEu->Fill(double(ieta), double(k3), bbb1);
3214  } //if(k1+1 ==7)
3215  } //if(k0==1) =HE
3216  // HF:
3217  if (k0 == 3) {
3218  // HFdepth1
3219  if (k1 + 1 == 1) {
3220  h_sumADCAmplLS6->Fill(bbbc / bbb1);
3221  if (bbbc / bbb1 > lsdep_estimator1_HFdepth1_)
3222  h_2DsumADCAmplLS6->Fill(double(ieta), double(k3), bbbc);
3223  if (bbbc / bbb1 > 2. * lsdep_estimator1_HFdepth1_)
3224  h_2DsumADCAmplLS6_LSselected->Fill(double(ieta), double(k3), bbbc);
3225  h_2D0sumADCAmplLS6->Fill(double(ieta), double(k3), bbb1);
3226  h_sumADCAmplperLS6->Fill(float(lscounterM1), bbbc);
3227  if (bbbc / bbb1 > lsdep_estimator1_HFdepth1_)
3228  h_sumCutADCAmplperLS6->Fill(float(lscounterM1), bbbc);
3229  h_sum0ADCAmplperLS6->Fill(float(lscounterM1), bbb1);
3230 
3232  if (ieta > 0) {
3233  if (k3 < 36) {
3234  h_sumADCAmplperLS6_P1->Fill(float(lscounterM1), bbbc);
3235  h_sum0ADCAmplperLS6_P1->Fill(float(lscounterM1), bbb1);
3236  } else {
3237  h_sumADCAmplperLS6_P2->Fill(float(lscounterM1), bbbc);
3238  h_sum0ADCAmplperLS6_P2->Fill(float(lscounterM1), bbb1);
3239  }
3241  if (bbbc / bbb1 > 20.) {
3242  pcountall6 += bbb1;
3243  pcountmin6 += bbb1;
3244  }
3246 
3247  } else {
3248  if (k3 < 36) {
3249  h_sumADCAmplperLS6_M1->Fill(float(lscounterM1), bbbc);
3250  h_sum0ADCAmplperLS6_M1->Fill(float(lscounterM1), bbb1);
3251  } else {
3252  h_sumADCAmplperLS6_M2->Fill(float(lscounterM1), bbbc);
3253  h_sum0ADCAmplperLS6_M2->Fill(float(lscounterM1), bbb1);
3254  }
3256  if (bbbc / bbb1 > 20.) {
3257  mcountall6 += bbb1;
3258  mcountmin6 += bbb1;
3259  }
3261  }
3263  } //if(k1+1 ==1)
3264 
3265  // HFdepth2
3266  if (k1 + 1 == 2) {
3267  h_sumADCAmplLS7->Fill(bbbc / bbb1);
3268  if (bbbc / bbb1 > lsdep_estimator1_HFdepth2_)
3269  h_2DsumADCAmplLS7->Fill(double(ieta), double(k3), bbbc);
3270  if (bbbc / bbb1 > 2. * lsdep_estimator1_HFdepth2_)
3271  h_2DsumADCAmplLS7_LSselected->Fill(double(ieta), double(k3), bbbc);
3272  h_2D0sumADCAmplLS7->Fill(double(ieta), double(k3), bbb1);
3273  h_sumADCAmplperLS7->Fill(float(lscounterM1), bbbc);
3274  if (bbbc / bbb1 > lsdep_estimator1_HFdepth2_)
3275  h_sumCutADCAmplperLS7->Fill(float(lscounterM1), bbbc);
3276  h_sum0ADCAmplperLS7->Fill(float(lscounterM1), bbb1);
3277 
3278  if (ieta > 0) {
3279  if (k3 < 36) {
3280  h_sumADCAmplperLS6_P1->Fill(float(lscounterM1), bbbc);
3281  h_sum0ADCAmplperLS6_P1->Fill(float(lscounterM1), bbb1);
3282  } else {
3283  h_sumADCAmplperLS6_P2->Fill(float(lscounterM1), bbbc);
3284  h_sum0ADCAmplperLS6_P2->Fill(float(lscounterM1), bbb1);
3285  }
3286  } else {
3287  if (k3 < 36) {
3288  h_sumADCAmplperLS6_M1->Fill(float(lscounterM1), bbbc);
3289  h_sum0ADCAmplperLS6_M1->Fill(float(lscounterM1), bbb1);
3290  } else {
3291  h_sumADCAmplperLS6_M2->Fill(float(lscounterM1), bbbc);
3292  h_sum0ADCAmplperLS6_M2->Fill(float(lscounterM1), bbb1);
3293  }
3294  }
3295  } //if(k1+1 ==2)
3296 
3297  // HFdepth3 upgrade
3298  if (k1 + 1 == 3) {
3299  h_sumADCAmplperLS6u->Fill(float(lscounterM1), bbbc);
3300  if (bbbc / bbb1 > lsdep_estimator1_HFdepth3_)
3301  h_sumCutADCAmplperLS6u->Fill(float(lscounterM1), bbbc);
3302  h_sum0ADCAmplperLS6u->Fill(float(lscounterM1), bbb1);
3303 
3304  if (bbbc / bbb1 > lsdep_estimator1_HFdepth3_)
3305  h_2DsumADCAmplLSdepth3HFu->Fill(double(ieta), double(k3), bbbc);
3306  h_2D0sumADCAmplLSdepth3HFu->Fill(double(ieta), double(k3), bbb1);
3307  } //if(k1+1 ==3)
3308 
3309  // HFdepth4 upgrade
3310  if (k1 + 1 == 4) {
3311  h_sumADCAmplperLS7u->Fill(float(lscounterM1), bbbc);
3312  if (bbbc / bbb1 > lsdep_estimator1_HFdepth4_)
3313  h_sumCutADCAmplperLS7u->Fill(float(lscounterM1), bbbc);
3314  h_sum0ADCAmplperLS7u->Fill(float(lscounterM1), bbb1);
3315 
3316  if (bbbc / bbb1 > lsdep_estimator1_HFdepth4_)
3317  h_2DsumADCAmplLSdepth4HFu->Fill(double(ieta), double(k3), bbbc);
3318  h_2D0sumADCAmplLSdepth4HFu->Fill(double(ieta), double(k3), bbb1);
3319  } //if(k1+1 ==4)
3320 
3321  } //end HF
3322 
3323  // HO:
3324  if (k0 == 2) {
3325  // HOdepth4
3326  if (k1 + 1 == 4) {
3327  h_sumADCAmplLS8->Fill(bbbc / bbb1);
3328  if (bbbc / bbb1 > lsdep_estimator1_HOdepth4_)
3329  h_2DsumADCAmplLS8->Fill(double(ieta), double(k3), bbbc);
3330  if (bbbc / bbb1 > 2. * lsdep_estimator1_HOdepth4_)
3331  h_2DsumADCAmplLS8_LSselected->Fill(double(ieta), double(k3), bbbc);
3332  h_2D0sumADCAmplLS8->Fill(double(ieta), double(k3), bbb1);
3333  h_sumADCAmplperLS8->Fill(float(lscounterM1), bbbc);
3334  if (bbbc / bbb1 > lsdep_estimator1_HOdepth4_)
3335  h_sumCutADCAmplperLS8->Fill(float(lscounterM1), bbbc);
3336  h_sum0ADCAmplperLS8->Fill(float(lscounterM1), bbb1);
3337 
3339  if (ieta > 0) {
3340  if (k3 < 36) {
3341  h_sumADCAmplperLS8_P1->Fill(float(lscounterM1), bbbc);
3342  h_sum0ADCAmplperLS8_P1->Fill(float(lscounterM1), bbb1);
3343  } else {
3344  h_sumADCAmplperLS8_P2->Fill(float(lscounterM1), bbbc);
3345  h_sum0ADCAmplperLS8_P2->Fill(float(lscounterM1), bbb1);
3346  }
3348  if (bbbc / bbb1 > 80.) {
3349  pcountall8 += bbb1;
3350  pcountmin8 += bbb1;
3351  }
3353 
3354  } else {
3355  if (k3 < 36) {
3356  h_sumADCAmplperLS8_M1->Fill(float(lscounterM1), bbbc);
3357  h_sum0ADCAmplperLS8_M1->Fill(float(lscounterM1), bbb1);
3358  } else {
3359  h_sumADCAmplperLS8_M2->Fill(float(lscounterM1), bbbc);
3360  h_sum0ADCAmplperLS8_M2->Fill(float(lscounterM1), bbb1);
3361  }
3363  if (bbbc / bbb1 > 80.) {
3364  mcountall8 += bbb1;
3365  mcountmin8 += bbb1;
3366  }
3368  }
3370  }
3371  }
3372  } //if(sumEstimator1[k0][k1][k2][k3] != 0.
3373  // ------------------------------------------------------------------------------------------------------------------------sumEstimator2
3374  if (sumEstimator2[k0][k1][k2][k3] != 0.) {
3375  // fill histoes:
3376  double bbbc = 0.;
3377  if (flagestimatornormalization_ == 0)
3378  bbbc = sumEstimator2[k0][k1][k2][k3] / nevcounter0;
3379  if (flagestimatornormalization_ == 1)
3380  bbbc = sumEstimator2[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
3381  double bbb1 = 1.;
3382  if (flagestimatornormalization_ == 2) {
3383  bbbc = sumEstimator2[k0][k1][k2][k3];
3384  bbb1 = sum0Estimator[k0][k1][k2][k3];
3385  }
3386 
3387  // HB:
3388  if (k0 == 0) {
3389  // HBdepth1
3390  if (k1 + 1 == 1) {
3391  h_sumTSmeanALS1->Fill(bbbc / bbb1);
3392  if (bbbc / bbb1 > lsdep_estimator2_HBdepth1_)
3393  h_2DsumTSmeanALS1->Fill(double(ieta), double(k3), bbbc);
3394  h_2D0sumTSmeanALS1->Fill(double(ieta), double(k3), bbb1);
3395  h_sumTSmeanAperLS1->Fill(float(lscounterM1), bbbc);
3396  if (bbbc / bbb1 > lsdep_estimator2_HBdepth1_)
3397  h_sumCutTSmeanAperLS1->Fill(float(lscounterM1), bbbc);
3398  h_sum0TSmeanAperLS1->Fill(float(lscounterM1), bbb1);
3399  if (bbbc / bbb1 > 2. * lsdep_estimator2_HBdepth1_)
3400  h_sumTSmeanAperLS1_LSselected->Fill(float(lscounterM1), bbbc);
3401  }
3402  if (k1 + 1 == 2) {
3403  h_sumTSmeanALS2->Fill(bbbc / bbb1);
3404  if (bbbc / bbb1 > lsdep_estimator2_HBdepth2_)
3405  h_2DsumTSmeanALS2->Fill(double(ieta), double(k3), bbbc);
3406  h_2D0sumTSmeanALS2->Fill(double(ieta), double(k3), bbb1);
3407  h_sumTSmeanAperLS2->Fill(float(lscounterM1), bbbc);
3408  if (bbbc / bbb1 > lsdep_estimator2_HBdepth2_)
3409  h_sumCutTSmeanAperLS2->Fill(float(lscounterM1), bbbc);
3410  h_sum0TSmeanAperLS2->Fill(float(lscounterM1), bbb1);
3411  }
3412  }
3413  // HE:
3414  if (k0 == 1) {
3415  // HBdepth1
3416  if (k1 + 1 == 1) {
3417  h_sumTSmeanALS3->Fill(bbbc / bbb1);
3418  if (bbbc / bbb1 > lsdep_estimator2_HEdepth1_)
3419  h_2DsumTSmeanALS3->Fill(double(ieta), double(k3), bbbc);
3420  h_2D0sumTSmeanALS3->Fill(double(ieta), double(k3), bbb1);
3421  h_sumTSmeanAperLS3->Fill(float(lscounterM1), bbbc);
3422  if (bbbc / bbb1 > lsdep_estimator2_HEdepth1_)
3423  h_sumCutTSmeanAperLS3->Fill(float(lscounterM1), bbbc);
3424  h_sum0TSmeanAperLS3->Fill(float(lscounterM1), bbb1);
3425  }
3426  if (k1 + 1 == 2) {
3427  h_sumTSmeanALS4->Fill(bbbc / bbb1);
3428  if (bbbc / bbb1 > lsdep_estimator2_HEdepth2_)
3429  h_2DsumTSmeanALS4->Fill(double(ieta), double(k3), bbbc);
3430  h_2D0sumTSmeanALS4->Fill(double(ieta), double(k3), bbb1);
3431  h_sumTSmeanAperLS4->Fill(float(lscounterM1), bbbc);
3432  if (bbbc / bbb1 > lsdep_estimator2_HEdepth2_)
3433  h_sumCutTSmeanAperLS4->Fill(float(lscounterM1), bbbc);
3434  h_sum0TSmeanAperLS4->Fill(float(lscounterM1), bbb1);
3435  }
3436  if (k1 + 1 == 3) {
3437  h_sumTSmeanALS5->Fill(bbbc / bbb1);
3438  if (bbbc / bbb1 > lsdep_estimator2_HEdepth3_)
3439  h_2DsumTSmeanALS5->Fill(double(ieta), double(k3), bbbc);
3440  h_2D0sumTSmeanALS5->Fill(double(ieta), double(k3), bbb1);
3441  h_sumTSmeanAperLS5->Fill(float(lscounterM1), bbbc);
3442  if (bbbc / bbb1 > lsdep_estimator2_HEdepth3_)
3443  h_sumCutTSmeanAperLS5->Fill(float(lscounterM1), bbbc);
3444  h_sum0TSmeanAperLS5->Fill(float(lscounterM1), bbb1);
3445  }
3446  }
3447  // HF:
3448  if (k0 == 3) {
3449  // HBdepth1
3450  if (k1 + 1 == 1) {
3451  h_sumTSmeanALS6->Fill(bbbc / bbb1);
3452  if (bbbc / bbb1 > lsdep_estimator2_HFdepth1_)
3453  h_2DsumTSmeanALS6->Fill(double(ieta), double(k3), bbbc);
3454  h_2D0sumTSmeanALS6->Fill(double(ieta), double(k3), bbb1);
3455  h_sumTSmeanAperLS6->Fill(float(lscounterM1), bbbc);
3456  if (bbbc / bbb1 > lsdep_estimator2_HFdepth1_)
3457  h_sumCutTSmeanAperLS6->Fill(float(lscounterM1), bbbc);
3458  h_sum0TSmeanAperLS6->Fill(float(lscounterM1), bbb1);
3459  }
3460  if (k1 + 1 == 2) {
3461  h_sumTSmeanALS7->Fill(bbbc / bbb1);
3462  if (bbbc / bbb1 > lsdep_estimator2_HFdepth2_)
3463  h_2DsumTSmeanALS7->Fill(double(ieta), double(k3), bbbc);
3464  h_2D0sumTSmeanALS7->Fill(double(ieta), double(k3), bbb1);
3465  h_sumTSmeanAperLS7->Fill(float(lscounterM1), bbbc);
3466  if (bbbc / bbb1 > lsdep_estimator2_HFdepth2_)
3467  h_sumCutTSmeanAperLS7->Fill(float(lscounterM1), bbbc);
3468  h_sum0TSmeanAperLS7->Fill(float(lscounterM1), bbb1);
3469  }
3470  }
3471  // HO:
3472  if (k0 == 2) {
3473  // HBdepth1
3474  if (k1 + 1 == 4) {
3475  h_sumTSmeanALS8->Fill(bbbc / bbb1);
3476  if (bbbc / bbb1 > lsdep_estimator2_HOdepth4_)
3477  h_2DsumTSmeanALS8->Fill(double(ieta), double(k3), bbbc);
3478  h_2D0sumTSmeanALS8->Fill(double(ieta), double(k3), bbb1);
3479  h_sumTSmeanAperLS8->Fill(float(lscounterM1), bbbc);
3480  if (bbbc / bbb1 > lsdep_estimator2_HOdepth4_)
3481  h_sumCutTSmeanAperLS8->Fill(float(lscounterM1), bbbc);
3482  h_sum0TSmeanAperLS8->Fill(float(lscounterM1), bbb1);
3483  }
3484  }
3485  } //if(sumEstimator2[k0][k1][k2][k3] != 0.
3486 
3487  // ------------------------------------------------------------------------------------------------------------------------sumEstimator3
3488  if (sumEstimator3[k0][k1][k2][k3] != 0.) {
3489  // fill histoes:
3490  double bbbc = 0.;
3491  if (flagestimatornormalization_ == 0)
3492  bbbc = sumEstimator3[k0][k1][k2][k3] / nevcounter0;
3493  if (flagestimatornormalization_ == 1)
3494  bbbc = sumEstimator3[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
3495  double bbb1 = 1.;
3496  if (flagestimatornormalization_ == 2) {
3497  bbbc = sumEstimator3[k0][k1][k2][k3];
3498  bbb1 = sum0Estimator[k0][k1][k2][k3];
3499  }
3500 
3501  // HB:
3502  if (k0 == 0) {
3503  // HBdepth1
3504  if (k1 + 1 == 1) {
3505  h_sumTSmaxALS1->Fill(bbbc / bbb1);
3506  if (bbbc / bbb1 > lsdep_estimator3_HBdepth1_)
3507  h_2DsumTSmaxALS1->Fill(double(ieta), double(k3), bbbc);
3508  h_2D0sumTSmaxALS1->Fill(double(ieta), double(k3), bbb1);
3509  h_sumTSmaxAperLS1->Fill(float(lscounterM1), bbbc);
3510  if (bbbc / bbb1 > lsdep_estimator3_HBdepth1_)
3511  h_sumCutTSmaxAperLS1->Fill(float(lscounterM1), bbbc);
3512  h_sum0TSmaxAperLS1->Fill(float(lscounterM1), bbb1);
3513  if (bbbc / bbb1 > 2. * lsdep_estimator3_HBdepth1_)
3514  h_sumTSmaxAperLS1_LSselected->Fill(float(lscounterM1), bbbc);
3515  }
3516  if (k1 + 1 == 2) {
3517  h_sumTSmaxALS2->Fill(bbbc / bbb1);
3518  if (bbbc / bbb1 > lsdep_estimator3_HBdepth2_)
3519  h_2DsumTSmaxALS2->Fill(double(ieta), double(k3), bbbc);
3520  h_2D0sumTSmaxALS2->Fill(double(ieta), double(k3), bbb1);
3521  h_sumTSmaxAperLS2->Fill(float(lscounterM1), bbbc);
3522  if (bbbc / bbb1 > lsdep_estimator3_HBdepth2_)
3523  h_sumCutTSmaxAperLS2->Fill(float(lscounterM1), bbbc);
3524  h_sum0TSmaxAperLS2->Fill(float(lscounterM1), bbb1);
3525  }
3526  }
3527  // HE:
3528  if (k0 == 1) {
3529  // HBdepth1
3530  if (k1 + 1 == 1) {
3531  h_sumTSmaxALS3->Fill(bbbc / bbb1);
3532  if (bbbc / bbb1 > lsdep_estimator3_HEdepth1_)
3533  h_2DsumTSmaxALS3->Fill(double(ieta), double(k3), bbbc);
3534  h_2D0sumTSmaxALS3->Fill(double(ieta), double(k3), bbb1);
3535  h_sumTSmaxAperLS3->Fill(float(lscounterM1), bbbc);
3536  if (bbbc / bbb1 > lsdep_estimator3_HEdepth1_)
3537  h_sumCutTSmaxAperLS3->Fill(float(lscounterM1), bbbc);
3538  h_sum0TSmaxAperLS3->Fill(float(lscounterM1), bbb1);
3539  }
3540  if (k1 + 1 == 2) {
3541  h_sumTSmaxALS4->Fill(bbbc / bbb1);
3542  if (bbbc / bbb1 > lsdep_estimator3_HEdepth2_)
3543  h_2DsumTSmaxALS4->Fill(double(ieta), double(k3), bbbc);
3544  h_2D0sumTSmaxALS4->Fill(double(ieta), double(k3), bbb1);
3545  h_sumTSmaxAperLS4->Fill(float(lscounterM1), bbbc);
3546  if (bbbc / bbb1 > lsdep_estimator3_HEdepth2_)
3547  h_sumCutTSmaxAperLS4->Fill(float(lscounterM1), bbbc);
3548  h_sum0TSmaxAperLS4->Fill(float(lscounterM1), bbb1);
3549  }
3550  if (k1 + 1 == 3) {
3551  h_sumTSmaxALS5->Fill(bbbc / bbb1);
3552  if (bbbc / bbb1 > lsdep_estimator3_HEdepth3_)
3553  h_2DsumTSmaxALS5->Fill(double(ieta), double(k3), bbbc);
3554  h_2D0sumTSmaxALS5->Fill(double(ieta), double(k3), bbb1);
3555  h_sumTSmaxAperLS5->Fill(float(lscounterM1), bbbc);
3556  if (bbbc / bbb1 > lsdep_estimator3_HEdepth3_)
3557  h_sumCutTSmaxAperLS5->Fill(float(lscounterM1), bbbc);
3558  h_sum0TSmaxAperLS5->Fill(float(lscounterM1), bbb1);
3559  }
3560  }
3561  // HF:
3562  if (k0 == 3) {
3563  // HBdepth1
3564  if (k1 + 1 == 1) {
3565  h_sumTSmaxALS6->Fill(bbbc / bbb1);
3566  if (bbbc / bbb1 > lsdep_estimator3_HFdepth1_)
3567  h_2DsumTSmaxALS6->Fill(double(ieta), double(k3), bbbc);
3568  h_2D0sumTSmaxALS6->Fill(double(ieta), double(k3), bbb1);
3569  h_sumTSmaxAperLS6->Fill(float(lscounterM1), bbbc);
3570  if (bbbc / bbb1 > lsdep_estimator3_HFdepth1_)
3571  h_sumCutTSmaxAperLS6->Fill(float(lscounterM1), bbbc);
3572  h_sum0TSmaxAperLS6->Fill(float(lscounterM1), bbb1);
3573  }
3574  if (k1 + 1 == 2) {
3575  h_sumTSmaxALS7->Fill(bbbc / bbb1);
3576  if (bbbc / bbb1 > lsdep_estimator3_HFdepth2_)
3577  h_2DsumTSmaxALS7->Fill(double(ieta), double(k3), bbbc);
3578  h_2D0sumTSmaxALS7->Fill(double(ieta), double(k3), bbb1);
3579  h_sumTSmaxAperLS7->Fill(float(lscounterM1), bbbc);
3580  if (bbbc / bbb1 > lsdep_estimator3_HFdepth2_)
3581  h_sumCutTSmaxAperLS7->Fill(float(lscounterM1), bbbc);
3582  h_sum0TSmaxAperLS7->Fill(float(lscounterM1), bbb1);
3583  }
3584  }
3585  // HO:
3586  if (k0 == 2) {
3587  // HBdepth1
3588  if (k1 + 1 == 4) {
3589  h_sumTSmaxALS8->Fill(bbbc / bbb1);
3590  if (bbbc / bbb1 > lsdep_estimator3_HOdepth4_)
3591  h_2DsumTSmaxALS8->Fill(double(ieta), double(k3), bbbc);
3592  h_2D0sumTSmaxALS8->Fill(double(ieta), double(k3), bbb1);
3593  h_sumTSmaxAperLS8->Fill(float(lscounterM1), bbbc);
3594  if (bbbc / bbb1 > lsdep_estimator3_HOdepth4_)
3595  h_sumCutTSmaxAperLS8->Fill(float(lscounterM1), bbbc);
3596  h_sum0TSmaxAperLS8->Fill(float(lscounterM1), bbb1);
3597  }
3598  }
3599  } //if(sumEstimator3[k0][k1][k2][k3] != 0.
3600 
3601  // ------------------------------------------------------------------------------------------------------------------------sumEstimator4
3602  if (sumEstimator4[k0][k1][k2][k3] != 0.) {
3603  // fill histoes:
3604  double bbbc = 0.;
3605  if (flagestimatornormalization_ == 0)
3606  bbbc = sumEstimator4[k0][k1][k2][k3] / nevcounter0;
3607  if (flagestimatornormalization_ == 1)
3608  bbbc = sumEstimator4[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
3609  double bbb1 = 1.;
3610  if (flagestimatornormalization_ == 2) {
3611  bbbc = sumEstimator4[k0][k1][k2][k3];
3612  bbb1 = sum0Estimator[k0][k1][k2][k3];
3613  }
3614 
3615  // HB:
3616  if (k0 == 0) {
3617  // HBdepth1
3618  if (k1 + 1 == 1) {
3619  h_sumAmplitudeLS1->Fill(bbbc / bbb1);
3620  if (bbbc / bbb1 > lsdep_estimator4_HBdepth1_)
3621  h_2DsumAmplitudeLS1->Fill(double(ieta), double(k3), bbbc);
3622  h_2D0sumAmplitudeLS1->Fill(double(ieta), double(k3), bbb1);
3623  h_sumAmplitudeperLS1->Fill(float(lscounterM1), bbbc);
3624  if (bbbc / bbb1 > lsdep_estimator4_HBdepth1_)
3625  h_sumCutAmplitudeperLS1->Fill(float(lscounterM1), bbbc);
3626  h_sum0AmplitudeperLS1->Fill(float(lscounterM1), bbb1);
3627  if (bbbc / bbb1 > 2. * lsdep_estimator4_HBdepth1_)
3628  h_sumAmplitudeperLS1_LSselected->Fill(float(lscounterM1), bbbc);
3629  }
3630  if (k1 + 1 == 2) {
3631  h_sumAmplitudeLS2->Fill(bbbc / bbb1);
3632  if (bbbc / bbb1 > lsdep_estimator4_HBdepth2_)
3633  h_2DsumAmplitudeLS2->Fill(double(ieta), double(k3), bbbc);
3634  h_2D0sumAmplitudeLS2->Fill(double(ieta), double(k3), bbb1);
3635  h_sumAmplitudeperLS2->Fill(float(lscounterM1), bbbc);
3636  if (bbbc / bbb1 > lsdep_estimator4_HBdepth2_)
3637  h_sumCutAmplitudeperLS2->Fill(float(lscounterM1), bbbc);
3638  h_sum0AmplitudeperLS2->Fill(float(lscounterM1), bbb1);
3639  }
3640  }
3641  // HE:
3642  if (k0 == 1) {
3643  // HBdepth1
3644  if (k1 + 1 == 1) {
3645  h_sumAmplitudeLS3->Fill(bbbc / bbb1);
3646  if (bbbc / bbb1 > lsdep_estimator4_HEdepth1_)
3647  h_2DsumAmplitudeLS3->Fill(double(ieta), double(k3), bbbc);
3648  h_2D0sumAmplitudeLS3->Fill(double(ieta), double(k3), bbb1);
3649  h_sumAmplitudeperLS3->Fill(float(lscounterM1), bbbc);
3650  if (bbbc / bbb1 > lsdep_estimator4_HEdepth1_)
3651  h_sumCutAmplitudeperLS3->Fill(float(lscounterM1), bbbc);
3652  h_sum0AmplitudeperLS3->Fill(float(lscounterM1), bbb1);
3653  }
3654  if (k1 + 1 == 2) {
3655  h_sumAmplitudeLS4->Fill(bbbc / bbb1);
3656  if (bbbc / bbb1 > lsdep_estimator4_HEdepth2_)
3657  h_2DsumAmplitudeLS4->Fill(double(ieta), double(k3), bbbc);
3658  h_2D0sumAmplitudeLS4->Fill(double(ieta), double(k3), bbb1);
3659  h_sumAmplitudeperLS4->Fill(float(lscounterM1), bbbc);
3660  if (bbbc / bbb1 > lsdep_estimator4_HEdepth2_)
3661  h_sumCutAmplitudeperLS4->Fill(float(lscounterM1), bbbc);
3662  h_sum0AmplitudeperLS4->Fill(float(lscounterM1), bbb1);
3663  }
3664  if (k1 + 1 == 3) {
3665  h_sumAmplitudeLS5->Fill(bbbc / bbb1);
3666  if (bbbc / bbb1 > lsdep_estimator4_HEdepth3_)
3667  h_2DsumAmplitudeLS5->Fill(double(ieta), double(k3), bbbc);
3668  h_2D0sumAmplitudeLS5->Fill(double(ieta), double(k3), bbb1);
3669  h_sumAmplitudeperLS5->Fill(float(lscounterM1), bbbc);
3670  if (bbbc / bbb1 > lsdep_estimator4_HEdepth3_)
3671  h_sumCutAmplitudeperLS5->Fill(float(lscounterM1), bbbc);
3672  h_sum0AmplitudeperLS5->Fill(float(lscounterM1), bbb1);
3673  }
3674  }
3675  // HF:
3676  if (k0 == 3) {
3677  // HBdepth1
3678  if (k1 + 1 == 1) {
3679  h_sumAmplitudeLS6->Fill(bbbc / bbb1);
3680  if (bbbc / bbb1 > lsdep_estimator4_HFdepth1_)
3681  h_2DsumAmplitudeLS6->Fill(double(ieta), double(k3), bbbc);
3682  h_2D0sumAmplitudeLS6->Fill(double(ieta), double(k3), bbb1);
3683  h_sumAmplitudeperLS6->Fill(float(lscounterM1), bbbc);
3684  if (bbbc / bbb1 > lsdep_estimator4_HFdepth1_)
3685  h_sumCutAmplitudeperLS6->Fill(float(lscounterM1), bbbc);
3686  h_sum0AmplitudeperLS6->Fill(float(lscounterM1), bbb1);
3687  }
3688  if (k1 + 1 == 2) {
3689  h_sumAmplitudeLS7->Fill(bbbc / bbb1);
3690  if (bbbc / bbb1 > lsdep_estimator4_HFdepth2_)
3691  h_2DsumAmplitudeLS7->Fill(double(ieta), double(k3), bbbc);
3692  h_2D0sumAmplitudeLS7->Fill(double(ieta), double(k3), bbb1);
3693  h_sumAmplitudeperLS7->Fill(float(lscounterM1), bbbc);
3694  if (bbbc / bbb1 > lsdep_estimator4_HFdepth2_)
3695  h_sumCutAmplitudeperLS7->Fill(float(lscounterM1), bbbc);
3696  h_sum0AmplitudeperLS7->Fill(float(lscounterM1), bbb1);
3697  }
3698  }
3699  // HO:
3700  if (k0 == 2) {
3701  // HBdepth1
3702  if (k1 + 1 == 4) {
3703  h_sumAmplitudeLS8->Fill(bbbc / bbb1);
3704  if (bbbc / bbb1 > lsdep_estimator4_HOdepth4_)
3705  h_2DsumAmplitudeLS8->Fill(double(ieta), double(k3), bbbc);
3706  h_2D0sumAmplitudeLS8->Fill(double(ieta), double(k3), bbb1);
3707  h_sumAmplitudeperLS8->Fill(float(lscounterM1), bbbc);
3708  if (bbbc / bbb1 > lsdep_estimator4_HOdepth4_)
3709  h_sumCutAmplitudeperLS8->Fill(float(lscounterM1), bbbc);
3710  h_sum0AmplitudeperLS8->Fill(float(lscounterM1), bbb1);
3711  }
3712  }
3713  } //if(sumEstimator4[k0][k1][k2][k3] != 0.
3714  // ------------------------------------------------------------------------------------------------------------------------sumEstimator5
3715  if (sumEstimator5[k0][k1][k2][k3] != 0.) {
3716  // fill histoes:
3717  double bbbc = 0.;
3718  if (flagestimatornormalization_ == 0)
3719  bbbc = sumEstimator5[k0][k1][k2][k3] / nevcounter0;
3720  if (flagestimatornormalization_ == 1)
3721  bbbc = sumEstimator5[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
3722  double bbb1 = 1.;
3723  if (flagestimatornormalization_ == 2) {
3724  bbbc = sumEstimator5[k0][k1][k2][k3];
3725  bbb1 = sum0Estimator[k0][k1][k2][k3];
3726  }
3727 
3728  // HB:
3729  if (k0 == 0) {
3730  // HBdepth1
3731  if (k1 + 1 == 1) {
3732  h_sumAmplLS1->Fill(bbbc / bbb1);
3733  if (bbbc / bbb1 > lsdep_estimator5_HBdepth1_)
3734  h_2DsumAmplLS1->Fill(double(ieta), double(k3), bbbc);
3735  h_2D0sumAmplLS1->Fill(double(ieta), double(k3), bbb1);
3736  h_sumAmplperLS1->Fill(float(lscounterM1), bbbc);
3737  if (bbbc / bbb1 > lsdep_estimator5_HBdepth1_)
3738  h_sumCutAmplperLS1->Fill(float(lscounterM1), bbbc);
3739  h_sum0AmplperLS1->Fill(float(lscounterM1), bbb1);
3740  if (bbbc / bbb1 > 2. * lsdep_estimator5_HBdepth1_)
3741  h_sumAmplperLS1_LSselected->Fill(float(lscounterM1), bbbc);
3742  }
3743  if (k1 + 1 == 2) {
3744  h_sumAmplLS2->Fill(bbbc / bbb1);
3745  if (bbbc / bbb1 > lsdep_estimator5_HBdepth2_)
3746  h_2DsumAmplLS2->Fill(double(ieta), double(k3), bbbc);
3747  h_2D0sumAmplLS2->Fill(double(ieta), double(k3), bbb1);
3748  h_sumAmplperLS2->Fill(float(lscounterM1), bbbc);
3749  if (bbbc / bbb1 > lsdep_estimator5_HBdepth2_)
3750  h_sumCutAmplperLS2->Fill(float(lscounterM1), bbbc);
3751  h_sum0AmplperLS2->Fill(float(lscounterM1), bbb1);
3752  }
3753  }
3754  // HE:
3755  if (k0 == 1) {
3756  // HEdepth1
3757  if (k1 + 1 == 1) {
3758  h_sumAmplLS3->Fill(bbbc / bbb1);
3759  if (bbbc / bbb1 > lsdep_estimator5_HEdepth1_)
3760  h_2DsumAmplLS3->Fill(double(ieta), double(k3), bbbc);
3761  h_2D0sumAmplLS3->Fill(double(ieta), double(k3), bbb1);
3762  h_sumAmplperLS3->Fill(float(lscounterM1), bbbc);
3763  if (bbbc / bbb1 > lsdep_estimator5_HEdepth1_)
3764  h_sumCutAmplperLS3->Fill(float(lscounterM1), bbbc);
3765  h_sum0AmplperLS3->Fill(float(lscounterM1), bbb1);
3766  }
3767  if (k1 + 1 == 2) {
3768  h_sumAmplLS4->Fill(bbbc / bbb1);
3769  if (bbbc / bbb1 > lsdep_estimator5_HEdepth2_)
3770  h_2DsumAmplLS4->Fill(double(ieta), double(k3), bbbc);
3771  h_2D0sumAmplLS4->Fill(double(ieta), double(k3), bbb1);
3772  h_sumAmplperLS4->Fill(float(lscounterM1), bbbc);
3773  if (bbbc / bbb1 > lsdep_estimator5_HEdepth2_)
3774  h_sumCutAmplperLS4->Fill(float(lscounterM1), bbbc);
3775  h_sum0AmplperLS4->Fill(float(lscounterM1), bbb1);
3776  }
3777  if (k1 + 1 == 3) {
3778  h_sumAmplLS5->Fill(bbbc / bbb1);
3779  if (bbbc / bbb1 > lsdep_estimator5_HEdepth3_)
3780  h_2DsumAmplLS5->Fill(double(ieta), double(k3), bbbc);
3781  h_2D0sumAmplLS5->Fill(double(ieta), double(k3), bbb1);
3782  h_sumAmplperLS5->Fill(float(lscounterM1), bbbc);
3783  if (bbbc / bbb1 > lsdep_estimator5_HEdepth3_)
3784  h_sumCutAmplperLS5->Fill(float(lscounterM1), bbbc);
3785  h_sum0AmplperLS5->Fill(float(lscounterM1), bbb1);
3786  }
3787  }
3788  // HF:
3789  if (k0 == 3) {
3790  // HFdepth1
3791  if (k1 + 1 == 1) {
3792  h_sumAmplLS6->Fill(bbbc / bbb1);
3793  if (bbbc / bbb1 > lsdep_estimator5_HFdepth1_)
3794  h_2DsumAmplLS6->Fill(double(ieta), double(k3), bbbc);
3795  h_2D0sumAmplLS6->Fill(double(ieta), double(k3), bbb1);
3796  h_sumAmplperLS6->Fill(float(lscounterM1), bbbc);
3797  if (bbbc / bbb1 > lsdep_estimator5_HFdepth1_)
3798  h_sumCutAmplperLS6->Fill(float(lscounterM1), bbbc);
3799  h_sum0AmplperLS6->Fill(float(lscounterM1), bbb1);
3800  }
3801  if (k1 + 1 == 2) {
3802  h_sumAmplLS7->Fill(bbbc / bbb1);
3803  if (bbbc / bbb1 > lsdep_estimator5_HFdepth2_)
3804  h_2DsumAmplLS7->Fill(double(ieta), double(k3), bbbc);
3805  h_2D0sumAmplLS7->Fill(double(ieta), double(k3), bbb1);
3806  h_sumAmplperLS7->Fill(float(lscounterM1), bbbc);
3807  if (bbbc / bbb1 > lsdep_estimator5_HFdepth2_)
3808  h_sumCutAmplperLS7->Fill(float(lscounterM1), bbbc);
3809  h_sum0AmplperLS7->Fill(float(lscounterM1), bbb1);
3810  }
3811  }
3812  // HO:
3813  if (k0 == 2) {
3814  // HOdepth4
3815  if (k1 + 1 == 4) {
3816  h_sumAmplLS8->Fill(bbbc / bbb1);
3817  if (bbbc / bbb1 > lsdep_estimator5_HOdepth4_)
3818  h_2DsumAmplLS8->Fill(double(ieta), double(k3), bbbc);
3819  h_2D0sumAmplLS8->Fill(double(ieta), double(k3), bbb1);
3820  h_sumAmplperLS8->Fill(float(lscounterM1), bbbc);
3821  if (bbbc / bbb1 > lsdep_estimator5_HOdepth4_)
3822  h_sumCutAmplperLS8->Fill(float(lscounterM1), bbbc);
3823  h_sum0AmplperLS8->Fill(float(lscounterM1), bbb1);
3824  }
3825  }
3826  } //if(sumEstimator5[k0][k1][k2][k3] != 0.
3827  // ------------------------------------------------------------------------------------------------------------------------sumEstimator6 (Error-B)
3828  if (sumEstimator6[k0][k1][k2][k3] != 0.) {
3829  // fill histoes:
3830  double bbbc = 0.;
3831  if (flagestimatornormalization_ == 0)
3832  bbbc = sumEstimator6[k0][k1][k2][k3] / nevcounter0;
3833  if (flagestimatornormalization_ == 1)
3834  bbbc = sumEstimator6[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
3835  double bbb1 = 1.;
3836  if (flagestimatornormalization_ == 2) {
3837  bbbc = sumEstimator6[k0][k1][k2][k3];
3838  bbb1 = sum0Estimator[k0][k1][k2][k3];
3839  }
3840 
3841  // HB:
3842  if (k0 == 0) {
3843  // HBdepth1
3844  if (k1 + 1 == 1) {
3845  h_sumErrorBLS1->Fill(bbbc / bbb1);
3846  h_2DsumErrorBLS1->Fill(double(ieta), double(k3), bbbc);
3847  h_2D0sumErrorBLS1->Fill(double(ieta), double(k3), bbb1);
3848  h_sumErrorBperLS1->Fill(float(lscounterM1), bbbc);
3849  h_sum0ErrorBperLS1->Fill(float(lscounterM1), bbb1);
3850  }
3851  if (k1 + 1 == 2) {
3852  h_sumErrorBLS2->Fill(bbbc / bbb1);
3853  h_2DsumErrorBLS2->Fill(double(ieta), double(k3), bbbc);
3854  h_2D0sumErrorBLS2->Fill(double(ieta), double(k3), bbb1);
3855  h_sumErrorBperLS2->Fill(float(lscounterM1), bbbc);
3856  h_sum0ErrorBperLS2->Fill(float(lscounterM1), bbb1);
3857  }
3858  }
3859  // HE:
3860  if (k0 == 1) {
3861  // HEdepth1
3862  if (k1 + 1 == 1) {
3863  h_sumErrorBLS3->Fill(bbbc / bbb1);
3864  h_2DsumErrorBLS3->Fill(double(ieta), double(k3), bbbc);
3865  h_2D0sumErrorBLS3->Fill(double(ieta), double(k3), bbb1);
3866  h_sumErrorBperLS3->Fill(float(lscounterM1), bbbc);
3867  h_sum0ErrorBperLS3->Fill(float(lscounterM1), bbb1);
3868  }
3869  if (k1 + 1 == 2) {
3870  h_sumErrorBLS4->Fill(bbbc / bbb1);
3871  h_2DsumErrorBLS4->Fill(double(ieta), double(k3), bbbc);
3872  h_2D0sumErrorBLS4->Fill(double(ieta), double(k3), bbb1);
3873  h_sumErrorBperLS4->Fill(float(lscounterM1), bbbc);
3874  h_sum0ErrorBperLS4->Fill(float(lscounterM1), bbb1);
3875  }
3876  if (k1 + 1 == 3) {
3877  h_sumErrorBLS5->Fill(bbbc / bbb1);
3878  h_2DsumErrorBLS5->Fill(double(ieta), double(k3), bbbc);
3879  h_2D0sumErrorBLS5->Fill(double(ieta), double(k3), bbb1);
3880  h_sumErrorBperLS5->Fill(float(lscounterM1), bbbc);
3881  h_sum0ErrorBperLS5->Fill(float(lscounterM1), bbb1);
3882  }
3883  }
3884  // HF:
3885  if (k0 == 3) {
3886  // HFdepth1
3887  if (k1 + 1 == 1) {
3888  h_sumErrorBLS6->Fill(bbbc / bbb1);
3889  h_2DsumErrorBLS6->Fill(double(ieta), double(k3), bbbc);
3890  h_2D0sumErrorBLS6->Fill(double(ieta), double(k3), bbb1);
3891  h_sumErrorBperLS6->Fill(float(lscounterM1), bbbc);
3892  h_sum0ErrorBperLS6->Fill(float(lscounterM1), bbb1);
3893  }
3894  if (k1 + 1 == 2) {
3895  h_sumErrorBLS7->Fill(bbbc / bbb1);
3896  h_2DsumErrorBLS7->Fill(double(ieta), double(k3), bbbc);
3897  h_2D0sumErrorBLS7->Fill(double(ieta), double(k3), bbb1);
3898  h_sumErrorBperLS7->Fill(float(lscounterM1), bbbc);
3899  h_sum0ErrorBperLS7->Fill(float(lscounterM1), bbb1);
3900  }
3901  }
3902  // HO:
3903  if (k0 == 2) {
3904  // HOdepth4
3905  if (k1 + 1 == 4) {
3906  h_sumErrorBLS8->Fill(bbbc / bbb1);
3907  h_2DsumErrorBLS8->Fill(double(ieta), double(k3), bbbc);
3908  h_2D0sumErrorBLS8->Fill(double(ieta), double(k3), bbb1);
3909  h_sumErrorBperLS8->Fill(float(lscounterM1), bbbc);
3910  h_sum0ErrorBperLS8->Fill(float(lscounterM1), bbb1);
3911  }
3912  }
3914  } //if(sumEstimator6[k0][k1][k2][k3] != 0.
3915  } //for k2
3916  // occupancy distributions for error-A:
3917  // HB
3918  if (k0 == 0 && k1 == 0) {
3919  if (pcountmin1 > 0) {
3920  if (pcountmin1 < pnnmin1)
3921  pnnmin1 = pcountmin1;
3922  pcountmin1 = 0;
3923  pnnbins1++;
3924  }
3925  if (mcountmin1 > 0) {
3926  if (mcountmin1 < mnnmin1)
3927  mnnmin1 = mcountmin1;
3928  mcountmin1 = 0;
3929  mnnbins1++;
3930  }
3931  } //
3932  // HE
3933  if (k0 == 1 && k1 == 0) {
3934  if (pcountmin3 > 0) {
3935  if (pcountmin3 < pnnmin3)
3936  pnnmin3 = pcountmin3;
3937  pcountmin3 = 0;
3938  pnnbins3++;
3939  }
3940  if (mcountmin3 > 0) {
3941  if (mcountmin3 < mnnmin3)
3942  mnnmin3 = mcountmin3;
3943  mcountmin3 = 0;
3944  mnnbins3++;
3945  }
3946  } //
3947  // HO
3948  if (k0 == 2 && k1 == 3) {
3949  if (pcountmin8 > 0) {
3950  if (pcountmin8 < pnnmin8)
3951  pnnmin8 = pcountmin8;
3952  pcountmin8 = 0;
3953  pnnbins8++;
3954  }
3955  if (mcountmin8 > 0) {
3956  if (mcountmin8 < mnnmin8)
3957  mnnmin8 = mcountmin8;
3958  mcountmin8 = 0;
3959  mnnbins8++;
3960  }
3961  } //
3962  // HF
3963  if (k0 == 3 && k1 == 0) {
3964  if (pcountmin6 > 0) {
3965  if (pcountmin6 < pnnmin6)
3966  pnnmin6 = pcountmin6;
3967  pcountmin6 = 0;
3968  pnnbins6++;
3969  }
3970  if (mcountmin6 > 0) {
3971  if (mcountmin6 < mnnmin6)
3972  mnnmin6 = mcountmin6;
3973  mcountmin6 = 0;
3974  mnnbins6++;
3975  }
3976  } //
3977 
3978  } //for k3
3979  } //for k1
3980  } //for k0
3984 
3985  // cout<<"=============================== lscounterM1 = "<< (float)lscounterM1 <<endl;
3986 
3987  float patiooccupancy1 = 0.;
3988  if (pcountall1 != 0)
3989  patiooccupancy1 = (float)pnnmin1 * mnnbins1 / pcountall1;
3990  h_RatioOccupancy_HBM->Fill(float(lscounterM1), patiooccupancy1);
3991  float matiooccupancy1 = 0.;
3992  if (mcountall1 != 0)
3993  matiooccupancy1 = (float)mnnmin1 * mnnbins1 / mcountall1;
3994  h_RatioOccupancy_HBP->Fill(float(lscounterM1), matiooccupancy1);
3995 
3996  float patiooccupancy3 = 0.;
3997  if (pcountall3 != 0)
3998  patiooccupancy3 = (float)pnnmin3 * mnnbins3 / pcountall3;
3999  h_RatioOccupancy_HEM->Fill(float(lscounterM1), patiooccupancy3);
4000  float matiooccupancy3 = 0.;
4001  if (mcountall3 != 0)
4002  matiooccupancy3 = (float)mnnmin3 * mnnbins3 / mcountall3;
4003  h_RatioOccupancy_HEP->Fill(float(lscounterM1), matiooccupancy3);
4004 
4005  float patiooccupancy6 = 0.;
4006  if (pcountall6 != 0)
4007  patiooccupancy6 = (float)pnnmin6 * mnnbins6 / pcountall6;
4008  h_RatioOccupancy_HFM->Fill(float(lscounterM1), patiooccupancy6);
4009  float matiooccupancy6 = 0.;
4010  if (mcountall6 != 0)
4011  matiooccupancy6 = (float)mnnmin6 * mnnbins6 / mcountall6;
4012  h_RatioOccupancy_HFP->Fill(float(lscounterM1), matiooccupancy6);
4013 
4014  float patiooccupancy8 = 0.;
4015  if (pcountall8 != 0)
4016  patiooccupancy8 = (float)pnnmin8 * mnnbins8 / pcountall8;
4017  h_RatioOccupancy_HOM->Fill(float(lscounterM1), patiooccupancy8);
4018  float matiooccupancy8 = 0.;
4019  if (mcountall8 != 0)
4020  matiooccupancy8 = (float)mnnmin8 * mnnbins8 / mcountall8;
4021  h_RatioOccupancy_HOP->Fill(float(lscounterM1), matiooccupancy8);
4022 
4023  for (int k0 = 0; k0 < nsub; k0++) {
4024  for (int k1 = 0; k1 < ndepth; k1++) {
4025  for (int k2 = 0; k2 < neta; k2++) {
4026  for (int k3 = 0; k3 < nphi; k3++) {
4027  // reset massives:
4028  sumEstimator0[k0][k1][k2][k3] = 0.;
4029  sumEstimator1[k0][k1][k2][k3] = 0.;
4030  sumEstimator2[k0][k1][k2][k3] = 0.;
4031  sumEstimator3[k0][k1][k2][k3] = 0.;
4032  sumEstimator4[k0][k1][k2][k3] = 0.;
4033  sumEstimator5[k0][k1][k2][k3] = 0.;
4034  sumEstimator6[k0][k1][k2][k3] = 0.;
4035  sum0Estimator[k0][k1][k2][k3] = 0.;
4036  } //for
4037  } //for
4038  } //for
4039  } //for
4040 
4041  //------------------------------------------------------ averSIGNAL
4050 
4055 
4056  //------------------------------------------------------
4065 
4070 
4071  //------------------------------------------------------ averNOSIGNAL
4080 
4085 
4086  //------------------------------------------------------
4095 
4100 
4101  //------------------------------------------------------ maxxSA and maxxOccupancy
4102  h_maxxSUMAmpl_HB->Fill(float(lscounterM1), maxxSUM1);
4103  h_maxxSUMAmpl_HE->Fill(float(lscounterM1), maxxSUM2);
4104  h_maxxSUMAmpl_HO->Fill(float(lscounterM1), maxxSUM3);
4105  h_maxxSUMAmpl_HF->Fill(float(lscounterM1), maxxSUM4);
4106  maxxSUM1 = 0.;
4107  maxxSUM2 = 0.;
4108  maxxSUM3 = 0.;
4109  maxxSUM4 = 0.;
4110  //------------------------------------------------------
4111  h_maxxOCCUP_HB->Fill(float(lscounterM1), maxxOCCUP1);
4112  h_maxxOCCUP_HE->Fill(float(lscounterM1), maxxOCCUP2);
4113  h_maxxOCCUP_HO->Fill(float(lscounterM1), maxxOCCUP3);
4114  h_maxxOCCUP_HF->Fill(float(lscounterM1), maxxOCCUP4);
4115  maxxOCCUP1 = 0.;
4116  maxxOCCUP2 = 0.;
4117  maxxOCCUP3 = 0.;
4118  maxxOCCUP4 = 0.;
4119 
4120  //------------------------------------------------------
4121  } //if(nevcounter0 != 0)
4122  // POINT1
4123 
4125  // for upgrade:
4126  for (int k1 = 0; k1 < ndepth; k1++) {
4127  for (int k2 = 0; k2 < neta; k2++) {
4128  for (int k3 = 0; k3 < nphi; k3++) {
4129  if (studyCalibCellsHist_) {
4130  signal[k1][k2][k3] = 0.;
4131  calibt[k1][k2][k3] = 0.;
4132  calibcapiderror[k1][k2][k3] = 0;
4133  caliba[k1][k2][k3] = 0.;
4134  calibw[k1][k2][k3] = 0.;
4135  calib0[k1][k2][k3] = 0.;
4136  signal3[k1][k2][k3] = 0.;
4137  calib3[k1][k2][k3] = 0.;
4138  calib2[k1][k2][k3] = 0.;
4139  }
4141  for (int k0 = 0; k0 < nsub; k0++) {
4142  badchannels[k0][k1][k2][k3] = 0;
4143  } //for
4144  } //if
4145 
4146  } //for
4147  } //for
4148  } //for
4149  for (int k0 = 0; k0 < nsub; k0++) {
4150  for (int k1 = 0; k1 < ndepth; k1++) {
4151  for (int k2 = 0; k2 < neta; k2++) {
4152  for (int k3 = 0; k3 < nphi; k3++) {
4153  amplitudechannel0[k0][k1][k2][k3] = 0.;
4154  amplitudechannel[k0][k1][k2][k3] = 0.;
4155  amplitudechannel2[k0][k1][k2][k3] = 0.;
4156 
4157  tocamplchannel[k0][k1][k2][k3] = 0.;
4158  maprphinorm[k0][k1][k2][k3] = 0.;
4159  // phi-symmetry monitoring for calibration group:
4160  // rec energy:
4161  recSignalEnergy0[k0][k1][k2][k3] = 0.;
4162  recSignalEnergy1[k0][k1][k2][k3] = 0.;
4163  recSignalEnergy2[k0][k1][k2][k3] = 0.;
4164  recNoiseEnergy0[k0][k1][k2][k3] = 0.;
4165  recNoiseEnergy1[k0][k1][k2][k3] = 0.;
4166  recNoiseEnergy2[k0][k1][k2][k3] = 0.;
4167 
4168  } //k3
4169  } //k2
4170  } //k1
4171  } //k0
4175 
4176  if (flagToUseDigiCollectionsORNot_ != 0) {
4180  if (flagupgradeqie1011_ != 2 && flagupgradeqie1011_ != 3 && flagupgradeqie1011_ != 6 &&
4183  iEvent.getByToken(tok_hf_, hf);
4184  bool gotHFDigis = true;
4185  if (!(iEvent.getByToken(tok_hf_, hf))) {
4186  gotHFDigis = false;
4187  } //this is a boolean set up to check if there are HFdigis in input root file
4188  if (!(hf.isValid())) {
4189  gotHFDigis = false;
4190  } //if it is not there, leave it false
4191  if (!gotHFDigis) {
4192  std::cout << " ****************************** =========================== No HFDigiCollection found "
4193  << std::endl;
4194  } else {
4196  for (HFDigiCollection::const_iterator digi = hf->begin(); digi != hf->end(); digi++) {
4197  eta = digi->id().ieta();
4198  phi = digi->id().iphi();
4199  depth = digi->id().depth();
4200  nTS = digi->size();
4202  counterhf++;
4205  fillDigiErrorsHF(digi);
4207  if (recordHistoes_)
4208  fillDigiAmplitudeHF(digi);
4211  int iphi = phi - 1;
4212  int ieta = eta;
4213  if (ieta > 0)
4214  ieta -= 1;
4215  if (nTS <= numOfTS)
4216  for (int i = 0; i < nTS; i++) {
4217  TS_data[i] = adc2fC[digi->sample(i).adc()];
4218  signal[3][ieta + 41][iphi] += TS_data[i];
4219  if (i > 1 && i < 6)
4220  signal3[3][ieta + 41][iphi] += TS_data[i];
4221  } // TS
4222  } // if(recordHistoes_ && studyCalibCellsHist_)
4223  } // for
4224  } // hf.isValid
4225  } // end flagupgrade
4226 
4229  // upgrade:
4230  if (flagupgradeqie1011_ != 1) {
4232  iEvent.getByToken(tok_qie10_, hfqie10);
4233  const QIE10DigiCollection& qie10dc =
4234  *(hfqie10);
4235  bool gotQIE10Digis = true;
4236  if (!(iEvent.getByToken(tok_qie10_, hfqie10))) {
4237  gotQIE10Digis = false;
4238  } //this is a boolean set up to check if there are HFdigis in input root file
4239  if (!(hfqie10.isValid())) {
4240  gotQIE10Digis = false;
4241  } //if it is not there, leave it false
4242  if (!gotQIE10Digis) {
4243  std::cout << " No QIE10DigiCollection collection is found " << std::endl;
4244  } else {
4246  double totalAmplitudeHF = 0.;
4247  for (unsigned int j = 0; j < qie10dc.size(); j++) {
4248  QIE10DataFrame qie10df = static_cast<QIE10DataFrame>(qie10dc[j]);
4249  DetId detid = qie10df.detid();
4250  HcalDetId hcaldetid = HcalDetId(detid);
4251  int eta = hcaldetid.ieta();
4252  int phi = hcaldetid.iphi();
4253  // int depth = hcaldetid.depth();
4254  // loop over the samples in the digi
4255  nTS = qie10df.samples();
4257  counterhfqie10++;
4260  fillDigiErrorsHFQIE10(qie10df);
4262  if (recordHistoes_)
4263  fillDigiAmplitudeHFQIE10(qie10df);
4265  // if(recordHistoes_ ) {
4267  int iphi = phi - 1;
4268  int ieta = eta;
4269  if (ieta > 0)
4270  ieta -= 1;
4271  double amplitudefullTSs = 0.;
4272  double nnnnnnTS = 0.;
4273  for (int i = 0; i < nTS; ++i) {
4274  // j - QIE channel
4275  // i - time sample (TS)
4276  int adc = qie10df[i].adc();
4277  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4278  // float charge = adc2fC_QIE10[ adc ];
4279  TS_data[i] = adc2fC_QIE10[adc];
4280  signal[3][ieta + 41][iphi] += TS_data[i];
4281  totalAmplitudeHF += TS_data[i];
4282  amplitudefullTSs += TS_data[i];
4283  nnnnnnTS++;
4284  if (i > 1 && i < 6)
4285  signal3[3][ieta + 41][iphi] += TS_data[i];
4286 
4287  } // TS
4288  h_numberofhitsHFtest->Fill(nnnnnnTS);
4289  h_AmplitudeHFtest->Fill(amplitudefullTSs);
4290  } // if(recordHistoes_ && studyCalibCellsHist_)
4291  } // for
4292  h_totalAmplitudeHF->Fill(totalAmplitudeHF);
4293  h_totalAmplitudeHFperEvent->Fill(float(eventcounter), totalAmplitudeHF);
4294  } // hfqie10.isValid
4295  } // end flagupgrade
4296  //end upgrade
4297  //
4298  //
4300  int qwert1 = 0;
4301  int qwert2 = 0;
4302  int qwert3 = 0;
4303  int qwert4 = 0;
4304  int qwert5 = 0;
4305  if (flagupgradeqie1011_ != 2 && flagupgradeqie1011_ != 3) {
4307  iEvent.getByToken(tok_hbhe_, hbhe);
4308  bool gotHBHEDigis = true;
4309  if (!(iEvent.getByToken(tok_hbhe_, hbhe)))
4310  gotHBHEDigis = false; //this is a boolean set up to check if there are HBHEgigis in input root file
4311  if (!(hbhe.isValid()))
4312  gotHBHEDigis = false; //if it is not there, leave it false
4313  if (!gotHBHEDigis) {
4314  std::cout << " No HBHEDigiCollection collection is found " << std::endl;
4315  } else {
4316  // unsigned int NHBHEDigiCollectionsize = hbhe->size();
4317  double totalAmplitudeHB = 0.;
4318  double totalAmplitudeHE = 0.;
4319  double nnnnnnTSHB = 0.;
4320  double nnnnnnTSHE = 0.;
4321 
4322  for (HBHEDigiCollection::const_iterator digi = hbhe->begin(); digi != hbhe->end(); digi++) {
4323  eta = digi->id().ieta();
4324  phi = digi->id().iphi();
4325  depth = digi->id().depth();
4326  nTS = digi->size();
4328  nnnnnnhbhe++;
4329  nnnnnn++;
4331  if (digi->id().subdet() == HcalBarrel && depth == 1 && qwert1 == 0) {
4332  nnnnnn1++;
4333  qwert1 = 1;
4334  }
4335  if (digi->id().subdet() == HcalBarrel && depth == 2 && qwert2 == 0) {
4336  nnnnnn2++;
4337  qwert2 = 1;
4338  }
4339  if (digi->id().subdet() == HcalEndcap && depth == 1 && qwert3 == 0) {
4340  nnnnnn3++;
4341  qwert3 = 1;
4342  }
4343  if (digi->id().subdet() == HcalEndcap && depth == 2 && qwert4 == 0) {
4344  nnnnnn4++;
4345  qwert4 = 1;
4346  }
4347  if (digi->id().subdet() == HcalEndcap && depth == 3 && qwert5 == 0) {
4348  nnnnnn5++;
4349  qwert5 = 1;
4350  }
4353  fillDigiErrors(digi);
4355  if (recordHistoes_)
4356  fillDigiAmplitude(digi);
4357 
4359  int iphi = phi - 1;
4360  int ieta = eta;
4361  if (ieta > 0)
4362  ieta -= 1;
4364  if (digi->id().subdet() == HcalBarrel) {
4365  double amplitudefullTSs = 0.;
4366  nnnnnnTSHB++;
4367  if (nTS <= numOfTS)
4368  for (int i = 0; i < nTS; i++) {
4369  TS_data[i] = adc2fC[digi->sample(i).adc()];
4370  signal[0][ieta + 41][iphi] += TS_data[i];
4371  amplitudefullTSs += TS_data[i];
4372  totalAmplitudeHB += TS_data[i];
4373  if (i > 1 && i < 6)
4374  signal3[0][ieta + 41][iphi] += TS_data[i];
4375  }
4376  h_AmplitudeHBtest->Fill(amplitudefullTSs);
4377  } // HB
4379  if (digi->id().subdet() == HcalEndcap) {
4380  double amplitudefullTSs = 0.;
4381  nnnnnnTSHE++;
4382  if (nTS <= numOfTS)
4383  for (int i = 0; i < nTS; i++) {
4384  TS_data[i] = adc2fC[digi->sample(i).adc()];
4385  signal[1][ieta + 41][iphi] += TS_data[i];
4386  totalAmplitudeHE += TS_data[i];
4387  amplitudefullTSs += TS_data[i];
4388  if (i > 1 && i < 6)
4389  signal3[1][ieta + 41][iphi] += TS_data[i];
4390  }
4391  h_AmplitudeHEtest->Fill(amplitudefullTSs);
4392  } // HE
4393 
4394  } //if(recordHistoes_ && studyCalibCellsHist_)
4396  } //if(recordNtuples_)
4397  } // for HBHE digis
4398  if (totalAmplitudeHB != 0.) {
4399  h_numberofhitsHBtest->Fill(nnnnnnTSHB);
4400  h_totalAmplitudeHB->Fill(totalAmplitudeHB);
4401  h_totalAmplitudeHBperEvent->Fill(float(eventcounter), totalAmplitudeHB);
4402  }
4403  if (totalAmplitudeHE != 0.) {
4404  h_numberofhitsHEtest->Fill(nnnnnnTSHE);
4405  h_totalAmplitudeHE->Fill(totalAmplitudeHE);
4406  h_totalAmplitudeHEperEvent->Fill(float(eventcounter), totalAmplitudeHE);
4407  }
4408  } //hbhe.isValid
4409  } // end flagupgrade
4410  //---------------------------------------------------------------
4412  // upgrade:
4413  if (flagupgradeqie1011_ != 1 && flagupgradeqie1011_ != 4 && flagupgradeqie1011_ != 5 &&
4414  flagupgradeqie1011_ != 10) {
4416  iEvent.getByToken(tok_qie11_, heqie11);
4417  const QIE11DigiCollection& qie11dc =
4418  *(heqie11);
4419  bool gotQIE11Digis = true;
4420  if (!(iEvent.getByToken(tok_qie11_, heqie11)))
4421  gotQIE11Digis = false; //this is a boolean set up to check if there are QIE11gigis in input root file
4422  if (!(heqie11.isValid()))
4423  gotQIE11Digis = false; //if it is not there, leave it false
4424  if (!gotQIE11Digis) {
4425  std::cout << " No QIE11DigiCollection collection is found " << std::endl;
4426  } else {
4428  double totalAmplitudeHBQIE11 = 0.;
4429  double totalAmplitudeHEQIE11 = 0.;
4430  double nnnnnnTSHBQIE11 = 0.;
4431  double nnnnnnTSHEQIE11 = 0.;
4432  for (unsigned int j = 0; j < qie11dc.size(); j++) {
4433  QIE11DataFrame qie11df = static_cast<QIE11DataFrame>(qie11dc[j]);
4434  DetId detid = qie11df.detid();
4435  HcalDetId hcaldetid = HcalDetId(detid);
4436  int eta = hcaldetid.ieta();
4437  int phi = hcaldetid.iphi();
4438  int depth = hcaldetid.depth();
4439  if (depth == 0)
4440  return;
4441  int sub = hcaldetid.subdet(); // 1-HB, 2-HE (HFDigiCollection: 4-HF)
4442  // loop over the samples in the digi
4443  nTS = qie11df.samples();
4445  nnnnnnhbheqie11++;
4446  nnnnnn++;
4448  fillDigiErrorsQIE11(qie11df);
4450  if (recordHistoes_)
4451  fillDigiAmplitudeQIE11(qie11df);
4454  if (sub == 1 && depth == 1 && qwert1 == 0) {
4455  nnnnnn1++;
4456  qwert1 = 1;
4457  }
4458  if (sub == 1 && depth == 2 && qwert2 == 0) {
4459  nnnnnn2++;
4460  qwert2 = 1;
4461  }
4462  if (sub == 2 && depth == 1 && qwert3 == 0) {
4463  nnnnnn3++;
4464  qwert3 = 1;
4465  }
4466  if (sub == 2 && depth == 2 && qwert4 == 0) {
4467  nnnnnn4++;
4468  qwert4 = 1;
4469  }
4470  if (sub == 2 && depth == 3 && qwert5 == 0) {
4471  nnnnnn5++;
4472  qwert5 = 1;
4473  }
4474 
4476  int iphi = phi - 1;
4477  int ieta = eta;
4478  if (ieta > 0)
4479  ieta -= 1;
4480  // HB:
4481  if (sub == 1) {
4482  double amplitudefullTSs1 = 0.;
4483  double amplitudefullTSs6 = 0.;
4484  nnnnnnTSHBQIE11++;
4485  for (int i = 0; i < nTS; ++i) {
4486  int adc = qie11df[i].adc();
4487  double charge1 = adc2fC_QIE11_shunt1[adc];
4488  double charge6 = adc2fC_QIE11_shunt6[adc];
4489  amplitudefullTSs1 += charge1;
4490  amplitudefullTSs6 += charge6;
4491  double charge = charge6;
4492  TS_data[i] = charge;
4493  signal[0][ieta + 41][iphi] += charge;
4494  if (i > 1 && i < 6)
4495  signal3[0][ieta + 41][iphi] += charge;
4496  totalAmplitudeHBQIE11 += charge;
4497  } //for
4498  h_AmplitudeHBtest1->Fill(amplitudefullTSs1, 1.);
4499  h_AmplitudeHBtest6->Fill(amplitudefullTSs6, 1.);
4500  } //HB end
4501  // HE:
4502  if (sub == 2) {
4503  double amplitudefullTSs1 = 0.;
4504  double amplitudefullTSs6 = 0.;
4505  nnnnnnTSHEQIE11++;
4506  for (int i = 0; i < nTS; i++) {
4507  int adc = qie11df[i].adc();
4508  double charge1 = adc2fC_QIE11_shunt1[adc];
4509  double charge6 = adc2fC_QIE11_shunt6[adc];
4510  amplitudefullTSs1 += charge1;
4511  amplitudefullTSs6 += charge6;
4512  double charge = charge6;
4513  TS_data[i] = charge;
4514  signal[1][ieta + 41][iphi] += charge;
4515  if (i > 1 && i < 6)
4516  signal3[1][ieta + 41][iphi] += charge;
4517  totalAmplitudeHEQIE11 += charge;
4518  } //for
4519  h_AmplitudeHEtest1->Fill(amplitudefullTSs1, 1.);
4520  h_AmplitudeHEtest6->Fill(amplitudefullTSs6, 1.);
4521 
4522  } //HE end
4523  } //if(recordHistoes_ && studyCalibCellsHist_)
4524  } // for QIE11 digis
4525 
4526  if (totalAmplitudeHBQIE11 != 0.) {
4527  h_numberofhitsHBtest->Fill(nnnnnnTSHBQIE11);
4528  h_totalAmplitudeHB->Fill(totalAmplitudeHBQIE11);
4529  h_totalAmplitudeHBperEvent->Fill(float(eventcounter), totalAmplitudeHBQIE11);
4530  }
4531  if (totalAmplitudeHEQIE11 != 0.) {
4532  h_numberofhitsHEtest->Fill(nnnnnnTSHEQIE11);
4533  h_totalAmplitudeHE->Fill(totalAmplitudeHEQIE11);
4534  h_totalAmplitudeHEperEvent->Fill(float(eventcounter), totalAmplitudeHEQIE11);
4535  }
4536  } //heqie11.isValid
4537  } // end flagupgrade
4538 
4541  iEvent.getByToken(tok_ho_, ho);
4542  bool gotHODigis = true;
4543  if (!(iEvent.getByToken(tok_ho_, ho)))
4544  gotHODigis = false; //this is a boolean set up to check if there are HOgigis in input root file
4545  if (!(ho.isValid()))
4546  gotHODigis = false; //if it is not there, leave it false
4547  if (!gotHODigis) {
4548  // if(!ho.isValid()) {
4549  std::cout << " No HO collection is found " << std::endl;
4550  } else {
4551  int qwert6 = 0;
4552  double totalAmplitudeHO = 0.;
4553  for (HODigiCollection::const_iterator digi = ho->begin(); digi != ho->end(); digi++) {
4554  eta = digi->id().ieta();
4555  phi = digi->id().iphi();
4556  depth = digi->id().depth();
4557  nTS = digi->size();
4559  counterho++;
4561  if (qwert6 == 0) {
4562  nnnnnn6++;
4563  qwert6 = 1;
4564  }
4567  fillDigiErrorsHO(digi);
4569  if (recordHistoes_)
4570  fillDigiAmplitudeHO(digi);
4573  int iphi = phi - 1;
4574  int ieta = eta;
4575  if (ieta > 0)
4576  ieta -= 1;
4577  double nnnnnnTS = 0.;
4578  double amplitudefullTSs = 0.;
4579  if (nTS <= numOfTS)
4580  for (int i = 0; i < nTS; i++) {
4581  TS_data[i] = adc2fC[digi->sample(i).adc()];
4582  amplitudefullTSs += TS_data[i];
4583  signal[2][ieta + 41][iphi] += TS_data[i];
4584  totalAmplitudeHO += TS_data[i];
4585  if (i > 1 && i < 6)
4586  signal3[2][ieta + 41][iphi] += TS_data[i];
4587  nnnnnnTS++;
4588  } //if for
4589  h_AmplitudeHOtest->Fill(amplitudefullTSs);
4590  h_numberofhitsHOtest->Fill(nnnnnnTS);
4591  } //if(recordHistoes_ && studyCalibCellsHist_)
4592  } //for HODigiCollection
4593 
4594  h_totalAmplitudeHO->Fill(totalAmplitudeHO);
4595  h_totalAmplitudeHOperEvent->Fill(float(eventcounter), totalAmplitudeHO);
4596  } //ho.isValid(
4597  } // flagToUseDigiCollectionsORNot_
4598 
4600  // AZ 04.11.2019
4606  // HBHE: HBHERecHitCollection hbheNoise Noise
4608  iEvent.getByToken(tok_hbheNoise_, hbheNoise);
4609  bool gotHBHERecHitsNoise = true;
4610  if (!(iEvent.getByToken(tok_hbheNoise_, hbheNoise)))
4611  gotHBHERecHitsNoise =
4612  false; //this is a boolean set up to check if there are HBHERecHitsNoise in input root file
4613  if (!(hbheNoise.isValid()))
4614  gotHBHERecHitsNoise = false; //if it is not there, leave it false
4615  if (!gotHBHERecHitsNoise) {
4616  // if(!hbheNoise.isValid()) {
4617  std::cout << " No RecHits HBHENoise collection is found " << std::endl;
4618  } else {
4619  for (HBHERecHitCollection::const_iterator hbheItr = hbheNoise->begin(); hbheItr != hbheNoise->end();
4620  hbheItr++) {
4621  // Recalibration of energy
4622  float icalconst = 1.;
4623  // DetId mydetid = hbheItr->id().rawId();
4624  // if( theRecalib ) icalconst=myRecalib->getValues(mydetid)->getValue();
4625  HBHERecHit aHit(hbheItr->id(), hbheItr->eraw() * icalconst, hbheItr->time());
4626  // HBHERecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
4627  double energyhit = aHit.energy();
4628  DetId id = (*hbheItr).detid();
4629  HcalDetId hid = HcalDetId(id);
4630  int sub = ((hid).rawId() >> 25) & 0x7;
4631 
4632  if (sub == 1)
4633  h_energyhitNoise_HB->Fill(energyhit, 1.);
4634  if (sub == 2)
4635  h_energyhitNoise_HE->Fill(energyhit, 1.);
4636  // if(fabs(energyhit) > 40. ) continue;
4637 
4638  //std::cout<<sub<<std::endl;
4639  if (hid.depth() == 1 && sub == 1 && hid.iphi() == 25) {
4640  if (verbosity < 0)
4641  std::cout << " Noise,sub = " << sub << " mdepth = " << hid.depth() << " ieta= " << hid.ieta()
4642  << " iphi= " << hid.iphi() << " energyhit= " << energyhit << std::endl;
4643  }
4644  if (hid.depth() == 1 && sub == 2 && hid.iphi() == 25) {
4645  if (verbosity < 0)
4646  std::cout << " Noise,sub = " << sub << " mdepth = " << hid.depth() << " ieta= " << hid.ieta()
4647  << " iphi= " << hid.iphi() << " energyhit= " << energyhit << std::endl;
4648  }
4649  int ieta = hid.ieta(); // -15 ... -1; 1... 15 for HB
4650  if (ieta > 0)
4651  ieta -= 1; // -15 ... -1; 0... 14 for HB
4652  int iphi = hid.iphi() - 1;
4653  int mdepth = hid.depth();
4654  recNoiseEnergy0[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
4655  recNoiseEnergy1[sub - 1][mdepth - 1][ieta + 41][iphi] += energyhit;
4656  recNoiseEnergy2[sub - 1][mdepth - 1][ieta + 41][iphi] += pow(energyhit, 2);
4657  } // hbheNoise
4658  } //hbheNoise.isValid(
4660 
4661  // HF: HFRecHitCollection hfNoise Noise
4663  iEvent.getByToken(tok_hfNoise_, hfNoise);
4664  bool gotHFRecHitsNoise = true;
4665  if (!(iEvent.getByToken(tok_hfNoise_, hfNoise)))
4666  gotHFRecHitsNoise = false; //this is a boolean set up to check if there are HFRecHitsNoise in input root file
4667  if (!(hfNoise.isValid()))
4668  gotHFRecHitsNoise = false; //if it is not there, leave it false
4669  if (!gotHFRecHitsNoise) {
4670  // if(!hfNoise.isValid()) {
4671  std::cout << " No RecHits HFNoise collection is found " << std::endl;
4672  } else {
4673  for (HFRecHitCollection::const_iterator hfItr = hfNoise->begin(); hfItr != hfNoise->end(); hfItr++) {
4674  // Recalibration of energy
4675  float icalconst = 1.;
4676  // DetId mydetid = hfItr->id().rawId();
4677  // if( theRecalib ) icalconst=myRecalib->getValues(mydetid)->getValue();
4678  HFRecHit aHit(hfItr->id(), hfItr->energy() * icalconst, hfItr->time());
4679  double energyhit = aHit.energy();
4680  DetId id = (*hfItr).detid();
4681  HcalDetId hid = HcalDetId(id);
4682  int sub = ((hid).rawId() >> 25) & 0x7;
4683 
4684  h_energyhitNoise_HF->Fill(energyhit, 1.);
4685  // if(fabs(energyhit) > 40. ) continue;
4686 
4687  //std::cout<<sub<<std::endl;
4688  if (hid.iphi() == 25) {
4689  if (verbosity < 0)
4690  std::cout << "HF Noise,sub = " << sub << " mdepth = " << hid.depth() << " ieta= " << hid.ieta()
4691  << " iphi= " << hid.iphi() << " energyhit= " << energyhit << std::endl;
4692  }
4693  int ieta = hid.ieta(); // -15 ... -1; 1... 15 for HB
4694  if (ieta > 0)
4695  ieta -= 1; // -15 ... -1; 0... 14 for HB
4696  int iphi = hid.iphi() - 1;
4697  int mdepth = hid.depth();
4698  recNoiseEnergy0[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
4699  recNoiseEnergy1[sub - 1][mdepth - 1][ieta + 41][iphi] += energyhit;
4700  recNoiseEnergy2[sub - 1][mdepth - 1][ieta + 41][iphi] += pow(energyhit, 2);
4701  } // hfNoise
4702  } //hfNoise.isValid(
4704 
4708  // HBHE: HBHERecHitCollection hbheSignal Signal
4710  iEvent.getByToken(tok_hbheSignal_, hbheSignal);
4711  bool gotHBHERecHitsSignal = true;
4712  if (!(iEvent.getByToken(tok_hbheSignal_, hbheSignal)))
4713  gotHBHERecHitsSignal =
4714  false; //this is a boolean set up to check if there are HBHERecHitsSignal in input root file
4715  if (!(hbheSignal.isValid()))
4716  gotHBHERecHitsSignal = false; //if it is not there, leave it false
4717  if (!gotHBHERecHitsSignal) {
4718  // if(!hbheSignal.isValid()) {
4719  std::cout << " No RecHits HBHESignal collection is found " << std::endl;
4720  } else {
4721  for (HBHERecHitCollection::const_iterator hbheItr = hbheSignal->begin(); hbheItr != hbheSignal->end();
4722  hbheItr++) {
4723  // Recalibration of energy
4724  float icalconst = 1.;
4725  // DetId mydetid = hbheItr->id().rawId();
4726  // if( theRecalib ) icalconst=myRecalib->getValues(mydetid)->getValue();
4727  HBHERecHit aHit(hbheItr->id(), hbheItr->eraw() * icalconst, hbheItr->time());
4728  // HBHERecHit aHit(hbheItr->id(), hbheItr->energy() * icalconst, hbheItr->time());
4729  double energyhit = aHit.energy();
4730  DetId id = (*hbheItr).detid();
4731  HcalDetId hid = HcalDetId(id);
4732  int sub = ((hid).rawId() >> 25) & 0x7;
4733 
4734  if (sub == 1)
4735  h_energyhitSignal_HB->Fill(energyhit, 1.);
4736  if (sub == 2)
4737  h_energyhitSignal_HE->Fill(energyhit, 1.);
4738 
4739  //std::cout<<sub<<std::endl;
4740  if (hid.depth() == 1 && sub == 1 && hid.iphi() == 25) {
4741  if (verbosity < 0)
4742  std::cout << "HBHE Signal,sub = " << sub << " mdepth = " << hid.depth() << " ieta= " << hid.ieta()
4743  << " iphi= " << hid.iphi() << " energyhit= " << energyhit << std::endl;
4744  }
4745  if (hid.depth() == 1 && sub == 2 && hid.iphi() == 25) {
4746  if (verbosity < 0)
4747  std::cout << "HBHE Signal,sub = " << sub << " mdepth = " << hid.depth() << " ieta= " << hid.ieta()
4748  << " iphi= " << hid.iphi() << " energyhit= " << energyhit << std::endl;
4749  }
4750  int ieta = hid.ieta(); // -15 ... -1; 1... 15 for HB
4751  if (ieta > 0)
4752  ieta -= 1; // -15 ... -1; 0... 14 for HB
4753  int iphi = hid.iphi() - 1;
4754  int mdepth = hid.depth();
4755  recSignalEnergy0[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
4756  recSignalEnergy1[sub - 1][mdepth - 1][ieta + 41][iphi] += energyhit;
4757  recSignalEnergy2[sub - 1][mdepth - 1][ieta + 41][iphi] += pow(energyhit, 2);
4758  } // hbheSignal
4759  } //hbheSignal.isValid(
4761 
4762  // HF: HFRecHitCollection hfSignal Signal
4764  iEvent.getByToken(tok_hfSignal_, hfSignal);
4765  bool gotHFRecHitsSignal = true;
4766  if (!(iEvent.getByToken(tok_hfSignal_, hfSignal)))
4767  gotHFRecHitsSignal = false; //this is a boolean set up to check if there are HFRecHitsSignal in input root file
4768  if (!(hfSignal.isValid()))
4769  gotHFRecHitsSignal = false; //if it is not there, leave it false
4770  if (!gotHFRecHitsSignal) {
4771  // if(!hfSignal.isValid()) {
4772  std::cout << " No RecHits HFSignal collection is found " << std::endl;
4773  } else {
4774  for (HFRecHitCollection::const_iterator hfItr = hfSignal->begin(); hfItr != hfSignal->end(); hfItr++) {
4775  // Recalibration of energy
4776  float icalconst = 1.;
4777  // DetId mydetid = hfItr->id().rawId();
4778  // if( theRecalib ) icalconst=myRecalib->getValues(mydetid)->getValue();
4779  HFRecHit aHit(hfItr->id(), hfItr->energy() * icalconst, hfItr->time());
4780  double energyhit = aHit.energy();
4781  DetId id = (*hfItr).detid();
4782  HcalDetId hid = HcalDetId(id);
4783  int sub = ((hid).rawId() >> 25) & 0x7;
4784 
4785  h_energyhitSignal_HF->Fill(energyhit, 1.);
4786  // if(fabs(energyhit) > 40. ) continue;
4787 
4788  //std::cout<<sub<<std::endl;
4789  if (hid.iphi() == 25) {
4790  if (verbosity < 0)
4791  std::cout << "HF Signal,sub = " << sub << " mdepth = " << hid.depth() << " ieta= " << hid.ieta()
4792  << " iphi= " << hid.iphi() << " energyhit= " << energyhit << std::endl;
4793  }
4794  int ieta = hid.ieta(); // -15 ... -1; 1... 15 for HB
4795  if (ieta > 0)
4796  ieta -= 1; // -15 ... -1; 0... 14 for HB
4797  int iphi = hid.iphi() - 1;
4798  int mdepth = hid.depth();
4799  recSignalEnergy0[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
4800  recSignalEnergy1[sub - 1][mdepth - 1][ieta + 41][iphi] += energyhit;
4801  recSignalEnergy2[sub - 1][mdepth - 1][ieta + 41][iphi] += pow(energyhit, 2);
4802  } // hfSignal
4803  } //hfSignal.isValid(
4805 
4807  // END of RecHits for phi-symmetry monitoring of calibration group
4808  } // flagIterativeMethodCalibrationGroupReco_ > 0
4810 
4812 
4824  // // // // // // // tocdefault tocampl tocamplchannel: calibration group, Iterative method, coding start 29.08.2019
4825  for (int k0 = 0; k0 < nsub; k0++) {
4826  // HE only, temporary
4827  if (k0 == 1) {
4828  for (int k1 = 0; k1 < ndepth; k1++) {
4829  // k2: 0-81
4830  for (int k2 = 0; k2 < neta; k2++) {
4831  // int k2plot = k2-41;int kkk = k2; if(k2plot >0 ) kkk=k2+1; //-41 +41 !=0
4832  int k2plot = k2 - 41;
4833  int kkk = k2plot; //if(k2plot >=0 ) kkk=k2plot+1; //-41 +40 !=0
4834  //preparation for PHI normalization:
4835  double sumoverphi = 0;
4836  int nsumoverphi = 0;
4837  for (int k3 = 0; k3 < nphi; k3++) {
4838  if (tocamplchannel[k0][k1][k2][k3] != 0) {
4839  sumoverphi += tocamplchannel[k0][k1][k2][k3];
4840  ++nsumoverphi;
4841  if (verbosity < 0)
4842  std::cout << "==== nsumoverphi = " << nsumoverphi << " sumoverphi = " << sumoverphi
4843  << " k1 = " << k1 << " k2 = " << k2 << " kkk = " << kkk << " k3 = " << k3 << std::endl;
4844  } //if != 0
4845  } //k3
4846  // PHI normalization into new massive && filling plots:
4847  for (int k3 = 0; k3 < nphi; k3++) {
4848  if (nsumoverphi != 0) {
4849  maprphinorm[k0][k1][k2][k3] = tocamplchannel[k0][k1][k2][k3] / (sumoverphi / nsumoverphi);
4850  if (verbosity < 0)
4851  std::cout << "nsumoverphi= " << nsumoverphi << " sumoverphi= " << sumoverphi << " k1= " << k1
4852  << " k2= " << k2 << " kkk= " << kkk << " k3= " << k3
4853  << " maprphinorm= " << maprphinorm[k0][k1][k2][k3] << std::endl;
4854  if (k1 == 0) {
4855  h_mapenophinorm_HE1->Fill(double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3]);
4856  h_mapenophinorm2_HE1->Fill(
4857  double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3] * tocamplchannel[k0][k1][k2][k3]);
4858  h_maprphinorm_HE1->Fill(double(kkk), double(k3), maprphinorm[k0][k1][k2][k3]);
4859  h_maprphinorm2_HE1->Fill(
4860  double(kkk), double(k3), maprphinorm[k0][k1][k2][k3] * maprphinorm[k0][k1][k2][k3]);
4861  h_maprphinorm0_HE1->Fill(double(kkk), double(k3), 1.);
4862  }
4863  if (k1 == 1) {
4864  h_mapenophinorm_HE2->Fill(double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3]);
4865  h_mapenophinorm2_HE2->Fill(
4866  double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3] * tocamplchannel[k0][k1][k2][k3]);
4867  h_maprphinorm_HE2->Fill(double(kkk), double(k3), maprphinorm[k0][k1][k2][k3]);
4868  h_maprphinorm2_HE2->Fill(
4869  double(kkk), double(k3), maprphinorm[k0][k1][k2][k3] * maprphinorm[k0][k1][k2][k3]);
4870  h_maprphinorm0_HE2->Fill(double(kkk), double(k3), 1.);
4871  }
4872  if (k1 == 2) {
4873  h_mapenophinorm_HE3->Fill(double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3]);
4874  h_mapenophinorm2_HE3->Fill(
4875  double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3] * tocamplchannel[k0][k1][k2][k3]);
4876  h_maprphinorm_HE3->Fill(double(kkk), double(k3), maprphinorm[k0][k1][k2][k3]);
4877  h_maprphinorm2_HE3->Fill(
4878  double(kkk), double(k3), maprphinorm[k0][k1][k2][k3] * maprphinorm[k0][k1][k2][k3]);
4879  h_maprphinorm0_HE3->Fill(double(kkk), double(k3), 1.);
4880  }
4881  if (k1 == 3) {
4882  h_mapenophinorm_HE4->Fill(double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3]);
4883  h_mapenophinorm2_HE4->Fill(
4884  double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3] * tocamplchannel[k0][k1][k2][k3]);
4885  h_maprphinorm_HE4->Fill(double(kkk), double(k3), maprphinorm[k0][k1][k2][k3]);
4886  h_maprphinorm2_HE4->Fill(
4887  double(kkk), double(k3), maprphinorm[k0][k1][k2][k3] * maprphinorm[k0][k1][k2][k3]);
4888  h_maprphinorm0_HE4->Fill(double(kkk), double(k3), 1.);
4889  }
4890  if (k1 == 4) {
4891  h_mapenophinorm_HE5->Fill(double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3]);
4892  h_mapenophinorm2_HE5->Fill(
4893  double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3] * tocamplchannel[k0][k1][k2][k3]);
4894  h_maprphinorm_HE5->Fill(double(kkk), double(k3), maprphinorm[k0][k1][k2][k3]);
4895  h_maprphinorm2_HE5->Fill(
4896  double(kkk), double(k3), maprphinorm[k0][k1][k2][k3] * maprphinorm[k0][k1][k2][k3]);
4897  h_maprphinorm0_HE5->Fill(double(kkk), double(k3), 1.);
4898  }
4899  if (k1 == 5) {
4900  h_mapenophinorm_HE6->Fill(double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3]);
4901  h_mapenophinorm2_HE6->Fill(
4902  double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3] * tocamplchannel[k0][k1][k2][k3]);
4903  h_maprphinorm_HE6->Fill(double(kkk), double(k3), maprphinorm[k0][k1][k2][k3]);
4904  h_maprphinorm2_HE6->Fill(
4905  double(kkk), double(k3), maprphinorm[k0][k1][k2][k3] * maprphinorm[k0][k1][k2][k3]);
4906  h_maprphinorm0_HE6->Fill(double(kkk), double(k3), 1.);
4907  }
4908  if (k1 == 6) {
4909  h_mapenophinorm_HE7->Fill(double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3]);
4910  h_mapenophinorm2_HE7->Fill(
4911  double(kkk), double(k3), tocamplchannel[k0][k1][k2][k3] * tocamplchannel[k0][k1][k2][k3]);
4912  h_maprphinorm_HE7->Fill(double(kkk), double(k3), maprphinorm[k0][k1][k2][k3]);
4913  h_maprphinorm2_HE7->Fill(
4914  double(kkk), double(k3), maprphinorm[k0][k1][k2][k3] * maprphinorm[k0][k1][k2][k3]);
4915  h_maprphinorm0_HE7->Fill(double(kkk), double(k3), 1.);
4916  }
4917  } //if nsumoverphi != 0
4918  } //k3
4919  } //k2
4920  } //k1
4921  } //if k0 == 1 HE
4922  } //k0
4923  // // // // // // // // // // // // // // // // // // // // // // // //
4924  // // // // // // // amplitudechannel amplitudechannel amplitudechannel: calibration group, Iterative method, coding start 11.11.2019
4925  for (int k0 = 0; k0 < nsub; k0++) {
4926  // HB:
4927  if (k0 == 0) {
4928  for (int k1 = 0; k1 < ndepth; k1++) {
4929  // k2: 0-81
4930  for (int k2 = 0; k2 < neta; k2++) {
4931  // int k2plot = k2-41;int kkk = k2; if(k2plot >0 ) kkk=k2+1; //-41 +41 !=0
4932  int k2plot = k2 - 41;
4933  int kkk = k2plot; // if(k2plot >=0 ) kkk=k2plot+1; //-41 +40 !=0
4934  for (int k3 = 0; k3 < nphi; k3++) {
4935  if (k1 == 0) {
4936  h_amplitudechannel0_HB1->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4937  h_amplitudechannel1_HB1->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4938  h_amplitudechannel2_HB1->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4939  }
4940  if (k1 == 1) {
4941  h_amplitudechannel0_HB2->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4942  h_amplitudechannel1_HB2->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4943  h_amplitudechannel2_HB2->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4944  }
4945  if (k1 == 2) {
4946  h_amplitudechannel0_HB3->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4947  h_amplitudechannel1_HB3->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4948  h_amplitudechannel2_HB3->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4949  }
4950  if (k1 == 3) {
4951  h_amplitudechannel0_HB4->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4952  h_amplitudechannel1_HB4->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4953  h_amplitudechannel2_HB4->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4954  }
4955  } //k3
4956  } //k2
4957  } //k1
4958  } //if k0 == 0 HB
4959 
4960  // HE:
4961  if (k0 == 1) {
4962  for (int k1 = 0; k1 < ndepth; k1++) {
4963  // k2: 0-81
4964  for (int k2 = 0; k2 < neta; k2++) {
4965  // int k2plot = k2-41;int kkk = k2; if(k2plot >0 ) kkk=k2+1; //-41 +41 !=0
4966  int k2plot = k2 - 41;
4967  int kkk = k2plot; // if(k2plot >=0 ) kkk=k2plot+1; //-41 +40 !=0
4968  for (int k3 = 0; k3 < nphi; k3++) {
4969  if (k1 == 0) {
4970  h_amplitudechannel0_HE1->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4971  h_amplitudechannel1_HE1->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4972  h_amplitudechannel2_HE1->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4973  }
4974  if (k1 == 1) {
4975  h_amplitudechannel0_HE2->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4976  h_amplitudechannel1_HE2->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4977  h_amplitudechannel2_HE2->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4978  }
4979  if (k1 == 2) {
4980  h_amplitudechannel0_HE3->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4981  h_amplitudechannel1_HE3->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4982  h_amplitudechannel2_HE3->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4983  }
4984  if (k1 == 3) {
4985  h_amplitudechannel0_HE4->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4986  h_amplitudechannel1_HE4->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4987  h_amplitudechannel2_HE4->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4988  }
4989  if (k1 == 4) {
4990  h_amplitudechannel0_HE5->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4991  h_amplitudechannel1_HE5->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4992  h_amplitudechannel2_HE5->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4993  }
4994  if (k1 == 5) {
4995  h_amplitudechannel0_HE6->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
4996  h_amplitudechannel1_HE6->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
4997  h_amplitudechannel2_HE6->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
4998  }
4999  if (k1 == 6) {
5000  h_amplitudechannel0_HE7->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
5001  h_amplitudechannel1_HE7->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
5002  h_amplitudechannel2_HE7->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
5003  }
5004  } //k3
5005  } //k2
5006  } //k1
5007  } //if k0 == 1 HE
5008 
5009  // HF: 4 depthes for Digis and only 2 - for Reco !!!
5010  if (k0 == 3) {
5011  for (int k1 = 0; k1 < ndepth; k1++) {
5012  // k2: 0-81
5013  for (int k2 = 0; k2 < neta; k2++) {
5014  // int k2plot = k2-41;int kkk = k2; if(k2plot >0 ) kkk=k2+1; //-41 +41 !=0
5015  int k2plot = k2 - 41;
5016  int kkk = k2plot; // if(k2plot >=0 ) kkk=k2plot+1; //-41 +40 !=0
5017  for (int k3 = 0; k3 < nphi; k3++) {
5018  if (k1 == 0) {
5019  h_amplitudechannel0_HF1->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
5020  h_amplitudechannel1_HF1->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
5021  h_amplitudechannel2_HF1->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
5022  }
5023  if (k1 == 1) {
5024  h_amplitudechannel0_HF2->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
5025  h_amplitudechannel1_HF2->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
5026  h_amplitudechannel2_HF2->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
5027  }
5028  if (k1 == 2) {
5029  h_amplitudechannel0_HF3->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
5030  h_amplitudechannel1_HF3->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
5031  h_amplitudechannel2_HF3->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
5032  }
5033  if (k1 == 3) {
5034  h_amplitudechannel0_HF4->Fill(double(kkk), double(k3), amplitudechannel0[k0][k1][k2][k3]);
5035  h_amplitudechannel1_HF4->Fill(double(kkk), double(k3), amplitudechannel[k0][k1][k2][k3]);
5036  h_amplitudechannel2_HF4->Fill(double(kkk), double(k3), amplitudechannel2[k0][k1][k2][k3]);
5037  }
5038  } //k3
5039  } //k2
5040  } //k1
5041  } //if k0 == 3 HF
5042 
5043  } //k0
5044 
5045  } // if(flagIterativeMethodCalibrationGroupDigi
5046 
5056  //
5057  for (int k0 = 0; k0 < nsub; k0++) {
5058  // HB:
5059  if (k0 == 0) {
5060  for (int k1 = 0; k1 < ndepth; k1++) {
5061  // k2: 0-81
5062  for (int k2 = 0; k2 < neta; k2++) {
5063  // int k2plot = k2-41;int kkk = k2; if(k2plot >0 ) kkk=k2+1; //-41 +41 !=0
5064  int k2plot = k2 - 41;
5065  int kkk = k2plot; // if(k2plot >=0 ) kkk=k2plot+1; //-41 +40 !=0
5066  for (int k3 = 0; k3 < nphi; k3++) {
5067  if (k1 == 0) {
5068  h_recSignalEnergy0_HB1->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5069  h_recSignalEnergy1_HB1->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5070  h_recSignalEnergy2_HB1->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5071  h_recNoiseEnergy0_HB1->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5072  h_recNoiseEnergy1_HB1->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5073  h_recNoiseEnergy2_HB1->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5074  }
5075  if (k1 == 1) {
5076  h_recSignalEnergy0_HB2->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5077  h_recSignalEnergy1_HB2->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5078  h_recSignalEnergy2_HB2->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5079  h_recNoiseEnergy0_HB2->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5080  h_recNoiseEnergy1_HB2->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5081  h_recNoiseEnergy2_HB2->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5082  }
5083  if (k1 == 2) {
5084  h_recSignalEnergy0_HB3->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5085  h_recSignalEnergy1_HB3->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5086  h_recSignalEnergy2_HB3->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5087  h_recNoiseEnergy0_HB3->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5088  h_recNoiseEnergy1_HB3->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5089  h_recNoiseEnergy2_HB3->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5090  }
5091  if (k1 == 3) {
5092  h_recSignalEnergy0_HB4->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5093  h_recSignalEnergy1_HB4->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5094  h_recSignalEnergy2_HB4->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5095  h_recNoiseEnergy0_HB4->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5096  h_recNoiseEnergy1_HB4->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5097  h_recNoiseEnergy2_HB4->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5098  }
5099  } //k3
5100  } //k2
5101  } //k1
5102  } //if k0 == 0 HB
5103 
5104  // HE:
5105  if (k0 == 1) {
5106  for (int k1 = 0; k1 < ndepth; k1++) {
5107  // k2: 0-81
5108  for (int k2 = 0; k2 < neta; k2++) {
5109  // int k2plot = k2-41;int kkk = k2; if(k2plot >0 ) kkk=k2+1; //-41 +41 !=0
5110  int k2plot = k2 - 41;
5111  int kkk = k2plot; // if(k2plot >=0 ) kkk=k2plot+1; //-41 +40 !=0
5112  for (int k3 = 0; k3 < nphi; k3++) {
5113  if (k1 == 0) {
5114  h_recSignalEnergy0_HE1->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5115  h_recSignalEnergy1_HE1->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5116  h_recSignalEnergy2_HE1->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5117  h_recNoiseEnergy0_HE1->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5118  h_recNoiseEnergy1_HE1->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5119  h_recNoiseEnergy2_HE1->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5120  }
5121  if (k1 == 1) {
5122  h_recSignalEnergy0_HE2->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5123  h_recSignalEnergy1_HE2->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5124  h_recSignalEnergy2_HE2->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5125  h_recNoiseEnergy0_HE2->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5126  h_recNoiseEnergy1_HE2->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5127  h_recNoiseEnergy2_HE2->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5128  }
5129  if (k1 == 2) {
5130  h_recSignalEnergy0_HE3->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5131  h_recSignalEnergy1_HE3->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5132  h_recSignalEnergy2_HE3->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5133  h_recNoiseEnergy0_HE3->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5134  h_recNoiseEnergy1_HE3->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5135  h_recNoiseEnergy2_HE3->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5136  }
5137  if (k1 == 3) {
5138  h_recSignalEnergy0_HE4->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5139  h_recSignalEnergy1_HE4->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5140  h_recSignalEnergy2_HE4->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5141  h_recNoiseEnergy0_HE4->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5142  h_recNoiseEnergy1_HE4->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5143  h_recNoiseEnergy2_HE4->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5144  }
5145  if (k1 == 4) {
5146  h_recSignalEnergy0_HE5->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5147  h_recSignalEnergy1_HE5->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5148  h_recSignalEnergy2_HE5->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5149  h_recNoiseEnergy0_HE5->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5150  h_recNoiseEnergy1_HE5->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5151  h_recNoiseEnergy2_HE5->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5152  }
5153  if (k1 == 5) {
5154  h_recSignalEnergy0_HE6->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5155  h_recSignalEnergy1_HE6->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5156  h_recSignalEnergy2_HE6->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5157  h_recNoiseEnergy0_HE6->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5158  h_recNoiseEnergy1_HE6->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5159  h_recNoiseEnergy2_HE6->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5160  }
5161  if (k1 == 6) {
5162  h_recSignalEnergy0_HE7->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5163  h_recSignalEnergy1_HE7->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5164  h_recSignalEnergy2_HE7->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5165  h_recNoiseEnergy0_HE7->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5166  h_recNoiseEnergy1_HE7->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5167  h_recNoiseEnergy2_HE7->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5168  }
5169  } //k3
5170  } //k2
5171  } //k1
5172  } //if k0 == 1 HE
5173 
5174  // HF: 4 depthes for Digis and only 2 - for Reco !!! ('ve tried to enter 4 for reco since 31.10.2021 AZ)
5175  if (k0 == 3) {
5176  for (int k1 = 0; k1 < ndepth; k1++) {
5177  // k2: 0-81
5178  for (int k2 = 0; k2 < neta; k2++) {
5179  // int k2plot = k2-41;int kkk = k2; if(k2plot >0 ) kkk=k2+1; //-41 +41 !=0
5180  int k2plot = k2 - 41;
5181  int kkk = k2plot; // if(k2plot >=0 ) kkk=k2plot+1; //-41 +40 !=0
5182  for (int k3 = 0; k3 < nphi; k3++) {
5183  if (k1 == 0) {
5184  h_recSignalEnergy0_HF1->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5185  h_recSignalEnergy1_HF1->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5186  h_recSignalEnergy2_HF1->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5187  h_recNoiseEnergy0_HF1->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5188  h_recNoiseEnergy1_HF1->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5189  h_recNoiseEnergy2_HF1->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5190  }
5191  if (k1 == 1) {
5192  h_recSignalEnergy0_HF2->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5193  h_recSignalEnergy1_HF2->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5194  h_recSignalEnergy2_HF2->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5195  h_recNoiseEnergy0_HF2->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5196  h_recNoiseEnergy1_HF2->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5197  h_recNoiseEnergy2_HF2->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5198  }
5199  // AZ 31.10.2021: k1=3 and 4 added for HF recoSignal,recNoise
5200  if (k1 == 2) {
5201  h_recSignalEnergy0_HF3->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5202  h_recSignalEnergy1_HF3->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5203  h_recSignalEnergy2_HF3->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5204  h_recNoiseEnergy0_HF3->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5205  h_recNoiseEnergy1_HF3->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5206  h_recNoiseEnergy2_HF3->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5207  }
5208  if (k1 == 3) {
5209  h_recSignalEnergy0_HF4->Fill(double(kkk), double(k3), recSignalEnergy0[k0][k1][k2][k3]);
5210  h_recSignalEnergy1_HF4->Fill(double(kkk), double(k3), recSignalEnergy1[k0][k1][k2][k3]);
5211  h_recSignalEnergy2_HF4->Fill(double(kkk), double(k3), recSignalEnergy2[k0][k1][k2][k3]);
5212  h_recNoiseEnergy0_HF4->Fill(double(kkk), double(k3), recNoiseEnergy0[k0][k1][k2][k3]);
5213  h_recNoiseEnergy1_HF4->Fill(double(kkk), double(k3), recNoiseEnergy1[k0][k1][k2][k3]);
5214  h_recNoiseEnergy2_HF4->Fill(double(kkk), double(k3), recNoiseEnergy2[k0][k1][k2][k3]);
5215  }
5216  } //k3
5217  } //k2
5218  } //k1
5219  } //if k0 == 3 HF
5220 
5221  } //k0
5222 
5223  } // if(flagIterativeMethodCalibrationGroupReco
5224 
5226 
5228  if (flagLaserRaddam_ > 1) {
5230  for (int k1 = 0; k1 < ndepth; k1++) {
5231  for (int k2 = 0; k2 < neta; k2++) {
5232  for (int k3 = 0; k3 < nphi; k3++) {
5233  if (mapRADDAM0_HE[k1][k2][k3] != 0) {
5234  // ---------------------------------------- D2 sum over phi before!!! any dividing:
5235  mapRADDAM_HED2[k1][k2] += mapRADDAM_HE[k1][k2][k3];
5236  // N phi sectors w/ digihits
5237  ++mapRADDAM_HED20[k1][k2];
5238  } //if
5239  } //for
5240  } //for
5241  } //for
5242 
5244  for (int k1 = 0; k1 < ndepth; k1++) {
5245  for (int k2 = 0; k2 < neta; k2++) {
5246  if (mapRADDAM_HED20[k1][k2] != 0) {
5247  // validation of channels at eta16:
5248  if (k1 == 2 && k2 == 25) {
5250  h_Eta16Depth3RADDAM_HED2->Fill(mapRADDAM_HED2[k1][k2] / mapRADDAM_HED20[k1][k2]);
5252  } else if (k1 == 2 && k2 == 56) {
5254  h_Eta16Depth3RADDAM_HED2P->Fill(mapRADDAM_HED2[k1][k2] / mapRADDAM_HED20[k1][k2]);
5256  } else {
5260  }
5262  mapRADDAM_HED2[k1][k2] /= mapRADDAM_HED20[k1][k2];
5263  } // if(mapRADDAM_HED20[k1][k2] != 0
5264  } //for
5265  } //for
5267  for (int k1 = 0; k1 < ndepth; k1++) {
5268  for (int k2 = 0; k2 < neta; k2++) {
5269  if (k1 == 2 && (k2 == 25 || k2 == 56)) {
5270  } else {
5271  // if(k2!=25 && k2!=56) {
5272  int k2plot = k2 - 41;
5273  int kkk = k2;
5274  if (k2plot > 0)
5275  kkk = k2 + 1;
5276  int kk2 = 25;
5277  if (k2plot > 0)
5278  kk2 = 56;
5279  if (mapRADDAM_HED2[k1][k2] != 0. && mapRADDAM_HED2[2][kk2] != 0) {
5280  mapRADDAM_HED2[k1][k2] /= mapRADDAM_HED2[2][kk2];
5281  // (d1 & eta 17-29) L1
5282  int LLLLLL111111 = 0;
5283  if ((k1 == 0 && fabs(kkk - 41) > 16 && fabs(kkk - 41) < 30))
5284  LLLLLL111111 = 1;
5285  // (d2 & eta 17-26) && (d3 & eta 27-28) L2
5286  int LLLLLL222222 = 0;
5287  if ((k1 == 1 && fabs(kkk - 41) > 16 && fabs(kkk - 41) < 27) ||
5288  (k1 == 2 && fabs(kkk - 41) > 26 && fabs(kkk - 41) < 29))
5289  LLLLLL222222 = 1;
5290  //
5291  if (LLLLLL111111 == 1) {
5292  h_sigLayer1RADDAM5_HED2->Fill(double(kkk - 41), mapRADDAM_HED2[k1][k2]);
5293  h_sigLayer1RADDAM6_HED2->Fill(double(kkk - 41), 1.);
5294  }
5295  if (LLLLLL222222 == 1) {
5296  h_sigLayer2RADDAM5_HED2->Fill(double(kkk - 41), mapRADDAM_HED2[k1][k2]);
5297  h_sigLayer2RADDAM6_HED2->Fill(double(kkk - 41), 1.);
5298  }
5299  } //if
5300  } // if(k2!=25 && k2!=56
5301  } //for
5302  } //for
5303 
5305 
5306  //------------------------------------------------------ aver per eta 16(depth=3-> k1=2, k2=16(15) :
5308  for (int k1 = 0; k1 < ndepth; k1++) {
5309  for (int k2 = 0; k2 < neta; k2++) {
5310  if (k1 == 2 && (k2 == 25 || k2 == 56)) {
5311  } else {
5312  int k2plot = k2 - 41;
5313  int kk2 = 25;
5314  if (k2plot > 0)
5315  kk2 = 56;
5316  int kkk = k2;
5317  if (k2plot > 0)
5318  kkk = k2 + 1;
5319  for (int k3 = 0; k3 < nphi; k3++) {
5320  if (mapRADDAM_HE[k1][k2][k3] != 0. && mapRADDAM_HE[2][kk2][k3] != 0) {
5321  mapRADDAM_HE[k1][k2][k3] /= mapRADDAM_HE[2][kk2][k3];
5322  int LLLLLL111111 = 0;
5323  if ((k1 == 0 && fabs(kkk - 41) > 16 && fabs(kkk - 41) < 30))
5324  LLLLLL111111 = 1;
5325  int LLLLLL222222 = 0;
5326  if ((k1 == 1 && fabs(kkk - 41) > 16 && fabs(kkk - 41) < 27) ||
5327  (k1 == 2 && fabs(kkk - 41) > 26 && fabs(kkk - 41) < 29))
5328  LLLLLL222222 = 1;
5329  if (LLLLLL111111 == 1) {
5330  h_sigLayer1RADDAM5_HE->Fill(double(kkk - 41), mapRADDAM_HE[k1][k2][k3]);
5331  h_sigLayer1RADDAM6_HE->Fill(double(kkk - 41), 1.);
5332  }
5333  if (LLLLLL222222 == 1) {
5334  h_sigLayer2RADDAM5_HE->Fill(double(kkk - 41), mapRADDAM_HE[k1][k2][k3]);
5335  h_sigLayer2RADDAM6_HE->Fill(double(kkk - 41), 1.);
5336  }
5337  } //if
5338  } //for
5339  } // if(k2!=25 && k2!=56
5340  } //for
5341  } //for
5342  //
5344  for (int k1 = 0; k1 < ndepth; k1++) {
5345  for (int k2 = 0; k2 < neta; k2++) {
5346  mapRADDAM_HED2[k1][k2] = 0.;
5347  mapRADDAM_HED20[k1][k2] = 0.;
5348  for (int k3 = 0; k3 < nphi; k3++) {
5349  mapRADDAM_HE[k1][k2][k3] = 0.;
5350  mapRADDAM0_HE[k1][k2][k3] = 0;
5351  } //for
5352  } //for
5353  } //for
5354 
5356  } // END TREATMENT : if(flagLaserRaddam_ == 1
5358 
5360  // // // // // // //sumamplitudes:
5361  int testcount1 = 0;
5362  int testcount2 = 0;
5363  int testcount3 = 0;
5365  for (int k0 = 0; k0 < nsub; k0++) {
5366  int sumofchannels = 0;
5367  double sumamplitudesubdet = 0.;
5368  int sumofchannels0 = 0;
5369  double sumamplitudesubdet0 = 0.;
5370  for (int k2 = 0; k2 < neta; k2++) {
5371  for (int k3 = 0; k3 < nphi; k3++) {
5372  if (amplitudechannel[k0][0][k2][k3] != 0. && amplitudechannel[k0][1][k2][k3] != 0.)
5373  testcount1++;
5374  if (amplitudechannel[k0][0][k2][k3] != 0. && amplitudechannel[k0][1][k2][k3] == 0.)
5375  testcount2++;
5376  if (amplitudechannel[k0][0][k2][k3] == 0. && amplitudechannel[k0][1][k2][k3] != 0.)
5377  testcount3++;
5378 
5379  // HB
5380  if (k0 == 0) {
5381  double sumamplitudechannel_HB = amplitudechannel[k0][0][k2][k3] + amplitudechannel[k0][1][k2][k3];
5382  h_sumamplitudechannel_HB->Fill(sumamplitudechannel_HB);
5383  if (sumamplitudechannel_HB > 80.) {
5384  sumamplitudesubdet += sumamplitudechannel_HB;
5385  sumofchannels++;
5386  } else {
5387  if (sumamplitudechannel_HB > 0.) {
5388  sumamplitudesubdet0 += sumamplitudechannel_HB;
5389  sumofchannels0++;
5390  }
5391  }
5392  } //
5393 
5394  // HE
5395  if (k0 == 1) {
5396  double sumamplitudechannel_HE =
5397  amplitudechannel[k0][0][k2][k3] + amplitudechannel[k0][1][k2][k3] + amplitudechannel[k0][2][k2][k3];
5398  h_sumamplitudechannel_HE->Fill(sumamplitudechannel_HE);
5399  if (sumamplitudechannel_HE > 200.) {
5400  sumamplitudesubdet += sumamplitudechannel_HE;
5401  sumofchannels++;
5402  } else {
5403  if (sumamplitudechannel_HE > 0.) {
5404  sumamplitudesubdet0 += sumamplitudechannel_HE;
5405  sumofchannels0++;
5406  }
5407  }
5408  } //
5409 
5410  // HO
5411  if (k0 == 2) {
5412  double sumamplitudechannel_HO = amplitudechannel[k0][3][k2][k3];
5413  h_sumamplitudechannel_HO->Fill(sumamplitudechannel_HO);
5414  if (sumamplitudechannel_HO > 1200.) {
5415  sumamplitudesubdet += sumamplitudechannel_HO;
5416  sumofchannels++;
5417  } else {
5418  if (sumamplitudechannel_HO > 0.) {
5419  sumamplitudesubdet0 += sumamplitudechannel_HO;
5420  sumofchannels0++;
5421  }
5422  }
5423  } //
5424  // HF
5425  if (k0 == 3) {
5426  double sumamplitudechannel_HF = amplitudechannel[k0][0][k2][k3] + amplitudechannel[k0][1][k2][k3];
5427  h_sumamplitudechannel_HF->Fill(sumamplitudechannel_HF);
5428  if (sumamplitudechannel_HF > 600.) {
5429  sumamplitudesubdet += sumamplitudechannel_HF;
5430  sumofchannels++;
5431  } else {
5432  if (sumamplitudechannel_HF > 0.) {
5433  sumamplitudesubdet0 += sumamplitudechannel_HF;
5434  sumofchannels0++;
5435  }
5436  }
5437  } //
5438 
5439  } //k3
5440  } //k2
5441  // }//k1
5442  // SA of each sub-detector DONE. Then: summarize or find maximum throught events of LS
5443  if (k0 == 0) {
5444  h_eventamplitude_HB->Fill((sumamplitudesubdet + sumamplitudesubdet0));
5445  h_eventoccupancy_HB->Fill((sumofchannels + sumofchannels0));
5446  if ((sumamplitudesubdet + sumamplitudesubdet0) > maxxSUM1)
5447  maxxSUM1 = sumamplitudesubdet + sumamplitudesubdet0;
5448  if ((sumofchannels + sumofchannels0) > maxxOCCUP1)
5449  maxxOCCUP1 = sumofchannels + sumofchannels0;
5450  averSIGNALoccupancy_HB += sumofchannels;
5451  averSIGNALsumamplitude_HB += sumamplitudesubdet;
5452  averNOSIGNALoccupancy_HB += sumofchannels0;
5453  averNOSIGNALsumamplitude_HB += sumamplitudesubdet0;
5454  if ((sumamplitudesubdet + sumamplitudesubdet0) > 60000) {
5455  for (int k2 = 0; k2 < neta; k2++) {
5456  for (int k3 = 0; k3 < nphi; k3++) {
5457  int ieta = k2 - 41;
5459  if (amplitudechannel[k0][0][k2][k3] != 0.) {
5460  h_2DAtaildepth1_HB->Fill(double(ieta), double(k3), amplitudechannel[k0][0][k2][k3]);
5461  h_2D0Ataildepth1_HB->Fill(double(ieta), double(k3), 1.);
5462  }
5464  if (amplitudechannel[k0][1][k2][k3] != 0.) {
5465  h_2DAtaildepth2_HB->Fill(double(ieta), double(k3), amplitudechannel[k0][1][k2][k3]);
5466  h_2D0Ataildepth2_HB->Fill(double(ieta), double(k3), 1.);
5467  }
5468  } //for
5469  } //for
5470  } //>60000
5471  } //HB
5472  if (k0 == 1) {
5473  h_eventamplitude_HE->Fill((sumamplitudesubdet + sumamplitudesubdet0));
5474  h_eventoccupancy_HE->Fill((sumofchannels + sumofchannels0));
5475  if ((sumamplitudesubdet + sumamplitudesubdet0) > maxxSUM2)
5476  maxxSUM2 = sumamplitudesubdet + sumamplitudesubdet0;
5477  if ((sumofchannels + sumofchannels0) > maxxOCCUP2)
5478  maxxOCCUP2 = sumofchannels + sumofchannels0;
5479  averSIGNALoccupancy_HE += sumofchannels;
5480  averSIGNALsumamplitude_HE += sumamplitudesubdet;
5481  averNOSIGNALoccupancy_HE += sumofchannels0;
5482  averNOSIGNALsumamplitude_HE += sumamplitudesubdet0;
5483  } //HE
5484  if (k0 == 2) {
5485  h_eventamplitude_HO->Fill((sumamplitudesubdet + sumamplitudesubdet0));
5486  h_eventoccupancy_HO->Fill((sumofchannels + sumofchannels0));
5487  if ((sumamplitudesubdet + sumamplitudesubdet0) > maxxSUM3)
5488  maxxSUM3 = sumamplitudesubdet + sumamplitudesubdet0;
5489  if ((sumofchannels + sumofchannels0) > maxxOCCUP3)
5490  maxxOCCUP3 = sumofchannels + sumofchannels0;
5491  averSIGNALoccupancy_HO += sumofchannels;
5492  averSIGNALsumamplitude_HO += sumamplitudesubdet;
5493  averNOSIGNALoccupancy_HO += sumofchannels0;
5494  averNOSIGNALsumamplitude_HO += sumamplitudesubdet0;
5495  } //HO
5496  if (k0 == 3) {
5497  h_eventamplitude_HF->Fill((sumamplitudesubdet + sumamplitudesubdet0));
5498  h_eventoccupancy_HF->Fill((sumofchannels + sumofchannels0));
5499  if ((sumamplitudesubdet + sumamplitudesubdet0) > maxxSUM4)
5500  maxxSUM4 = sumamplitudesubdet + sumamplitudesubdet0;
5501  if ((sumofchannels + sumofchannels0) > maxxOCCUP4)
5502  maxxOCCUP4 = sumofchannels + sumofchannels0;
5503  averSIGNALoccupancy_HF += sumofchannels;
5504  averSIGNALsumamplitude_HF += sumamplitudesubdet;
5505  averNOSIGNALoccupancy_HF += sumofchannels0;
5506  averNOSIGNALsumamplitude_HF += sumamplitudesubdet0;
5507  } //HF
5508  } //k0
5509 
5513  int eeeeee;
5514  eeeeee = lscounterM1;
5515  if (flagtoaskrunsorls_ == 0)
5516  eeeeee = runcounter;
5517 
5519  for (int k0 = 0; k0 < nsub; k0++) {
5522  for (int k1 = 0; k1 < ndepth; k1++) {
5524  int nbadchannels = 0;
5525  for (int k2 = 0; k2 < neta; k2++) {
5526  for (int k3 = 0; k3 < nphi; k3++) {
5527  if (badchannels[k0][k1][k2][k3] != 0)
5528  ++nbadchannels;
5529  } //k3
5530  } //k2
5532  //HB
5533  if (k0 == 0) {
5534  if (k1 == 0) {
5535  h_nbadchannels_depth1_HB->Fill(float(nbadchannels));
5536  h_runnbadchannels_depth1_HB->Fill(float(eeeeee), float(nbadchannels));
5537  if (nbadchannels > lsdep_cut1_peak_HBdepth1_)
5538  h_runnbadchannelsC_depth1_HB->Fill(float(eeeeee), float(nbadchannels));
5539  if (nbadchannels != 0)
5540  h_runbadrate_depth1_HB->Fill(float(eeeeee), 1.);
5541  if (nbadchannels > lsdep_cut3_max_HBdepth1_)
5542  h_runbadrateC_depth1_HB->Fill(float(eeeeee), 1.);
5543  h_bcnnbadchannels_depth1_HB->Fill(float(bcn), float(nbadchannels));
5544  h_runbadrate0_depth1_HB->Fill(float(eeeeee), 1.);
5545  h_bcnbadrate0_depth1_HB->Fill(float(bcn), 1.);
5546  }
5547  if (k1 == 1) {
5548  h_nbadchannels_depth2_HB->Fill(float(nbadchannels));
5549  h_runnbadchannels_depth2_HB->Fill(float(eeeeee), float(nbadchannels));
5550  if (nbadchannels > lsdep_cut1_peak_HBdepth2_)
5551  h_runnbadchannelsC_depth2_HB->Fill(float(eeeeee), float(nbadchannels));
5552  if (nbadchannels != 0)
5553  h_runbadrate_depth2_HB->Fill(float(eeeeee), 1.);
5554  if (nbadchannels > lsdep_cut3_max_HBdepth2_)
5555  h_runbadrateC_depth2_HB->Fill(float(eeeeee), 1.);
5556  h_bcnnbadchannels_depth2_HB->Fill(float(bcn), float(nbadchannels));
5557  h_runbadrate0_depth2_HB->Fill(float(eeeeee), 1.);
5558  h_bcnbadrate0_depth2_HB->Fill(float(bcn), 1.);
5559  }
5560  }
5561  //HE
5562  if (k0 == 1) {
5563  if (k1 == 0) {
5564  h_nbadchannels_depth1_HE->Fill(float(nbadchannels));
5565  h_runnbadchannels_depth1_HE->Fill(float(eeeeee), float(nbadchannels));
5566  if (nbadchannels > lsdep_cut1_peak_HEdepth1_)
5567  h_runnbadchannelsC_depth1_HE->Fill(float(eeeeee), float(nbadchannels));
5568  if (nbadchannels != 0)
5569  h_runbadrate_depth1_HE->Fill(float(eeeeee), 1.);
5570  if (nbadchannels > lsdep_cut3_max_HEdepth1_)
5571  h_runbadrateC_depth1_HE->Fill(float(eeeeee), 1.);
5572  h_bcnnbadchannels_depth1_HE->Fill(float(bcn), float(nbadchannels));
5573  h_runbadrate0_depth1_HE->Fill(float(eeeeee), 1.);
5574  h_bcnbadrate0_depth1_HE->Fill(float(bcn), 1.);
5575  }
5576  if (k1 == 1) {
5577  h_nbadchannels_depth2_HE->Fill(float(nbadchannels));
5578  h_runnbadchannels_depth2_HE->Fill(float(eeeeee), float(nbadchannels));
5579  if (nbadchannels > lsdep_cut1_peak_HEdepth2_)
5580  h_runnbadchannelsC_depth2_HE->Fill(float(eeeeee), float(nbadchannels));
5581  if (nbadchannels != 0)
5582  h_runbadrate_depth2_HE->Fill(float(eeeeee), 1.);
5583  if (nbadchannels > lsdep_cut3_max_HEdepth2_)
5584  h_runbadrateC_depth2_HE->Fill(float(eeeeee), 1.);
5585  h_bcnnbadchannels_depth2_HE->Fill(float(bcn), float(nbadchannels));
5586  h_runbadrate0_depth2_HE->Fill(float(eeeeee), 1.);
5587  h_bcnbadrate0_depth2_HE->Fill(float(bcn), 1.);
5588  }
5589  if (k1 == 2) {
5590  h_nbadchannels_depth3_HE->Fill(float(nbadchannels));
5591  h_runnbadchannels_depth3_HE->Fill(float(eeeeee), float(nbadchannels));
5592  if (nbadchannels > lsdep_cut1_peak_HEdepth3_)
5593  h_runnbadchannelsC_depth3_HE->Fill(float(eeeeee), float(nbadchannels));
5594  if (nbadchannels != 0)
5595  h_runbadrate_depth3_HE->Fill(float(eeeeee), 1.);
5596  if (nbadchannels > lsdep_cut3_max_HEdepth3_)
5597  h_runbadrateC_depth3_HE->Fill(float(eeeeee), 1.);
5598  h_bcnnbadchannels_depth3_HE->Fill(float(bcn), float(nbadchannels));
5599  h_runbadrate0_depth3_HE->Fill(float(eeeeee), 1.);
5600  h_bcnbadrate0_depth3_HE->Fill(float(bcn), 1.);
5601  }
5602  }
5603  //HO
5604  if (k0 == 2) {
5605  if (k1 == 3) {
5606  h_nbadchannels_depth4_HO->Fill(float(nbadchannels));
5607  h_runnbadchannels_depth4_HO->Fill(float(eeeeee), float(nbadchannels));
5608  if (nbadchannels > lsdep_cut1_peak_HOdepth4_)
5609  h_runnbadchannelsC_depth4_HO->Fill(float(eeeeee), float(nbadchannels));
5610  if (nbadchannels != 0)
5611  h_runbadrate_depth4_HO->Fill(float(eeeeee), 1.);
5612  if (nbadchannels > lsdep_cut3_max_HOdepth4_)
5613  h_runbadrateC_depth4_HO->Fill(float(eeeeee), 1.);
5614  h_bcnnbadchannels_depth4_HO->Fill(float(bcn), float(nbadchannels));
5615  h_runbadrate0_depth4_HO->Fill(float(eeeeee), 1.);
5616  h_bcnbadrate0_depth4_HO->Fill(float(bcn), 1.);
5617  }
5618  }
5619  //HF
5620  if (k0 == 3) {
5621  if (k1 == 0) {
5622  h_nbadchannels_depth1_HF->Fill(float(nbadchannels));
5623  h_runnbadchannels_depth1_HF->Fill(float(eeeeee), float(nbadchannels));
5624  if (nbadchannels > lsdep_cut1_peak_HFdepth1_)
5625  h_runnbadchannelsC_depth1_HF->Fill(float(eeeeee), float(nbadchannels));
5626  if (nbadchannels != 0)
5627  h_runbadrate_depth1_HF->Fill(float(eeeeee), 1.);
5628  if (nbadchannels > lsdep_cut3_max_HFdepth1_)
5629  h_runbadrateC_depth1_HF->Fill(float(eeeeee), 1.);
5630  h_bcnnbadchannels_depth1_HF->Fill(float(bcn), float(nbadchannels));
5631  h_runbadrate0_depth1_HF->Fill(float(eeeeee), 1.);
5632  h_bcnbadrate0_depth1_HF->Fill(float(bcn), 1.);
5633  }
5634  if (k1 == 1) {
5635  h_nbadchannels_depth2_HF->Fill(float(nbadchannels));
5636  h_runnbadchannels_depth2_HF->Fill(float(eeeeee), float(nbadchannels));
5637  if (nbadchannels > lsdep_cut1_peak_HFdepth2_)
5638  h_runnbadchannelsC_depth2_HF->Fill(float(eeeeee), float(nbadchannels));
5639  if (nbadchannels != 0)
5640  h_runbadrate_depth2_HF->Fill(float(eeeeee), 1.);
5641  if (nbadchannels > lsdep_cut3_max_HFdepth2_)
5642  h_runbadrateC_depth2_HF->Fill(float(eeeeee), 1.);
5643  h_bcnnbadchannels_depth2_HF->Fill(float(bcn), float(nbadchannels));
5644  h_runbadrate0_depth2_HF->Fill(float(eeeeee), 1.);
5645  h_bcnbadrate0_depth2_HF->Fill(float(bcn), 1.);
5646  }
5647  }
5648 
5650  } //k1
5651  } //k0
5653  } //if(recordHistoes_&& studyRunDependenceHist_)
5654 
5657  iEvent.getByToken(tok_calib_, calib);
5658 
5659  bool gotCALIBDigis = true;
5660  if (!(iEvent.getByToken(tok_calib_, calib))) {
5661  gotCALIBDigis = false; //this is a boolean set up to check if there are CALIBgigis in input root file
5662  }
5663  if (!(calib.isValid())) {
5664  gotCALIBDigis = false; //if it is not there, leave it false
5665  }
5666  if (!gotCALIBDigis) {
5667  } else {
5668  for (HcalCalibDigiCollection::const_iterator digi = calib->begin(); digi != calib->end(); digi++) {
5669  int cal_det = digi->id().hcalSubdet(); // 1-HB,2-HE,3-HO,4-HF
5670  int cal_phi = digi->id().iphi();
5671  int cal_eta = digi->id().ieta();
5672  int cal_cbox = digi->id().cboxChannel();
5673 
5676  if (cal_det > 0 && cal_det < 5 && cal_cbox == 0) {
5677  int iphi = cal_phi - 1;
5678  int ieta = cal_eta;
5679  if (ieta > 0)
5680  ieta -= 1;
5681  nTS = digi->size();
5682  double max_signal = -100.;
5683  int ts_with_max_signal = -100;
5684  double timew = 0.;
5685 
5686  //
5687  if (nTS <= numOfTS)
5688  for (int i = 0; i < nTS; i++) {
5689  double ampldefault = adc2fC[digi->sample(i).adc() & 0xff];
5690  if (max_signal < ampldefault) {
5691  max_signal = ampldefault;
5692  ts_with_max_signal = i;
5693  }
5694  if (i > 1 && i < 6)
5695  calib3[cal_det - 1][ieta + 41][iphi] += ampldefault;
5696  calib0[cal_det - 1][ieta + 41][iphi] += ampldefault;
5697  timew += (i + 1) * ampldefault;
5698  } // for
5699  //
5700 
5701  double amplitude = calib0[cal_det - 1][ieta + 41][iphi];
5702  double aveamplitude = -100.;
5703  if (amplitude > 0 && timew > 0)
5704  aveamplitude = timew / amplitude; // average_TS +1
5705  double aveamplitude1 = aveamplitude - 1; // means iTS=0-9
5706  caliba[cal_det - 1][ieta + 41][iphi] = aveamplitude1;
5707 
5708  double rmsamp = 0.;
5709  for (int ii = 0; ii < nTS; ii++) {
5710  double ampldefault = adc2fC[digi->sample(ii).adc() & 0xff];
5711  double aaaaaa = (ii + 1) - aveamplitude;
5712  double aaaaaa2 = aaaaaa * aaaaaa;
5713  rmsamp += (aaaaaa2 * ampldefault); // fC
5714  } //for 2
5715  double rmsamplitude = -100.;
5716  if ((amplitude > 0 && rmsamp > 0) || (amplitude < 0 && rmsamp < 0))
5717  rmsamplitude = sqrt(rmsamp / amplitude);
5718  calibw[cal_det - 1][ieta + 41][iphi] = rmsamplitude;
5719  //
5720  calibt[cal_det - 1][ieta + 41][iphi] = ts_with_max_signal;
5721  //
5722 
5723  if (ts_with_max_signal > -1 && ts_with_max_signal < nTS)
5724  calib2[cal_det - 1][ieta + 41][iphi] = adc2fC[digi->sample(ts_with_max_signal).adc() & 0xff];
5725  if (ts_with_max_signal + 1 > -1 && ts_with_max_signal + 1 < nTS)
5726  calib2[cal_det - 1][ieta + 41][iphi] += adc2fC[digi->sample(ts_with_max_signal + 1).adc() & 0xff];
5727  if (ts_with_max_signal + 2 > -1 && ts_with_max_signal + 2 < nTS)
5728  calib2[cal_det - 1][ieta + 41][iphi] += adc2fC[digi->sample(ts_with_max_signal + 2).adc() & 0xff];
5729  if (ts_with_max_signal - 1 > -1 && ts_with_max_signal - 1 < nTS)
5730  calib2[cal_det - 1][ieta + 41][iphi] += adc2fC[digi->sample(ts_with_max_signal - 1).adc() & 0xff];
5731  if (ts_with_max_signal - 2 > -1 && ts_with_max_signal - 2 < nTS)
5732  calib2[cal_det - 1][ieta + 41][iphi] += adc2fC[digi->sample(ts_with_max_signal - 2).adc() & 0xff];
5733  //
5734  bool anycapid = true;
5735  bool anyer = false;
5736  bool anydv = true;
5737  int error1 = 0, error2 = 0, error3 = 0;
5738  int lastcapid = 0, capid = 0;
5739  for (int ii = 0; ii < (*digi).size(); ii++) {
5740  capid = (*digi)[ii].capid(); // capId (0-3, sequential)
5741  bool er = (*digi)[ii].er(); // error
5742  bool dv = (*digi)[ii].dv(); // valid data
5743  if (ii != 0 && ((lastcapid + 1) % 4) != capid)
5744  anycapid = false;
5745  lastcapid = capid;
5746  if (er)
5747  anyer = true;
5748  if (!dv)
5749  anydv = false;
5750  }
5751  if (!anycapid)
5752  error1 = 1;
5753  if (anyer)
5754  error2 = 1;
5755  if (!anydv)
5756  error3 = 1;
5757  if (error1 != 0 || error2 != 0 || error3 != 0)
5758  calibcapiderror[cal_det - 1][ieta + 41][iphi] = 100;
5759 
5760  } // if(cal_det>0 && cal_det<5
5761  } //if(recordHistoes_ && studyCalibCellsHist_)
5763 
5765  } //if(recordNtuples_) {
5766 
5767  } //for(HcalCalibDigiCollection
5768  } //if(calib.isValid(
5772  for (int k1 = 0; k1 < nsub; k1++) {
5773  for (int k2 = 0; k2 < neta; k2++) {
5774  for (int k3 = 0; k3 < nphi; k3++) {
5775  int k2plot = k2 - 41;
5776  if (flagcpuoptimization_ == 0) {
5778 
5779  if (signal[k1][k2][k3] > 0.) {
5780  if (k1 == 0) {
5781  h_FullSignal3D_HB->Fill(double(k2plot), double(k3), signal[k1][k2][k3]);
5782  h_FullSignal3D0_HB->Fill(double(k2plot), double(k3), 1.);
5783  }
5784  if (k1 == 1) {
5785  h_FullSignal3D_HE->Fill(double(k2plot), double(k3), signal[k1][k2][k3]);
5786  h_FullSignal3D0_HE->Fill(double(k2plot), double(k3), 1.);
5787  }
5788  if (k1 == 2) {
5789  h_FullSignal3D_HO->Fill(double(k2plot), double(k3), signal[k1][k2][k3]);
5790  h_FullSignal3D0_HO->Fill(double(k2plot), double(k3), 1.);
5791  }
5792  if (k1 == 3) {
5793  h_FullSignal3D_HF->Fill(double(k2plot), double(k3), signal[k1][k2][k3]);
5794  h_FullSignal3D0_HF->Fill(double(k2plot), double(k3), 1.);
5795  }
5796  }
5797 
5798  } // optimization
5800 
5802  // k2 = 0-81, k3= 0-71
5803  // return to real indexes in eta and phi ( k20 and k30)
5804  int k20 = k2 - 41; // k20 = -41 - 40
5805  if (k20 > 0 || k20 == 0)
5806  k20 += 1; // k20 = -41 - -1 and +1 - +41
5807  int k30 = k3 + 1; // k30= 1-nphi
5808 
5809  // find calibration indexes in eta and phi ( kk2 and kk3)
5810  int kk2 = 0, kk3 = 0;
5811  if (k1 == 0 || k1 == 1) {
5812  if (k20 > 0)
5813  kk2 = 1;
5814  else
5815  kk2 = -1;
5816  if (k30 == 71 || k30 == nphi || k30 == 1 || k30 == 2)
5817  kk3 = 71;
5818  else
5819  kk3 = ((k30 - 3) / 4) * 4 + 3;
5820  } else if (k1 == 2) {
5821  if (abs(k20) <= 4) {
5822  kk2 = 0;
5823  if (k30 == 71 || k30 == nphi || k30 == 1 || k30 == 2 || k30 == 3 || k30 == 4)
5824  kk3 = 71;
5825  else
5826  kk3 = ((k30 - 5) / 6) * 6 + 5;
5827  } else {
5828  if (abs(k20) > 4 && abs(k20) <= 10)
5829  kk2 = 1;
5830  if (abs(k20) > 10 && abs(k20) <= 15)
5831  kk2 = 2;
5832  if (k20 < 0)
5833  kk2 = -kk2;
5834  if (k30 == 71 || k30 == nphi || (k30 >= 1 && k30 <= 10))
5835  kk3 = 71;
5836  else
5837  kk3 = ((k30 - 11) / 12) * 12 + 11;
5838  }
5839  } else if (k1 == 3) {
5840  if (k20 > 0)
5841  kk2 = 1;
5842  else
5843  kk2 = -1;
5844  if (k30 >= 1 && k30 <= 18)
5845  kk3 = 1;
5846  if (k30 >= 19 && k30 <= 36)
5847  kk3 = 19;
5848  if (k30 >= 37 && k30 <= 54)
5849  kk3 = 37;
5850  if (k30 >= 55 && k30 <= nphi)
5851  kk3 = 55;
5852  }
5853  // return to indexes in massiv
5854  int kkk2 = kk2 + 41;
5855  if (kk2 > 0)
5856  kkk2 -= 1;
5857  int kkk3 = kk3;
5858  kkk3 -= 1;
5859 
5860  if (flagcpuoptimization_ == 0) {
5861  double GetRMSOverNormalizedSignal = -1.;
5862  if (signal[k1][k2][k3] > 0. && calib0[k1][kkk2][kkk3] > 0.) {
5863  GetRMSOverNormalizedSignal = signal[k1][k2][k3] / calib0[k1][kkk2][kkk3];
5864  if (k1 == 0) {
5865  h_mapGetRMSOverNormalizedSignal_HB->Fill(double(k2plot), double(k3), GetRMSOverNormalizedSignal);
5866  h_mapGetRMSOverNormalizedSignal0_HB->Fill(double(k2plot), double(k3), 1.);
5867  }
5868  if (k1 == 1) {
5869  h_mapGetRMSOverNormalizedSignal_HE->Fill(double(k2plot), double(k3), GetRMSOverNormalizedSignal);
5870  h_mapGetRMSOverNormalizedSignal0_HE->Fill(double(k2plot), double(k3), 1.);
5871  }
5872  if (k1 == 2) {
5873  h_mapGetRMSOverNormalizedSignal_HO->Fill(double(k2plot), double(k3), GetRMSOverNormalizedSignal);
5874  h_mapGetRMSOverNormalizedSignal0_HO->Fill(double(k2plot), double(k3), 1.);
5875  }
5876  if (k1 == 3) {
5877  h_mapGetRMSOverNormalizedSignal_HF->Fill(double(k2plot), double(k3), GetRMSOverNormalizedSignal);
5878  h_mapGetRMSOverNormalizedSignal0_HF->Fill(double(k2plot), double(k3), 1.);
5879  }
5880  }
5881  } //optimization
5883  if (signal[k1][k2][k3] > 0.) {
5884  // ADC
5885  double adc = 0.;
5886  if (calib0[k1][kkk2][kkk3] > 0.)
5887  adc = calib0[k1][kkk2][kkk3];
5888  // Ratio
5889  double ratio = 2.;
5890  if (calib0[k1][kkk2][kkk3] > 0.)
5891  ratio = calib2[k1][kkk2][kkk3] / calib0[k1][kkk2][kkk3];
5892  // TSmax
5893  float calibtsmax = calibt[k1][kkk2][kkk3];
5894  // TSmean
5895  float calibtsmean = caliba[k1][kkk2][kkk3];
5896  // Width
5897  float calibwidth = calibw[k1][kkk2][kkk3];
5898  // CapIdErrors
5899  float calibcap = -100.;
5900  calibcap = calibcapiderror[k1][kkk2][kkk3];
5901 
5902  // HB:
5903  if (k1 == 0) {
5904  // ADC
5905  h_ADCCalib_HB->Fill(adc, 1.);
5906  h_ADCCalib1_HB->Fill(adc, 1.);
5907  if (adc < calibrADCHBMin_ || adc > calibrADCHBMax_)
5908  h_mapADCCalib047_HB->Fill(double(k2plot), double(k3), 1.);
5909  h_mapADCCalib_HB->Fill(double(k2plot), double(k3), adc);
5910  // Ratio
5911  h_RatioCalib_HB->Fill(ratio, 1.);
5912  if (ratio < calibrRatioHBMin_ || ratio > calibrRatioHBMax_)
5913  h_mapRatioCalib047_HB->Fill(double(k2plot), double(k3), 1.);
5914  h_mapRatioCalib_HB->Fill(double(k2plot), double(k3), ratio);
5915  // TSmax
5916  if (calibtsmax > -0.5) {
5917  h_TSmaxCalib_HB->Fill(calibtsmax, 1.);
5918  if (calibtsmax < calibrTSmaxHBMin_ || calibtsmax > calibrTSmaxHBMax_)
5919  h_mapTSmaxCalib047_HB->Fill(double(k2plot), double(k3), 1.);
5920  h_mapTSmaxCalib_HB->Fill(double(k2plot), double(k3), calibtsmax);
5921  }
5922  // TSmean
5923  if (calibtsmean > -0.5) {
5924  h_TSmeanCalib_HB->Fill(calibtsmean, 1.);
5925  if (calibtsmean < calibrTSmeanHBMin_ || calibtsmean > calibrTSmeanHBMax_)
5926  h_mapTSmeanCalib047_HB->Fill(double(k2plot), double(k3), 1.);
5927  h_mapTSmeanCalib_HB->Fill(double(k2plot), double(k3), calibtsmean);
5928  }
5929  // Width
5930  if (calibwidth > -0.5) {
5931  h_WidthCalib_HB->Fill(calibwidth, 1.);
5932  if (calibwidth < calibrWidthHBMin_ || calibwidth > calibrWidthHBMax_)
5933  h_mapWidthCalib047_HB->Fill(double(k2plot), double(k3), 1.);
5934  h_mapWidthCalib_HB->Fill(double(k2plot), double(k3), calibwidth);
5935  }
5936  // CapIdErrors
5937  if (calibcap > 0)
5938  h_mapCapCalib047_HB->Fill(double(k2plot), double(k3), 1.);
5939  //
5940  h_map_HB->Fill(double(k2plot), double(k3), 1.);
5941  }
5942  // HE:
5943  if (k1 == 1) {
5944  // ADC
5945  h_ADCCalib_HE->Fill(adc, 1.);
5946  h_ADCCalib1_HE->Fill(adc, 1.);
5947  if (adc < calibrADCHEMin_ || adc > calibrADCHEMax_)
5948  h_mapADCCalib047_HE->Fill(double(k2plot), double(k3), 1.);
5949  h_mapADCCalib_HE->Fill(double(k2plot), double(k3), adc);
5950  // Ratio
5951  h_RatioCalib_HE->Fill(ratio, 1.);
5952  if (ratio < calibrRatioHEMin_ || ratio > calibrRatioHEMax_)
5953  h_mapRatioCalib047_HE->Fill(double(k2plot), double(k3), 1.);
5954  h_mapRatioCalib_HE->Fill(double(k2plot), double(k3), ratio);
5955  // TSmax
5956  if (calibtsmax > -0.5) {
5957  h_TSmaxCalib_HE->Fill(calibtsmax, 1.);
5958  if (calibtsmax < calibrTSmaxHEMin_ || calibtsmax > calibrTSmaxHEMax_)
5959  h_mapTSmaxCalib047_HE->Fill(double(k2plot), double(k3), 1.);
5960  h_mapTSmaxCalib_HE->Fill(double(k2plot), double(k3), calibtsmax);
5961  }
5962  // TSmean
5963  if (calibtsmean > -0.5) {
5964  h_TSmeanCalib_HE->Fill(calibtsmean, 1.);
5965  if (calibtsmean < calibrTSmeanHEMin_ || calibtsmean > calibrTSmeanHEMax_)
5966  h_mapTSmeanCalib047_HE->Fill(double(k2plot), double(k3), 1.);
5967  h_mapTSmeanCalib_HE->Fill(double(k2plot), double(k3), calibtsmean);
5968  }
5969  // Width
5970  if (calibwidth > -0.5) {
5971  h_WidthCalib_HE->Fill(calibwidth, 1.);
5972  if (calibwidth < calibrWidthHEMin_ || calibwidth > calibrWidthHEMax_)
5973  h_mapWidthCalib047_HE->Fill(double(k2plot), double(k3), 1.);
5974  h_mapWidthCalib_HE->Fill(double(k2plot), double(k3), calibwidth);
5975  }
5976  // CapIdErrors
5977  if (calibcap > 0)
5978  h_mapCapCalib047_HE->Fill(double(k2plot), double(k3), 1.);
5979  //
5980  h_map_HE->Fill(double(k2plot), double(k3), 1.);
5981  }
5982  // HO:
5983  if (k1 == 2) {
5984  // ADC
5985  h_ADCCalib_HO->Fill(adc, 1.);
5986  h_ADCCalib1_HO->Fill(adc, 1.);
5987  if (adc < calibrADCHOMin_ || adc > calibrADCHOMax_)
5988  h_mapADCCalib047_HO->Fill(double(k2plot), double(k3), 1.);
5989  h_mapADCCalib_HO->Fill(double(k2plot), double(k3), adc);
5990  // Ratio
5991  h_RatioCalib_HO->Fill(ratio, 1.);
5992  if (ratio < calibrRatioHOMin_ || ratio > calibrRatioHOMax_)
5993  h_mapRatioCalib047_HO->Fill(double(k2plot), double(k3), 1.);
5994  h_mapRatioCalib_HO->Fill(double(k2plot), double(k3), ratio);
5995  // TSmax
5996  if (calibtsmax > -0.5) {
5997  h_TSmaxCalib_HO->Fill(calibtsmax, 1.);
5998  if (calibtsmax < calibrTSmaxHOMin_ || calibtsmax > calibrTSmaxHOMax_)
5999  h_mapTSmaxCalib047_HO->Fill(double(k2plot), double(k3), 1.);
6000  h_mapTSmaxCalib_HO->Fill(double(k2plot), double(k3), calibtsmax);
6001  }
6002  // TSmean
6003  if (calibtsmean > -0.5) {
6004  h_TSmeanCalib_HO->Fill(calibtsmean, 1.);
6005  if (calibtsmean < calibrTSmeanHOMin_ || calibtsmean > calibrTSmeanHOMax_)
6006  h_mapTSmeanCalib047_HO->Fill(double(k2plot), double(k3), 1.);
6007  h_mapTSmeanCalib_HO->Fill(double(k2plot), double(k3), calibtsmean);
6008  }
6009  // Width
6010  if (calibwidth > -0.5) {
6011  h_WidthCalib_HO->Fill(calibwidth, 1.);
6012  if (calibwidth < calibrWidthHOMin_ || calibwidth > calibrWidthHOMax_)
6013  h_mapWidthCalib047_HO->Fill(double(k2plot), double(k3), 1.);
6014  h_mapWidthCalib_HO->Fill(double(k2plot), double(k3), calibwidth);
6015  }
6016  // CapIdErrors
6017  if (calibcap > 0)
6018  h_mapCapCalib047_HO->Fill(double(k2plot), double(k3), 1.);
6019  //
6020  h_map_HO->Fill(double(k2plot), double(k3), 1.);
6021  }
6022  // HF:
6023  if (k1 == 3) {
6024  // ADC
6025  h_ADCCalib_HF->Fill(adc, 1.);
6026  h_ADCCalib1_HF->Fill(adc, 1.);
6027  if (adc < calibrADCHFMin_ || adc > calibrADCHFMax_)
6028  h_mapADCCalib047_HF->Fill(double(k2plot), double(k3), 1.);
6029  h_mapADCCalib_HF->Fill(double(k2plot), double(k3), adc);
6030  // Ratio
6031  h_RatioCalib_HF->Fill(ratio, 1.);
6032  if (ratio < calibrRatioHFMin_ || ratio > calibrRatioHFMax_)
6033  h_mapRatioCalib047_HF->Fill(double(k2plot), double(k3), 1.);
6034  h_mapRatioCalib_HF->Fill(double(k2plot), double(k3), ratio);
6035  // TSmax
6036  if (calibtsmax > -0.5) {
6037  h_TSmaxCalib_HF->Fill(calibtsmax, 1.);
6038  if (calibtsmax < calibrTSmaxHFMin_ || calibtsmax > calibrTSmaxHFMax_)
6039  h_mapTSmaxCalib047_HF->Fill(double(k2plot), double(k3), 1.);
6040  h_mapTSmaxCalib_HF->Fill(double(k2plot), double(k3), calibtsmax);
6041  }
6042  // TSmean
6043  if (calibtsmean > -0.5) {
6044  h_TSmeanCalib_HF->Fill(calibtsmean, 1.);
6045  if (calibtsmean < calibrTSmeanHFMin_ || calibtsmean > calibrTSmeanHFMax_)
6046  h_mapTSmeanCalib047_HF->Fill(double(k2plot), double(k3), 1.);
6047  h_mapTSmeanCalib_HF->Fill(double(k2plot), double(k3), calibtsmean);
6048  }
6049  // Width
6050  if (calibwidth > -0.5) {
6051  h_WidthCalib_HF->Fill(calibwidth, 1.);
6052  if (calibwidth < calibrWidthHFMin_ || calibwidth > calibrWidthHFMax_)
6053  h_mapWidthCalib047_HF->Fill(double(k2plot), double(k3), 1.);
6054  h_mapWidthCalib_HF->Fill(double(k2plot), double(k3), calibwidth);
6055  }
6056  // CapIdErrors
6057  if (calibcap > 0)
6058  h_mapCapCalib047_HF->Fill(double(k2plot), double(k3), 1.);
6059  //
6060  h_map_HF->Fill(double(k2plot), double(k3), 1.);
6061  }
6063  } // if(signal[k1][k2][k3]>0.)
6065  } // k3
6066  } // k2
6067  } // k1
6068 
6070 
6071  } //if(recordHistoes_&& studyCalibCellsHist_)
6072 
6075  myTree->Fill();
6076  // if(recordNtuples_ && nevent < maxNeventsInNtuple_) myTree->Fill();
6077 
6079  if (++local_event % 100 == 0) {
6080  if (verbosity < 0)
6081  std::cout << "run " << Run << " processing events " << local_event << " ok, "
6082  << ", lumi " << lumi << ", numOfLaserEv " << numOfLaserEv << std::endl;
6083  }
6084  } // bcn
6085 
6086  //EndAnalyzer
6087 }
6088 
6089 // ------------ method called once each job just before starting event loop -----------
6091  if (verbosity > 0)
6092  std::cout << "======================== beignJob START +++++++++++++++++++++++++++" << std::endl;
6093  nnnnnn = 0;
6094  nnnnnnhbhe = 0;
6095  nnnnnnhbheqie11 = 0;
6096  nevent = 0;
6097  nevent50 = 0;
6098  counterhf = 0;
6099  counterhfqie10 = 0;
6100  counterho = 0;
6101  nnnnnn1 = 0;
6102  nnnnnn2 = 0;
6103  nnnnnn3 = 0;
6104  nnnnnn4 = 0;
6105  nnnnnn5 = 0;
6106  nnnnnn6 = 0;
6108 
6109  if (recordHistoes_) {
6110  // ha2 = fs_->make<TH2F>("ha2"," ", neta, -41., 41., nphi, 0., bphi);
6111 
6112  h_errorGeneral = fs_->make<TH1F>("h_errorGeneral", " ", 5, 0., 5.);
6113  h_error1 = fs_->make<TH1F>("h_error1", " ", 5, 0., 5.);
6114  h_error2 = fs_->make<TH1F>("h_error2", " ", 5, 0., 5.);
6115  h_error3 = fs_->make<TH1F>("h_error3", " ", 5, 0., 5.);
6116  h_amplError = fs_->make<TH1F>("h_amplError", " ", 100, -2., 98.);
6117  h_amplFine = fs_->make<TH1F>("h_amplFine", " ", 100, -2., 98.);
6118 
6119  h_errorGeneral_HB = fs_->make<TH1F>("h_errorGeneral_HB", " ", 5, 0., 5.);
6120  h_error1_HB = fs_->make<TH1F>("h_error1_HB", " ", 5, 0., 5.);
6121  h_error2_HB = fs_->make<TH1F>("h_error2_HB", " ", 5, 0., 5.);
6122  h_error3_HB = fs_->make<TH1F>("h_error3_HB", " ", 5, 0., 5.);
6123  h_error4_HB = fs_->make<TH1F>("h_error4_HB", " ", 5, 0., 5.);
6124  h_error5_HB = fs_->make<TH1F>("h_error5_HB", " ", 5, 0., 5.);
6125  h_error6_HB = fs_->make<TH1F>("h_error6_HB", " ", 5, 0., 5.);
6126  h_error7_HB = fs_->make<TH1F>("h_error7_HB", " ", 5, 0., 5.);
6127  h_amplError_HB = fs_->make<TH1F>("h_amplError_HB", " ", 100, -2., 98.);
6128  h_amplFine_HB = fs_->make<TH1F>("h_amplFine_HB", " ", 100, -2., 98.);
6129  h_mapDepth1Error_HB = fs_->make<TH2F>("h_mapDepth1Error_HB", " ", neta, -41., 41., nphi, 0., bphi);
6130  h_mapDepth2Error_HB = fs_->make<TH2F>("h_mapDepth2Error_HB", " ", neta, -41., 41., nphi, 0., bphi);
6131  h_mapDepth3Error_HB = fs_->make<TH2F>("h_mapDepth3Error_HB", " ", neta, -41., 41., nphi, 0., bphi);
6132  h_mapDepth4Error_HB = fs_->make<TH2F>("h_mapDepth4Error_HB", " ", neta, -41., 41., nphi, 0., bphi);
6133  h_fiber0_HB = fs_->make<TH1F>("h_fiber0_HB", " ", 10, 0., 10.);
6134  h_fiber1_HB = fs_->make<TH1F>("h_fiber1_HB", " ", 10, 0., 10.);
6135  h_fiber2_HB = fs_->make<TH1F>("h_fiber2_HB", " ", 40, 0., 40.);
6136  h_repetedcapid_HB = fs_->make<TH1F>("h_repetedcapid_HB", " ", 5, 0., 5.);
6137 
6138  h_errorGeneral_HE = fs_->make<TH1F>("h_errorGeneral_HE", " ", 5, 0., 5.);
6139  h_error1_HE = fs_->make<TH1F>("h_error1_HE", " ", 5, 0., 5.);
6140  h_error2_HE = fs_->make<TH1F>("h_error2_HE", " ", 5, 0., 5.);
6141  h_error3_HE = fs_->make<TH1F>("h_error3_HE", " ", 5, 0., 5.);
6142  h_error4_HE = fs_->make<TH1F>("h_error4_HE", " ", 5, 0., 5.);
6143  h_error5_HE = fs_->make<TH1F>("h_error5_HE", " ", 5, 0., 5.);
6144  h_error6_HE = fs_->make<TH1F>("h_error6_HE", " ", 5, 0., 5.);
6145  h_error7_HE = fs_->make<TH1F>("h_error7_HE", " ", 5, 0., 5.);
6146  h_amplError_HE = fs_->make<TH1F>("h_amplError_HE", " ", 100, -2., 98.);
6147  h_amplFine_HE = fs_->make<TH1F>("h_amplFine_HE", " ", 100, -2., 98.);
6148  h_mapDepth1Error_HE = fs_->make<TH2F>("h_mapDepth1Error_HE", " ", neta, -41., 41., nphi, 0., bphi);
6149  h_mapDepth2Error_HE = fs_->make<TH2F>("h_mapDepth2Error_HE", " ", neta, -41., 41., nphi, 0., bphi);
6150  h_mapDepth3Error_HE = fs_->make<TH2F>("h_mapDepth3Error_HE", " ", neta, -41., 41., nphi, 0., bphi);
6151  h_mapDepth4Error_HE = fs_->make<TH2F>("h_mapDepth4Error_HE", " ", neta, -41., 41., nphi, 0., bphi);
6152  h_mapDepth5Error_HE = fs_->make<TH2F>("h_mapDepth5Error_HE", " ", neta, -41., 41., nphi, 0., bphi);
6153  h_mapDepth6Error_HE = fs_->make<TH2F>("h_mapDepth6Error_HE", " ", neta, -41., 41., nphi, 0., bphi);
6154  h_mapDepth7Error_HE = fs_->make<TH2F>("h_mapDepth7Error_HE", " ", neta, -41., 41., nphi, 0., bphi);
6155  h_fiber0_HE = fs_->make<TH1F>("h_fiber0_HE", " ", 10, 0., 10.);
6156  h_fiber1_HE = fs_->make<TH1F>("h_fiber1_HE", " ", 10, 0., 10.);
6157  h_fiber2_HE = fs_->make<TH1F>("h_fiber2_HE", " ", 40, 0., 40.);
6158  h_repetedcapid_HE = fs_->make<TH1F>("h_repetedcapid_HE", " ", 5, 0., 5.);
6159 
6160  h_errorGeneral_HF = fs_->make<TH1F>("h_errorGeneral_HF", " ", 5, 0., 5.);
6161  h_error1_HF = fs_->make<TH1F>("h_error1_HF", " ", 5, 0., 5.);
6162  h_error2_HF = fs_->make<TH1F>("h_error2_HF", " ", 5, 0., 5.);
6163  h_error3_HF = fs_->make<TH1F>("h_error3_HF", " ", 5, 0., 5.);
6164  h_error4_HF = fs_->make<TH1F>("h_error4_HF", " ", 5, 0., 5.);
6165  h_error5_HF = fs_->make<TH1F>("h_error5_HF", " ", 5, 0., 5.);
6166  h_error6_HF = fs_->make<TH1F>("h_error6_HF", " ", 5, 0., 5.);
6167  h_error7_HF = fs_->make<TH1F>("h_error7_HF", " ", 5, 0., 5.);
6168  h_amplError_HF = fs_->make<TH1F>("h_amplError_HF", " ", 100, -2., 98.);
6169  h_amplFine_HF = fs_->make<TH1F>("h_amplFine_HF", " ", 100, -2., 98.);
6170  h_mapDepth1Error_HF = fs_->make<TH2F>("h_mapDepth1Error_HF", " ", neta, -41., 41., nphi, 0., bphi);
6171  h_mapDepth2Error_HF = fs_->make<TH2F>("h_mapDepth2Error_HF", " ", neta, -41., 41., nphi, 0., bphi);
6172  h_mapDepth3Error_HF = fs_->make<TH2F>("h_mapDepth3Error_HF", " ", neta, -41., 41., nphi, 0., bphi);
6173  h_mapDepth4Error_HF = fs_->make<TH2F>("h_mapDepth4Error_HF", " ", neta, -41., 41., nphi, 0., bphi);
6174  h_fiber0_HF = fs_->make<TH1F>("h_fiber0_HF", " ", 10, 0., 10.);
6175  h_fiber1_HF = fs_->make<TH1F>("h_fiber1_HF", " ", 10, 0., 10.);
6176  h_fiber2_HF = fs_->make<TH1F>("h_fiber2_HF", " ", 40, 0., 40.);
6177  h_repetedcapid_HF = fs_->make<TH1F>("h_repetedcapid_HF", " ", 5, 0., 5.);
6178 
6179  h_errorGeneral_HO = fs_->make<TH1F>("h_errorGeneral_HO", " ", 5, 0., 5.);
6180  h_error1_HO = fs_->make<TH1F>("h_error1_HO", " ", 5, 0., 5.);
6181  h_error2_HO = fs_->make<TH1F>("h_error2_HO", " ", 5, 0., 5.);
6182  h_error3_HO = fs_->make<TH1F>("h_error3_HO", " ", 5, 0., 5.);
6183  h_error4_HO = fs_->make<TH1F>("h_error4_HO", " ", 5, 0., 5.);
6184  h_error5_HO = fs_->make<TH1F>("h_error5_HO", " ", 5, 0., 5.);
6185  h_error6_HO = fs_->make<TH1F>("h_error6_HO", " ", 5, 0., 5.);
6186  h_error7_HO = fs_->make<TH1F>("h_error7_HO", " ", 5, 0., 5.);
6187  h_amplError_HO = fs_->make<TH1F>("h_amplError_HO", " ", 100, -2., 98.);
6188  h_amplFine_HO = fs_->make<TH1F>("h_amplFine_HO", " ", 100, -2., 98.);
6189  h_mapDepth4Error_HO = fs_->make<TH2F>("h_mapDepth4Error_HO", " ", neta, -41., 41., nphi, 0., bphi);
6190  h_fiber0_HO = fs_->make<TH1F>("h_fiber0_HO", " ", 10, 0., 10.);
6191  h_fiber1_HO = fs_->make<TH1F>("h_fiber1_HO", " ", 10, 0., 10.);
6192  h_fiber2_HO = fs_->make<TH1F>("h_fiber2_HO", " ", 40, 0., 40.);
6193  h_repetedcapid_HO = fs_->make<TH1F>("h_repetedcapid_HO", " ", 5, 0., 5.);
6194 
6196 
6197  h_numberofhitsHBtest = fs_->make<TH1F>("h_numberofhitsHBtest", " ", 100, 0., 100.);
6198  h_AmplitudeHBtest = fs_->make<TH1F>("h_AmplitudeHBtest", " ", 100, 0., 10000.);
6199  h_AmplitudeHBtest1 = fs_->make<TH1F>("h_AmplitudeHBtest1", " ", 100, 0., 1000000.);
6200  h_AmplitudeHBtest6 = fs_->make<TH1F>("h_AmplitudeHBtest6", " ", 100, 0., 2000000.);
6201  h_totalAmplitudeHB = fs_->make<TH1F>("h_totalAmplitudeHB", " ", 100, 0., 3000000.);
6202  h_totalAmplitudeHBperEvent = fs_->make<TH1F>("h_totalAmplitudeHBperEvent", " ", 1000, 1., 1001.);
6203  // fullAmplitude:
6204  h_ADCAmpl345Zoom_HB = fs_->make<TH1F>("h_ADCAmpl345Zoom_HB", " ", 100, 0., 400.);
6205  h_ADCAmpl345Zoom1_HB = fs_->make<TH1F>("h_ADCAmpl345Zoom1_HB", " ", 100, 0., 100.);
6206  h_ADCAmpl345_HB = fs_->make<TH1F>("h_ADCAmpl345_HB", " ", 100, 10., 3000.);
6207 
6208  h_AmplitudeHBrest = fs_->make<TH1F>("h_AmplitudeHBrest", " ", 100, 0., 10000.);
6209  h_AmplitudeHBrest1 = fs_->make<TH1F>("h_AmplitudeHBrest1", " ", 100, 0., 1000000.);
6210  h_AmplitudeHBrest6 = fs_->make<TH1F>("h_AmplitudeHBrest6", " ", 100, 0., 2000000.);
6211 
6212  h_ADCAmpl345_HBCapIdError = fs_->make<TH1F>("h_ADCAmpl345_HBCapIdError", " ", 100, 10., 3000.);
6213  h_ADCAmpl345_HBCapIdNoError = fs_->make<TH1F>("h_ADCAmpl345_HBCapIdNoError", " ", 100, 10., 3000.);
6214  h_ADCAmpl_HBCapIdError = fs_->make<TH1F>("h_ADCAmpl_HBCapIdError", " ", 100, 10., 3000.);
6215  h_ADCAmpl_HBCapIdNoError = fs_->make<TH1F>("h_ADCAmpl_HBCapIdNoError", " ", 100, 10., 3000.);
6216 
6217  h_ADCAmplZoom_HB = fs_->make<TH1F>("h_ADCAmplZoom_HB", " ", 100, 0., 400.);
6218  h_ADCAmplZoom1_HB = fs_->make<TH1F>("h_ADCAmplZoom1_HB", " ", 100, -20., 80.);
6219  h_ADCAmpl_HB = fs_->make<TH1F>("h_ADCAmpl_HB", " ", 100, 10., 5000.);
6220  h_mapDepth1ADCAmpl225_HB = fs_->make<TH2F>("h_mapDepth1ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6221  h_mapDepth2ADCAmpl225_HB = fs_->make<TH2F>("h_mapDepth2ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6222  h_mapDepth3ADCAmpl225_HB = fs_->make<TH2F>("h_mapDepth3ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6223  h_mapDepth4ADCAmpl225_HB = fs_->make<TH2F>("h_mapDepth4ADCAmpl225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6225  fs_->make<TH2F>("h_mapDepth1ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi);
6227  fs_->make<TH2F>("h_mapDepth2ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi);
6229  fs_->make<TH2F>("h_mapDepth3ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi);
6231  fs_->make<TH2F>("h_mapDepth4ADCAmpl225Copy_HB", " ", neta, -41., 41., nphi, 0., bphi);
6232  h_mapDepth1ADCAmpl_HB = fs_->make<TH2F>("h_mapDepth1ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi);
6233  h_mapDepth2ADCAmpl_HB = fs_->make<TH2F>("h_mapDepth2ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi);
6234  h_mapDepth3ADCAmpl_HB = fs_->make<TH2F>("h_mapDepth3ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi);
6235  h_mapDepth4ADCAmpl_HB = fs_->make<TH2F>("h_mapDepth4ADCAmpl_HB", " ", neta, -41., 41., nphi, 0., bphi);
6236  h_TSmeanA_HB = fs_->make<TH1F>("h_TSmeanA_HB", " ", 100, -1., 11.);
6237  h_mapDepth1TSmeanA225_HB = fs_->make<TH2F>("h_mapDepth1TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6238  h_mapDepth2TSmeanA225_HB = fs_->make<TH2F>("h_mapDepth2TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6239  h_mapDepth3TSmeanA225_HB = fs_->make<TH2F>("h_mapDepth3TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6240  h_mapDepth4TSmeanA225_HB = fs_->make<TH2F>("h_mapDepth4TSmeanA225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6241  h_mapDepth1TSmeanA_HB = fs_->make<TH2F>("h_mapDepth1TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi);
6242  h_mapDepth2TSmeanA_HB = fs_->make<TH2F>("h_mapDepth2TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi);
6243  h_mapDepth3TSmeanA_HB = fs_->make<TH2F>("h_mapDepth3TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi);
6244  h_mapDepth4TSmeanA_HB = fs_->make<TH2F>("h_mapDepth4TSmeanA_HB", " ", neta, -41., 41., nphi, 0., bphi);
6245  h_TSmaxA_HB = fs_->make<TH1F>("h_TSmaxA_HB", " ", 100, -1., 11.);
6246  h_mapDepth1TSmaxA225_HB = fs_->make<TH2F>("h_mapDepth1TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6247  h_mapDepth2TSmaxA225_HB = fs_->make<TH2F>("h_mapDepth2TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6248  h_mapDepth3TSmaxA225_HB = fs_->make<TH2F>("h_mapDepth3TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6249  h_mapDepth4TSmaxA225_HB = fs_->make<TH2F>("h_mapDepth4TSmaxA225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6250  h_mapDepth1TSmaxA_HB = fs_->make<TH2F>("h_mapDepth1TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi);
6251  h_mapDepth2TSmaxA_HB = fs_->make<TH2F>("h_mapDepth2TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi);
6252  h_mapDepth3TSmaxA_HB = fs_->make<TH2F>("h_mapDepth3TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi);
6253  h_mapDepth4TSmaxA_HB = fs_->make<TH2F>("h_mapDepth4TSmaxA_HB", " ", neta, -41., 41., nphi, 0., bphi);
6254  // RMS:
6255  h_Amplitude_HB = fs_->make<TH1F>("h_Amplitude_HB", " ", 100, 0., 5.);
6256  h_mapDepth1Amplitude225_HB = fs_->make<TH2F>("h_mapDepth1Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6257  h_mapDepth2Amplitude225_HB = fs_->make<TH2F>("h_mapDepth2Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6258  h_mapDepth3Amplitude225_HB = fs_->make<TH2F>("h_mapDepth3Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6259  h_mapDepth4Amplitude225_HB = fs_->make<TH2F>("h_mapDepth4Amplitude225_HB", " ", neta, -41., 41., nphi, 0., bphi);
6260  h_mapDepth1Amplitude_HB = fs_->make<TH2F>("h_mapDepth1Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi);
6261  h_mapDepth2Amplitude_HB = fs_->make<TH2F>("h_mapDepth2Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi);
6262  h_mapDepth3Amplitude_HB = fs_->make<TH2F>("h_mapDepth3Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi);
6263  h_mapDepth4Amplitude_HB = fs_->make<TH2F>("h_mapDepth4Amplitude_HB", " ", neta, -41., 41., nphi, 0., bphi);
6264  // Ratio:
6265  h_Ampl_HB = fs_->make<TH1F>("h_Ampl_HB", " ", 100, 0., 1.1);
6266  h_mapDepth1Ampl047_HB = fs_->make<TH2F>("h_mapDepth1Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6267  h_mapDepth2Ampl047_HB = fs_->make<TH2F>("h_mapDepth2Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6268  h_mapDepth3Ampl047_HB = fs_->make<TH2F>("h_mapDepth3Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6269  h_mapDepth4Ampl047_HB = fs_->make<TH2F>("h_mapDepth4Ampl047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6270  h_mapDepth1Ampl_HB = fs_->make<TH2F>("h_mapDepth1Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi);
6271  h_mapDepth2Ampl_HB = fs_->make<TH2F>("h_mapDepth2Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi);
6272  h_mapDepth3Ampl_HB = fs_->make<TH2F>("h_mapDepth3Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi);
6273  h_mapDepth4Ampl_HB = fs_->make<TH2F>("h_mapDepth4Ampl_HB", " ", neta, -41., 41., nphi, 0., bphi);
6274  h_mapDepth1AmplE34_HB = fs_->make<TH2F>("h_mapDepth1AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi);
6275  h_mapDepth2AmplE34_HB = fs_->make<TH2F>("h_mapDepth2AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi);
6276  h_mapDepth3AmplE34_HB = fs_->make<TH2F>("h_mapDepth3AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi);
6277  h_mapDepth4AmplE34_HB = fs_->make<TH2F>("h_mapDepth4AmplE34_HB", " ", neta, -41., 41., nphi, 0., bphi);
6278  h_mapDepth1_HB = fs_->make<TH2F>("h_mapDepth1_HB", " ", neta, -41., 41., nphi, 0., bphi);
6279  h_mapDepth2_HB = fs_->make<TH2F>("h_mapDepth2_HB", " ", neta, -41., 41., nphi, 0., bphi);
6280  h_mapDepth3_HB = fs_->make<TH2F>("h_mapDepth3_HB", " ", neta, -41., 41., nphi, 0., bphi);
6281  h_mapDepth4_HB = fs_->make<TH2F>("h_mapDepth4_HB", " ", neta, -41., 41., nphi, 0., bphi);
6282 
6283  h_mapDepth1TS2_HB = fs_->make<TH2F>("h_mapDepth1TS2_HB", " ", neta, -41., 41., nphi, 0., bphi);
6284  h_mapDepth2TS2_HB = fs_->make<TH2F>("h_mapDepth2TS2_HB", " ", neta, -41., 41., nphi, 0., bphi);
6285  h_mapDepth3TS2_HB = fs_->make<TH2F>("h_mapDepth3TS2_HB", " ", neta, -41., 41., nphi, 0., bphi);
6286  h_mapDepth4TS2_HB = fs_->make<TH2F>("h_mapDepth4TS2_HB", " ", neta, -41., 41., nphi, 0., bphi);
6287  h_mapDepth1TS2_HE = fs_->make<TH2F>("h_mapDepth1TS2_HE", " ", neta, -41., 41., nphi, 0., bphi);
6288  h_mapDepth2TS2_HE = fs_->make<TH2F>("h_mapDepth2TS2_HE", " ", neta, -41., 41., nphi, 0., bphi);
6289  h_mapDepth3TS2_HE = fs_->make<TH2F>("h_mapDepth3TS2_HE", " ", neta, -41., 41., nphi, 0., bphi);
6290  h_mapDepth4TS2_HE = fs_->make<TH2F>("h_mapDepth4TS2_HE", " ", neta, -41., 41., nphi, 0., bphi);
6291  h_mapDepth5TS2_HE = fs_->make<TH2F>("h_mapDepth5TS2_HE", " ", neta, -41., 41., nphi, 0., bphi);
6292  h_mapDepth6TS2_HE = fs_->make<TH2F>("h_mapDepth6TS2_HE", " ", neta, -41., 41., nphi, 0., bphi);
6293  h_mapDepth7TS2_HE = fs_->make<TH2F>("h_mapDepth7TS2_HE", " ", neta, -41., 41., nphi, 0., bphi);
6294  h_recSignalEnergy0_HF3 = fs_->make<TH2F>("h_recSignalEnergy0_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6295  h_recSignalEnergy1_HF3 = fs_->make<TH2F>("h_recSignalEnergy1_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6296  h_recSignalEnergy2_HF3 = fs_->make<TH2F>("h_recSignalEnergy2_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6297  h_recSignalEnergy0_HF4 = fs_->make<TH2F>("h_recSignalEnergy0_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6298  h_recSignalEnergy1_HF4 = fs_->make<TH2F>("h_recSignalEnergy1_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6299  h_recSignalEnergy2_HF4 = fs_->make<TH2F>("h_recSignalEnergy2_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6300  h_recNoiseEnergy0_HF3 = fs_->make<TH2F>("h_recNoiseEnergy0_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6301  h_recNoiseEnergy1_HF3 = fs_->make<TH2F>("h_recNoiseEnergy1_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6302  h_recNoiseEnergy2_HF3 = fs_->make<TH2F>("h_recNoiseEnergy2_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6303  h_recNoiseEnergy0_HF4 = fs_->make<TH2F>("h_recNoiseEnergy0_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6304  h_recNoiseEnergy1_HF4 = fs_->make<TH2F>("h_recNoiseEnergy1_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6305  h_recNoiseEnergy2_HF4 = fs_->make<TH2F>("h_recNoiseEnergy2_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6306  h_mapDepth1TS1_HF = fs_->make<TH2F>("h_mapDepth1TS1_HF", " ", neta, -41., 41., nphi, 0., bphi);
6307  h_mapDepth2TS1_HF = fs_->make<TH2F>("h_mapDepth2TS1_HF", " ", neta, -41., 41., nphi, 0., bphi);
6308  h_mapDepth3TS1_HF = fs_->make<TH2F>("h_mapDepth3TS1_HF", " ", neta, -41., 41., nphi, 0., bphi);
6309  h_mapDepth4TS1_HF = fs_->make<TH2F>("h_mapDepth4TS1_HF", " ", neta, -41., 41., nphi, 0., bphi);
6310  h_mapDepth4TS012_HO = fs_->make<TH2F>("h_mapDepth4TS012_HO", " ", neta, -41., 41., nphi, 0., bphi);
6311 
6313 
6314  // stuff regarding summed(total) Amplitude vs iEvent (histo-name is h_totalAmplitudeHEperEvent)
6315  // to see from which event ALL channels are available(related to quality of the run)
6316  h_numberofhitsHEtest = fs_->make<TH1F>("h_numberofhitsHEtest", " ", 100, 0., 10000.);
6317  h_AmplitudeHEtest = fs_->make<TH1F>("h_AmplitudeHEtest", " ", 100, 0., 1000000.);
6318  h_AmplitudeHEtest1 = fs_->make<TH1F>("h_AmplitudeHEtest1", " ", 100, 0., 1000000.);
6319  h_AmplitudeHEtest6 = fs_->make<TH1F>("h_AmplitudeHEtest6", " ", 100, 0., 2000000.);
6320  h_totalAmplitudeHE = fs_->make<TH1F>("h_totalAmplitudeHE", " ", 100, 0., 10000000000.);
6321  h_totalAmplitudeHEperEvent = fs_->make<TH1F>("h_totalAmplitudeHEperEvent", " ", 1000, 1., 1001.);
6322 
6323  // Aijk Amplitude:
6324  h_ADCAmplZoom1_HE = fs_->make<TH1F>("h_ADCAmplZoom1_HE", " ", npfit, 0., anpfit); // for amplmaxts 1TS w/ max
6325  h_ADCAmpl345Zoom1_HE = fs_->make<TH1F>("h_ADCAmpl345Zoom1_HE", " ", npfit, 0., anpfit); // for ampl3ts 3TSs
6326  h_ADCAmpl345Zoom_HE = fs_->make<TH1F>("h_ADCAmpl345Zoom_HE", " ", npfit, 0., anpfit); // for ampl 4TSs
6328  fs_->make<TH1F>("h_amplitudeaveragedbydepthes_HE", " ", npfit, 0., anpfit); // for cross-check: A spectrum
6330  fs_->make<TH1F>("h_ndepthesperamplitudebins_HE", " ", 10, 0., 10.); // for cross-check: ndepthes
6331 
6332  // Ampl12 4TSs to work with "ped-Gsel0" or "led-low-intensity" to clarify gain diff peak2-peak1
6334  fs_->make<TH2F>("h_mapADCAmplfirstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max
6336  fs_->make<TH2F>("h_mapADCAmplfirstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max
6338  fs_->make<TH2F>("h_mapADCAmplsecondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max
6340  "h_mapADCAmplsecondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for amplmaxts 1TS w/ max
6341 
6343  fs_->make<TH2F>("h_mapADCAmpl11firstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs
6345  fs_->make<TH2F>("h_mapADCAmpl11firstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs
6347  fs_->make<TH2F>("h_mapADCAmpl11secondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs
6349  fs_->make<TH2F>("h_mapADCAmpl11secondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl3ts 3TSs
6350 
6352  fs_->make<TH2F>("h_mapADCAmpl12firstpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs
6354  fs_->make<TH2F>("h_mapADCAmpl12firstpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs
6356  fs_->make<TH2F>("h_mapADCAmpl12secondpeak_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs
6358  fs_->make<TH2F>("h_mapADCAmpl12secondpeak0_HE", " ", neta, -41., 41., nphi, 0., bphi); // for ampl 4TSs
6359 
6360  // Ampl12 4TSs to work with "ped-Gsel0" or "led-low-intensity" to clarify gain diff peak2-peak1 fit results:
6361  h_gsmdifferencefit1_HE = fs_->make<TH1F>("h_gsmdifferencefit1_HE", " ", 80, 20., 60.);
6362  h_gsmdifferencefit2_HE = fs_->make<TH1F>("h_gsmdifferencefit2_HE", " ", 80, 20., 60.);
6363  h_gsmdifferencefit3_HE = fs_->make<TH1F>("h_gsmdifferencefit3_HE", " ", 80, 20., 60.);
6364  h_gsmdifferencefit4_HE = fs_->make<TH1F>("h_gsmdifferencefit4_HE", " ", 80, 20., 60.);
6365  h_gsmdifferencefit5_HE = fs_->make<TH1F>("h_gsmdifferencefit5_HE", " ", 80, 20., 60.);
6366  h_gsmdifferencefit6_HE = fs_->make<TH1F>("h_gsmdifferencefit6_HE", " ", 80, 20., 60.);
6367 
6368  // Aijk Amplitude:
6369  h_ADCAmpl_HE = fs_->make<TH1F>("h_ADCAmpl_HE", " ", 200, 0., 2000000.);
6370  h_ADCAmplrest_HE = fs_->make<TH1F>("h_ADCAmplrest_HE", " ", 100, 0., 500.);
6371  h_ADCAmplrest1_HE = fs_->make<TH1F>("h_ADCAmplrest1_HE", " ", 100, 0., 100.);
6372  h_ADCAmplrest6_HE = fs_->make<TH1F>("h_ADCAmplrest6_HE", " ", 100, 0., 10000.);
6373 
6374  h_ADCAmpl345_HE = fs_->make<TH1F>("h_ADCAmpl345_HE", " ", 70, 0., 700000.);
6375 
6376  // SiPM corrections:
6377  h_corrforxaMAIN_HE = fs_->make<TH1F>("h_corrforxaMAIN_HE", " ", 70, 0., 700000.);
6378  h_corrforxaMAIN0_HE = fs_->make<TH1F>("h_corrforxaMAIN0_HE", " ", 70, 0., 700000.);
6379  h_corrforxaADDI_HE = fs_->make<TH1F>("h_corrforxaADDI_HE", " ", 70, 0., 700000.);
6380  h_corrforxaADDI0_HE = fs_->make<TH1F>("h_corrforxaADDI0_HE", " ", 70, 0., 700000.);
6381 
6382  h_mapDepth1ADCAmpl225_HE = fs_->make<TH2F>("h_mapDepth1ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6383  h_mapDepth2ADCAmpl225_HE = fs_->make<TH2F>("h_mapDepth2ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6384  h_mapDepth3ADCAmpl225_HE = fs_->make<TH2F>("h_mapDepth3ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6385  h_mapDepth4ADCAmpl225_HE = fs_->make<TH2F>("h_mapDepth4ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6386  h_mapDepth5ADCAmpl225_HE = fs_->make<TH2F>("h_mapDepth5ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6387  h_mapDepth6ADCAmpl225_HE = fs_->make<TH2F>("h_mapDepth6ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6388  h_mapDepth7ADCAmpl225_HE = fs_->make<TH2F>("h_mapDepth7ADCAmpl225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6390  fs_->make<TH2F>("h_mapDepth1ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi);
6392  fs_->make<TH2F>("h_mapDepth2ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi);
6394  fs_->make<TH2F>("h_mapDepth3ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi);
6396  fs_->make<TH2F>("h_mapDepth4ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi);
6398  fs_->make<TH2F>("h_mapDepth5ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi);
6400  fs_->make<TH2F>("h_mapDepth6ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi);
6402  fs_->make<TH2F>("h_mapDepth7ADCAmpl225Copy_HE", " ", neta, -41., 41., nphi, 0., bphi);
6403 
6404  h_mapDepth1ADCAmpl_HE = fs_->make<TH2F>("h_mapDepth1ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6405  h_mapDepth2ADCAmpl_HE = fs_->make<TH2F>("h_mapDepth2ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6406  h_mapDepth3ADCAmpl_HE = fs_->make<TH2F>("h_mapDepth3ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6407  h_mapDepth4ADCAmpl_HE = fs_->make<TH2F>("h_mapDepth4ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6408  h_mapDepth5ADCAmpl_HE = fs_->make<TH2F>("h_mapDepth5ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6409  h_mapDepth6ADCAmpl_HE = fs_->make<TH2F>("h_mapDepth6ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6410  h_mapDepth7ADCAmpl_HE = fs_->make<TH2F>("h_mapDepth7ADCAmpl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6411  h_mapDepth1ADCAmplSiPM_HE = fs_->make<TH2F>("h_mapDepth1ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi);
6412  h_mapDepth2ADCAmplSiPM_HE = fs_->make<TH2F>("h_mapDepth2ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi);
6413  h_mapDepth3ADCAmplSiPM_HE = fs_->make<TH2F>("h_mapDepth3ADCAmplSiPM_HE", " ", neta, -41., 41., nphi, 0., bphi);
6414 
6415  h_TSmeanA_HE = fs_->make<TH1F>("h_TSmeanA_HE", " ", 100, -2., 8.);
6416  h_mapDepth1TSmeanA225_HE = fs_->make<TH2F>("h_mapDepth1TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6417  h_mapDepth2TSmeanA225_HE = fs_->make<TH2F>("h_mapDepth2TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6418  h_mapDepth3TSmeanA225_HE = fs_->make<TH2F>("h_mapDepth3TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6419  h_mapDepth4TSmeanA225_HE = fs_->make<TH2F>("h_mapDepth4TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6420  h_mapDepth5TSmeanA225_HE = fs_->make<TH2F>("h_mapDepth5TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6421  h_mapDepth6TSmeanA225_HE = fs_->make<TH2F>("h_mapDepth6TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6422  h_mapDepth7TSmeanA225_HE = fs_->make<TH2F>("h_mapDepth7TSmeanA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6423  h_mapDepth1TSmeanA_HE = fs_->make<TH2F>("h_mapDepth1TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6424  h_mapDepth2TSmeanA_HE = fs_->make<TH2F>("h_mapDepth2TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6425  h_mapDepth3TSmeanA_HE = fs_->make<TH2F>("h_mapDepth3TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6426  h_mapDepth4TSmeanA_HE = fs_->make<TH2F>("h_mapDepth4TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6427  h_mapDepth5TSmeanA_HE = fs_->make<TH2F>("h_mapDepth5TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6428  h_mapDepth6TSmeanA_HE = fs_->make<TH2F>("h_mapDepth6TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6429  h_mapDepth7TSmeanA_HE = fs_->make<TH2F>("h_mapDepth7TSmeanA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6430  h_TSmaxA_HE = fs_->make<TH1F>("h_TSmaxA_HE", " ", 100, -1., 11.);
6431  h_mapDepth1TSmaxA225_HE = fs_->make<TH2F>("h_mapDepth1TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6432  h_mapDepth2TSmaxA225_HE = fs_->make<TH2F>("h_mapDepth2TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6433  h_mapDepth3TSmaxA225_HE = fs_->make<TH2F>("h_mapDepth3TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6434  h_mapDepth4TSmaxA225_HE = fs_->make<TH2F>("h_mapDepth4TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6435  h_mapDepth5TSmaxA225_HE = fs_->make<TH2F>("h_mapDepth5TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6436  h_mapDepth6TSmaxA225_HE = fs_->make<TH2F>("h_mapDepth6TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6437  h_mapDepth7TSmaxA225_HE = fs_->make<TH2F>("h_mapDepth7TSmaxA225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6438  h_mapDepth1TSmaxA_HE = fs_->make<TH2F>("h_mapDepth1TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6439  h_mapDepth2TSmaxA_HE = fs_->make<TH2F>("h_mapDepth2TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6440  h_mapDepth3TSmaxA_HE = fs_->make<TH2F>("h_mapDepth3TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6441  h_mapDepth4TSmaxA_HE = fs_->make<TH2F>("h_mapDepth4TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6442  h_mapDepth5TSmaxA_HE = fs_->make<TH2F>("h_mapDepth5TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6443  h_mapDepth6TSmaxA_HE = fs_->make<TH2F>("h_mapDepth6TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6444  h_mapDepth7TSmaxA_HE = fs_->make<TH2F>("h_mapDepth7TSmaxA_HE", " ", neta, -41., 41., nphi, 0., bphi);
6445  // RMS:
6446  h_Amplitude_HE = fs_->make<TH1F>("h_Amplitude_HE", " ", 100, 0., 5.5);
6447  h_mapDepth1Amplitude225_HE = fs_->make<TH2F>("h_mapDepth1Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6448  h_mapDepth2Amplitude225_HE = fs_->make<TH2F>("h_mapDepth2Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6449  h_mapDepth3Amplitude225_HE = fs_->make<TH2F>("h_mapDepth3Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6450  h_mapDepth4Amplitude225_HE = fs_->make<TH2F>("h_mapDepth4Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6451  h_mapDepth5Amplitude225_HE = fs_->make<TH2F>("h_mapDepth5Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6452  h_mapDepth6Amplitude225_HE = fs_->make<TH2F>("h_mapDepth6Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6453  h_mapDepth7Amplitude225_HE = fs_->make<TH2F>("h_mapDepth7Amplitude225_HE", " ", neta, -41., 41., nphi, 0., bphi);
6454  h_mapDepth1Amplitude_HE = fs_->make<TH2F>("h_mapDepth1Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi);
6455  h_mapDepth2Amplitude_HE = fs_->make<TH2F>("h_mapDepth2Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi);
6456  h_mapDepth3Amplitude_HE = fs_->make<TH2F>("h_mapDepth3Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi);
6457  h_mapDepth4Amplitude_HE = fs_->make<TH2F>("h_mapDepth4Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi);
6458  h_mapDepth5Amplitude_HE = fs_->make<TH2F>("h_mapDepth5Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi);
6459  h_mapDepth6Amplitude_HE = fs_->make<TH2F>("h_mapDepth6Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi);
6460  h_mapDepth7Amplitude_HE = fs_->make<TH2F>("h_mapDepth7Amplitude_HE", " ", neta, -41., 41., nphi, 0., bphi);
6461 
6462  // Ratio:
6463  h_Ampl_HE = fs_->make<TH1F>("h_Ampl_HE", " ", 100, 0., 1.1);
6464  h_mapDepth1Ampl047_HE = fs_->make<TH2F>("h_mapDepth1Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6465  h_mapDepth2Ampl047_HE = fs_->make<TH2F>("h_mapDepth2Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6466  h_mapDepth3Ampl047_HE = fs_->make<TH2F>("h_mapDepth3Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6467  h_mapDepth4Ampl047_HE = fs_->make<TH2F>("h_mapDepth4Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6468  h_mapDepth5Ampl047_HE = fs_->make<TH2F>("h_mapDepth5Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6469  h_mapDepth6Ampl047_HE = fs_->make<TH2F>("h_mapDepth6Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6470  h_mapDepth7Ampl047_HE = fs_->make<TH2F>("h_mapDepth7Ampl047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6471  h_mapDepth1Ampl_HE = fs_->make<TH2F>("h_mapDepth1Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6472  h_mapDepth2Ampl_HE = fs_->make<TH2F>("h_mapDepth2Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6473  h_mapDepth3Ampl_HE = fs_->make<TH2F>("h_mapDepth3Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6474  h_mapDepth4Ampl_HE = fs_->make<TH2F>("h_mapDepth4Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6475  h_mapDepth5Ampl_HE = fs_->make<TH2F>("h_mapDepth5Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6476  h_mapDepth6Ampl_HE = fs_->make<TH2F>("h_mapDepth6Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6477  h_mapDepth7Ampl_HE = fs_->make<TH2F>("h_mapDepth7Ampl_HE", " ", neta, -41., 41., nphi, 0., bphi);
6478  h_mapDepth1AmplE34_HE = fs_->make<TH2F>("h_mapDepth1AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi);
6479  h_mapDepth2AmplE34_HE = fs_->make<TH2F>("h_mapDepth2AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi);
6480  h_mapDepth3AmplE34_HE = fs_->make<TH2F>("h_mapDepth3AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi);
6481  h_mapDepth4AmplE34_HE = fs_->make<TH2F>("h_mapDepth4AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi);
6482  h_mapDepth5AmplE34_HE = fs_->make<TH2F>("h_mapDepth5AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi);
6483  h_mapDepth6AmplE34_HE = fs_->make<TH2F>("h_mapDepth6AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi);
6484  h_mapDepth7AmplE34_HE = fs_->make<TH2F>("h_mapDepth7AmplE34_HE", " ", neta, -41., 41., nphi, 0., bphi);
6485  h_mapDepth1_HE = fs_->make<TH2F>("h_mapDepth1_HE", " ", neta, -41., 41., nphi, 0., bphi);
6486  h_mapDepth2_HE = fs_->make<TH2F>("h_mapDepth2_HE", " ", neta, -41., 41., nphi, 0., bphi);
6487  h_mapDepth3_HE = fs_->make<TH2F>("h_mapDepth3_HE", " ", neta, -41., 41., nphi, 0., bphi);
6488  h_mapDepth4_HE = fs_->make<TH2F>("h_mapDepth4_HE", " ", neta, -41., 41., nphi, 0., bphi);
6489  h_mapDepth5_HE = fs_->make<TH2F>("h_mapDepth5_HE", " ", neta, -41., 41., nphi, 0., bphi);
6490  h_mapDepth6_HE = fs_->make<TH2F>("h_mapDepth6_HE", " ", neta, -41., 41., nphi, 0., bphi);
6491  h_mapDepth7_HE = fs_->make<TH2F>("h_mapDepth7_HE", " ", neta, -41., 41., nphi, 0., bphi);
6493  h_mapenophinorm_HE1 = fs_->make<TH2F>("h_mapenophinorm_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6494  h_mapenophinorm_HE2 = fs_->make<TH2F>("h_mapenophinorm_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6495  h_mapenophinorm_HE3 = fs_->make<TH2F>("h_mapenophinorm_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6496  h_mapenophinorm_HE4 = fs_->make<TH2F>("h_mapenophinorm_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6497  h_mapenophinorm_HE5 = fs_->make<TH2F>("h_mapenophinorm_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6498  h_mapenophinorm_HE6 = fs_->make<TH2F>("h_mapenophinorm_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6499  h_mapenophinorm_HE7 = fs_->make<TH2F>("h_mapenophinorm_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6500  h_mapenophinorm2_HE1 = fs_->make<TH2F>("h_mapenophinorm2_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6501  h_mapenophinorm2_HE2 = fs_->make<TH2F>("h_mapenophinorm2_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6502  h_mapenophinorm2_HE3 = fs_->make<TH2F>("h_mapenophinorm2_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6503  h_mapenophinorm2_HE4 = fs_->make<TH2F>("h_mapenophinorm2_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6504  h_mapenophinorm2_HE5 = fs_->make<TH2F>("h_mapenophinorm2_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6505  h_mapenophinorm2_HE6 = fs_->make<TH2F>("h_mapenophinorm2_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6506  h_mapenophinorm2_HE7 = fs_->make<TH2F>("h_mapenophinorm2_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6507 
6508  h_maprphinorm_HE1 = fs_->make<TH2F>("h_maprphinorm_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6509  h_maprphinorm_HE2 = fs_->make<TH2F>("h_maprphinorm_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6510  h_maprphinorm_HE3 = fs_->make<TH2F>("h_maprphinorm_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6511  h_maprphinorm_HE4 = fs_->make<TH2F>("h_maprphinorm_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6512  h_maprphinorm_HE5 = fs_->make<TH2F>("h_maprphinorm_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6513  h_maprphinorm_HE6 = fs_->make<TH2F>("h_maprphinorm_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6514  h_maprphinorm_HE7 = fs_->make<TH2F>("h_maprphinorm_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6515  h_maprphinorm2_HE1 = fs_->make<TH2F>("h_maprphinorm2_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6516  h_maprphinorm2_HE2 = fs_->make<TH2F>("h_maprphinorm2_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6517  h_maprphinorm2_HE3 = fs_->make<TH2F>("h_maprphinorm2_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6518  h_maprphinorm2_HE4 = fs_->make<TH2F>("h_maprphinorm2_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6519  h_maprphinorm2_HE5 = fs_->make<TH2F>("h_maprphinorm2_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6520  h_maprphinorm2_HE6 = fs_->make<TH2F>("h_maprphinorm2_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6521  h_maprphinorm2_HE7 = fs_->make<TH2F>("h_maprphinorm2_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6522 
6523  h_maprphinorm0_HE1 = fs_->make<TH2F>("h_maprphinorm0_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6524  h_maprphinorm0_HE2 = fs_->make<TH2F>("h_maprphinorm0_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6525  h_maprphinorm0_HE3 = fs_->make<TH2F>("h_maprphinorm0_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6526  h_maprphinorm0_HE4 = fs_->make<TH2F>("h_maprphinorm0_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6527  h_maprphinorm0_HE5 = fs_->make<TH2F>("h_maprphinorm0_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6528  h_maprphinorm0_HE6 = fs_->make<TH2F>("h_maprphinorm0_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6529  h_maprphinorm0_HE7 = fs_->make<TH2F>("h_maprphinorm0_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6530 
6531  //
6532  // Didi as done in Reco
6533  //HB:
6534  h_amplitudechannel0_HB1 = fs_->make<TH2F>("h_amplitudechannel0_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6535  h_amplitudechannel1_HB1 = fs_->make<TH2F>("h_amplitudechannel1_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6536  h_amplitudechannel2_HB1 = fs_->make<TH2F>("h_amplitudechannel2_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6537  h_amplitudechannel0_HB2 = fs_->make<TH2F>("h_amplitudechannel0_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6538  h_amplitudechannel1_HB2 = fs_->make<TH2F>("h_amplitudechannel1_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6539  h_amplitudechannel2_HB2 = fs_->make<TH2F>("h_amplitudechannel2_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6540  h_amplitudechannel0_HB3 = fs_->make<TH2F>("h_amplitudechannel0_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6541  h_amplitudechannel1_HB3 = fs_->make<TH2F>("h_amplitudechannel1_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6542  h_amplitudechannel2_HB3 = fs_->make<TH2F>("h_amplitudechannel2_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6543  h_amplitudechannel0_HB4 = fs_->make<TH2F>("h_amplitudechannel0_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6544  h_amplitudechannel1_HB4 = fs_->make<TH2F>("h_amplitudechannel1_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6545  h_amplitudechannel2_HB4 = fs_->make<TH2F>("h_amplitudechannel2_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6546  //HE:
6547  h_amplitudechannel0_HE1 = fs_->make<TH2F>("h_amplitudechannel0_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6548  h_amplitudechannel1_HE1 = fs_->make<TH2F>("h_amplitudechannel1_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6549  h_amplitudechannel2_HE1 = fs_->make<TH2F>("h_amplitudechannel2_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6550  h_amplitudechannel0_HE2 = fs_->make<TH2F>("h_amplitudechannel0_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6551  h_amplitudechannel1_HE2 = fs_->make<TH2F>("h_amplitudechannel1_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6552  h_amplitudechannel2_HE2 = fs_->make<TH2F>("h_amplitudechannel2_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6553  h_amplitudechannel0_HE3 = fs_->make<TH2F>("h_amplitudechannel0_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6554  h_amplitudechannel1_HE3 = fs_->make<TH2F>("h_amplitudechannel1_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6555  h_amplitudechannel2_HE3 = fs_->make<TH2F>("h_amplitudechannel2_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6556  h_amplitudechannel0_HE4 = fs_->make<TH2F>("h_amplitudechannel0_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6557  h_amplitudechannel1_HE4 = fs_->make<TH2F>("h_amplitudechannel1_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6558  h_amplitudechannel2_HE4 = fs_->make<TH2F>("h_amplitudechannel2_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6559  h_amplitudechannel0_HE5 = fs_->make<TH2F>("h_amplitudechannel0_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6560  h_amplitudechannel1_HE5 = fs_->make<TH2F>("h_amplitudechannel1_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6561  h_amplitudechannel2_HE5 = fs_->make<TH2F>("h_amplitudechannel2_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6562  h_amplitudechannel0_HE6 = fs_->make<TH2F>("h_amplitudechannel0_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6563  h_amplitudechannel1_HE6 = fs_->make<TH2F>("h_amplitudechannel1_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6564  h_amplitudechannel2_HE6 = fs_->make<TH2F>("h_amplitudechannel2_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6565  h_amplitudechannel0_HE7 = fs_->make<TH2F>("h_amplitudechannel0_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6566  h_amplitudechannel1_HE7 = fs_->make<TH2F>("h_amplitudechannel1_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6567  h_amplitudechannel2_HE7 = fs_->make<TH2F>("h_amplitudechannel2_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6568  //HF:
6569  h_amplitudechannel0_HF1 = fs_->make<TH2F>("h_amplitudechannel0_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6570  h_amplitudechannel1_HF1 = fs_->make<TH2F>("h_amplitudechannel1_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6571  h_amplitudechannel2_HF1 = fs_->make<TH2F>("h_amplitudechannel2_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6572  h_amplitudechannel0_HF2 = fs_->make<TH2F>("h_amplitudechannel0_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6573  h_amplitudechannel1_HF2 = fs_->make<TH2F>("h_amplitudechannel1_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6574  h_amplitudechannel2_HF2 = fs_->make<TH2F>("h_amplitudechannel2_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6575  h_amplitudechannel0_HF3 = fs_->make<TH2F>("h_amplitudechannel0_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6576  h_amplitudechannel1_HF3 = fs_->make<TH2F>("h_amplitudechannel1_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6577  h_amplitudechannel2_HF3 = fs_->make<TH2F>("h_amplitudechannel2_HF3", " ", neta, -41., 41., nphi, 0., bphi);
6578  h_amplitudechannel0_HF4 = fs_->make<TH2F>("h_amplitudechannel0_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6579  h_amplitudechannel1_HF4 = fs_->make<TH2F>("h_amplitudechannel1_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6580  h_amplitudechannel2_HF4 = fs_->make<TH2F>("h_amplitudechannel2_HF4", " ", neta, -41., 41., nphi, 0., bphi);
6581 
6582  // Reco
6583  h_energyhitSignal_HB = fs_->make<TH1F>("h_energyhitSignal_HB", " ", npfit, -0.22, 0.22);
6584  h_energyhitSignal_HE = fs_->make<TH1F>("h_energyhitSignal_HE", " ", npfit, -0.22, 0.22);
6585  h_energyhitSignal_HF = fs_->make<TH1F>("h_energyhitSignal_HF", " ", npfit, -6.6, 6.6);
6586  h_energyhitNoise_HB = fs_->make<TH1F>("h_energyhitNoise_HB", " ", npfit, -0.22, 0.22);
6587  h_energyhitNoise_HE = fs_->make<TH1F>("h_energyhitNoise_HE", " ", npfit, -0.22, 0.22);
6588  h_energyhitNoise_HF = fs_->make<TH1F>("h_energyhitNoise_HF", " ", npfit, -4.4, 4.4);
6589 
6590  //HB:
6591  h_recSignalEnergy0_HB1 = fs_->make<TH2F>("h_recSignalEnergy0_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6592  h_recSignalEnergy1_HB1 = fs_->make<TH2F>("h_recSignalEnergy1_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6593  h_recSignalEnergy2_HB1 = fs_->make<TH2F>("h_recSignalEnergy2_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6594  h_recSignalEnergy0_HB2 = fs_->make<TH2F>("h_recSignalEnergy0_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6595  h_recSignalEnergy1_HB2 = fs_->make<TH2F>("h_recSignalEnergy1_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6596  h_recSignalEnergy2_HB2 = fs_->make<TH2F>("h_recSignalEnergy2_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6597  h_recSignalEnergy0_HB3 = fs_->make<TH2F>("h_recSignalEnergy0_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6598  h_recSignalEnergy1_HB3 = fs_->make<TH2F>("h_recSignalEnergy1_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6599  h_recSignalEnergy2_HB3 = fs_->make<TH2F>("h_recSignalEnergy2_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6600  h_recSignalEnergy0_HB4 = fs_->make<TH2F>("h_recSignalEnergy0_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6601  h_recSignalEnergy1_HB4 = fs_->make<TH2F>("h_recSignalEnergy1_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6602  h_recSignalEnergy2_HB4 = fs_->make<TH2F>("h_recSignalEnergy2_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6603 
6604  h_recNoiseEnergy0_HB1 = fs_->make<TH2F>("h_recNoiseEnergy0_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6605  h_recNoiseEnergy1_HB1 = fs_->make<TH2F>("h_recNoiseEnergy1_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6606  h_recNoiseEnergy2_HB1 = fs_->make<TH2F>("h_recNoiseEnergy2_HB1", " ", neta, -41., 41., nphi, 0., bphi);
6607  h_recNoiseEnergy0_HB2 = fs_->make<TH2F>("h_recNoiseEnergy0_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6608  h_recNoiseEnergy1_HB2 = fs_->make<TH2F>("h_recNoiseEnergy1_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6609  h_recNoiseEnergy2_HB2 = fs_->make<TH2F>("h_recNoiseEnergy2_HB2", " ", neta, -41., 41., nphi, 0., bphi);
6610  h_recNoiseEnergy0_HB3 = fs_->make<TH2F>("h_recNoiseEnergy0_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6611  h_recNoiseEnergy1_HB3 = fs_->make<TH2F>("h_recNoiseEnergy1_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6612  h_recNoiseEnergy2_HB3 = fs_->make<TH2F>("h_recNoiseEnergy2_HB3", " ", neta, -41., 41., nphi, 0., bphi);
6613  h_recNoiseEnergy0_HB4 = fs_->make<TH2F>("h_recNoiseEnergy0_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6614  h_recNoiseEnergy1_HB4 = fs_->make<TH2F>("h_recNoiseEnergy1_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6615  h_recNoiseEnergy2_HB4 = fs_->make<TH2F>("h_recNoiseEnergy2_HB4", " ", neta, -41., 41., nphi, 0., bphi);
6616 
6617  //HE:
6618  h_recSignalEnergy0_HE1 = fs_->make<TH2F>("h_recSignalEnergy0_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6619  h_recSignalEnergy1_HE1 = fs_->make<TH2F>("h_recSignalEnergy1_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6620  h_recSignalEnergy2_HE1 = fs_->make<TH2F>("h_recSignalEnergy2_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6621  h_recSignalEnergy0_HE2 = fs_->make<TH2F>("h_recSignalEnergy0_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6622  h_recSignalEnergy1_HE2 = fs_->make<TH2F>("h_recSignalEnergy1_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6623  h_recSignalEnergy2_HE2 = fs_->make<TH2F>("h_recSignalEnergy2_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6624  h_recSignalEnergy0_HE3 = fs_->make<TH2F>("h_recSignalEnergy0_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6625  h_recSignalEnergy1_HE3 = fs_->make<TH2F>("h_recSignalEnergy1_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6626  h_recSignalEnergy2_HE3 = fs_->make<TH2F>("h_recSignalEnergy2_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6627  h_recSignalEnergy0_HE4 = fs_->make<TH2F>("h_recSignalEnergy0_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6628  h_recSignalEnergy1_HE4 = fs_->make<TH2F>("h_recSignalEnergy1_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6629  h_recSignalEnergy2_HE4 = fs_->make<TH2F>("h_recSignalEnergy2_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6630  h_recSignalEnergy0_HE5 = fs_->make<TH2F>("h_recSignalEnergy0_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6631  h_recSignalEnergy1_HE5 = fs_->make<TH2F>("h_recSignalEnergy1_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6632  h_recSignalEnergy2_HE5 = fs_->make<TH2F>("h_recSignalEnergy2_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6633  h_recSignalEnergy0_HE6 = fs_->make<TH2F>("h_recSignalEnergy0_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6634  h_recSignalEnergy1_HE6 = fs_->make<TH2F>("h_recSignalEnergy1_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6635  h_recSignalEnergy2_HE6 = fs_->make<TH2F>("h_recSignalEnergy2_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6636  h_recSignalEnergy0_HE7 = fs_->make<TH2F>("h_recSignalEnergy0_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6637  h_recSignalEnergy1_HE7 = fs_->make<TH2F>("h_recSignalEnergy1_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6638  h_recSignalEnergy2_HE7 = fs_->make<TH2F>("h_recSignalEnergy2_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6639 
6640  h_recNoiseEnergy0_HE1 = fs_->make<TH2F>("h_recNoiseEnergy0_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6641  h_recNoiseEnergy1_HE1 = fs_->make<TH2F>("h_recNoiseEnergy1_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6642  h_recNoiseEnergy2_HE1 = fs_->make<TH2F>("h_recNoiseEnergy2_HE1", " ", neta, -41., 41., nphi, 0., bphi);
6643  h_recNoiseEnergy0_HE2 = fs_->make<TH2F>("h_recNoiseEnergy0_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6644  h_recNoiseEnergy1_HE2 = fs_->make<TH2F>("h_recNoiseEnergy1_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6645  h_recNoiseEnergy2_HE2 = fs_->make<TH2F>("h_recNoiseEnergy2_HE2", " ", neta, -41., 41., nphi, 0., bphi);
6646  h_recNoiseEnergy0_HE3 = fs_->make<TH2F>("h_recNoiseEnergy0_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6647  h_recNoiseEnergy1_HE3 = fs_->make<TH2F>("h_recNoiseEnergy1_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6648  h_recNoiseEnergy2_HE3 = fs_->make<TH2F>("h_recNoiseEnergy2_HE3", " ", neta, -41., 41., nphi, 0., bphi);
6649  h_recNoiseEnergy0_HE4 = fs_->make<TH2F>("h_recNoiseEnergy0_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6650  h_recNoiseEnergy1_HE4 = fs_->make<TH2F>("h_recNoiseEnergy1_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6651  h_recNoiseEnergy2_HE4 = fs_->make<TH2F>("h_recNoiseEnergy2_HE4", " ", neta, -41., 41., nphi, 0., bphi);
6652  h_recNoiseEnergy0_HE5 = fs_->make<TH2F>("h_recNoiseEnergy0_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6653  h_recNoiseEnergy1_HE5 = fs_->make<TH2F>("h_recNoiseEnergy1_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6654  h_recNoiseEnergy2_HE5 = fs_->make<TH2F>("h_recNoiseEnergy2_HE5", " ", neta, -41., 41., nphi, 0., bphi);
6655  h_recNoiseEnergy0_HE6 = fs_->make<TH2F>("h_recNoiseEnergy0_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6656  h_recNoiseEnergy1_HE6 = fs_->make<TH2F>("h_recNoiseEnergy1_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6657  h_recNoiseEnergy2_HE6 = fs_->make<TH2F>("h_recNoiseEnergy2_HE6", " ", neta, -41., 41., nphi, 0., bphi);
6658  h_recNoiseEnergy0_HE7 = fs_->make<TH2F>("h_recNoiseEnergy0_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6659  h_recNoiseEnergy1_HE7 = fs_->make<TH2F>("h_recNoiseEnergy1_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6660  h_recNoiseEnergy2_HE7 = fs_->make<TH2F>("h_recNoiseEnergy2_HE7", " ", neta, -41., 41., nphi, 0., bphi);
6661 
6662  //HF:
6663  h_recSignalEnergy0_HF1 = fs_->make<TH2F>("h_recSignalEnergy0_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6664  h_recSignalEnergy1_HF1 = fs_->make<TH2F>("h_recSignalEnergy1_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6665  h_recSignalEnergy2_HF1 = fs_->make<TH2F>("h_recSignalEnergy2_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6666  h_recSignalEnergy0_HF2 = fs_->make<TH2F>("h_recSignalEnergy0_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6667  h_recSignalEnergy1_HF2 = fs_->make<TH2F>("h_recSignalEnergy1_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6668  h_recSignalEnergy2_HF2 = fs_->make<TH2F>("h_recSignalEnergy2_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6669 
6670  h_recNoiseEnergy0_HF1 = fs_->make<TH2F>("h_recNoiseEnergy0_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6671  h_recNoiseEnergy1_HF1 = fs_->make<TH2F>("h_recNoiseEnergy1_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6672  h_recNoiseEnergy2_HF1 = fs_->make<TH2F>("h_recNoiseEnergy2_HF1", " ", neta, -41., 41., nphi, 0., bphi);
6673  h_recNoiseEnergy0_HF2 = fs_->make<TH2F>("h_recNoiseEnergy0_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6674  h_recNoiseEnergy1_HF2 = fs_->make<TH2F>("h_recNoiseEnergy1_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6675  h_recNoiseEnergy2_HF2 = fs_->make<TH2F>("h_recNoiseEnergy2_HF2", " ", neta, -41., 41., nphi, 0., bphi);
6676 
6678  // RADDAM:
6679  // if(flagLaserRaddam_ == 1 ) {
6680  // }
6681  int min80 = -100.;
6682  int max80 = 9000.;
6683  // fill for each digi (=each event, each channel)
6684  h_mapDepth1RADDAM_HE = fs_->make<TH2F>("h_mapDepth1RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi);
6685  h_mapDepth2RADDAM_HE = fs_->make<TH2F>("h_mapDepth2RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi);
6686  h_mapDepth3RADDAM_HE = fs_->make<TH2F>("h_mapDepth3RADDAM_HE", " ", neta, -41., 41., nphi, 0., bphi);
6687  h_mapDepth1RADDAM0_HE = fs_->make<TH2F>("h_mapDepth1RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi);
6688  h_mapDepth2RADDAM0_HE = fs_->make<TH2F>("h_mapDepth2RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi);
6689  h_mapDepth3RADDAM0_HE = fs_->make<TH2F>("h_mapDepth3RADDAM0_HE", " ", neta, -41., 41., nphi, 0., bphi);
6690 
6691  h_sigLayer1RADDAM_HE = fs_->make<TH1F>("h_sigLayer1RADDAM_HE", " ", neta, -41., 41.);
6692  h_sigLayer2RADDAM_HE = fs_->make<TH1F>("h_sigLayer2RADDAM_HE", " ", neta, -41., 41.);
6693  h_sigLayer1RADDAM0_HE = fs_->make<TH1F>("h_sigLayer1RADDAM0_HE", " ", neta, -41., 41.);
6694  h_sigLayer2RADDAM0_HE = fs_->make<TH1F>("h_sigLayer2RADDAM0_HE", " ", neta, -41., 41.);
6695  h_AamplitudewithPedSubtr_RADDAM_HE = fs_->make<TH1F>("h_AamplitudewithPedSubtr_RADDAM_HE", " ", 100, min80, max80);
6697  fs_->make<TH1F>("h_AamplitudewithPedSubtr_RADDAM_HEzoom0", " ", 100, min80, 4000.);
6699  fs_->make<TH1F>("h_AamplitudewithPedSubtr_RADDAM_HEzoom1", " ", 100, min80, 1000.);
6700  h_mapDepth3RADDAM16_HE = fs_->make<TH1F>("h_mapDepth3RADDAM16_HE", " ", 100, min80, max80);
6701  h_A_Depth1RADDAM_HE = fs_->make<TH1F>("h_A_Depth1RADDAM_HE", " ", 100, min80, max80);
6702  h_A_Depth2RADDAM_HE = fs_->make<TH1F>("h_A_Depth2RADDAM_HE", " ", 100, min80, max80);
6703  h_A_Depth3RADDAM_HE = fs_->make<TH1F>("h_A_Depth3RADDAM_HE", " ", 100, min80, max80);
6704  int min90 = 0.;
6705  int max90 = 5000.;
6706  h_sumphiEta16Depth3RADDAM_HED2 = fs_->make<TH1F>("h_sumphiEta16Depth3RADDAM_HED2", " ", 100, min90, 70. * max90);
6707  h_Eta16Depth3RADDAM_HED2 = fs_->make<TH1F>("h_Eta16Depth3RADDAM_HED2", " ", 100, min90, max90);
6708  h_NphiForEta16Depth3RADDAM_HED2 = fs_->make<TH1F>("h_NphiForEta16Depth3RADDAM_HED2", " ", 100, 0, 100.);
6709  h_sumphiEta16Depth3RADDAM_HED2P = fs_->make<TH1F>("h_sumphiEta16Depth3RADDAM_HED2P", " ", 100, min90, 70. * max90);
6710  h_Eta16Depth3RADDAM_HED2P = fs_->make<TH1F>("h_Eta16Depth3RADDAM_HED2P", " ", 100, min90, max90);
6711  h_NphiForEta16Depth3RADDAM_HED2P = fs_->make<TH1F>("h_NphiForEta16Depth3RADDAM_HED2P", " ", 100, 0, 100.);
6713  fs_->make<TH1F>("h_sumphiEta16Depth3RADDAM_HED2ALL", " ", 100, min90, 70. * max90);
6714  h_Eta16Depth3RADDAM_HED2ALL = fs_->make<TH1F>("h_Eta16Depth3RADDAM_HED2ALL", " ", 100, min90, max90);
6715  h_NphiForEta16Depth3RADDAM_HED2ALL = fs_->make<TH1F>("h_NphiForEta16Depth3RADDAM_HED2ALL", " ", 100, 0, 100.);
6716  h_sigLayer1RADDAM5_HE = fs_->make<TH1F>("h_sigLayer1RADDAM5_HE", " ", neta, -41., 41.);
6717  h_sigLayer2RADDAM5_HE = fs_->make<TH1F>("h_sigLayer2RADDAM5_HE", " ", neta, -41., 41.);
6718  h_sigLayer1RADDAM6_HE = fs_->make<TH1F>("h_sigLayer1RADDAM6_HE", " ", neta, -41., 41.);
6719  h_sigLayer2RADDAM6_HE = fs_->make<TH1F>("h_sigLayer2RADDAM6_HE", " ", neta, -41., 41.);
6720  h_sigLayer1RADDAM5_HED2 = fs_->make<TH1F>("h_sigLayer1RADDAM5_HED2", " ", neta, -41., 41.);
6721  h_sigLayer2RADDAM5_HED2 = fs_->make<TH1F>("h_sigLayer2RADDAM5_HED2", " ", neta, -41., 41.);
6722  h_sigLayer1RADDAM6_HED2 = fs_->make<TH1F>("h_sigLayer1RADDAM6_HED2", " ", neta, -41., 41.);
6723  h_sigLayer2RADDAM6_HED2 = fs_->make<TH1F>("h_sigLayer2RADDAM6_HED2", " ", neta, -41., 41.);
6724 
6725  h_numberofhitsHFtest = fs_->make<TH1F>("h_numberofhitsHFtest", " ", 100, 0., 30000.);
6726  h_AmplitudeHFtest = fs_->make<TH1F>("h_AmplitudeHFtest", " ", 100, 0., 300000.);
6727  h_totalAmplitudeHF = fs_->make<TH1F>("h_totalAmplitudeHF", " ", 100, 0., 100000000000.);
6728  h_totalAmplitudeHFperEvent = fs_->make<TH1F>("h_totalAmplitudeHFperEvent", " ", 1000, 1., 1001.);
6729  // fullAmplitude:
6730  h_ADCAmplZoom1_HF = fs_->make<TH1F>("h_ADCAmplZoom1_HF", " ", 100, 0., 1000000.);
6731  h_ADCAmpl_HF = fs_->make<TH1F>("h_ADCAmpl_HF", " ", 250, 0., 500000.);
6732  h_ADCAmplrest1_HF = fs_->make<TH1F>("h_ADCAmplrest1_HF", " ", 100, 0., 1000.);
6733  h_ADCAmplrest6_HF = fs_->make<TH1F>("h_ADCAmplrest6_HF", " ", 100, 0., 10000.);
6734 
6735  h_mapDepth1ADCAmpl225_HF = fs_->make<TH2F>("h_mapDepth1ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6736  h_mapDepth2ADCAmpl225_HF = fs_->make<TH2F>("h_mapDepth2ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6738  fs_->make<TH2F>("h_mapDepth1ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi);
6740  fs_->make<TH2F>("h_mapDepth2ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi);
6741  h_mapDepth1ADCAmpl_HF = fs_->make<TH2F>("h_mapDepth1ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi);
6742  h_mapDepth2ADCAmpl_HF = fs_->make<TH2F>("h_mapDepth2ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi);
6743  h_mapDepth3ADCAmpl225_HF = fs_->make<TH2F>("h_mapDepth3ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6744  h_mapDepth4ADCAmpl225_HF = fs_->make<TH2F>("h_mapDepth4ADCAmpl225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6746  fs_->make<TH2F>("h_mapDepth3ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi);
6748  fs_->make<TH2F>("h_mapDepth4ADCAmpl225Copy_HF", " ", neta, -41., 41., nphi, 0., bphi);
6749  h_mapDepth3ADCAmpl_HF = fs_->make<TH2F>("h_mapDepth3ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi);
6750  h_mapDepth4ADCAmpl_HF = fs_->make<TH2F>("h_mapDepth4ADCAmpl_HF", " ", neta, -41., 41., nphi, 0., bphi);
6751  h_TSmeanA_HF = fs_->make<TH1F>("h_TSmeanA_HF", " ", 100, -1., 11.);
6752  h_mapDepth1TSmeanA225_HF = fs_->make<TH2F>("h_mapDepth1TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6753  h_mapDepth2TSmeanA225_HF = fs_->make<TH2F>("h_mapDepth2TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6754  h_mapDepth1TSmeanA_HF = fs_->make<TH2F>("h_mapDepth1TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi);
6755  h_mapDepth2TSmeanA_HF = fs_->make<TH2F>("h_mapDepth2TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi);
6756  h_mapDepth3TSmeanA225_HF = fs_->make<TH2F>("h_mapDepth3TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6757  h_mapDepth4TSmeanA225_HF = fs_->make<TH2F>("h_mapDepth4TSmeanA225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6758  h_mapDepth3TSmeanA_HF = fs_->make<TH2F>("h_mapDepth3TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi);
6759  h_mapDepth4TSmeanA_HF = fs_->make<TH2F>("h_mapDepth4TSmeanA_HF", " ", neta, -41., 41., nphi, 0., bphi);
6760  h_Amplitude_HF = fs_->make<TH1F>("h_Amplitude_HF", " ", 100, 0., 5.);
6761  h_TSmaxA_HF = fs_->make<TH1F>("h_TSmaxA_HF", " ", 100, -1., 11.);
6762  h_mapDepth1TSmaxA225_HF = fs_->make<TH2F>("h_mapDepth1TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6763  h_mapDepth2TSmaxA225_HF = fs_->make<TH2F>("h_mapDepth2TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6764  h_mapDepth1TSmaxA_HF = fs_->make<TH2F>("h_mapDepth1TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi);
6765  h_mapDepth2TSmaxA_HF = fs_->make<TH2F>("h_mapDepth2TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi);
6766  h_mapDepth3TSmaxA225_HF = fs_->make<TH2F>("h_mapDepth3TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6767  h_mapDepth4TSmaxA225_HF = fs_->make<TH2F>("h_mapDepth4TSmaxA225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6768  h_mapDepth3TSmaxA_HF = fs_->make<TH2F>("h_mapDepth3TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi);
6769  h_mapDepth4TSmaxA_HF = fs_->make<TH2F>("h_mapDepth4TSmaxA_HF", " ", neta, -41., 41., nphi, 0., bphi);
6770  h_Amplitude_HF = fs_->make<TH1F>("h_Amplitude_HF", " ", 100, 0., 5.);
6771  h_mapDepth1Amplitude225_HF = fs_->make<TH2F>("h_mapDepth1Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6772  h_mapDepth2Amplitude225_HF = fs_->make<TH2F>("h_mapDepth2Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6773  h_mapDepth1Amplitude_HF = fs_->make<TH2F>("h_mapDepth1Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi);
6774  h_mapDepth2Amplitude_HF = fs_->make<TH2F>("h_mapDepth2Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi);
6775  h_mapDepth3Amplitude225_HF = fs_->make<TH2F>("h_mapDepth3Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6776  h_mapDepth4Amplitude225_HF = fs_->make<TH2F>("h_mapDepth4Amplitude225_HF", " ", neta, -41., 41., nphi, 0., bphi);
6777  h_mapDepth3Amplitude_HF = fs_->make<TH2F>("h_mapDepth3Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi);
6778  h_mapDepth4Amplitude_HF = fs_->make<TH2F>("h_mapDepth4Amplitude_HF", " ", neta, -41., 41., nphi, 0., bphi);
6779  // Ratio:
6780  h_Ampl_HF = fs_->make<TH1F>("h_Ampl_HF", " ", 100, 0., 1.1);
6781  h_mapDepth1Ampl047_HF = fs_->make<TH2F>("h_mapDepth1Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi);
6782  h_mapDepth2Ampl047_HF = fs_->make<TH2F>("h_mapDepth2Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi);
6783  h_mapDepth1Ampl_HF = fs_->make<TH2F>("h_mapDepth1Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi);
6784  h_mapDepth2Ampl_HF = fs_->make<TH2F>("h_mapDepth2Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi);
6785  h_mapDepth1AmplE34_HF = fs_->make<TH2F>("h_mapDepth1AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi);
6786  h_mapDepth2AmplE34_HF = fs_->make<TH2F>("h_mapDepth2AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi);
6787  h_mapDepth1_HF = fs_->make<TH2F>("h_mapDepth1_HF", " ", neta, -41., 41., nphi, 0., bphi);
6788  h_mapDepth2_HF = fs_->make<TH2F>("h_mapDepth2_HF", " ", neta, -41., 41., nphi, 0., bphi);
6789  h_mapDepth3Ampl047_HF = fs_->make<TH2F>("h_mapDepth3Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi);
6790  h_mapDepth4Ampl047_HF = fs_->make<TH2F>("h_mapDepth4Ampl047_HF", " ", neta, -41., 41., nphi, 0., bphi);
6791  h_mapDepth3Ampl_HF = fs_->make<TH2F>("h_mapDepth3Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi);
6792  h_mapDepth4Ampl_HF = fs_->make<TH2F>("h_mapDepth4Ampl_HF", " ", neta, -41., 41., nphi, 0., bphi);
6793  h_mapDepth3AmplE34_HF = fs_->make<TH2F>("h_mapDepth3AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi);
6794  h_mapDepth4AmplE34_HF = fs_->make<TH2F>("h_mapDepth4AmplE34_HF", " ", neta, -41., 41., nphi, 0., bphi);
6795  h_mapDepth3_HF = fs_->make<TH2F>("h_mapDepth3_HF", " ", neta, -41., 41., nphi, 0., bphi);
6796  h_mapDepth4_HF = fs_->make<TH2F>("h_mapDepth4_HF", " ", neta, -41., 41., nphi, 0., bphi);
6797 
6799  h_numberofhitsHOtest = fs_->make<TH1F>("h_numberofhitsHOtest", " ", 100, 0., 30000.);
6800  h_AmplitudeHOtest = fs_->make<TH1F>("h_AmplitudeHOtest", " ", 100, 0., 300000.);
6801  h_totalAmplitudeHO = fs_->make<TH1F>("h_totalAmplitudeHO", " ", 100, 0., 100000000.);
6802  h_totalAmplitudeHOperEvent = fs_->make<TH1F>("h_totalAmplitudeHOperEvent", " ", 1000, 1., 1001.);
6803  // fullAmplitude:
6804  h_ADCAmpl_HO = fs_->make<TH1F>("h_ADCAmpl_HO", " ", 100, 0., 7000.);
6805  h_ADCAmplrest1_HO = fs_->make<TH1F>("h_ADCAmplrest1_HO", " ", 100, 0., 150.);
6806  h_ADCAmplrest6_HO = fs_->make<TH1F>("h_ADCAmplrest6_HO", " ", 100, 0., 500.);
6807 
6808  h_ADCAmplZoom1_HO = fs_->make<TH1F>("h_ADCAmplZoom1_HO", " ", 100, -20., 280.);
6809  h_ADCAmpl_HO_copy = fs_->make<TH1F>("h_ADCAmpl_HO_copy", " ", 100, 0., 30000.);
6810  h_mapDepth4ADCAmpl225_HO = fs_->make<TH2F>("h_mapDepth4ADCAmpl225_HO", " ", neta, -41., 41., nphi, 0., bphi);
6812  fs_->make<TH2F>("h_mapDepth4ADCAmpl225Copy_HO", " ", neta, -41., 41., nphi, 0., bphi);
6813  h_mapDepth4ADCAmpl_HO = fs_->make<TH2F>("h_mapDepth4ADCAmpl_HO", " ", neta, -41., 41., nphi, 0., bphi);
6814  h_TSmeanA_HO = fs_->make<TH1F>("h_TSmeanA_HO", " ", 100, 0., 10.);
6815  h_mapDepth4TSmeanA225_HO = fs_->make<TH2F>("h_mapDepth4TSmeanA225_HO", " ", neta, -41., 41., nphi, 0., bphi);
6816  h_mapDepth4TSmeanA_HO = fs_->make<TH2F>("h_mapDepth4TSmeanA_HO", " ", neta, -41., 41., nphi, 0., bphi);
6817  h_TSmaxA_HO = fs_->make<TH1F>("h_TSmaxA_HO", " ", 100, 0., 10.);
6818  h_mapDepth4TSmaxA225_HO = fs_->make<TH2F>("h_mapDepth4TSmaxA225_HO", " ", neta, -41., 41., nphi, 0., bphi);
6819  h_mapDepth4TSmaxA_HO = fs_->make<TH2F>("h_mapDepth4TSmaxA_HO", " ", neta, -41., 41., nphi, 0., bphi);
6820  h_Amplitude_HO = fs_->make<TH1F>("h_Amplitude_HO", " ", 100, 0., 5.);
6821  h_mapDepth4Amplitude225_HO = fs_->make<TH2F>("h_mapDepth4Amplitude225_HO", " ", neta, -41., 41., nphi, 0., bphi);
6822  h_mapDepth4Amplitude_HO = fs_->make<TH2F>("h_mapDepth4Amplitude_HO", " ", neta, -41., 41., nphi, 0., bphi);
6823  // Ratio:
6824  h_Ampl_HO = fs_->make<TH1F>("h_Ampl_HO", " ", 100, 0., 1.1);
6825  h_mapDepth4Ampl047_HO = fs_->make<TH2F>("h_mapDepth4Ampl047_HO", " ", neta, -41., 41., nphi, 0., bphi);
6826  h_mapDepth4Ampl_HO = fs_->make<TH2F>("h_mapDepth4Ampl_HO", " ", neta, -41., 41., nphi, 0., bphi);
6827  h_mapDepth4AmplE34_HO = fs_->make<TH2F>("h_mapDepth4AmplE34_HO", " ", neta, -41., 41., nphi, 0., bphi);
6828  h_mapDepth4_HO = fs_->make<TH2F>("h_mapDepth4_HO", " ", neta, -41., 41., nphi, 0., bphi);
6829 
6831  int baP = 4000;
6832  float baR = 0.;
6833  float baR2 = baP;
6834  h_bcnnbadchannels_depth1_HB = fs_->make<TH1F>("h_bcnnbadchannels_depth1_HB", " ", baP, baR, baR2);
6835  h_bcnnbadchannels_depth2_HB = fs_->make<TH1F>("h_bcnnbadchannels_depth2_HB", " ", baP, baR, baR2);
6836  h_bcnnbadchannels_depth1_HE = fs_->make<TH1F>("h_bcnnbadchannels_depth1_HE", " ", baP, baR, baR2);
6837  h_bcnnbadchannels_depth2_HE = fs_->make<TH1F>("h_bcnnbadchannels_depth2_HE", " ", baP, baR, baR2);
6838  h_bcnnbadchannels_depth3_HE = fs_->make<TH1F>("h_bcnnbadchannels_depth3_HE", " ", baP, baR, baR2);
6839  h_bcnnbadchannels_depth4_HO = fs_->make<TH1F>("h_bcnnbadchannels_depth4_HO", " ", baP, baR, baR2);
6840  h_bcnnbadchannels_depth1_HF = fs_->make<TH1F>("h_bcnnbadchannels_depth1_HF", " ", baP, baR, baR2);
6841  h_bcnnbadchannels_depth2_HF = fs_->make<TH1F>("h_bcnnbadchannels_depth2_HF", " ", baP, baR, baR2);
6842  h_bcnbadrate0_depth1_HB = fs_->make<TH1F>("h_bcnbadrate0_depth1_HB", " ", baP, baR, baR2);
6843  h_bcnbadrate0_depth2_HB = fs_->make<TH1F>("h_bcnbadrate0_depth2_HB", " ", baP, baR, baR2);
6844  h_bcnbadrate0_depth1_HE = fs_->make<TH1F>("h_bcnbadrate0_depth1_HE", " ", baP, baR, baR2);
6845  h_bcnbadrate0_depth2_HE = fs_->make<TH1F>("h_bcnbadrate0_depth2_HE", " ", baP, baR, baR2);
6846  h_bcnbadrate0_depth3_HE = fs_->make<TH1F>("h_bcnbadrate0_depth3_HE", " ", baP, baR, baR2);
6847  h_bcnbadrate0_depth4_HO = fs_->make<TH1F>("h_bcnbadrate0_depth4_HO", " ", baP, baR, baR2);
6848  h_bcnbadrate0_depth1_HF = fs_->make<TH1F>("h_bcnbadrate0_depth1_HF", " ", baP, baR, baR2);
6849  h_bcnbadrate0_depth2_HF = fs_->make<TH1F>("h_bcnbadrate0_depth2_HF", " ", baP, baR, baR2);
6850 
6851  h_bcnvsamplitude_HB = fs_->make<TH1F>("h_bcnvsamplitude_HB", " ", baP, baR, baR2);
6852  h_bcnvsamplitude_HE = fs_->make<TH1F>("h_bcnvsamplitude_HE", " ", baP, baR, baR2);
6853  h_bcnvsamplitude_HF = fs_->make<TH1F>("h_bcnvsamplitude_HF", " ", baP, baR, baR2);
6854  h_bcnvsamplitude_HO = fs_->make<TH1F>("h_bcnvsamplitude_HO", " ", baP, baR, baR2);
6855  h_bcnvsamplitude0_HB = fs_->make<TH1F>("h_bcnvsamplitude0_HB", " ", baP, baR, baR2);
6856  h_bcnvsamplitude0_HE = fs_->make<TH1F>("h_bcnvsamplitude0_HE", " ", baP, baR, baR2);
6857  h_bcnvsamplitude0_HF = fs_->make<TH1F>("h_bcnvsamplitude0_HF", " ", baP, baR, baR2);
6858  h_bcnvsamplitude0_HO = fs_->make<TH1F>("h_bcnvsamplitude0_HO", " ", baP, baR, baR2);
6859 
6860  int zaP = 1000;
6861  float zaR = 10000000.;
6862  float zaR2 = 50000000.;
6863  h_orbitNumvsamplitude_HB = fs_->make<TH1F>("h_orbitNumvsamplitude_HB", " ", zaP, zaR, zaR2);
6864  h_orbitNumvsamplitude_HE = fs_->make<TH1F>("h_orbitNumvsamplitude_HE", " ", zaP, zaR, zaR2);
6865  h_orbitNumvsamplitude_HF = fs_->make<TH1F>("h_orbitNumvsamplitude_HF", " ", zaP, zaR, zaR2);
6866  h_orbitNumvsamplitude_HO = fs_->make<TH1F>("h_orbitNumvsamplitude_HO", " ", zaP, zaR, zaR2);
6867  h_orbitNumvsamplitude0_HB = fs_->make<TH1F>("h_orbitNumvsamplitude0_HB", " ", zaP, zaR, zaR2);
6868  h_orbitNumvsamplitude0_HE = fs_->make<TH1F>("h_orbitNumvsamplitude0_HE", " ", zaP, zaR, zaR2);
6869  h_orbitNumvsamplitude0_HF = fs_->make<TH1F>("h_orbitNumvsamplitude0_HF", " ", zaP, zaR, zaR2);
6870  h_orbitNumvsamplitude0_HO = fs_->make<TH1F>("h_orbitNumvsamplitude0_HO", " ", zaP, zaR, zaR2);
6871 
6872  h_2DsumADCAmplEtaPhiLs0 = fs_->make<TH2F>(
6873  "h_2DsumADCAmplEtaPhiLs0", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.);
6874  h_2DsumADCAmplEtaPhiLs1 = fs_->make<TH2F>(
6875  "h_2DsumADCAmplEtaPhiLs1", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.);
6876  h_2DsumADCAmplEtaPhiLs2 = fs_->make<TH2F>(
6877  "h_2DsumADCAmplEtaPhiLs2", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.);
6878  h_2DsumADCAmplEtaPhiLs3 = fs_->make<TH2F>(
6879  "h_2DsumADCAmplEtaPhiLs3", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.);
6880 
6882  "h_2DsumADCAmplEtaPhiLs00", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.);
6884  "h_2DsumADCAmplEtaPhiLs10", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.);
6886  "h_2DsumADCAmplEtaPhiLs20", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.);
6888  "h_2DsumADCAmplEtaPhiLs30", " ", nlsminmax, alsmin, blsmax, znphi * zneta, 1., znphi * zneta + 1.);
6889 
6890  h_sumADCAmplEtaPhiLs = fs_->make<TH1F>("h_sumADCAmplEtaPhiLs", " ", 1000, 0., 14000.);
6891  h_sumADCAmplEtaPhiLs_bbbc = fs_->make<TH1F>("h_sumADCAmplEtaPhiLs_bbbc", " ", 1000, 0., 300000.);
6892  h_sumADCAmplEtaPhiLs_bbb1 = fs_->make<TH1F>("h_sumADCAmplEtaPhiLs_bbb1", " ", 100, 0., 3000.);
6893  h_sumADCAmplEtaPhiLs_lscounterM1 = fs_->make<TH1F>("h_sumADCAmplEtaPhiLs_lscounterM1", " ", 600, 1., 601.);
6894  h_sumADCAmplEtaPhiLs_ietaphi = fs_->make<TH1F>("h_sumADCAmplEtaPhiLs_ietaphi", " ", 400, 0., 400.);
6896  fs_->make<TH1F>("h_sumADCAmplEtaPhiLs_lscounterM1orbitNum", " ", 600, 1., 601.);
6897  h_sumADCAmplEtaPhiLs_orbitNum = fs_->make<TH1F>("h_sumADCAmplEtaPhiLs_orbitNum", " ", 1000, 25000000., 40000000.);
6898 
6899  // for LS :
6900 
6901  // for LS binning:
6902  int bac = howmanybinsonplots_;
6903  // int bac= 15;
6904  float bac2 = bac + 1.;
6905  // bac, 1., bac2 );
6906 
6907  h_nbadchannels_depth1_HB = fs_->make<TH1F>("h_nbadchannels_depth1_HB", " ", 100, 1., 3001.);
6908  h_runnbadchannels_depth1_HB = fs_->make<TH1F>("h_runnbadchannels_depth1_HB", " ", bac, 1., bac2);
6909  h_runnbadchannelsC_depth1_HB = fs_->make<TH1F>("h_runnbadchannelsC_depth1_HB", " ", bac, 1., bac2);
6910  h_runbadrate_depth1_HB = fs_->make<TH1F>("h_runbadrate_depth1_HB", " ", bac, 1., bac2);
6911  h_runbadrateC_depth1_HB = fs_->make<TH1F>("h_runbadrateC_depth1_HB", " ", bac, 1., bac2);
6912  h_runbadrate0_depth1_HB = fs_->make<TH1F>("h_runbadrate0_depth1_HB", " ", bac, 1., bac2);
6913 
6914  h_nbadchannels_depth2_HB = fs_->make<TH1F>("h_nbadchannels_depth2_HB", " ", 100, 1., 501.);
6915  h_runnbadchannels_depth2_HB = fs_->make<TH1F>("h_runnbadchannels_depth2_HB", " ", bac, 1., bac2);
6916  h_runnbadchannelsC_depth2_HB = fs_->make<TH1F>("h_runnbadchannelsC_depth2_HB", " ", bac, 1., bac2);
6917  h_runbadrate_depth2_HB = fs_->make<TH1F>("h_runbadrate_depth2_HB", " ", bac, 1., bac2);
6918  h_runbadrateC_depth2_HB = fs_->make<TH1F>("h_runbadrateC_depth2_HB", " ", bac, 1., bac2);
6919  h_runbadrate0_depth2_HB = fs_->make<TH1F>("h_runbadrate0_depth2_HB", " ", bac, 1., bac2);
6920 
6921  h_nbadchannels_depth1_HE = fs_->make<TH1F>("h_nbadchannels_depth1_HE", " ", 100, 1., 3001.);
6922  h_runnbadchannels_depth1_HE = fs_->make<TH1F>("h_runnbadchannels_depth1_HE", " ", bac, 1., bac2);
6923  h_runnbadchannelsC_depth1_HE = fs_->make<TH1F>("h_runnbadchannelsC_depth1_HE", " ", bac, 1., bac2);
6924  h_runbadrate_depth1_HE = fs_->make<TH1F>("h_runbadrate_depth1_HE", " ", bac, 1., bac2);
6925  h_runbadrateC_depth1_HE = fs_->make<TH1F>("h_runbadrateC_depth1_HE", " ", bac, 1., bac2);
6926  h_runbadrate0_depth1_HE = fs_->make<TH1F>("h_runbadrate0_depth1_HE", " ", bac, 1., bac2);
6927 
6928  h_nbadchannels_depth2_HE = fs_->make<TH1F>("h_nbadchannels_depth2_HE", " ", 100, 1., 3001.);
6929  h_runnbadchannels_depth2_HE = fs_->make<TH1F>("h_runnbadchannels_depth2_HE", " ", bac, 1., bac2);
6930  h_runnbadchannelsC_depth2_HE = fs_->make<TH1F>("h_runnbadchannelsC_depth2_HE", " ", bac, 1., bac2);
6931  h_runbadrate_depth2_HE = fs_->make<TH1F>("h_runbadrate_depth2_HE", " ", bac, 1., bac2);
6932  h_runbadrateC_depth2_HE = fs_->make<TH1F>("h_runbadrateC_depth2_HE", " ", bac, 1., bac2);
6933  h_runbadrate0_depth2_HE = fs_->make<TH1F>("h_runbadrate0_depth2_HE", " ", bac, 1., bac2);
6934 
6935  h_nbadchannels_depth3_HE = fs_->make<TH1F>("h_nbadchannels_depth3_HE", " ", 100, 1., 501.);
6936  h_runnbadchannels_depth3_HE = fs_->make<TH1F>("h_runnbadchannels_depth3_HE", " ", bac, 1., bac2);
6937  h_runnbadchannelsC_depth3_HE = fs_->make<TH1F>("h_runnbadchannelsC_depth3_HE", " ", bac, 1., bac2);
6938  h_runbadrate_depth3_HE = fs_->make<TH1F>("h_runbadrate_depth3_HE", " ", bac, 1., bac2);
6939  h_runbadrateC_depth3_HE = fs_->make<TH1F>("h_runbadrateC_depth3_HE", " ", bac, 1., bac2);
6940  h_runbadrate0_depth3_HE = fs_->make<TH1F>("h_runbadrate0_depth3_HE", " ", bac, 1., bac2);
6941 
6942  h_nbadchannels_depth1_HF = fs_->make<TH1F>("h_nbadchannels_depth1_HF", " ", 100, 1., 3001.);
6943  h_runnbadchannels_depth1_HF = fs_->make<TH1F>("h_runnbadchannels_depth1_HF", " ", bac, 1., bac2);
6944  h_runnbadchannelsC_depth1_HF = fs_->make<TH1F>("h_runnbadchannelsC_depth1_HF", " ", bac, 1., bac2);
6945  h_runbadrate_depth1_HF = fs_->make<TH1F>("h_runbadrate_depth1_HF", " ", bac, 1., bac2);
6946  h_runbadrateC_depth1_HF = fs_->make<TH1F>("h_runbadrateC_depth1_HF", " ", bac, 1., bac2);
6947  h_runbadrate0_depth1_HF = fs_->make<TH1F>("h_runbadrate0_depth1_HF", " ", bac, 1., bac2);
6948 
6949  h_nbadchannels_depth2_HF = fs_->make<TH1F>("h_nbadchannels_depth2_HF", " ", 100, 1., 501.);
6950  h_runnbadchannels_depth2_HF = fs_->make<TH1F>("h_runnbadchannels_depth2_HF", " ", bac, 1., bac2);
6951  h_runnbadchannelsC_depth2_HF = fs_->make<TH1F>("h_runnbadchannelsC_depth2_HF", " ", bac, 1., bac2);
6952  h_runbadrate_depth2_HF = fs_->make<TH1F>("h_runbadrate_depth2_HF", " ", bac, 1., bac2);
6953  h_runbadrateC_depth2_HF = fs_->make<TH1F>("h_runbadrateC_depth2_HF", " ", bac, 1., bac2);
6954  h_runbadrate0_depth2_HF = fs_->make<TH1F>("h_runbadrate0_depth2_HF", " ", bac, 1., bac2);
6955 
6956  h_nbadchannels_depth4_HO = fs_->make<TH1F>("h_nbadchannels_depth4_HO", " ", 100, 1., 3001.);
6957  h_runnbadchannels_depth4_HO = fs_->make<TH1F>("h_runnbadchannels_depth4_HO", " ", bac, 1., bac2);
6958  h_runnbadchannelsC_depth4_HO = fs_->make<TH1F>("h_runnbadchannelsC_depth4_HO", " ", bac, 1., bac2);
6959  h_runbadrate_depth4_HO = fs_->make<TH1F>("h_runbadrate_depth4_HO", " ", bac, 1., bac2);
6960  h_runbadrateC_depth4_HO = fs_->make<TH1F>("h_runbadrateC_depth4_HO", " ", bac, 1., bac2);
6961  h_runbadrate0_depth4_HO = fs_->make<TH1F>("h_runbadrate0_depth4_HO", " ", bac, 1., bac2);
6962 
6964  h_FullSignal3D_HB = fs_->make<TH2F>("h_FullSignal3D_HB", " ", neta, -41., 41., nphi, 0., bphi);
6965  h_FullSignal3D0_HB = fs_->make<TH2F>("h_FullSignal3D0_HB", " ", neta, -41., 41., nphi, 0., bphi);
6966  h_FullSignal3D_HE = fs_->make<TH2F>("h_FullSignal3D_HE", " ", neta, -41., 41., nphi, 0., bphi);
6967  h_FullSignal3D0_HE = fs_->make<TH2F>("h_FullSignal3D0_HE", " ", neta, -41., 41., nphi, 0., bphi);
6968  h_FullSignal3D_HO = fs_->make<TH2F>("h_FullSignal3D_HO", " ", neta, -41., 41., nphi, 0., bphi);
6969  h_FullSignal3D0_HO = fs_->make<TH2F>("h_FullSignal3D0_HO", " ", neta, -41., 41., nphi, 0., bphi);
6970  h_FullSignal3D_HF = fs_->make<TH2F>("h_FullSignal3D_HF", " ", neta, -41., 41., nphi, 0., bphi);
6971  h_FullSignal3D0_HF = fs_->make<TH2F>("h_FullSignal3D0_HF", " ", neta, -41., 41., nphi, 0., bphi);
6972 
6974  h_ADCCalib_HB = fs_->make<TH1F>("h_ADCCalib_HB", " ", 100, 10., 10000.);
6975  h_ADCCalib1_HB = fs_->make<TH1F>("h_ADCCalib1_HB", " ", 100, 0.1, 100.1);
6976  h_mapADCCalib047_HB = fs_->make<TH2F>("h_mapADCCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6977  h_mapADCCalib_HB = fs_->make<TH2F>("h_mapADCCalib_HB", " ", neta, -41., 41., nphi, 0., bphi);
6978  h_RatioCalib_HB = fs_->make<TH1F>("h_RatioCalib_HB", " ", 100, 0., 1.);
6979  h_mapRatioCalib047_HB = fs_->make<TH2F>("h_mapRatioCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6980  h_mapRatioCalib_HB = fs_->make<TH2F>("h_mapRatioCalib_HB", " ", neta, -41., 41., nphi, 0., bphi);
6981  h_TSmaxCalib_HB = fs_->make<TH1F>("h_TSmaxCalib_HB", " ", 100, 0., 10.);
6982  h_mapTSmaxCalib047_HB = fs_->make<TH2F>("h_mapTSmaxCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6983  h_mapTSmaxCalib_HB = fs_->make<TH2F>("h_mapTSmaxCalib_HB", " ", neta, -41., 41., nphi, 0., bphi);
6984  h_TSmeanCalib_HB = fs_->make<TH1F>("h_TSmeanCalib_HB", " ", 100, 0., 10.);
6985  h_mapTSmeanCalib047_HB = fs_->make<TH2F>("h_mapTSmeanCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6986  h_mapTSmeanCalib_HB = fs_->make<TH2F>("h_mapTSmeanCalib_HB", " ", neta, -41., 41., nphi, 0., bphi);
6987  h_WidthCalib_HB = fs_->make<TH1F>("h_WidthCalib_HB", " ", 100, 0., 5.);
6988  h_mapWidthCalib047_HB = fs_->make<TH2F>("h_mapWidthCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6989  h_mapCapCalib047_HB = fs_->make<TH2F>("h_mapCapCalib047_HB", " ", neta, -41., 41., nphi, 0., bphi);
6990  h_mapWidthCalib_HB = fs_->make<TH2F>("h_mapWidthCalib_HB", " ", neta, -41., 41., nphi, 0., bphi);
6991  h_map_HB = fs_->make<TH2F>("h_map_HB", " ", neta, -41., 41., nphi, 0., bphi);
6992  h_ADCCalib_HE = fs_->make<TH1F>("h_ADCCalib_HE", " ", 100, 10., 10000.);
6993  h_ADCCalib1_HE = fs_->make<TH1F>("h_ADCCalib1_HE", " ", 100, 0.1, 100.1);
6994  h_mapADCCalib047_HE = fs_->make<TH2F>("h_mapADCCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6995  h_mapADCCalib_HE = fs_->make<TH2F>("h_mapADCCalib_HE", " ", neta, -41., 41., nphi, 0., bphi);
6996  h_RatioCalib_HE = fs_->make<TH1F>("h_RatioCalib_HE", " ", 100, 0., 1.);
6997  h_mapRatioCalib047_HE = fs_->make<TH2F>("h_mapRatioCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi);
6998  h_mapRatioCalib_HE = fs_->make<TH2F>("h_mapRatioCalib_HE", " ", neta, -41., 41., nphi, 0., bphi);
6999  h_TSmaxCalib_HE = fs_->make<TH1F>("h_TSmaxCalib_HE", " ", 100, 0., 10.);
7000  h_mapTSmaxCalib047_HE = fs_->make<TH2F>("h_mapTSmaxCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi);
7001  h_mapTSmaxCalib_HE = fs_->make<TH2F>("h_mapTSmaxCalib_HE", " ", neta, -41., 41., nphi, 0., bphi);
7002  h_TSmeanCalib_HE = fs_->make<TH1F>("h_TSmeanCalib_HE", " ", 100, 0., 10.);
7003  h_mapTSmeanCalib047_HE = fs_->make<TH2F>("h_mapTSmeanCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi);
7004  h_mapTSmeanCalib_HE = fs_->make<TH2F>("h_mapTSmeanCalib_HE", " ", neta, -41., 41., nphi, 0., bphi);
7005  h_WidthCalib_HE = fs_->make<TH1F>("h_WidthCalib_HE", " ", 100, 0., 5.);
7006  h_mapWidthCalib047_HE = fs_->make<TH2F>("h_mapWidthCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi);
7007  h_mapCapCalib047_HE = fs_->make<TH2F>("h_mapCapCalib047_HE", " ", neta, -41., 41., nphi, 0., bphi);
7008  h_mapWidthCalib_HE = fs_->make<TH2F>("h_mapWidthCalib_HE", " ", neta, -41., 41., nphi, 0., bphi);
7009  h_map_HE = fs_->make<TH2F>("h_map_HE", " ", neta, -41., 41., nphi, 0., bphi);
7010  h_ADCCalib_HO = fs_->make<TH1F>("h_ADCCalib_HO", " ", 100, 10., 10000.);
7011  h_ADCCalib1_HO = fs_->make<TH1F>("h_ADCCalib1_HO", " ", 100, 0.1, 100.1);
7012  h_mapADCCalib047_HO = fs_->make<TH2F>("h_mapADCCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi);
7013  h_mapADCCalib_HO = fs_->make<TH2F>("h_mapADCCalib_HO", " ", neta, -41., 41., nphi, 0., bphi);
7014  h_RatioCalib_HO = fs_->make<TH1F>("h_RatioCalib_HO", " ", 100, 0., 1.);
7015  h_mapRatioCalib047_HO = fs_->make<TH2F>("h_mapRatioCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi);
7016  h_mapRatioCalib_HO = fs_->make<TH2F>("h_mapRatioCalib_HO", " ", neta, -41., 41., nphi, 0., bphi);
7017  h_TSmaxCalib_HO = fs_->make<TH1F>("h_TSmaxCalib_HO", " ", 100, 0., 10.);
7018  h_mapTSmaxCalib047_HO = fs_->make<TH2F>("h_mapTSmaxCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi);
7019  h_mapTSmaxCalib_HO = fs_->make<TH2F>("h_mapTSmaxCalib_HO", " ", neta, -41., 41., nphi, 0., bphi);
7020  h_TSmeanCalib_HO = fs_->make<TH1F>("h_TSmeanCalib_HO", " ", 100, 0., 10.);
7021  h_mapTSmeanCalib047_HO = fs_->make<TH2F>("h_mapTSmeanCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi);
7022  h_mapTSmeanCalib_HO = fs_->make<TH2F>("h_mapTSmeanCalib_HO", " ", neta, -41., 41., nphi, 0., bphi);
7023  h_WidthCalib_HO = fs_->make<TH1F>("h_WidthCalib_HO", " ", 100, 0., 5.);
7024  h_mapWidthCalib047_HO = fs_->make<TH2F>("h_mapWidthCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi);
7025  h_mapCapCalib047_HO = fs_->make<TH2F>("h_mapCapCalib047_HO", " ", neta, -41., 41., nphi, 0., bphi);
7026  h_mapWidthCalib_HO = fs_->make<TH2F>("h_mapWidthCalib_HO", " ", neta, -41., 41., nphi, 0., bphi);
7027  h_map_HO = fs_->make<TH2F>("h_map_HO", " ", neta, -41., 41., nphi, 0., bphi);
7028  h_ADCCalib_HF = fs_->make<TH1F>("h_ADCCalib_HF", " ", 100, 10., 2000.);
7029  h_ADCCalib1_HF = fs_->make<TH1F>("h_ADCCalib1_HF", " ", 100, 0.1, 100.1);
7030  h_mapADCCalib047_HF = fs_->make<TH2F>("h_mapADCCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi);
7031  h_mapADCCalib_HF = fs_->make<TH2F>("h_mapADCCalib_HF", " ", neta, -41., 41., nphi, 0., bphi);
7032  h_RatioCalib_HF = fs_->make<TH1F>("h_RatioCalib_HF", " ", 100, 0., 1.);
7033  h_mapRatioCalib047_HF = fs_->make<TH2F>("h_mapRatioCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi);
7034  h_mapRatioCalib_HF = fs_->make<TH2F>("h_mapRatioCalib_HF", " ", neta, -41., 41., nphi, 0., bphi);
7035  h_TSmaxCalib_HF = fs_->make<TH1F>("h_TSmaxCalib_HF", " ", 100, 0., 10.);
7036  h_mapTSmaxCalib047_HF = fs_->make<TH2F>("h_mapTSmaxCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi);
7037  h_mapTSmaxCalib_HF = fs_->make<TH2F>("h_mapTSmaxCalib_HF", " ", neta, -41., 41., nphi, 0., bphi);
7038  h_TSmeanCalib_HF = fs_->make<TH1F>("h_TSmeanCalib_HF", " ", 100, 0., 10.);
7039  h_mapTSmeanCalib047_HF = fs_->make<TH2F>("h_mapTSmeanCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi);
7040  h_mapTSmeanCalib_HF = fs_->make<TH2F>("h_mapTSmeanCalib_HF", " ", neta, -41., 41., nphi, 0., bphi);
7041  h_WidthCalib_HF = fs_->make<TH1F>("h_WidthCalib_HF", " ", 100, 0., 5.);
7042  h_mapWidthCalib047_HF = fs_->make<TH2F>("h_mapWidthCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi);
7043  h_mapCapCalib047_HF = fs_->make<TH2F>("h_mapCapCalib047_HF", " ", neta, -41., 41., nphi, 0., bphi);
7044  h_mapWidthCalib_HF = fs_->make<TH2F>("h_mapWidthCalib_HF", " ", neta, -41., 41., nphi, 0., bphi);
7045  h_map_HF = fs_->make<TH2F>("h_map_HF", " ", neta, -41., 41., nphi, 0., bphi);
7046 
7047  h_nls_per_run = fs_->make<TH1F>("h_nls_per_run", " ", 100, 0., 800.);
7048  h_nls_per_run10 = fs_->make<TH1F>("h_nls_per_run10", " ", 100, 0., 60.);
7049  h_nevents_per_LS = fs_->make<TH1F>("h_nevents_per_LS", " ", 100, 0., 600.);
7050  h_nevents_per_LSzoom = fs_->make<TH1F>("h_nevents_per_LSzoom", " ", 50, 0., 50.);
7051  h_nevents_per_eachLS = fs_->make<TH1F>("h_nevents_per_eachLS", " ", bac, 1., bac2);
7052  h_nevents_per_eachRealLS = fs_->make<TH1F>("h_nevents_per_eachRealLS", " ", bac, 1., bac2);
7053  h_lsnumber_per_eachLS = fs_->make<TH1F>("h_lsnumber_per_eachLS", " ", bac, 1., bac2);
7054  //--------------------------------------------------
7055  // for estimator0:
7056  float pst1 = 30.;
7057  h_sumPedestalLS1 = fs_->make<TH1F>("h_sumPedestalLS1", " ", 100, 0., pst1);
7058  h_2DsumPedestalLS1 = fs_->make<TH2F>("h_2DsumPedestalLS1", " ", neta, -41., 41., nphi, 0., bphi);
7059  h_sumPedestalperLS1 = fs_->make<TH1F>("h_sumPedestalperLS1", " ", bac, 1., bac2);
7060  h_2D0sumPedestalLS1 = fs_->make<TH2F>("h_2D0sumPedestalLS1", " ", neta, -41., 41., nphi, 0., bphi);
7061  h_sum0PedestalperLS1 = fs_->make<TH1F>("h_sum0PedestalperLS1", " ", bac, 1., bac2);
7062 
7063  h_sumPedestalLS2 = fs_->make<TH1F>("h_sumPedestalLS2", " ", 100, 0., pst1);
7064  h_2DsumPedestalLS2 = fs_->make<TH2F>("h_2DsumPedestalLS2", " ", neta, -41., 41., nphi, 0., bphi);
7065  h_sumPedestalperLS2 = fs_->make<TH1F>("h_sumPedestalperLS2", " ", bac, 1., bac2);
7066  h_2D0sumPedestalLS2 = fs_->make<TH2F>("h_2D0sumPedestalLS2", " ", neta, -41., 41., nphi, 0., bphi);
7067  h_sum0PedestalperLS2 = fs_->make<TH1F>("h_sum0PedestalperLS2", " ", bac, 1., bac2);
7068 
7069  h_sumPedestalLS3 = fs_->make<TH1F>("h_sumPedestalLS3", " ", 100, 0., pst1);
7070  h_2DsumPedestalLS3 = fs_->make<TH2F>("h_2DsumPedestalLS3", " ", neta, -41., 41., nphi, 0., bphi);
7071  h_sumPedestalperLS3 = fs_->make<TH1F>("h_sumPedestalperLS3", " ", bac, 1., bac2);
7072  h_2D0sumPedestalLS3 = fs_->make<TH2F>("h_2D0sumPedestalLS3", " ", neta, -41., 41., nphi, 0., bphi);
7073  h_sum0PedestalperLS3 = fs_->make<TH1F>("h_sum0PedestalperLS3", " ", bac, 1., bac2);
7074 
7075  h_sumPedestalLS4 = fs_->make<TH1F>("h_sumPedestalLS4", " ", 100, 0., pst1);
7076  h_2DsumPedestalLS4 = fs_->make<TH2F>("h_2DsumPedestalLS4", " ", neta, -41., 41., nphi, 0., bphi);
7077  h_sumPedestalperLS4 = fs_->make<TH1F>("h_sumPedestalperLS4", " ", bac, 1., bac2);
7078  h_2D0sumPedestalLS4 = fs_->make<TH2F>("h_2D0sumPedestalLS4", " ", neta, -41., 41., nphi, 0., bphi);
7079  h_sum0PedestalperLS4 = fs_->make<TH1F>("h_sum0PedestalperLS4", " ", bac, 1., bac2);
7080 
7081  h_sumPedestalLS5 = fs_->make<TH1F>("h_sumPedestalLS5", " ", 100, 0., pst1);
7082  h_2DsumPedestalLS5 = fs_->make<TH2F>("h_2DsumPedestalLS5", " ", neta, -41., 41., nphi, 0., bphi);
7083  h_sumPedestalperLS5 = fs_->make<TH1F>("h_sumPedestalperLS5", " ", bac, 1., bac2);
7084  h_2D0sumPedestalLS5 = fs_->make<TH2F>("h_2D0sumPedestalLS5", " ", neta, -41., 41., nphi, 0., bphi);
7085  h_sum0PedestalperLS5 = fs_->make<TH1F>("h_sum0PedestalperLS5", " ", bac, 1., bac2);
7086 
7087  h_sumPedestalLS6 = fs_->make<TH1F>("h_sumPedestalLS6", " ", 100, 0., pst1);
7088  h_2DsumPedestalLS6 = fs_->make<TH2F>("h_2DsumPedestalLS6", " ", neta, -41., 41., nphi, 0., bphi);
7089  h_sumPedestalperLS6 = fs_->make<TH1F>("h_sumPedestalperLS6", " ", bac, 1., bac2);
7090  h_2D0sumPedestalLS6 = fs_->make<TH2F>("h_2D0sumPedestalLS6", " ", neta, -41., 41., nphi, 0., bphi);
7091  h_sum0PedestalperLS6 = fs_->make<TH1F>("h_sum0PedestalperLS6", " ", bac, 1., bac2);
7092 
7093  h_sumPedestalLS7 = fs_->make<TH1F>("h_sumPedestalLS7", " ", 100, 0., pst1);
7094  h_2DsumPedestalLS7 = fs_->make<TH2F>("h_2DsumPedestalLS7", " ", neta, -41., 41., nphi, 0., bphi);
7095  h_sumPedestalperLS7 = fs_->make<TH1F>("h_sumPedestalperLS7", " ", bac, 1., bac2);
7096  h_2D0sumPedestalLS7 = fs_->make<TH2F>("h_2D0sumPedestalLS7", " ", neta, -41., 41., nphi, 0., bphi);
7097  h_sum0PedestalperLS7 = fs_->make<TH1F>("h_sum0PedestalperLS7", " ", bac, 1., bac2);
7098 
7099  h_sumPedestalLS8 = fs_->make<TH1F>("h_sumPedestalLS8", " ", 100, 0., pst1);
7100  h_2DsumPedestalLS8 = fs_->make<TH2F>("h_2DsumPedestalLS8", " ", neta, -41., 41., nphi, 0., bphi);
7101  h_sumPedestalperLS8 = fs_->make<TH1F>("h_sumPedestalperLS8", " ", bac, 1., bac2);
7102  h_2D0sumPedestalLS8 = fs_->make<TH2F>("h_2D0sumPedestalLS8", " ", neta, -41., 41., nphi, 0., bphi);
7103  h_sum0PedestalperLS8 = fs_->make<TH1F>("h_sum0PedestalperLS8", " ", bac, 1., bac2);
7104 
7105  //--------------------------------------------------
7106  // for estimator1:
7107  h_sumADCAmplLS1copy1 = fs_->make<TH1F>("h_sumADCAmplLS1copy1", " ", 100, 0., 10000);
7108  h_sumADCAmplLS1copy2 = fs_->make<TH1F>("h_sumADCAmplLS1copy2", " ", 100, 0., 20000);
7109  h_sumADCAmplLS1copy3 = fs_->make<TH1F>("h_sumADCAmplLS1copy3", " ", 100, 0., 50000);
7110  h_sumADCAmplLS1copy4 = fs_->make<TH1F>("h_sumADCAmplLS1copy4", " ", 100, 0., 100000);
7111  h_sumADCAmplLS1copy5 = fs_->make<TH1F>("h_sumADCAmplLS1copy5", " ", 100, 0., 150000);
7112  h_sumADCAmplLS1 = fs_->make<TH1F>("h_sumADCAmplLS1", " ", 100, 0., lsdep_estimator1_HBdepth1_);
7113  h_2DsumADCAmplLS1 = fs_->make<TH2F>("h_2DsumADCAmplLS1", " ", neta, -41., 41., nphi, 0., bphi);
7115  fs_->make<TH2F>("h_2DsumADCAmplLS1_LSselected", " ", neta, -41., 41., nphi, 0., bphi);
7116  h_sumADCAmplperLS1 = fs_->make<TH1F>("h_sumADCAmplperLS1", " ", bac, 1., bac2);
7117  h_sumCutADCAmplperLS1 = fs_->make<TH1F>("h_sumCutADCAmplperLS1", " ", bac, 1., bac2);
7118  h_2D0sumADCAmplLS1 = fs_->make<TH2F>("h_2D0sumADCAmplLS1", " ", neta, -41., 41., nphi, 0., bphi);
7119  h_sum0ADCAmplperLS1 = fs_->make<TH1F>("h_sum0ADCAmplperLS1", " ", bac, 1., bac2);
7120 
7121  h_sumADCAmplLS2 = fs_->make<TH1F>("h_sumADCAmplLS2", " ", 100, 0., lsdep_estimator1_HBdepth2_);
7122  h_2DsumADCAmplLS2 = fs_->make<TH2F>("h_2DsumADCAmplLS2", " ", neta, -41., 41., nphi, 0., bphi);
7124  fs_->make<TH2F>("h_2DsumADCAmplLS2_LSselected", " ", neta, -41., 41., nphi, 0., bphi);
7125  h_sumADCAmplperLS2 = fs_->make<TH1F>("h_sumADCAmplperLS2", " ", bac, 1., bac2);
7126  h_sumCutADCAmplperLS2 = fs_->make<TH1F>("h_sumCutADCAmplperLS2", " ", bac, 1., bac2);
7127  h_2D0sumADCAmplLS2 = fs_->make<TH2F>("h_2D0sumADCAmplLS2", " ", neta, -41., 41., nphi, 0., bphi);
7128  h_sum0ADCAmplperLS2 = fs_->make<TH1F>("h_sum0ADCAmplperLS2", " ", bac, 1., bac2);
7129 
7130  h_sumADCAmplLS3 = fs_->make<TH1F>("h_sumADCAmplLS3", " ", 100, 0., lsdep_estimator1_HEdepth1_);
7131  h_2DsumADCAmplLS3 = fs_->make<TH2F>("h_2DsumADCAmplLS3", " ", neta, -41., 41., nphi, 0., bphi);
7133  fs_->make<TH2F>("h_2DsumADCAmplLS3_LSselected", " ", neta, -41., 41., nphi, 0., bphi);
7134  h_sumADCAmplperLS3 = fs_->make<TH1F>("h_sumADCAmplperLS3", " ", bac, 1., bac2);
7135  h_sumCutADCAmplperLS3 = fs_->make<TH1F>("h_sumCutADCAmplperLS3", " ", bac, 1., bac2);
7136  h_2D0sumADCAmplLS3 = fs_->make<TH2F>("h_2D0sumADCAmplLS3", " ", neta, -41., 41., nphi, 0., bphi);
7137  h_sum0ADCAmplperLS3 = fs_->make<TH1F>("h_sum0ADCAmplperLS3", " ", bac, 1., bac2);
7138 
7139  h_sumADCAmplLS4 = fs_->make<TH1F>("h_sumADCAmplLS4", " ", 100, 0., lsdep_estimator1_HEdepth2_);
7140  h_2DsumADCAmplLS4 = fs_->make<TH2F>("h_2DsumADCAmplLS4", " ", neta, -41., 41., nphi, 0., bphi);
7142  fs_->make<TH2F>("h_2DsumADCAmplLS4_LSselected", " ", neta, -41., 41., nphi, 0., bphi);
7143  h_sumADCAmplperLS4 = fs_->make<TH1F>("h_sumADCAmplperLS4", " ", bac, 1., bac2);
7144  h_sumCutADCAmplperLS4 = fs_->make<TH1F>("h_sumCutADCAmplperLS4", " ", bac, 1., bac2);
7145  h_2D0sumADCAmplLS4 = fs_->make<TH2F>("h_2D0sumADCAmplLS4", " ", neta, -41., 41., nphi, 0., bphi);
7146  h_sum0ADCAmplperLS4 = fs_->make<TH1F>("h_sum0ADCAmplperLS4", " ", bac, 1., bac2);
7147 
7148  h_sumADCAmplLS5 = fs_->make<TH1F>("h_sumADCAmplLS5", " ", 100, 0., lsdep_estimator1_HEdepth3_);
7149  h_2DsumADCAmplLS5 = fs_->make<TH2F>("h_2DsumADCAmplLS5", " ", neta, -41., 41., nphi, 0., bphi);
7151  fs_->make<TH2F>("h_2DsumADCAmplLS5_LSselected", " ", neta, -41., 41., nphi, 0., bphi);
7152  h_sumADCAmplperLS5 = fs_->make<TH1F>("h_sumADCAmplperLS5", " ", bac, 1., bac2);
7153  h_sumCutADCAmplperLS5 = fs_->make<TH1F>("h_sumCutADCAmplperLS5", " ", bac, 1., bac2);
7154  h_2D0sumADCAmplLS5 = fs_->make<TH2F>("h_2D0sumADCAmplLS5", " ", neta, -41., 41., nphi, 0., bphi);
7155  h_sum0ADCAmplperLS5 = fs_->make<TH1F>("h_sum0ADCAmplperLS5", " ", bac, 1., bac2);
7156  // HE upgrade depth4
7157  h_sumADCAmplperLSdepth4HEu = fs_->make<TH1F>("h_sumADCAmplperLSdepth4HEu", " ", bac, 1., bac2);
7158  h_sumCutADCAmplperLSdepth4HEu = fs_->make<TH1F>("h_sumCutADCAmplperLSdepth4HEu", " ", bac, 1., bac2);
7159  h_sum0ADCAmplperLSdepth4HEu = fs_->make<TH1F>("h_sum0ADCAmplperLSdepth4HEu", " ", bac, 1., bac2);
7160 
7161  // HE upgrade depth5
7162  h_sumADCAmplperLSdepth5HEu = fs_->make<TH1F>("h_sumADCAmplperLSdepth5HEu", " ", bac, 1., bac2);
7163  h_sumCutADCAmplperLSdepth5HEu = fs_->make<TH1F>("h_sumCutADCAmplperLSdepth5HEu", " ", bac, 1., bac2);
7164  h_sum0ADCAmplperLSdepth5HEu = fs_->make<TH1F>("h_sum0ADCAmplperLSdepth5HEu", " ", bac, 1., bac2);
7165  // HE upgrade depth6
7166  h_sumADCAmplperLSdepth6HEu = fs_->make<TH1F>("h_sumADCAmplperLSdepth6HEu", " ", bac, 1., bac2);
7167  h_sumCutADCAmplperLSdepth6HEu = fs_->make<TH1F>("h_sumCutADCAmplperLSdepth6HEu", " ", bac, 1., bac2);
7168  h_sum0ADCAmplperLSdepth6HEu = fs_->make<TH1F>("h_sum0ADCAmplperLSdepth6HEu", " ", bac, 1., bac2);
7169  // HE upgrade depth7
7170  h_sumADCAmplperLSdepth7HEu = fs_->make<TH1F>("h_sumADCAmplperLSdepth7HEu", " ", bac, 1., bac2);
7171  h_sumCutADCAmplperLSdepth7HEu = fs_->make<TH1F>("h_sumCutADCAmplperLSdepth7HEu", " ", bac, 1., bac2);
7172  h_sum0ADCAmplperLSdepth7HEu = fs_->make<TH1F>("h_sum0ADCAmplperLSdepth7HEu", " ", bac, 1., bac2);
7173  // for HE gain stability vs LS:
7174  h_2DsumADCAmplLSdepth4HEu = fs_->make<TH2F>("h_2DsumADCAmplLSdepth4HEu", " ", neta, -41., 41., nphi, 0., bphi);
7175  h_2D0sumADCAmplLSdepth4HEu = fs_->make<TH2F>("h_2D0sumADCAmplLSdepth4HEu", " ", neta, -41., 41., nphi, 0., bphi);
7176  h_2DsumADCAmplLSdepth5HEu = fs_->make<TH2F>("h_2DsumADCAmplLSdepth5HEu", " ", neta, -41., 41., nphi, 0., bphi);
7177  h_2D0sumADCAmplLSdepth5HEu = fs_->make<TH2F>("h_2D0sumADCAmplLSdepth5HEu", " ", neta, -41., 41., nphi, 0., bphi);
7178  h_2DsumADCAmplLSdepth6HEu = fs_->make<TH2F>("h_2DsumADCAmplLSdepth6HEu", " ", neta, -41., 41., nphi, 0., bphi);
7179  h_2D0sumADCAmplLSdepth6HEu = fs_->make<TH2F>("h_2D0sumADCAmplLSdepth6HEu", " ", neta, -41., 41., nphi, 0., bphi);
7180  h_2DsumADCAmplLSdepth7HEu = fs_->make<TH2F>("h_2DsumADCAmplLSdepth7HEu", " ", neta, -41., 41., nphi, 0., bphi);
7181  h_2D0sumADCAmplLSdepth7HEu = fs_->make<TH2F>("h_2D0sumADCAmplLSdepth7HEu", " ", neta, -41., 41., nphi, 0., bphi);
7182  h_2DsumADCAmplLSdepth3HFu = fs_->make<TH2F>("h_2DsumADCAmplLSdepth3HFu", " ", neta, -41., 41., nphi, 0., bphi);
7183  h_2D0sumADCAmplLSdepth3HFu = fs_->make<TH2F>("h_2D0sumADCAmplLSdepth3HFu", " ", neta, -41., 41., nphi, 0., bphi);
7184  h_2DsumADCAmplLSdepth4HFu = fs_->make<TH2F>("h_2DsumADCAmplLSdepth4HFu", " ", neta, -41., 41., nphi, 0., bphi);
7185  h_2D0sumADCAmplLSdepth4HFu = fs_->make<TH2F>("h_2D0sumADCAmplLSdepth4HFu", " ", neta, -41., 41., nphi, 0., bphi);
7186 
7187  h_sumADCAmplLS6 = fs_->make<TH1F>("h_sumADCAmplLS6", " ", 100, 0., lsdep_estimator1_HFdepth1_);
7188  h_2DsumADCAmplLS6 = fs_->make<TH2F>("h_2DsumADCAmplLS6", " ", neta, -41., 41., nphi, 0., bphi);
7190  fs_->make<TH2F>("h_2DsumADCAmplLS6_LSselected", " ", neta, -41., 41., nphi, 0., bphi);
7191  h_2D0sumADCAmplLS6 = fs_->make<TH2F>("h_2D0sumADCAmplLS6", " ", neta, -41., 41., nphi, 0., bphi);
7192  h_sumADCAmplperLS6 = fs_->make<TH1F>("h_sumADCAmplperLS6", " ", bac, 1., bac2);
7193  h_sumCutADCAmplperLS6 = fs_->make<TH1F>("h_sumCutADCAmplperLS6", " ", bac, 1., bac2);
7194  h_sum0ADCAmplperLS6 = fs_->make<TH1F>("h_sum0ADCAmplperLS6", " ", bac, 1., bac2);
7195  // HF upgrade depth3
7196  h_sumADCAmplperLS6u = fs_->make<TH1F>("h_sumADCAmplperLS6u", " ", bac, 1., bac2);
7197  h_sumCutADCAmplperLS6u = fs_->make<TH1F>("h_sumCutADCAmplperLS6u", " ", bac, 1., bac2);
7198  h_sum0ADCAmplperLS6u = fs_->make<TH1F>("h_sum0ADCAmplperLS6u", " ", bac, 1., bac2);
7199 
7200  h_sumADCAmplLS7 = fs_->make<TH1F>("h_sumADCAmplLS7", " ", 100, 0., lsdep_estimator1_HFdepth2_);
7201  h_2DsumADCAmplLS7 = fs_->make<TH2F>("h_2DsumADCAmplLS7", " ", neta, -41., 41., nphi, 0., bphi);
7203  fs_->make<TH2F>("h_2DsumADCAmplLS7_LSselected", " ", neta, -41., 41., nphi, 0., bphi);
7204  h_2D0sumADCAmplLS7 = fs_->make<TH2F>("h_2D0sumADCAmplLS7", " ", neta, -41., 41., nphi, 0., bphi);
7205  h_sumADCAmplperLS7 = fs_->make<TH1F>("h_sumADCAmplperLS7", " ", bac, 1., bac2);
7206  h_sumCutADCAmplperLS7 = fs_->make<TH1F>("h_sumCutADCAmplperLS7", " ", bac, 1., bac2);
7207  h_sum0ADCAmplperLS7 = fs_->make<TH1F>("h_sum0ADCAmplperLS7", " ", bac, 1., bac2);
7208  // HF upgrade depth4
7209  h_sumADCAmplperLS7u = fs_->make<TH1F>("h_sumADCAmplperLS7u", " ", bac, 1., bac2);
7210  h_sumCutADCAmplperLS7u = fs_->make<TH1F>("h_sumCutADCAmplperLS7u", " ", bac, 1., bac2);
7211  h_sum0ADCAmplperLS7u = fs_->make<TH1F>("h_sum0ADCAmplperLS7u", " ", bac, 1., bac2);
7212 
7213  h_sumADCAmplLS8 = fs_->make<TH1F>("h_sumADCAmplLS8", " ", 100, 0., lsdep_estimator1_HOdepth4_);
7214  h_2DsumADCAmplLS8 = fs_->make<TH2F>("h_2DsumADCAmplLS8", " ", neta, -41., 41., nphi, 0., bphi);
7216  fs_->make<TH2F>("h_2DsumADCAmplLS8_LSselected", " ", neta, -41., 41., nphi, 0., bphi);
7217  h_sumADCAmplperLS8 = fs_->make<TH1F>("h_sumADCAmplperLS8", " ", bac, 1., bac2);
7218  h_sumCutADCAmplperLS8 = fs_->make<TH1F>("h_sumCutADCAmplperLS8", " ", bac, 1., bac2);
7219  h_2D0sumADCAmplLS8 = fs_->make<TH2F>("h_2D0sumADCAmplLS8", " ", neta, -41., 41., nphi, 0., bphi);
7220  h_sum0ADCAmplperLS8 = fs_->make<TH1F>("h_sum0ADCAmplperLS8", " ", bac, 1., bac2);
7221 
7222  // HB upgrade depth3
7223  h_sumADCAmplperLSdepth3HBu = fs_->make<TH1F>("h_sumADCAmplperLSdepth3HBu", " ", bac, 1., bac2);
7224  h_sumCutADCAmplperLSdepth3HBu = fs_->make<TH1F>("h_sumCutADCAmplperLSdepth3HBu", " ", bac, 1., bac2);
7225  h_sum0ADCAmplperLSdepth3HBu = fs_->make<TH1F>("h_sum0ADCAmplperLSdepth3HBu", " ", bac, 1., bac2);
7226  // HB upgrade depth4
7227  h_sumADCAmplperLSdepth4HBu = fs_->make<TH1F>("h_sumADCAmplperLSdepth4HBu", " ", bac, 1., bac2);
7228  h_sumCutADCAmplperLSdepth4HBu = fs_->make<TH1F>("h_sumCutADCAmplperLSdepth4HBu", " ", bac, 1., bac2);
7229  h_sum0ADCAmplperLSdepth4HBu = fs_->make<TH1F>("h_sum0ADCAmplperLSdepth4HBu", " ", bac, 1., bac2);
7230 
7231  // for HB gain stability vs LS:
7232  h_2DsumADCAmplLSdepth3HBu = fs_->make<TH2F>("h_2DsumADCAmplLSdepth3HBu", " ", neta, -41., 41., nphi, 0., bphi);
7233  h_2D0sumADCAmplLSdepth3HBu = fs_->make<TH2F>("h_2D0sumADCAmplLSdepth3HBu", " ", neta, -41., 41., nphi, 0., bphi);
7234  h_2DsumADCAmplLSdepth4HBu = fs_->make<TH2F>("h_2DsumADCAmplLSdepth4HBu", " ", neta, -41., 41., nphi, 0., bphi);
7235  h_2D0sumADCAmplLSdepth4HBu = fs_->make<TH2F>("h_2D0sumADCAmplLSdepth4HBu", " ", neta, -41., 41., nphi, 0., bphi);
7236 
7237  // error-A for HB( depth1 only)
7238  h_sumADCAmplperLS1_P1 = fs_->make<TH1F>("h_sumADCAmplperLS1_P1", " ", bac, 1., bac2);
7239  h_sum0ADCAmplperLS1_P1 = fs_->make<TH1F>("h_sum0ADCAmplperLS1_P1", " ", bac, 1., bac2);
7240  h_sumADCAmplperLS1_P2 = fs_->make<TH1F>("h_sumADCAmplperLS1_P2", " ", bac, 1., bac2);
7241  h_sum0ADCAmplperLS1_P2 = fs_->make<TH1F>("h_sum0ADCAmplperLS1_P2", " ", bac, 1., bac2);
7242  h_sumADCAmplperLS1_M1 = fs_->make<TH1F>("h_sumADCAmplperLS1_M1", " ", bac, 1., bac2);
7243  h_sum0ADCAmplperLS1_M1 = fs_->make<TH1F>("h_sum0ADCAmplperLS1_M1", " ", bac, 1., bac2);
7244  h_sumADCAmplperLS1_M2 = fs_->make<TH1F>("h_sumADCAmplperLS1_M2", " ", bac, 1., bac2);
7245  h_sum0ADCAmplperLS1_M2 = fs_->make<TH1F>("h_sum0ADCAmplperLS1_M2", " ", bac, 1., bac2);
7246 
7247  // error-A for HE( depth1 only)
7248  h_sumADCAmplperLS3_P1 = fs_->make<TH1F>("h_sumADCAmplperLS3_P1", " ", bac, 1., bac2);
7249  h_sum0ADCAmplperLS3_P1 = fs_->make<TH1F>("h_sum0ADCAmplperLS3_P1", " ", bac, 1., bac2);
7250  h_sumADCAmplperLS3_P2 = fs_->make<TH1F>("h_sumADCAmplperLS3_P2", " ", bac, 1., bac2);
7251  h_sum0ADCAmplperLS3_P2 = fs_->make<TH1F>("h_sum0ADCAmplperLS3_P2", " ", bac, 1., bac2);
7252  h_sumADCAmplperLS3_M1 = fs_->make<TH1F>("h_sumADCAmplperLS3_M1", " ", bac, 1., bac2);
7253  h_sum0ADCAmplperLS3_M1 = fs_->make<TH1F>("h_sum0ADCAmplperLS3_M1", " ", bac, 1., bac2);
7254  h_sumADCAmplperLS3_M2 = fs_->make<TH1F>("h_sumADCAmplperLS3_M2", " ", bac, 1., bac2);
7255  h_sum0ADCAmplperLS3_M2 = fs_->make<TH1F>("h_sum0ADCAmplperLS3_M2", " ", bac, 1., bac2);
7256 
7257  // error-A for HF( depth1 only)
7258  h_sumADCAmplperLS6_P1 = fs_->make<TH1F>("h_sumADCAmplperLS6_P1", " ", bac, 1., bac2);
7259  h_sum0ADCAmplperLS6_P1 = fs_->make<TH1F>("h_sum0ADCAmplperLS6_P1", " ", bac, 1., bac2);
7260  h_sumADCAmplperLS6_P2 = fs_->make<TH1F>("h_sumADCAmplperLS6_P2", " ", bac, 1., bac2);
7261  h_sum0ADCAmplperLS6_P2 = fs_->make<TH1F>("h_sum0ADCAmplperLS6_P2", " ", bac, 1., bac2);
7262  h_sumADCAmplperLS6_M1 = fs_->make<TH1F>("h_sumADCAmplperLS6_M1", " ", bac, 1., bac2);
7263  h_sum0ADCAmplperLS6_M1 = fs_->make<TH1F>("h_sum0ADCAmplperLS6_M1", " ", bac, 1., bac2);
7264  h_sumADCAmplperLS6_M2 = fs_->make<TH1F>("h_sumADCAmplperLS6_M2", " ", bac, 1., bac2);
7265  h_sum0ADCAmplperLS6_M2 = fs_->make<TH1F>("h_sum0ADCAmplperLS6_M2", " ", bac, 1., bac2);
7266 
7267  // error-A for HO( depth4 only)
7268  h_sumADCAmplperLS8_P1 = fs_->make<TH1F>("h_sumADCAmplperLS8_P1", " ", bac, 1., bac2);
7269  h_sum0ADCAmplperLS8_P1 = fs_->make<TH1F>("h_sum0ADCAmplperLS8_P1", " ", bac, 1., bac2);
7270  h_sumADCAmplperLS8_P2 = fs_->make<TH1F>("h_sumADCAmplperLS8_P2", " ", bac, 1., bac2);
7271  h_sum0ADCAmplperLS8_P2 = fs_->make<TH1F>("h_sum0ADCAmplperLS8_P2", " ", bac, 1., bac2);
7272  h_sumADCAmplperLS8_M1 = fs_->make<TH1F>("h_sumADCAmplperLS8_M1", " ", bac, 1., bac2);
7273  h_sum0ADCAmplperLS8_M1 = fs_->make<TH1F>("h_sum0ADCAmplperLS8_M1", " ", bac, 1., bac2);
7274  h_sumADCAmplperLS8_M2 = fs_->make<TH1F>("h_sumADCAmplperLS8_M2", " ", bac, 1., bac2);
7275  h_sum0ADCAmplperLS8_M2 = fs_->make<TH1F>("h_sum0ADCAmplperLS8_M2", " ", bac, 1., bac2);
7276 
7277  //--------------------------------------------------
7278  h_sumTSmeanALS1 = fs_->make<TH1F>("h_sumTSmeanALS1", " ", 100, 0., lsdep_estimator2_HBdepth1_);
7279  h_2DsumTSmeanALS1 = fs_->make<TH2F>("h_2DsumTSmeanALS1", " ", neta, -41., 41., nphi, 0., bphi);
7280  h_sumTSmeanAperLS1 = fs_->make<TH1F>("h_sumTSmeanAperLS1", " ", bac, 1., bac2);
7281  h_sumTSmeanAperLS1_LSselected = fs_->make<TH1F>("h_sumTSmeanAperLS1_LSselected", " ", bac, 1., bac2);
7282  h_sumCutTSmeanAperLS1 = fs_->make<TH1F>("h_sumCutTSmeanAperLS1", " ", bac, 1., bac2);
7283  h_2D0sumTSmeanALS1 = fs_->make<TH2F>("h_2D0sumTSmeanALS1", " ", neta, -41., 41., nphi, 0., bphi);
7284  h_sum0TSmeanAperLS1 = fs_->make<TH1F>("h_sum0TSmeanAperLS1", " ", bac, 1., bac2);
7285 
7286  h_sumTSmeanALS2 = fs_->make<TH1F>("h_sumTSmeanALS2", " ", 100, 0., lsdep_estimator2_HBdepth2_);
7287  h_2DsumTSmeanALS2 = fs_->make<TH2F>("h_2DsumTSmeanALS2", " ", neta, -41., 41., nphi, 0., bphi);
7288  h_sumTSmeanAperLS2 = fs_->make<TH1F>("h_sumTSmeanAperLS2", " ", bac, 1., bac2);
7289  h_sumCutTSmeanAperLS2 = fs_->make<TH1F>("h_sumCutTSmeanAperLS2", " ", bac, 1., bac2);
7290  h_2D0sumTSmeanALS2 = fs_->make<TH2F>("h_2D0sumTSmeanALS2", " ", neta, -41., 41., nphi, 0., bphi);
7291  h_sum0TSmeanAperLS2 = fs_->make<TH1F>("h_sum0TSmeanAperLS2", " ", bac, 1., bac2);
7292 
7293  h_sumTSmeanALS3 = fs_->make<TH1F>("h_sumTSmeanALS3", " ", 100, 0., lsdep_estimator2_HEdepth1_);
7294  h_2DsumTSmeanALS3 = fs_->make<TH2F>("h_2DsumTSmeanALS3", " ", neta, -41., 41., nphi, 0., bphi);
7295  h_sumTSmeanAperLS3 = fs_->make<TH1F>("h_sumTSmeanAperLS3", " ", bac, 1., bac2);
7296  h_sumCutTSmeanAperLS3 = fs_->make<TH1F>("h_sumCutTSmeanAperLS3", " ", bac, 1., bac2);
7297  h_2D0sumTSmeanALS3 = fs_->make<TH2F>("h_2D0sumTSmeanALS3", " ", neta, -41., 41., nphi, 0., bphi);
7298  h_sum0TSmeanAperLS3 = fs_->make<TH1F>("h_sum0TSmeanAperLS3", " ", bac, 1., bac2);
7299 
7300  h_sumTSmeanALS4 = fs_->make<TH1F>("h_sumTSmeanALS4", " ", 100, 0., lsdep_estimator2_HEdepth2_);
7301  h_2DsumTSmeanALS4 = fs_->make<TH2F>("h_2DsumTSmeanALS4", " ", neta, -41., 41., nphi, 0., bphi);
7302  h_sumTSmeanAperLS4 = fs_->make<TH1F>("h_sumTSmeanAperLS4", " ", bac, 1., bac2);
7303  h_sumCutTSmeanAperLS4 = fs_->make<TH1F>("h_sumCutTSmeanAperLS4", " ", bac, 1., bac2);
7304  h_2D0sumTSmeanALS4 = fs_->make<TH2F>("h_2D0sumTSmeanALS4", " ", neta, -41., 41., nphi, 0., bphi);
7305  h_sum0TSmeanAperLS4 = fs_->make<TH1F>("h_sum0TSmeanAperLS4", " ", bac, 1., bac2);
7306 
7307  h_sumTSmeanALS5 = fs_->make<TH1F>("h_sumTSmeanALS5", " ", 100, 0., lsdep_estimator2_HEdepth3_);
7308  h_2DsumTSmeanALS5 = fs_->make<TH2F>("h_2DsumTSmeanALS5", " ", neta, -41., 41., nphi, 0., bphi);
7309  h_sumTSmeanAperLS5 = fs_->make<TH1F>("h_sumTSmeanAperLS5", " ", bac, 1., bac2);
7310  h_sumCutTSmeanAperLS5 = fs_->make<TH1F>("h_sumCutTSmeanAperLS5", " ", bac, 1., bac2);
7311  h_2D0sumTSmeanALS5 = fs_->make<TH2F>("h_2D0sumTSmeanALS5", " ", neta, -41., 41., nphi, 0., bphi);
7312  h_sum0TSmeanAperLS5 = fs_->make<TH1F>("h_sum0TSmeanAperLS5", " ", bac, 1., bac2);
7313 
7314  h_sumTSmeanALS6 = fs_->make<TH1F>("h_sumTSmeanALS6", " ", 100, 0., lsdep_estimator2_HFdepth1_);
7315  h_2DsumTSmeanALS6 = fs_->make<TH2F>("h_2DsumTSmeanALS6", " ", neta, -41., 41., nphi, 0., bphi);
7316  h_sumTSmeanAperLS6 = fs_->make<TH1F>("h_sumTSmeanAperLS6", " ", bac, 1., bac2);
7317  h_sumCutTSmeanAperLS6 = fs_->make<TH1F>("h_sumCutTSmeanAperLS6", " ", bac, 1., bac2);
7318  h_2D0sumTSmeanALS6 = fs_->make<TH2F>("h_2D0sumTSmeanALS6", " ", neta, -41., 41., nphi, 0., bphi);
7319  h_sum0TSmeanAperLS6 = fs_->make<TH1F>("h_sum0TSmeanAperLS6", " ", bac, 1., bac2);
7320 
7321  h_sumTSmeanALS7 = fs_->make<TH1F>("h_sumTSmeanALS7", " ", 100, 0., lsdep_estimator2_HFdepth2_);
7322  h_2DsumTSmeanALS7 = fs_->make<TH2F>("h_2DsumTSmeanALS7", " ", neta, -41., 41., nphi, 0., bphi);
7323  h_sumTSmeanAperLS7 = fs_->make<TH1F>("h_sumTSmeanAperLS7", " ", bac, 1., bac2);
7324  h_sumCutTSmeanAperLS7 = fs_->make<TH1F>("h_sumCutTSmeanAperLS7", " ", bac, 1., bac2);
7325  h_2D0sumTSmeanALS7 = fs_->make<TH2F>("h_2D0sumTSmeanALS7", " ", neta, -41., 41., nphi, 0., bphi);
7326  h_sum0TSmeanAperLS7 = fs_->make<TH1F>("h_sum0TSmeanAperLS7", " ", bac, 1., bac2);
7327 
7328  h_sumTSmeanALS8 = fs_->make<TH1F>("h_sumTSmeanALS8", " ", 100, 0., lsdep_estimator2_HOdepth4_);
7329  h_2DsumTSmeanALS8 = fs_->make<TH2F>("h_2DsumTSmeanALS8", " ", neta, -41., 41., nphi, 0., bphi);
7330  h_sumTSmeanAperLS8 = fs_->make<TH1F>("h_sumTSmeanAperLS8", " ", bac, 1., bac2);
7331  h_sumCutTSmeanAperLS8 = fs_->make<TH1F>("h_sumCutTSmeanAperLS8", " ", bac, 1., bac2);
7332  h_2D0sumTSmeanALS8 = fs_->make<TH2F>("h_2D0sumTSmeanALS8", " ", neta, -41., 41., nphi, 0., bphi);
7333  h_sum0TSmeanAperLS8 = fs_->make<TH1F>("h_sum0TSmeanAperLS8", " ", bac, 1., bac2);
7334  //--------------------------------------------------
7335  // for estimator3:
7336  h_sumTSmaxALS1 = fs_->make<TH1F>("h_sumTSmaxALS1", " ", 100, 0., lsdep_estimator3_HBdepth1_);
7337  h_2DsumTSmaxALS1 = fs_->make<TH2F>("h_2DsumTSmaxALS1", " ", neta, -41., 41., nphi, 0., bphi);
7338  h_sumTSmaxAperLS1 = fs_->make<TH1F>("h_sumTSmaxAperLS1", " ", bac, 1., bac2);
7339  h_sumTSmaxAperLS1_LSselected = fs_->make<TH1F>("h_sumTSmaxAperLS1_LSselected", " ", bac, 1., bac2);
7340  h_sumCutTSmaxAperLS1 = fs_->make<TH1F>("h_sumCutTSmaxAperLS1", " ", bac, 1., bac2);
7341  h_2D0sumTSmaxALS1 = fs_->make<TH2F>("h_2D0sumTSmaxALS1", " ", neta, -41., 41., nphi, 0., bphi);
7342  h_sum0TSmaxAperLS1 = fs_->make<TH1F>("h_sum0TSmaxAperLS1", " ", bac, 1., bac2);
7343 
7344  h_sumTSmaxALS2 = fs_->make<TH1F>("h_sumTSmaxALS2", " ", 100, 0., lsdep_estimator3_HBdepth2_);
7345  h_2DsumTSmaxALS2 = fs_->make<TH2F>("h_2DsumTSmaxALS2", " ", neta, -41., 41., nphi, 0., bphi);
7346  h_sumTSmaxAperLS2 = fs_->make<TH1F>("h_sumTSmaxAperLS2", " ", bac, 1., bac2);
7347  h_sumCutTSmaxAperLS2 = fs_->make<TH1F>("h_sumCutTSmaxAperLS2", " ", bac, 1., bac2);
7348  h_2D0sumTSmaxALS2 = fs_->make<TH2F>("h_2D0sumTSmaxALS2", " ", neta, -41., 41., nphi, 0., bphi);
7349  h_sum0TSmaxAperLS2 = fs_->make<TH1F>("h_sum0TSmaxAperLS2", " ", bac, 1., bac2);
7350 
7351  h_sumTSmaxALS3 = fs_->make<TH1F>("h_sumTSmaxALS3", " ", 100, 0., lsdep_estimator3_HEdepth1_);
7352  h_2DsumTSmaxALS3 = fs_->make<TH2F>("h_2DsumTSmaxALS3", " ", neta, -41., 41., nphi, 0., bphi);
7353  h_sumTSmaxAperLS3 = fs_->make<TH1F>("h_sumTSmaxAperLS3", " ", bac, 1., bac2);
7354  h_sumCutTSmaxAperLS3 = fs_->make<TH1F>("h_sumCutTSmaxAperLS3", " ", bac, 1., bac2);
7355  h_2D0sumTSmaxALS3 = fs_->make<TH2F>("h_2D0sumTSmaxALS3", " ", neta, -41., 41., nphi, 0., bphi);
7356  h_sum0TSmaxAperLS3 = fs_->make<TH1F>("h_sum0TSmaxAperLS3", " ", bac, 1., bac2);
7357 
7358  h_sumTSmaxALS4 = fs_->make<TH1F>("h_sumTSmaxALS4", " ", 100, 0., lsdep_estimator3_HEdepth2_);
7359  h_2DsumTSmaxALS4 = fs_->make<TH2F>("h_2DsumTSmaxALS4", " ", neta, -41., 41., nphi, 0., bphi);
7360  h_sumTSmaxAperLS4 = fs_->make<TH1F>("h_sumTSmaxAperLS4", " ", bac, 1., bac2);
7361  h_sumCutTSmaxAperLS4 = fs_->make<TH1F>("h_sumCutTSmaxAperLS4", " ", bac, 1., bac2);
7362  h_2D0sumTSmaxALS4 = fs_->make<TH2F>("h_2D0sumTSmaxALS4", " ", neta, -41., 41., nphi, 0., bphi);
7363  h_sum0TSmaxAperLS4 = fs_->make<TH1F>("h_sum0TSmaxAperLS4", " ", bac, 1., bac2);
7364 
7365  h_sumTSmaxALS5 = fs_->make<TH1F>("h_sumTSmaxALS5", " ", 100, 0., lsdep_estimator3_HEdepth3_);
7366  h_2DsumTSmaxALS5 = fs_->make<TH2F>("h_2DsumTSmaxALS5", " ", neta, -41., 41., nphi, 0., bphi);
7367  h_sumTSmaxAperLS5 = fs_->make<TH1F>("h_sumTSmaxAperLS5", " ", bac, 1., bac2);
7368  h_sumCutTSmaxAperLS5 = fs_->make<TH1F>("h_sumCutTSmaxAperLS5", " ", bac, 1., bac2);
7369  h_2D0sumTSmaxALS5 = fs_->make<TH2F>("h_2D0sumTSmaxALS5", " ", neta, -41., 41., nphi, 0., bphi);
7370  h_sum0TSmaxAperLS5 = fs_->make<TH1F>("h_sum0TSmaxAperLS5", " ", bac, 1., bac2);
7371 
7372  h_sumTSmaxALS6 = fs_->make<TH1F>("h_sumTSmaxALS6", " ", 100, 0., lsdep_estimator3_HFdepth1_);
7373  h_2DsumTSmaxALS6 = fs_->make<TH2F>("h_2DsumTSmaxALS6", " ", neta, -41., 41., nphi, 0., bphi);
7374  h_sumTSmaxAperLS6 = fs_->make<TH1F>("h_sumTSmaxAperLS6", " ", bac, 1., bac2);
7375  h_sumCutTSmaxAperLS6 = fs_->make<TH1F>("h_sumCutTSmaxAperLS6", " ", bac, 1., bac2);
7376  h_2D0sumTSmaxALS6 = fs_->make<TH2F>("h_2D0sumTSmaxALS6", " ", neta, -41., 41., nphi, 0., bphi);
7377  h_sum0TSmaxAperLS6 = fs_->make<TH1F>("h_sum0TSmaxAperLS6", " ", bac, 1., bac2);
7378 
7379  h_sumTSmaxALS7 = fs_->make<TH1F>("h_sumTSmaxALS7", " ", 100, 0., lsdep_estimator3_HFdepth2_);
7380  h_2DsumTSmaxALS7 = fs_->make<TH2F>("h_2DsumTSmaxALS7", " ", neta, -41., 41., nphi, 0., bphi);
7381  h_sumTSmaxAperLS7 = fs_->make<TH1F>("h_sumTSmaxAperLS7", " ", bac, 1., bac2);
7382  h_sumCutTSmaxAperLS7 = fs_->make<TH1F>("h_sumCutTSmaxAperLS7", " ", bac, 1., bac2);
7383  h_2D0sumTSmaxALS7 = fs_->make<TH2F>("h_2D0sumTSmaxALS7", " ", neta, -41., 41., nphi, 0., bphi);
7384  h_sum0TSmaxAperLS7 = fs_->make<TH1F>("h_sum0TSmaxAperLS7", " ", bac, 1., bac2);
7385 
7386  h_sumTSmaxALS8 = fs_->make<TH1F>("h_sumTSmaxALS8", " ", 100, 0., lsdep_estimator3_HOdepth4_);
7387  h_2DsumTSmaxALS8 = fs_->make<TH2F>("h_2DsumTSmaxALS8", " ", neta, -41., 41., nphi, 0., bphi);
7388  h_sumTSmaxAperLS8 = fs_->make<TH1F>("h_sumTSmaxAperLS8", " ", bac, 1., bac2);
7389  h_sumCutTSmaxAperLS8 = fs_->make<TH1F>("h_sumCutTSmaxAperLS8", " ", bac, 1., bac2);
7390  h_2D0sumTSmaxALS8 = fs_->make<TH2F>("h_2D0sumTSmaxALS8", " ", neta, -41., 41., nphi, 0., bphi);
7391  h_sum0TSmaxAperLS8 = fs_->make<TH1F>("h_sum0TSmaxAperLS8", " ", bac, 1., bac2);
7392  //--------------------------------------------------
7393  // for estimator4:
7394  h_sumAmplitudeLS1 = fs_->make<TH1F>("h_sumAmplitudeLS1", " ", 100, 0.0, lsdep_estimator4_HBdepth1_);
7395  h_2DsumAmplitudeLS1 = fs_->make<TH2F>("h_2DsumAmplitudeLS1", " ", neta, -41., 41., nphi, 0., bphi);
7396  h_sumAmplitudeperLS1 = fs_->make<TH1F>("h_sumAmplitudeperLS1", " ", bac, 1., bac2);
7397  h_sumAmplitudeperLS1_LSselected = fs_->make<TH1F>("h_sumAmplitudeperLS1_LSselected", " ", bac, 1., bac2);
7398  h_sumCutAmplitudeperLS1 = fs_->make<TH1F>("h_sumCutAmplitudeperLS1", " ", bac, 1., bac2);
7399  h_2D0sumAmplitudeLS1 = fs_->make<TH2F>("h_2D0sumAmplitudeLS1", " ", neta, -41., 41., nphi, 0., bphi);
7400  h_sum0AmplitudeperLS1 = fs_->make<TH1F>("h_sum0AmplitudeperLS1", " ", bac, 1., bac2);
7401 
7402  h_sumAmplitudeLS2 = fs_->make<TH1F>("h_sumAmplitudeLS2", " ", 100, 0.0, lsdep_estimator4_HBdepth2_);
7403  h_2DsumAmplitudeLS2 = fs_->make<TH2F>("h_2DsumAmplitudeLS2", " ", neta, -41., 41., nphi, 0., bphi);
7404  h_sumAmplitudeperLS2 = fs_->make<TH1F>("h_sumAmplitudeperLS2", " ", bac, 1., bac2);
7405  h_sumCutAmplitudeperLS2 = fs_->make<TH1F>("h_sumCutAmplitudeperLS2", " ", bac, 1., bac2);
7406  h_2D0sumAmplitudeLS2 = fs_->make<TH2F>("h_2D0sumAmplitudeLS2", " ", neta, -41., 41., nphi, 0., bphi);
7407  h_sum0AmplitudeperLS2 = fs_->make<TH1F>("h_sum0AmplitudeperLS2", " ", bac, 1., bac2);
7408 
7409  h_sumAmplitudeLS3 = fs_->make<TH1F>("h_sumAmplitudeLS3", " ", 100, 0.0, lsdep_estimator4_HEdepth1_);
7410  h_2DsumAmplitudeLS3 = fs_->make<TH2F>("h_2DsumAmplitudeLS3", " ", neta, -41., 41., nphi, 0., bphi);
7411  h_sumAmplitudeperLS3 = fs_->make<TH1F>("h_sumAmplitudeperLS3", " ", bac, 1., bac2);
7412  h_sumCutAmplitudeperLS3 = fs_->make<TH1F>("h_sumCutAmplitudeperLS3", " ", bac, 1., bac2);
7413  h_2D0sumAmplitudeLS3 = fs_->make<TH2F>("h_2D0sumAmplitudeLS3", " ", neta, -41., 41., nphi, 0., bphi);
7414  h_sum0AmplitudeperLS3 = fs_->make<TH1F>("h_sum0AmplitudeperLS3", " ", bac, 1., bac2);
7415 
7416  h_sumAmplitudeLS4 = fs_->make<TH1F>("h_sumAmplitudeLS4", " ", 100, 0.0, lsdep_estimator4_HEdepth2_);
7417  h_2DsumAmplitudeLS4 = fs_->make<TH2F>("h_2DsumAmplitudeLS4", " ", neta, -41., 41., nphi, 0., bphi);
7418  h_sumAmplitudeperLS4 = fs_->make<TH1F>("h_sumAmplitudeperLS4", " ", bac, 1., bac2);
7419  h_sumCutAmplitudeperLS4 = fs_->make<TH1F>("h_sumCutAmplitudeperLS4", " ", bac, 1., bac2);
7420  h_2D0sumAmplitudeLS4 = fs_->make<TH2F>("h_2D0sumAmplitudeLS4", " ", neta, -41., 41., nphi, 0., bphi);
7421  h_sum0AmplitudeperLS4 = fs_->make<TH1F>("h_sum0AmplitudeperLS4", " ", bac, 1., bac2);
7422 
7423  h_sumAmplitudeLS5 = fs_->make<TH1F>("h_sumAmplitudeLS5", " ", 100, 0.0, lsdep_estimator4_HEdepth3_);
7424  h_2DsumAmplitudeLS5 = fs_->make<TH2F>("h_2DsumAmplitudeLS5", " ", neta, -41., 41., nphi, 0., bphi);
7425  h_sumAmplitudeperLS5 = fs_->make<TH1F>("h_sumAmplitudeperLS5", " ", bac, 1., bac2);
7426  h_sumCutAmplitudeperLS5 = fs_->make<TH1F>("h_sumCutAmplitudeperLS5", " ", bac, 1., bac2);
7427  h_2D0sumAmplitudeLS5 = fs_->make<TH2F>("h_2D0sumAmplitudeLS5", " ", neta, -41., 41., nphi, 0., bphi);
7428  h_sum0AmplitudeperLS5 = fs_->make<TH1F>("h_sum0AmplitudeperLS5", " ", bac, 1., bac2);
7429 
7430  h_sumAmplitudeLS6 = fs_->make<TH1F>("h_sumAmplitudeLS6", " ", 100, 0., lsdep_estimator4_HFdepth1_);
7431  h_2DsumAmplitudeLS6 = fs_->make<TH2F>("h_2DsumAmplitudeLS6", " ", neta, -41., 41., nphi, 0., bphi);
7432  h_sumAmplitudeperLS6 = fs_->make<TH1F>("h_sumAmplitudeperLS6", " ", bac, 1., bac2);
7433  h_sumCutAmplitudeperLS6 = fs_->make<TH1F>("h_sumCutAmplitudeperLS6", " ", bac, 1., bac2);
7434  h_2D0sumAmplitudeLS6 = fs_->make<TH2F>("h_2D0sumAmplitudeLS6", " ", neta, -41., 41., nphi, 0., bphi);
7435  h_sum0AmplitudeperLS6 = fs_->make<TH1F>("h_sum0AmplitudeperLS6", " ", bac, 1., bac2);
7436 
7437  h_sumAmplitudeLS7 = fs_->make<TH1F>("h_sumAmplitudeLS7", " ", 100, 0., lsdep_estimator4_HFdepth2_);
7438  h_2DsumAmplitudeLS7 = fs_->make<TH2F>("h_2DsumAmplitudeLS7", " ", neta, -41., 41., nphi, 0., bphi);
7439  h_sumAmplitudeperLS7 = fs_->make<TH1F>("h_sumAmplitudeperLS7", " ", bac, 1., bac2);
7440  h_sumCutAmplitudeperLS7 = fs_->make<TH1F>("h_sumCutAmplitudeperLS7", " ", bac, 1., bac2);
7441  h_2D0sumAmplitudeLS7 = fs_->make<TH2F>("h_2D0sumAmplitudeLS7", " ", neta, -41., 41., nphi, 0., bphi);
7442  h_sum0AmplitudeperLS7 = fs_->make<TH1F>("h_sum0AmplitudeperLS7", " ", bac, 1., bac2);
7443 
7444  h_sumAmplitudeLS8 = fs_->make<TH1F>("h_sumAmplitudeLS8", " ", 100, 0., lsdep_estimator4_HOdepth4_);
7445  h_2DsumAmplitudeLS8 = fs_->make<TH2F>("h_2DsumAmplitudeLS8", " ", neta, -41., 41., nphi, 0., bphi);
7446  h_sumAmplitudeperLS8 = fs_->make<TH1F>("h_sumAmplitudeperLS8", " ", bac, 1., bac2);
7447  h_sumCutAmplitudeperLS8 = fs_->make<TH1F>("h_sumCutAmplitudeperLS8", " ", bac, 1., bac2);
7448  h_2D0sumAmplitudeLS8 = fs_->make<TH2F>("h_2D0sumAmplitudeLS8", " ", neta, -41., 41., nphi, 0., bphi);
7449  h_sum0AmplitudeperLS8 = fs_->make<TH1F>("h_sum0AmplitudeperLS8", " ", bac, 1., bac2);
7450  //--------------------------------------------------
7451  // for estimator5:
7452  h_sumAmplLS1 = fs_->make<TH1F>("h_sumAmplLS1", " ", 100, 0.0, lsdep_estimator5_HBdepth1_);
7453  h_2DsumAmplLS1 = fs_->make<TH2F>("h_2DsumAmplLS1", " ", neta, -41., 41., nphi, 0., bphi);
7454  h_sumAmplperLS1 = fs_->make<TH1F>("h_sumAmplperLS1", " ", bac, 1., bac2);
7455  h_sumAmplperLS1_LSselected = fs_->make<TH1F>("h_sumAmplperLS1_LSselected", " ", bac, 1., bac2);
7456  h_sumCutAmplperLS1 = fs_->make<TH1F>("h_sumCutAmplperLS1", " ", bac, 1., bac2);
7457  h_2D0sumAmplLS1 = fs_->make<TH2F>("h_2D0sumAmplLS1", " ", neta, -41., 41., nphi, 0., bphi);
7458  h_sum0AmplperLS1 = fs_->make<TH1F>("h_sum0AmplperLS1", " ", bac, 1., bac2);
7459 
7460  h_sumAmplLS2 = fs_->make<TH1F>("h_sumAmplLS2", " ", 100, 0.0, lsdep_estimator5_HBdepth2_);
7461  h_2DsumAmplLS2 = fs_->make<TH2F>("h_2DsumAmplLS2", " ", neta, -41., 41., nphi, 0., bphi);
7462  h_sumAmplperLS2 = fs_->make<TH1F>("h_sumAmplperLS2", " ", bac, 1., bac2);
7463  h_sumCutAmplperLS2 = fs_->make<TH1F>("h_sumCutAmplperLS2", " ", bac, 1., bac2);
7464  h_2D0sumAmplLS2 = fs_->make<TH2F>("h_2D0sumAmplLS2", " ", neta, -41., 41., nphi, 0., bphi);
7465  h_sum0AmplperLS2 = fs_->make<TH1F>("h_sum0AmplperLS2", " ", bac, 1., bac2);
7466 
7467  h_sumAmplLS3 = fs_->make<TH1F>("h_sumAmplLS3", " ", 100, 0.0, lsdep_estimator5_HEdepth1_);
7468  h_2DsumAmplLS3 = fs_->make<TH2F>("h_2DsumAmplLS3", " ", neta, -41., 41., nphi, 0., bphi);
7469  h_sumAmplperLS3 = fs_->make<TH1F>("h_sumAmplperLS3", " ", bac, 1., bac2);
7470  h_sumCutAmplperLS3 = fs_->make<TH1F>("h_sumCutAmplperLS3", " ", bac, 1., bac2);
7471  h_2D0sumAmplLS3 = fs_->make<TH2F>("h_2D0sumAmplLS3", " ", neta, -41., 41., nphi, 0., bphi);
7472  h_sum0AmplperLS3 = fs_->make<TH1F>("h_sum0AmplperLS3", " ", bac, 1., bac2);
7473 
7474  h_sumAmplLS4 = fs_->make<TH1F>("h_sumAmplLS4", " ", 100, 0.0, lsdep_estimator5_HEdepth2_);
7475  h_2DsumAmplLS4 = fs_->make<TH2F>("h_2DsumAmplLS4", " ", neta, -41., 41., nphi, 0., bphi);
7476  h_sumAmplperLS4 = fs_->make<TH1F>("h_sumAmplperLS4", " ", bac, 1., bac2);
7477  h_sumCutAmplperLS4 = fs_->make<TH1F>("h_sumCutAmplperLS4", " ", bac, 1., bac2);
7478  h_2D0sumAmplLS4 = fs_->make<TH2F>("h_2D0sumAmplLS4", " ", neta, -41., 41., nphi, 0., bphi);
7479  h_sum0AmplperLS4 = fs_->make<TH1F>("h_sum0AmplperLS4", " ", bac, 1., bac2);
7480 
7481  h_sumAmplLS5 = fs_->make<TH1F>("h_sumAmplLS5", " ", 100, 0.0, lsdep_estimator5_HEdepth3_);
7482  h_2DsumAmplLS5 = fs_->make<TH2F>("h_2DsumAmplLS5", " ", neta, -41., 41., nphi, 0., bphi);
7483  h_sumAmplperLS5 = fs_->make<TH1F>("h_sumAmplperLS5", " ", bac, 1., bac2);
7484  h_sumCutAmplperLS5 = fs_->make<TH1F>("h_sumCutAmplperLS5", " ", bac, 1., bac2);
7485  h_2D0sumAmplLS5 = fs_->make<TH2F>("h_2D0sumAmplLS5", " ", neta, -41., 41., nphi, 0., bphi);
7486  h_sum0AmplperLS5 = fs_->make<TH1F>("h_sum0AmplperLS5", " ", bac, 1., bac2);
7487 
7488  h_sumAmplLS6 = fs_->make<TH1F>("h_sumAmplLS6", " ", 100, 0.0, lsdep_estimator5_HFdepth1_);
7489  h_2DsumAmplLS6 = fs_->make<TH2F>("h_2DsumAmplLS6", " ", neta, -41., 41., nphi, 0., bphi);
7490  h_sumAmplperLS6 = fs_->make<TH1F>("h_sumAmplperLS6", " ", bac, 1., bac2);
7491  h_sumCutAmplperLS6 = fs_->make<TH1F>("h_sumCutAmplperLS6", " ", bac, 1., bac2);
7492  h_2D0sumAmplLS6 = fs_->make<TH2F>("h_2D0sumAmplLS6", " ", neta, -41., 41., nphi, 0., bphi);
7493  h_sum0AmplperLS6 = fs_->make<TH1F>("h_sum0AmplperLS6", " ", bac, 1., bac2);
7494 
7495  h_RatioOccupancy_HBP = fs_->make<TH1F>("h_RatioOccupancy_HBP", " ", bac, 1., bac2);
7496  h_RatioOccupancy_HBM = fs_->make<TH1F>("h_RatioOccupancy_HBM", " ", bac, 1., bac2);
7497  h_RatioOccupancy_HEP = fs_->make<TH1F>("h_RatioOccupancy_HEP", " ", bac, 1., bac2);
7498  h_RatioOccupancy_HEM = fs_->make<TH1F>("h_RatioOccupancy_HEM", " ", bac, 1., bac2);
7499  h_RatioOccupancy_HOP = fs_->make<TH1F>("h_RatioOccupancy_HOP", " ", bac, 1., bac2);
7500  h_RatioOccupancy_HOM = fs_->make<TH1F>("h_RatioOccupancy_HOM", " ", bac, 1., bac2);
7501  h_RatioOccupancy_HFP = fs_->make<TH1F>("h_RatioOccupancy_HFP", " ", bac, 1., bac2);
7502  h_RatioOccupancy_HFM = fs_->make<TH1F>("h_RatioOccupancy_HFM", " ", bac, 1., bac2);
7503 
7504  h_sumAmplLS7 = fs_->make<TH1F>("h_sumAmplLS7", " ", 100, 0.0, lsdep_estimator5_HFdepth2_);
7505  h_2DsumAmplLS7 = fs_->make<TH2F>("h_2DsumAmplLS7", " ", neta, -41., 41., nphi, 0., bphi);
7506  h_sumAmplperLS7 = fs_->make<TH1F>("h_sumAmplperLS7", " ", bac, 1., bac2);
7507  h_sumCutAmplperLS7 = fs_->make<TH1F>("h_sumCutAmplperLS7", " ", bac, 1., bac2);
7508  h_2D0sumAmplLS7 = fs_->make<TH2F>("h_2D0sumAmplLS7", " ", neta, -41., 41., nphi, 0., bphi);
7509  h_sum0AmplperLS7 = fs_->make<TH1F>("h_sum0AmplperLS7", " ", bac, 1., bac2);
7510 
7511  h_sumAmplLS8 = fs_->make<TH1F>("h_sumAmplLS8", " ", 100, 0.0, lsdep_estimator5_HOdepth4_);
7512  h_2DsumAmplLS8 = fs_->make<TH2F>("h_2DsumAmplLS8", " ", neta, -41., 41., nphi, 0., bphi);
7513  h_sumAmplperLS8 = fs_->make<TH1F>("h_sumAmplperLS8", " ", bac, 1., bac2);
7514  h_sumCutAmplperLS8 = fs_->make<TH1F>("h_sumCutAmplperLS8", " ", bac, 1., bac2);
7515  h_2D0sumAmplLS8 = fs_->make<TH2F>("h_2D0sumAmplLS8", " ", neta, -41., 41., nphi, 0., bphi);
7516  h_sum0AmplperLS8 = fs_->make<TH1F>("h_sum0AmplperLS8", " ", bac, 1., bac2);
7517  //--------------------------------------------------
7518  // for estimator6:
7519  h_sumErrorBLS1 = fs_->make<TH1F>("h_sumErrorBLS1", " ", 10, 0., 10.);
7520  h_sumErrorBperLS1 = fs_->make<TH1F>("h_sumErrorBperLS1", " ", bac, 1., bac2);
7521  h_sum0ErrorBperLS1 = fs_->make<TH1F>("h_sum0ErrorBperLS1", " ", bac, 1., bac2);
7522  h_2D0sumErrorBLS1 = fs_->make<TH2F>("h_2D0sumErrorBLS1", " ", neta, -41., 41., nphi, 0., bphi);
7523  h_2DsumErrorBLS1 = fs_->make<TH2F>("h_2DsumErrorBLS1", " ", neta, -41., 41., nphi, 0., bphi);
7524  h_sumErrorBLS2 = fs_->make<TH1F>("h_sumErrorBLS2", " ", 10, 0., 10.);
7525  h_sumErrorBperLS2 = fs_->make<TH1F>("h_sumErrorBperLS2", " ", bac, 1., bac2);
7526  h_sum0ErrorBperLS2 = fs_->make<TH1F>("h_sum0ErrorBperLS2", " ", bac, 1., bac2);
7527  h_2D0sumErrorBLS2 = fs_->make<TH2F>("h_2D0sumErrorBLS2", " ", neta, -41., 41., nphi, 0., bphi);
7528  h_2DsumErrorBLS2 = fs_->make<TH2F>("h_2DsumErrorBLS2", " ", neta, -41., 41., nphi, 0., bphi);
7529 
7530  h_sumErrorBLS3 = fs_->make<TH1F>("h_sumErrorBLS3", " ", 10, 0., 10.);
7531  h_sumErrorBperLS3 = fs_->make<TH1F>("h_sumErrorBperLS3", " ", bac, 1., bac2);
7532  h_sum0ErrorBperLS3 = fs_->make<TH1F>("h_sum0ErrorBperLS3", " ", bac, 1., bac2);
7533  h_2D0sumErrorBLS3 = fs_->make<TH2F>("h_2D0sumErrorBLS3", " ", neta, -41., 41., nphi, 0., bphi);
7534  h_2DsumErrorBLS3 = fs_->make<TH2F>("h_2DsumErrorBLS3", " ", neta, -41., 41., nphi, 0., bphi);
7535  h_sumErrorBLS4 = fs_->make<TH1F>("h_sumErrorBLS4", " ", 10, 0., 10.);
7536  h_sumErrorBperLS4 = fs_->make<TH1F>("h_sumErrorBperLS4", " ", bac, 1., bac2);
7537  h_sum0ErrorBperLS4 = fs_->make<TH1F>("h_sum0ErrorBperLS4", " ", bac, 1., bac2);
7538  h_2D0sumErrorBLS4 = fs_->make<TH2F>("h_2D0sumErrorBLS4", " ", neta, -41., 41., nphi, 0., bphi);
7539  h_2DsumErrorBLS4 = fs_->make<TH2F>("h_2DsumErrorBLS4", " ", neta, -41., 41., nphi, 0., bphi);
7540  h_sumErrorBLS5 = fs_->make<TH1F>("h_sumErrorBLS5", " ", 10, 0., 10.);
7541  h_sumErrorBperLS5 = fs_->make<TH1F>("h_sumErrorBperLS5", " ", bac, 1., bac2);
7542  h_sum0ErrorBperLS5 = fs_->make<TH1F>("h_sum0ErrorBperLS5", " ", bac, 1., bac2);
7543  h_2D0sumErrorBLS5 = fs_->make<TH2F>("h_2D0sumErrorBLS5", " ", neta, -41., 41., nphi, 0., bphi);
7544  h_2DsumErrorBLS5 = fs_->make<TH2F>("h_2DsumErrorBLS5", " ", neta, -41., 41., nphi, 0., bphi);
7545 
7546  h_sumErrorBLS6 = fs_->make<TH1F>("h_sumErrorBLS6", " ", 10, 0., 10.);
7547  h_sumErrorBperLS6 = fs_->make<TH1F>("h_sumErrorBperLS6", " ", bac, 1., bac2);
7548  h_sum0ErrorBperLS6 = fs_->make<TH1F>("h_sum0ErrorBperLS6", " ", bac, 1., bac2);
7549  h_2D0sumErrorBLS6 = fs_->make<TH2F>("h_2D0sumErrorBLS6", " ", neta, -41., 41., nphi, 0., bphi);
7550  h_2DsumErrorBLS6 = fs_->make<TH2F>("h_2DsumErrorBLS6", " ", neta, -41., 41., nphi, 0., bphi);
7551  h_sumErrorBLS7 = fs_->make<TH1F>("h_sumErrorBLS7", " ", 10, 0., 10.);
7552  h_sumErrorBperLS7 = fs_->make<TH1F>("h_sumErrorBperLS7", " ", bac, 1., bac2);
7553  h_sum0ErrorBperLS7 = fs_->make<TH1F>("h_sum0ErrorBperLS7", " ", bac, 1., bac2);
7554  h_2D0sumErrorBLS7 = fs_->make<TH2F>("h_2D0sumErrorBLS7", " ", neta, -41., 41., nphi, 0., bphi);
7555  h_2DsumErrorBLS7 = fs_->make<TH2F>("h_2DsumErrorBLS7", " ", neta, -41., 41., nphi, 0., bphi);
7556 
7557  h_sumErrorBLS8 = fs_->make<TH1F>("h_sumErrorBLS8", " ", 10, 0., 10.);
7558  h_sumErrorBperLS8 = fs_->make<TH1F>("h_sumErrorBperLS8", " ", bac, 1., bac2);
7559  h_sum0ErrorBperLS8 = fs_->make<TH1F>("h_sum0ErrorBperLS8", " ", bac, 1., bac2);
7560  h_2D0sumErrorBLS8 = fs_->make<TH2F>("h_2D0sumErrorBLS8", " ", neta, -41., 41., nphi, 0., bphi);
7561  h_2DsumErrorBLS8 = fs_->make<TH2F>("h_2DsumErrorBLS8", " ", neta, -41., 41., nphi, 0., bphi);
7562 
7563  //--------------------------------------------------
7564  // for averSIGNALOCCUPANCY :
7565  h_averSIGNALoccupancy_HB = fs_->make<TH1F>("h_averSIGNALoccupancy_HB", " ", bac, 1., bac2);
7566  h_averSIGNALoccupancy_HE = fs_->make<TH1F>("h_averSIGNALoccupancy_HE", " ", bac, 1., bac2);
7567  h_averSIGNALoccupancy_HF = fs_->make<TH1F>("h_averSIGNALoccupancy_HF", " ", bac, 1., bac2);
7568  h_averSIGNALoccupancy_HO = fs_->make<TH1F>("h_averSIGNALoccupancy_HO", " ", bac, 1., bac2);
7569 
7570  // for averSIGNALsumamplitude :
7571  h_averSIGNALsumamplitude_HB = fs_->make<TH1F>("h_averSIGNALsumamplitude_HB", " ", bac, 1., bac2);
7572  h_averSIGNALsumamplitude_HE = fs_->make<TH1F>("h_averSIGNALsumamplitude_HE", " ", bac, 1., bac2);
7573  h_averSIGNALsumamplitude_HF = fs_->make<TH1F>("h_averSIGNALsumamplitude_HF", " ", bac, 1., bac2);
7574  h_averSIGNALsumamplitude_HO = fs_->make<TH1F>("h_averSIGNALsumamplitude_HO", " ", bac, 1., bac2);
7575 
7576  // for averNOSIGNALOCCUPANCY :
7577  h_averNOSIGNALoccupancy_HB = fs_->make<TH1F>("h_averNOSIGNALoccupancy_HB", " ", bac, 1., bac2);
7578  h_averNOSIGNALoccupancy_HE = fs_->make<TH1F>("h_averNOSIGNALoccupancy_HE", " ", bac, 1., bac2);
7579  h_averNOSIGNALoccupancy_HF = fs_->make<TH1F>("h_averNOSIGNALoccupancy_HF", " ", bac, 1., bac2);
7580  h_averNOSIGNALoccupancy_HO = fs_->make<TH1F>("h_averNOSIGNALoccupancy_HO", " ", bac, 1., bac2);
7581 
7582  // for averNOSIGNALsumamplitude :
7583  h_averNOSIGNALsumamplitude_HB = fs_->make<TH1F>("h_averNOSIGNALsumamplitude_HB", " ", bac, 1., bac2);
7584  h_averNOSIGNALsumamplitude_HE = fs_->make<TH1F>("h_averNOSIGNALsumamplitude_HE", " ", bac, 1., bac2);
7585  h_averNOSIGNALsumamplitude_HF = fs_->make<TH1F>("h_averNOSIGNALsumamplitude_HF", " ", bac, 1., bac2);
7586  h_averNOSIGNALsumamplitude_HO = fs_->make<TH1F>("h_averNOSIGNALsumamplitude_HO", " ", bac, 1., bac2);
7587 
7588  // for channel SUM over depthes Amplitudes for each sub-detector
7589  h_sumamplitudechannel_HB = fs_->make<TH1F>("h_sumamplitudechannel_HB", " ", 100, 0., 2000.);
7590  h_sumamplitudechannel_HE = fs_->make<TH1F>("h_sumamplitudechannel_HE", " ", 100, 0., 3000.);
7591  h_sumamplitudechannel_HF = fs_->make<TH1F>("h_sumamplitudechannel_HF", " ", 100, 0., 7000.);
7592  h_sumamplitudechannel_HO = fs_->make<TH1F>("h_sumamplitudechannel_HO", " ", 100, 0., 10000.);
7593 
7594  // for event Amplitudes for each sub-detector
7595  h_eventamplitude_HB = fs_->make<TH1F>("h_eventamplitude_HB", " ", 100, 0., 80000.);
7596  h_eventamplitude_HE = fs_->make<TH1F>("h_eventamplitude_HE", " ", 100, 0., 100000.);
7597  h_eventamplitude_HF = fs_->make<TH1F>("h_eventamplitude_HF", " ", 100, 0., 150000.);
7598  h_eventamplitude_HO = fs_->make<TH1F>("h_eventamplitude_HO", " ", 100, 0., 250000.);
7599 
7600  // for event Occupancy for each sub-detector
7601  h_eventoccupancy_HB = fs_->make<TH1F>("h_eventoccupancy_HB", " ", 100, 0., 3000.);
7602  h_eventoccupancy_HE = fs_->make<TH1F>("h_eventoccupancy_HE", " ", 100, 0., 2000.);
7603  h_eventoccupancy_HF = fs_->make<TH1F>("h_eventoccupancy_HF", " ", 100, 0., 1000.);
7604  h_eventoccupancy_HO = fs_->make<TH1F>("h_eventoccupancy_HO", " ", 100, 0., 2500.);
7605 
7606  // for maxxSUMAmplitude
7607  h_maxxSUMAmpl_HB = fs_->make<TH1F>("h_maxxSUMAmpl_HB", " ", bac, 1., bac2);
7608  h_maxxSUMAmpl_HE = fs_->make<TH1F>("h_maxxSUMAmpl_HE", " ", bac, 1., bac2);
7609  h_maxxSUMAmpl_HF = fs_->make<TH1F>("h_maxxSUMAmpl_HF", " ", bac, 1., bac2);
7610  h_maxxSUMAmpl_HO = fs_->make<TH1F>("h_maxxSUMAmpl_HO", " ", bac, 1., bac2);
7611 
7612  // for maxxOCCUP
7613  h_maxxOCCUP_HB = fs_->make<TH1F>("h_maxxOCCUP_HB", " ", bac, 1., bac2);
7614  h_maxxOCCUP_HE = fs_->make<TH1F>("h_maxxOCCUP_HE", " ", bac, 1., bac2);
7615  h_maxxOCCUP_HF = fs_->make<TH1F>("h_maxxOCCUP_HF", " ", bac, 1., bac2);
7616  h_maxxOCCUP_HO = fs_->make<TH1F>("h_maxxOCCUP_HO", " ", bac, 1., bac2);
7617  //--------------------------------------------------
7618  // pedestals
7619  h_pedestal0_HB = fs_->make<TH1F>("h_pedestal0_HB", " ", 100, 0., 10.);
7620  h_pedestal1_HB = fs_->make<TH1F>("h_pedestal1_HB", " ", 100, 0., 10.);
7621  h_pedestal2_HB = fs_->make<TH1F>("h_pedestal2_HB", " ", 100, 0., 10.);
7622  h_pedestal3_HB = fs_->make<TH1F>("h_pedestal3_HB", " ", 100, 0., 10.);
7623  h_pedestalaver4_HB = fs_->make<TH1F>("h_pedestalaver4_HB", " ", 100, 0., 10.);
7624  h_pedestalaver9_HB = fs_->make<TH1F>("h_pedestalaver9_HB", " ", 100, 0., 10.);
7625  h_pedestalw0_HB = fs_->make<TH1F>("h_pedestalw0_HB", " ", 100, 0., 2.5);
7626  h_pedestalw1_HB = fs_->make<TH1F>("h_pedestalw1_HB", " ", 100, 0., 2.5);
7627  h_pedestalw2_HB = fs_->make<TH1F>("h_pedestalw2_HB", " ", 100, 0., 2.5);
7628  h_pedestalw3_HB = fs_->make<TH1F>("h_pedestalw3_HB", " ", 100, 0., 2.5);
7629  h_pedestalwaver4_HB = fs_->make<TH1F>("h_pedestalwaver4_HB", " ", 100, 0., 2.5);
7630  h_pedestalwaver9_HB = fs_->make<TH1F>("h_pedestalwaver9_HB", " ", 100, 0., 2.5);
7631 
7632  h_pedestal0_HE = fs_->make<TH1F>("h_pedestal0_HE", " ", 100, 0., 10.);
7633  h_pedestal1_HE = fs_->make<TH1F>("h_pedestal1_HE", " ", 100, 0., 10.);
7634  h_pedestal2_HE = fs_->make<TH1F>("h_pedestal2_HE", " ", 100, 0., 10.);
7635  h_pedestal3_HE = fs_->make<TH1F>("h_pedestal3_HE", " ", 100, 0., 10.);
7636  h_pedestalaver4_HE = fs_->make<TH1F>("h_pedestalaver4_HE", " ", 100, 0., 10.);
7637  h_pedestalaver9_HE = fs_->make<TH1F>("h_pedestalaver9_HE", " ", 100, 0., 10.);
7638  h_pedestalw0_HE = fs_->make<TH1F>("h_pedestalw0_HE", " ", 100, 0., 2.5);
7639  h_pedestalw1_HE = fs_->make<TH1F>("h_pedestalw1_HE", " ", 100, 0., 2.5);
7640  h_pedestalw2_HE = fs_->make<TH1F>("h_pedestalw2_HE", " ", 100, 0., 2.5);
7641  h_pedestalw3_HE = fs_->make<TH1F>("h_pedestalw3_HE", " ", 100, 0., 2.5);
7642  h_pedestalwaver4_HE = fs_->make<TH1F>("h_pedestalwaver4_HE", " ", 100, 0., 2.5);
7643  h_pedestalwaver9_HE = fs_->make<TH1F>("h_pedestalwaver9_HE", " ", 100, 0., 2.5);
7644 
7645  h_pedestal0_HF = fs_->make<TH1F>("h_pedestal0_HF", " ", 100, 0., 20.);
7646  h_pedestal1_HF = fs_->make<TH1F>("h_pedestal1_HF", " ", 100, 0., 20.);
7647  h_pedestal2_HF = fs_->make<TH1F>("h_pedestal2_HF", " ", 100, 0., 20.);
7648  h_pedestal3_HF = fs_->make<TH1F>("h_pedestal3_HF", " ", 100, 0., 20.);
7649  h_pedestalaver4_HF = fs_->make<TH1F>("h_pedestalaver4_HF", " ", 100, 0., 20.);
7650  h_pedestalaver9_HF = fs_->make<TH1F>("h_pedestalaver9_HF", " ", 100, 0., 20.);
7651  h_pedestalw0_HF = fs_->make<TH1F>("h_pedestalw0_HF", " ", 100, 0., 2.5);
7652  h_pedestalw1_HF = fs_->make<TH1F>("h_pedestalw1_HF", " ", 100, 0., 2.5);
7653  h_pedestalw2_HF = fs_->make<TH1F>("h_pedestalw2_HF", " ", 100, 0., 2.5);
7654  h_pedestalw3_HF = fs_->make<TH1F>("h_pedestalw3_HF", " ", 100, 0., 2.5);
7655  h_pedestalwaver4_HF = fs_->make<TH1F>("h_pedestalwaver4_HF", " ", 100, 0., 2.5);
7656  h_pedestalwaver9_HF = fs_->make<TH1F>("h_pedestalwaver9_HF", " ", 100, 0., 2.5);
7657 
7658  h_pedestal0_HO = fs_->make<TH1F>("h_pedestal0_HO", " ", 100, 0., 20.);
7659  h_pedestal1_HO = fs_->make<TH1F>("h_pedestal1_HO", " ", 100, 0., 20.);
7660  h_pedestal2_HO = fs_->make<TH1F>("h_pedestal2_HO", " ", 100, 0., 20.);
7661  h_pedestal3_HO = fs_->make<TH1F>("h_pedestal3_HO", " ", 100, 0., 20.);
7662  h_pedestalaver4_HO = fs_->make<TH1F>("h_pedestalaver4_HO", " ", 100, 0., 20.);
7663  h_pedestalaver9_HO = fs_->make<TH1F>("h_pedestalaver9_HO", " ", 100, 0., 20.);
7664  h_pedestalw0_HO = fs_->make<TH1F>("h_pedestalw0_HO", " ", 100, 0., 2.5);
7665  h_pedestalw1_HO = fs_->make<TH1F>("h_pedestalw1_HO", " ", 100, 0., 2.5);
7666  h_pedestalw2_HO = fs_->make<TH1F>("h_pedestalw2_HO", " ", 100, 0., 2.5);
7667  h_pedestalw3_HO = fs_->make<TH1F>("h_pedestalw3_HO", " ", 100, 0., 2.5);
7668  h_pedestalwaver4_HO = fs_->make<TH1F>("h_pedestalwaver4_HO", " ", 100, 0., 2.5);
7669  h_pedestalwaver9_HO = fs_->make<TH1F>("h_pedestalwaver9_HO", " ", 100, 0., 2.5);
7670  //--------------------------------------------------
7671  h_mapDepth1pedestalw_HB = fs_->make<TH2F>("h_mapDepth1pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi);
7672  h_mapDepth2pedestalw_HB = fs_->make<TH2F>("h_mapDepth2pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi);
7673  h_mapDepth3pedestalw_HB = fs_->make<TH2F>("h_mapDepth3pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi);
7674  h_mapDepth4pedestalw_HB = fs_->make<TH2F>("h_mapDepth4pedestalw_HB", " ", neta, -41., 41., nphi, 0., bphi);
7675  h_mapDepth1pedestalw_HE = fs_->make<TH2F>("h_mapDepth1pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi);
7676  h_mapDepth2pedestalw_HE = fs_->make<TH2F>("h_mapDepth2pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi);
7677  h_mapDepth3pedestalw_HE = fs_->make<TH2F>("h_mapDepth3pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi);
7678  h_mapDepth4pedestalw_HE = fs_->make<TH2F>("h_mapDepth4pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi);
7679  h_mapDepth5pedestalw_HE = fs_->make<TH2F>("h_mapDepth5pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi);
7680  h_mapDepth6pedestalw_HE = fs_->make<TH2F>("h_mapDepth6pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi);
7681  h_mapDepth7pedestalw_HE = fs_->make<TH2F>("h_mapDepth7pedestalw_HE", " ", neta, -41., 41., nphi, 0., bphi);
7682  h_mapDepth1pedestalw_HF = fs_->make<TH2F>("h_mapDepth1pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi);
7683  h_mapDepth2pedestalw_HF = fs_->make<TH2F>("h_mapDepth2pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi);
7684  h_mapDepth3pedestalw_HF = fs_->make<TH2F>("h_mapDepth3pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi);
7685  h_mapDepth4pedestalw_HF = fs_->make<TH2F>("h_mapDepth4pedestalw_HF", " ", neta, -41., 41., nphi, 0., bphi);
7686  h_mapDepth4pedestalw_HO = fs_->make<TH2F>("h_mapDepth4pedestalw_HO", " ", neta, -41., 41., nphi, 0., bphi);
7687 
7688  h_mapDepth1pedestal_HB = fs_->make<TH2F>("h_mapDepth1pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi);
7689  h_mapDepth2pedestal_HB = fs_->make<TH2F>("h_mapDepth2pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi);
7690  h_mapDepth3pedestal_HB = fs_->make<TH2F>("h_mapDepth3pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi);
7691  h_mapDepth4pedestal_HB = fs_->make<TH2F>("h_mapDepth4pedestal_HB", " ", neta, -41., 41., nphi, 0., bphi);
7692  h_mapDepth1pedestal_HE = fs_->make<TH2F>("h_mapDepth1pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi);
7693  h_mapDepth2pedestal_HE = fs_->make<TH2F>("h_mapDepth2pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi);
7694  h_mapDepth3pedestal_HE = fs_->make<TH2F>("h_mapDepth3pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi);
7695  h_mapDepth4pedestal_HE = fs_->make<TH2F>("h_mapDepth4pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi);
7696  h_mapDepth5pedestal_HE = fs_->make<TH2F>("h_mapDepth5pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi);
7697  h_mapDepth6pedestal_HE = fs_->make<TH2F>("h_mapDepth6pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi);
7698  h_mapDepth7pedestal_HE = fs_->make<TH2F>("h_mapDepth7pedestal_HE", " ", neta, -41., 41., nphi, 0., bphi);
7699  h_mapDepth1pedestal_HF = fs_->make<TH2F>("h_mapDepth1pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi);
7700  h_mapDepth2pedestal_HF = fs_->make<TH2F>("h_mapDepth2pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi);
7701  h_mapDepth3pedestal_HF = fs_->make<TH2F>("h_mapDepth3pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi);
7702  h_mapDepth4pedestal_HF = fs_->make<TH2F>("h_mapDepth4pedestal_HF", " ", neta, -41., 41., nphi, 0., bphi);
7703  h_mapDepth4pedestal_HO = fs_->make<TH2F>("h_mapDepth4pedestal_HO", " ", neta, -41., 41., nphi, 0., bphi);
7704  //--------------------------------------------------
7705  h_pedestal00_HB = fs_->make<TH1F>("h_pedestal00_HB", " ", 100, 0., 10.);
7706  h_gain_HB = fs_->make<TH1F>("h_gain_HB", " ", 100, 0., 1.);
7707  h_respcorr_HB = fs_->make<TH1F>("h_respcorr_HB", " ", 100, 0., 2.5);
7708  h_timecorr_HB = fs_->make<TH1F>("h_timecorr_HB", " ", 100, 0., 30.);
7709  h_lutcorr_HB = fs_->make<TH1F>("h_lutcorr_HB", " ", 100, 0., 10.);
7710  h_difpedestal0_HB = fs_->make<TH1F>("h_difpedestal0_HB", " ", 100, -3., 3.);
7711  h_difpedestal1_HB = fs_->make<TH1F>("h_difpedestal1_HB", " ", 100, -3., 3.);
7712  h_difpedestal2_HB = fs_->make<TH1F>("h_difpedestal2_HB", " ", 100, -3., 3.);
7713  h_difpedestal3_HB = fs_->make<TH1F>("h_difpedestal3_HB", " ", 100, -3., 3.);
7714 
7715  h_pedestal00_HE = fs_->make<TH1F>("h_pedestal00_HE", " ", 100, 0., 10.);
7716  h_gain_HE = fs_->make<TH1F>("h_gain_HE", " ", 100, 0., 1.);
7717  h_respcorr_HE = fs_->make<TH1F>("h_respcorr_HE", " ", 100, 0., 2.5);
7718  h_timecorr_HE = fs_->make<TH1F>("h_timecorr_HE", " ", 100, 0., 30.);
7719  h_lutcorr_HE = fs_->make<TH1F>("h_lutcorr_HE", " ", 100, 0., 10.);
7720 
7721  h_pedestal00_HF = fs_->make<TH1F>("h_pedestal00_HF", " ", 100, 0., 10.);
7722  h_gain_HF = fs_->make<TH1F>("h_gain_HF", " ", 100, 0., 1.);
7723  h_respcorr_HF = fs_->make<TH1F>("h_respcorr_HF", " ", 100, 0., 2.5);
7724  h_timecorr_HF = fs_->make<TH1F>("h_timecorr_HF", " ", 100, 0., 30.);
7725  h_lutcorr_HF = fs_->make<TH1F>("h_lutcorr_HF", " ", 100, 0., 10.);
7726 
7727  h_pedestal00_HO = fs_->make<TH1F>("h_pedestal00_HO", " ", 100, 0., 10.);
7728  h_gain_HO = fs_->make<TH1F>("h_gain_HO", " ", 100, 0., 1.);
7729  h_respcorr_HO = fs_->make<TH1F>("h_respcorr_HO", " ", 100, 0., 2.5);
7730  h_timecorr_HO = fs_->make<TH1F>("h_timecorr_HO", " ", 100, 0., 30.);
7731  h_lutcorr_HO = fs_->make<TH1F>("h_lutcorr_HO", " ", 100, 0., 10.);
7732  //--------------------------------------------------
7733  float est6 = 2500.;
7734  int ist6 = 30;
7735  int ist2 = 60;
7736  h2_pedvsampl_HB = fs_->make<TH2F>("h2_pedvsampl_HB", " ", ist2, 0., 7.0, ist2, 0., est6);
7737  h2_pedwvsampl_HB = fs_->make<TH2F>("h2_pedwvsampl_HB", " ", ist2, 0., 2.5, ist2, 0., est6);
7738  h_pedvsampl_HB = fs_->make<TH1F>("h_pedvsampl_HB", " ", ist6, 0., 7.0);
7739  h_pedwvsampl_HB = fs_->make<TH1F>("h_pedwvsampl_HB", " ", ist6, 0., 2.5);
7740  h_pedvsampl0_HB = fs_->make<TH1F>("h_pedvsampl0_HB", " ", ist6, 0., 7.);
7741  h_pedwvsampl0_HB = fs_->make<TH1F>("h_pedwvsampl0_HB", " ", ist6, 0., 2.5);
7742  h2_amplvsped_HB = fs_->make<TH2F>("h2_amplvsped_HB", " ", ist2, 0., est6, ist2, 0., 7.0);
7743  h2_amplvspedw_HB = fs_->make<TH2F>("h2_amplvspedw_HB", " ", ist2, 0., est6, ist2, 0., 2.5);
7744  h_amplvsped_HB = fs_->make<TH1F>("h_amplvsped_HB", " ", ist6, 0., est6);
7745  h_amplvspedw_HB = fs_->make<TH1F>("h_amplvspedw_HB", " ", ist6, 0., est6);
7746  h_amplvsped0_HB = fs_->make<TH1F>("h_amplvsped0_HB", " ", ist6, 0., est6);
7747 
7748  h2_pedvsampl_HE = fs_->make<TH2F>("h2_pedvsampl_HE", " ", ist2, 0., 7.0, ist2, 0., est6);
7749  h2_pedwvsampl_HE = fs_->make<TH2F>("h2_pedwvsampl_HE", " ", ist2, 0., 2.5, ist2, 0., est6);
7750  h_pedvsampl_HE = fs_->make<TH1F>("h_pedvsampl_HE", " ", ist6, 0., 7.0);
7751  h_pedwvsampl_HE = fs_->make<TH1F>("h_pedwvsampl_HE", " ", ist6, 0., 2.5);
7752  h_pedvsampl0_HE = fs_->make<TH1F>("h_pedvsampl0_HE", " ", ist6, 0., 7.);
7753  h_pedwvsampl0_HE = fs_->make<TH1F>("h_pedwvsampl0_HE", " ", ist6, 0., 2.5);
7754 
7755  h2_pedvsampl_HF = fs_->make<TH2F>("h2_pedvsampl_HF", " ", ist2, 0., 20.0, ist2, 0., est6);
7756  h2_pedwvsampl_HF = fs_->make<TH2F>("h2_pedwvsampl_HF", " ", ist2, 0., 2.0, ist2, 0., est6);
7757  h_pedvsampl_HF = fs_->make<TH1F>("h_pedvsampl_HF", " ", ist6, 0., 20.0);
7758  h_pedwvsampl_HF = fs_->make<TH1F>("h_pedwvsampl_HF", " ", ist6, 0., 2.0);
7759  h_pedvsampl0_HF = fs_->make<TH1F>("h_pedvsampl0_HF", " ", ist6, 0., 20.);
7760  h_pedwvsampl0_HF = fs_->make<TH1F>("h_pedwvsampl0_HF", " ", ist6, 0., 2.0);
7761 
7762  h2_pedvsampl_HO = fs_->make<TH2F>("h2_pedvsampl_HO", " ", ist2, 0., 20.0, ist2, 0., est6);
7763  h2_pedwvsampl_HO = fs_->make<TH2F>("h2_pedwvsampl_HO", " ", ist2, 0., 2.5, ist2, 0., est6);
7764  h_pedvsampl_HO = fs_->make<TH1F>("h_pedvsampl_HO", " ", ist6, 0., 20.0);
7765  h_pedwvsampl_HO = fs_->make<TH1F>("h_pedwvsampl_HO", " ", ist6, 0., 2.5);
7766  h_pedvsampl0_HO = fs_->make<TH1F>("h_pedvsampl0_HO", " ", ist6, 0., 20.);
7767  h_pedwvsampl0_HO = fs_->make<TH1F>("h_pedwvsampl0_HO", " ", ist6, 0., 2.5);
7768  //--------------------------------------------------
7769  h_mapDepth1Ped0_HB = fs_->make<TH2F>("h_mapDepth1Ped0_HB", " ", neta, -41., 41., nphi, 0., bphi);
7770  h_mapDepth1Ped1_HB = fs_->make<TH2F>("h_mapDepth1Ped1_HB", " ", neta, -41., 41., nphi, 0., bphi);
7771  h_mapDepth1Ped2_HB = fs_->make<TH2F>("h_mapDepth1Ped2_HB", " ", neta, -41., 41., nphi, 0., bphi);
7772  h_mapDepth1Ped3_HB = fs_->make<TH2F>("h_mapDepth1Ped3_HB", " ", neta, -41., 41., nphi, 0., bphi);
7773  h_mapDepth1Pedw0_HB = fs_->make<TH2F>("h_mapDepth1Pedw0_HB", " ", neta, -41., 41., nphi, 0., bphi);
7774  h_mapDepth1Pedw1_HB = fs_->make<TH2F>("h_mapDepth1Pedw1_HB", " ", neta, -41., 41., nphi, 0., bphi);
7775  h_mapDepth1Pedw2_HB = fs_->make<TH2F>("h_mapDepth1Pedw2_HB", " ", neta, -41., 41., nphi, 0., bphi);
7776  h_mapDepth1Pedw3_HB = fs_->make<TH2F>("h_mapDepth1Pedw3_HB", " ", neta, -41., 41., nphi, 0., bphi);
7777  h_mapDepth2Ped0_HB = fs_->make<TH2F>("h_mapDepth2Ped0_HB", " ", neta, -41., 41., nphi, 0., bphi);
7778  h_mapDepth2Ped1_HB = fs_->make<TH2F>("h_mapDepth2Ped1_HB", " ", neta, -41., 41., nphi, 0., bphi);
7779  h_mapDepth2Ped2_HB = fs_->make<TH2F>("h_mapDepth2Ped2_HB", " ", neta, -41., 41., nphi, 0., bphi);
7780  h_mapDepth2Ped3_HB = fs_->make<TH2F>("h_mapDepth2Ped3_HB", " ", neta, -41., 41., nphi, 0., bphi);
7781  h_mapDepth2Pedw0_HB = fs_->make<TH2F>("h_mapDepth2Pedw0_HB", " ", neta, -41., 41., nphi, 0., bphi);
7782  h_mapDepth2Pedw1_HB = fs_->make<TH2F>("h_mapDepth2Pedw1_HB", " ", neta, -41., 41., nphi, 0., bphi);
7783  h_mapDepth2Pedw2_HB = fs_->make<TH2F>("h_mapDepth2Pedw2_HB", " ", neta, -41., 41., nphi, 0., bphi);
7784  h_mapDepth2Pedw3_HB = fs_->make<TH2F>("h_mapDepth2Pedw3_HB", " ", neta, -41., 41., nphi, 0., bphi);
7785 
7786  h_mapDepth1Ped0_HE = fs_->make<TH2F>("h_mapDepth1Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi);
7787  h_mapDepth1Ped1_HE = fs_->make<TH2F>("h_mapDepth1Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi);
7788  h_mapDepth1Ped2_HE = fs_->make<TH2F>("h_mapDepth1Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi);
7789  h_mapDepth1Ped3_HE = fs_->make<TH2F>("h_mapDepth1Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi);
7790  h_mapDepth1Pedw0_HE = fs_->make<TH2F>("h_mapDepth1Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi);
7791  h_mapDepth1Pedw1_HE = fs_->make<TH2F>("h_mapDepth1Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi);
7792  h_mapDepth1Pedw2_HE = fs_->make<TH2F>("h_mapDepth1Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi);
7793  h_mapDepth1Pedw3_HE = fs_->make<TH2F>("h_mapDepth1Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi);
7794  h_mapDepth2Ped0_HE = fs_->make<TH2F>("h_mapDepth2Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi);
7795  h_mapDepth2Ped1_HE = fs_->make<TH2F>("h_mapDepth2Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi);
7796  h_mapDepth2Ped2_HE = fs_->make<TH2F>("h_mapDepth2Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi);
7797  h_mapDepth2Ped3_HE = fs_->make<TH2F>("h_mapDepth2Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi);
7798  h_mapDepth2Pedw0_HE = fs_->make<TH2F>("h_mapDepth2Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi);
7799  h_mapDepth2Pedw1_HE = fs_->make<TH2F>("h_mapDepth2Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi);
7800  h_mapDepth2Pedw2_HE = fs_->make<TH2F>("h_mapDepth2Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi);
7801  h_mapDepth2Pedw3_HE = fs_->make<TH2F>("h_mapDepth2Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi);
7802  h_mapDepth3Ped0_HE = fs_->make<TH2F>("h_mapDepth3Ped0_HE", " ", neta, -41., 41., nphi, 0., bphi);
7803  h_mapDepth3Ped1_HE = fs_->make<TH2F>("h_mapDepth3Ped1_HE", " ", neta, -41., 41., nphi, 0., bphi);
7804  h_mapDepth3Ped2_HE = fs_->make<TH2F>("h_mapDepth3Ped2_HE", " ", neta, -41., 41., nphi, 0., bphi);
7805  h_mapDepth3Ped3_HE = fs_->make<TH2F>("h_mapDepth3Ped3_HE", " ", neta, -41., 41., nphi, 0., bphi);
7806  h_mapDepth3Pedw0_HE = fs_->make<TH2F>("h_mapDepth3Pedw0_HE", " ", neta, -41., 41., nphi, 0., bphi);
7807  h_mapDepth3Pedw1_HE = fs_->make<TH2F>("h_mapDepth3Pedw1_HE", " ", neta, -41., 41., nphi, 0., bphi);
7808  h_mapDepth3Pedw2_HE = fs_->make<TH2F>("h_mapDepth3Pedw2_HE", " ", neta, -41., 41., nphi, 0., bphi);
7809  h_mapDepth3Pedw3_HE = fs_->make<TH2F>("h_mapDepth3Pedw3_HE", " ", neta, -41., 41., nphi, 0., bphi);
7810 
7811  h_mapDepth1Ped0_HF = fs_->make<TH2F>("h_mapDepth1Ped0_HF", " ", neta, -41., 41., nphi, 0., bphi);
7812  h_mapDepth1Ped1_HF = fs_->make<TH2F>("h_mapDepth1Ped1_HF", " ", neta, -41., 41., nphi, 0., bphi);
7813  h_mapDepth1Ped2_HF = fs_->make<TH2F>("h_mapDepth1Ped2_HF", " ", neta, -41., 41., nphi, 0., bphi);
7814  h_mapDepth1Ped3_HF = fs_->make<TH2F>("h_mapDepth1Ped3_HF", " ", neta, -41., 41., nphi, 0., bphi);
7815  h_mapDepth1Pedw0_HF = fs_->make<TH2F>("h_mapDepth1Pedw0_HF", " ", neta, -41., 41., nphi, 0., bphi);
7816  h_mapDepth1Pedw1_HF = fs_->make<TH2F>("h_mapDepth1Pedw1_HF", " ", neta, -41., 41., nphi, 0., bphi);
7817  h_mapDepth1Pedw2_HF = fs_->make<TH2F>("h_mapDepth1Pedw2_HF", " ", neta, -41., 41., nphi, 0., bphi);
7818  h_mapDepth1Pedw3_HF = fs_->make<TH2F>("h_mapDepth1Pedw3_HF", " ", neta, -41., 41., nphi, 0., bphi);
7819  h_mapDepth2Ped0_HF = fs_->make<TH2F>("h_mapDepth2Ped0_HF", " ", neta, -41., 41., nphi, 0., bphi);
7820  h_mapDepth2Ped1_HF = fs_->make<TH2F>("h_mapDepth2Ped1_HF", " ", neta, -41., 41., nphi, 0., bphi);
7821  h_mapDepth2Ped2_HF = fs_->make<TH2F>("h_mapDepth2Ped2_HF", " ", neta, -41., 41., nphi, 0., bphi);
7822  h_mapDepth2Ped3_HF = fs_->make<TH2F>("h_mapDepth2Ped3_HF", " ", neta, -41., 41., nphi, 0., bphi);
7823  h_mapDepth2Pedw0_HF = fs_->make<TH2F>("h_mapDepth2Pedw0_HF", " ", neta, -41., 41., nphi, 0., bphi);
7824  h_mapDepth2Pedw1_HF = fs_->make<TH2F>("h_mapDepth2Pedw1_HF", " ", neta, -41., 41., nphi, 0., bphi);
7825  h_mapDepth2Pedw2_HF = fs_->make<TH2F>("h_mapDepth2Pedw2_HF", " ", neta, -41., 41., nphi, 0., bphi);
7826  h_mapDepth2Pedw3_HF = fs_->make<TH2F>("h_mapDepth2Pedw3_HF", " ", neta, -41., 41., nphi, 0., bphi);
7827 
7828  h_mapDepth4Ped0_HO = fs_->make<TH2F>("h_mapDepth4Ped0_HO", " ", neta, -41., 41., nphi, 0., bphi);
7829  h_mapDepth4Ped1_HO = fs_->make<TH2F>("h_mapDepth4Ped1_HO", " ", neta, -41., 41., nphi, 0., bphi);
7830  h_mapDepth4Ped2_HO = fs_->make<TH2F>("h_mapDepth4Ped2_HO", " ", neta, -41., 41., nphi, 0., bphi);
7831  h_mapDepth4Ped3_HO = fs_->make<TH2F>("h_mapDepth4Ped3_HO", " ", neta, -41., 41., nphi, 0., bphi);
7832  h_mapDepth4Pedw0_HO = fs_->make<TH2F>("h_mapDepth4Pedw0_HO", " ", neta, -41., 41., nphi, 0., bphi);
7833  h_mapDepth4Pedw1_HO = fs_->make<TH2F>("h_mapDepth4Pedw1_HO", " ", neta, -41., 41., nphi, 0., bphi);
7834  h_mapDepth4Pedw2_HO = fs_->make<TH2F>("h_mapDepth4Pedw2_HO", " ", neta, -41., 41., nphi, 0., bphi);
7835  h_mapDepth4Pedw3_HO = fs_->make<TH2F>("h_mapDepth4Pedw3_HO", " ", neta, -41., 41., nphi, 0., bphi);
7836  //--------------------------------------------------
7837  h_mapDepth1ADCAmpl12_HB = fs_->make<TH2F>("h_mapDepth1ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi);
7838  h_mapDepth2ADCAmpl12_HB = fs_->make<TH2F>("h_mapDepth2ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi);
7839  h_mapDepth3ADCAmpl12_HB = fs_->make<TH2F>("h_mapDepth3ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi);
7840  h_mapDepth4ADCAmpl12_HB = fs_->make<TH2F>("h_mapDepth4ADCAmpl12_HB", " ", neta, -41., 41., nphi, 0., bphi);
7841  h_mapDepth1ADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth1ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7842  h_mapDepth2ADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth2ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7843  h_mapDepth3ADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth3ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7844  h_mapDepth4ADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth4ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7845  h_mapDepth5ADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth5ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7846  h_mapDepth6ADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth6ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7847  h_mapDepth7ADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth7ADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7848  h_mapDepth1ADCAmpl12SiPM_HE = fs_->make<TH2F>("h_mapDepth1ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi);
7849  h_mapDepth2ADCAmpl12SiPM_HE = fs_->make<TH2F>("h_mapDepth2ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi);
7850  h_mapDepth3ADCAmpl12SiPM_HE = fs_->make<TH2F>("h_mapDepth3ADCAmpl12SiPM_HE", " ", neta, -41., 41., nphi, 0., bphi);
7851 
7852  h_mapDepth1ADCAmpl12_HF = fs_->make<TH2F>("h_mapDepth1ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi);
7853  h_mapDepth2ADCAmpl12_HF = fs_->make<TH2F>("h_mapDepth2ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi);
7854  h_mapDepth3ADCAmpl12_HF = fs_->make<TH2F>("h_mapDepth3ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi);
7855  h_mapDepth4ADCAmpl12_HF = fs_->make<TH2F>("h_mapDepth4ADCAmpl12_HF", " ", neta, -41., 41., nphi, 0., bphi);
7856 
7857  h_mapDepth4ADCAmpl12_HO = fs_->make<TH2F>("h_mapDepth4ADCAmpl12_HO", " ", neta, -41., 41., nphi, 0., bphi);
7858 
7859  h_mapDepth1linADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth1linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7860  h_mapDepth2linADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth2linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7861  h_mapDepth3linADCAmpl12_HE = fs_->make<TH2F>("h_mapDepth3linADCAmpl12_HE", " ", neta, -41., 41., nphi, 0., bphi);
7862  //--------------------------------------------------
7864  fs_->make<TH2F>("h_mapGetRMSOverNormalizedSignal_HB", " ", neta, -41., 41., nphi, 0., bphi);
7866  fs_->make<TH2F>("h_mapGetRMSOverNormalizedSignal0_HB", " ", neta, -41., 41., nphi, 0., bphi);
7868  fs_->make<TH2F>("h_mapGetRMSOverNormalizedSignal_HE", " ", neta, -41., 41., nphi, 0., bphi);
7870  fs_->make<TH2F>("h_mapGetRMSOverNormalizedSignal0_HE", " ", neta, -41., 41., nphi, 0., bphi);
7872  fs_->make<TH2F>("h_mapGetRMSOverNormalizedSignal_HF", " ", neta, -41., 41., nphi, 0., bphi);
7874  fs_->make<TH2F>("h_mapGetRMSOverNormalizedSignal0_HF", " ", neta, -41., 41., nphi, 0., bphi);
7876  fs_->make<TH2F>("h_mapGetRMSOverNormalizedSignal_HO", " ", neta, -41., 41., nphi, 0., bphi);
7878  fs_->make<TH2F>("h_mapGetRMSOverNormalizedSignal0_HO", " ", neta, -41., 41., nphi, 0., bphi);
7879  //--------------------------------------------------
7880  h_shape_Ahigh_HB0 = fs_->make<TH1F>("h_shape_Ahigh_HB0", " ", 10, 0., 10.);
7881  h_shape0_Ahigh_HB0 = fs_->make<TH1F>("h_shape0_Ahigh_HB0", " ", 10, 0., 10.);
7882  h_shape_Alow_HB0 = fs_->make<TH1F>("h_shape_Alow_HB0", " ", 10, 0., 10.);
7883  h_shape0_Alow_HB0 = fs_->make<TH1F>("h_shape0_Alow_HB0", " ", 10, 0., 10.);
7884  h_shape_Ahigh_HB1 = fs_->make<TH1F>("h_shape_Ahigh_HB1", " ", 10, 0., 10.);
7885  h_shape0_Ahigh_HB1 = fs_->make<TH1F>("h_shape0_Ahigh_HB1", " ", 10, 0., 10.);
7886  h_shape_Alow_HB1 = fs_->make<TH1F>("h_shape_Alow_HB1", " ", 10, 0., 10.);
7887  h_shape0_Alow_HB1 = fs_->make<TH1F>("h_shape0_Alow_HB1", " ", 10, 0., 10.);
7888  h_shape_Ahigh_HB2 = fs_->make<TH1F>("h_shape_Ahigh_HB2", " ", 10, 0., 10.);
7889  h_shape0_Ahigh_HB2 = fs_->make<TH1F>("h_shape0_Ahigh_HB2", " ", 10, 0., 10.);
7890  h_shape_Alow_HB2 = fs_->make<TH1F>("h_shape_Alow_HB2", " ", 10, 0., 10.);
7891  h_shape0_Alow_HB2 = fs_->make<TH1F>("h_shape0_Alow_HB2", " ", 10, 0., 10.);
7892  h_shape_Ahigh_HB3 = fs_->make<TH1F>("h_shape_Ahigh_HB3", " ", 10, 0., 10.);
7893  h_shape0_Ahigh_HB3 = fs_->make<TH1F>("h_shape0_Ahigh_HB3", " ", 10, 0., 10.);
7894  h_shape_Alow_HB3 = fs_->make<TH1F>("h_shape_Alow_HB3", " ", 10, 0., 10.);
7895  h_shape0_Alow_HB3 = fs_->make<TH1F>("h_shape0_Alow_HB3", " ", 10, 0., 10.);
7896  //--------------------------------------------------
7897  h_shape_bad_channels_HB = fs_->make<TH1F>("h_shape_bad_channels_HB", " ", 10, 0., 10.);
7898  h_shape0_bad_channels_HB = fs_->make<TH1F>("h_shape0_bad_channels_HB", " ", 10, 0., 10.);
7899  h_shape_good_channels_HB = fs_->make<TH1F>("h_shape_good_channels_HB", " ", 10, 0., 10.);
7900  h_shape0_good_channels_HB = fs_->make<TH1F>("h_shape0_good_channels_HB", " ", 10, 0., 10.);
7901  h_shape_bad_channels_HE = fs_->make<TH1F>("h_shape_bad_channels_HE", " ", 10, 0., 10.);
7902  h_shape0_bad_channels_HE = fs_->make<TH1F>("h_shape0_bad_channels_HE", " ", 10, 0., 10.);
7903  h_shape_good_channels_HE = fs_->make<TH1F>("h_shape_good_channels_HE", " ", 10, 0., 10.);
7904  h_shape0_good_channels_HE = fs_->make<TH1F>("h_shape0_good_channels_HE", " ", 10, 0., 10.);
7905  h_shape_bad_channels_HF = fs_->make<TH1F>("h_shape_bad_channels_HF", " ", 10, 0., 10.);
7906  h_shape0_bad_channels_HF = fs_->make<TH1F>("h_shape0_bad_channels_HF", " ", 10, 0., 10.);
7907  h_shape_good_channels_HF = fs_->make<TH1F>("h_shape_good_channels_HF", " ", 10, 0., 10.);
7908  h_shape0_good_channels_HF = fs_->make<TH1F>("h_shape0_good_channels_HF", " ", 10, 0., 10.);
7909  h_shape_bad_channels_HO = fs_->make<TH1F>("h_shape_bad_channels_HO", " ", 10, 0., 10.);
7910  h_shape0_bad_channels_HO = fs_->make<TH1F>("h_shape0_bad_channels_HO", " ", 10, 0., 10.);
7911  h_shape_good_channels_HO = fs_->make<TH1F>("h_shape_good_channels_HO", " ", 10, 0., 10.);
7912  h_shape0_good_channels_HO = fs_->make<TH1F>("h_shape0_good_channels_HO", " ", 10, 0., 10.);
7913  //--------------------------------------------------
7914  // if(flagcpuoptimization_== 0 ) {
7915 
7916  int spl = 1000;
7917  float spls = 5000;
7918  h_sumamplitude_depth1_HB = fs_->make<TH1F>("h_sumamplitude_depth1_HB", " ", spl, 0., spls);
7919  h_sumamplitude_depth2_HB = fs_->make<TH1F>("h_sumamplitude_depth2_HB", " ", spl, 0., spls);
7920  h_sumamplitude_depth1_HE = fs_->make<TH1F>("h_sumamplitude_depth1_HE", " ", spl, 0., spls);
7921  h_sumamplitude_depth2_HE = fs_->make<TH1F>("h_sumamplitude_depth2_HE", " ", spl, 0., spls);
7922  h_sumamplitude_depth3_HE = fs_->make<TH1F>("h_sumamplitude_depth3_HE", " ", spl, 0., spls);
7923  h_sumamplitude_depth1_HF = fs_->make<TH1F>("h_sumamplitude_depth1_HF", " ", spl, 0., spls);
7924  h_sumamplitude_depth2_HF = fs_->make<TH1F>("h_sumamplitude_depth2_HF", " ", spl, 0., spls);
7925  h_sumamplitude_depth4_HO = fs_->make<TH1F>("h_sumamplitude_depth4_HO", " ", spl, 0., spls);
7926  int spl0 = 1000;
7927  float spls0 = 10000;
7928  h_sumamplitude_depth1_HB0 = fs_->make<TH1F>("h_sumamplitude_depth1_HB0", " ", spl0, 0., spls0);
7929  h_sumamplitude_depth2_HB0 = fs_->make<TH1F>("h_sumamplitude_depth2_HB0", " ", spl0, 0., spls0);
7930  h_sumamplitude_depth1_HE0 = fs_->make<TH1F>("h_sumamplitude_depth1_HE0", " ", spl0, 0., spls0);
7931  h_sumamplitude_depth2_HE0 = fs_->make<TH1F>("h_sumamplitude_depth2_HE0", " ", spl0, 0., spls0);
7932  h_sumamplitude_depth3_HE0 = fs_->make<TH1F>("h_sumamplitude_depth3_HE0", " ", spl0, 0., spls0);
7933  h_sumamplitude_depth1_HF0 = fs_->make<TH1F>("h_sumamplitude_depth1_HF0", " ", spl0, 0., spls0);
7934  h_sumamplitude_depth2_HF0 = fs_->make<TH1F>("h_sumamplitude_depth2_HF0", " ", spl0, 0., spls0);
7935  h_sumamplitude_depth4_HO0 = fs_->make<TH1F>("h_sumamplitude_depth4_HO0", " ", spl0, 0., spls0);
7936  int spl1 = 1000;
7937  float spls1 = 100000;
7938  h_sumamplitude_depth1_HB1 = fs_->make<TH1F>("h_sumamplitude_depth1_HB1", " ", spl1, 0., spls1);
7939  h_sumamplitude_depth2_HB1 = fs_->make<TH1F>("h_sumamplitude_depth2_HB1", " ", spl1, 0., spls1);
7940  h_sumamplitude_depth1_HE1 = fs_->make<TH1F>("h_sumamplitude_depth1_HE1", " ", spl1, 0., spls1);
7941  h_sumamplitude_depth2_HE1 = fs_->make<TH1F>("h_sumamplitude_depth2_HE1", " ", spl1, 0., spls1);
7942  h_sumamplitude_depth3_HE1 = fs_->make<TH1F>("h_sumamplitude_depth3_HE1", " ", spl1, 0., spls1);
7943  h_sumamplitude_depth1_HF1 = fs_->make<TH1F>("h_sumamplitude_depth1_HF1", " ", spl1, 0., spls1);
7944  h_sumamplitude_depth2_HF1 = fs_->make<TH1F>("h_sumamplitude_depth2_HF1", " ", spl1, 0., spls1);
7945  h_sumamplitude_depth4_HO1 = fs_->make<TH1F>("h_sumamplitude_depth4_HO1", " ", spl1, 0., spls1);
7946 
7947  h_Amplitude_forCapIdErrors_HB1 = fs_->make<TH1F>("h_Amplitude_forCapIdErrors_HB1", " ", 100, 0., 30000.);
7948  h_Amplitude_forCapIdErrors_HB2 = fs_->make<TH1F>("h_Amplitude_forCapIdErrors_HB2", " ", 100, 0., 30000.);
7949  h_Amplitude_forCapIdErrors_HE1 = fs_->make<TH1F>("h_Amplitude_forCapIdErrors_HE1", " ", 100, 0., 30000.);
7950  h_Amplitude_forCapIdErrors_HE2 = fs_->make<TH1F>("h_Amplitude_forCapIdErrors_HE2", " ", 100, 0., 30000.);
7951  h_Amplitude_forCapIdErrors_HE3 = fs_->make<TH1F>("h_Amplitude_forCapIdErrors_HE3", " ", 100, 0., 30000.);
7952  h_Amplitude_forCapIdErrors_HF1 = fs_->make<TH1F>("h_Amplitude_forCapIdErrors_HF1", " ", 100, 0., 30000.);
7953  h_Amplitude_forCapIdErrors_HF2 = fs_->make<TH1F>("h_Amplitude_forCapIdErrors_HF2", " ", 100, 0., 30000.);
7954  h_Amplitude_forCapIdErrors_HO4 = fs_->make<TH1F>("h_Amplitude_forCapIdErrors_HO4", " ", 100, 0., 30000.);
7955 
7956  h_Amplitude_notCapIdErrors_HB1 = fs_->make<TH1F>("h_Amplitude_notCapIdErrors_HB1", " ", 100, 0., 30000.);
7957  h_Amplitude_notCapIdErrors_HB2 = fs_->make<TH1F>("h_Amplitude_notCapIdErrors_HB2", " ", 100, 0., 30000.);
7958  h_Amplitude_notCapIdErrors_HE1 = fs_->make<TH1F>("h_Amplitude_notCapIdErrors_HE1", " ", 100, 0., 30000.);
7959  h_Amplitude_notCapIdErrors_HE2 = fs_->make<TH1F>("h_Amplitude_notCapIdErrors_HE2", " ", 100, 0., 30000.);
7960  h_Amplitude_notCapIdErrors_HE3 = fs_->make<TH1F>("h_Amplitude_notCapIdErrors_HE3", " ", 100, 0., 30000.);
7961  h_Amplitude_notCapIdErrors_HF1 = fs_->make<TH1F>("h_Amplitude_notCapIdErrors_HF1", " ", 100, 0., 30000.);
7962  h_Amplitude_notCapIdErrors_HF2 = fs_->make<TH1F>("h_Amplitude_notCapIdErrors_HF2", " ", 100, 0., 30000.);
7963  h_Amplitude_notCapIdErrors_HO4 = fs_->make<TH1F>("h_Amplitude_notCapIdErrors_HO4", " ", 100, 0., 30000.);
7964 
7965  h_2DAtaildepth1_HB = fs_->make<TH2F>("h_2DAtaildepth1_HB", " ", neta, -41., 41., nphi, 0., bphi);
7966  h_2D0Ataildepth1_HB = fs_->make<TH2F>("h_2D0Ataildepth1_HB", " ", neta, -41., 41., nphi, 0., bphi);
7967  h_2DAtaildepth2_HB = fs_->make<TH2F>("h_2DAtaildepth2_HB", " ", neta, -41., 41., nphi, 0., bphi);
7968  h_2D0Ataildepth2_HB = fs_->make<TH2F>("h_2D0Ataildepth2_HB", " ", neta, -41., 41., nphi, 0., bphi);
7969 
7971  } //if(recordHistoes_
7972  if (verbosity > 0)
7973  std::cout << "======================== booking DONE +++++++++++++++++++++++++++" << std::endl;
7975  if (recordNtuples_) {
7976  myTree = fs_->make<TTree>("Hcal", "Hcal Tree");
7977  myTree->Branch("Nevent", &Nevent, "Nevent/I");
7978  myTree->Branch("Run", &Run, "Run/I");
7979 
7980  } //if(recordNtuples_
7981  if (verbosity > 0)
7982  std::cout << "======================== beignJob finish +++++++++++++++++++++++++++" << std::endl;
7984 }
7985 
7988 // ------------ method called for each event ------------
7990  CaloSamples toolOriginal; // TS
7991  // double tool[100];
7992  if (verbosity < 0)
7993  std::cout << "************** in loop over Digis counter = " << nnnnnnhbhe << std::endl;
7994  HcalDetId cell(digiItr->id());
7995  int mdepth = cell.depth();
7996  int iphi = cell.iphi() - 1;
7997  int ieta = cell.ieta();
7998  if (ieta > 0)
7999  ieta -= 1;
8000  int sub = cell.subdet(); // 1-HB, 2-HE (HFDigiCollection: 4-HF)
8001  // !!!!!!
8002  int errorGeneral = 0;
8003  int error1 = 0;
8004  int error2 = 0;
8005  int error3 = 0;
8006  int error4 = 0;
8007  int error5 = 0;
8008  int error6 = 0;
8009  int error7 = 0;
8010  // !!!!!!
8011  bool anycapid = true;
8012  bool anyer = false;
8013  bool anydv = true;
8014  // for help:
8015  int firstcapid = 0;
8016  int sumcapid = 0;
8017  int lastcapid = 0, capid = 0;
8018  int ERRORfiber = -10;
8019  int ERRORfiberChan = -10;
8020  int ERRORfiberAndChan = -10;
8021  int repetedcapid = 0;
8022  int TSsize = 10;
8023  TSsize = digiItr->size();
8024 
8026  for (int ii = 0; ii < TSsize; ii++) {
8027  capid = (*digiItr)[ii].capid(); // capId (0-3, sequential)
8028  bool er = (*digiItr)[ii].er(); // error
8029  bool dv = (*digiItr)[ii].dv(); // valid data
8030  int fiber = (*digiItr)[ii].fiber(); // get the fiber number
8031  int fiberChan = (*digiItr)[ii].fiberChan(); // get the fiber channel number
8032  int fiberAndChan = (*digiItr)[ii].fiberAndChan(); // get the id channel
8033  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
8034  anycapid = false;
8035  ERRORfiber = fiber;
8036  ERRORfiberChan = fiberChan;
8037  ERRORfiberAndChan = fiberAndChan;
8038  if (capid != lastcapid) {
8039  } else {
8040  repetedcapid = 1;
8041  }
8042  }
8043  lastcapid = capid;
8044 
8045  if (ii == 0)
8046  firstcapid = capid;
8047  sumcapid += capid;
8048 
8049  if (er) {
8050  anyer = true;
8051  ERRORfiber = fiber;
8052  ERRORfiberChan = fiberChan;
8053  ERRORfiberAndChan = fiberAndChan;
8054  }
8055  if (!dv) {
8056  anydv = false;
8057  ERRORfiber = fiber;
8058  ERRORfiberChan = fiberChan;
8059  ERRORfiberAndChan = fiberAndChan;
8060  }
8061 
8062  } // for
8063 
8065  if (firstcapid == 0 && !anycapid)
8066  errorGeneral = 1;
8067  if (firstcapid == 1 && !anycapid)
8068  errorGeneral = 2;
8069  if (firstcapid == 2 && !anycapid)
8070  errorGeneral = 3;
8071  if (firstcapid == 3 && !anycapid)
8072  errorGeneral = 4;
8073  if (!anycapid)
8074  error1 = 1;
8075  if (anyer)
8076  error2 = 1;
8077  if (!anydv)
8078  error3 = 1;
8079 
8080  if (!anycapid && anyer)
8081  error4 = 1;
8082  if (!anycapid && !anydv)
8083  error5 = 1;
8084  if (!anycapid && anyer && !anydv)
8085  error6 = 1;
8086  if (anyer && !anydv)
8087  error7 = 1;
8089  // Energy:
8090 
8091  double ampl = 0.;
8092  for (int ii = 0; ii < TSsize; ii++) {
8093  double ampldefault = adc2fC[digiItr->sample(ii).adc()];
8094  ampl += ampldefault; // fC
8095  }
8096 
8098  // Digis:
8099  // HB
8100  if (sub == 1) {
8101  h_errorGeneral_HB->Fill(double(errorGeneral), 1.);
8102  h_error1_HB->Fill(double(error1), 1.);
8103  h_error2_HB->Fill(double(error2), 1.);
8104  h_error3_HB->Fill(double(error3), 1.);
8105  h_error4_HB->Fill(double(error4), 1.);
8106  h_error5_HB->Fill(double(error5), 1.);
8107  h_error6_HB->Fill(double(error6), 1.);
8108  h_error7_HB->Fill(double(error7), 1.);
8109  h_repetedcapid_HB->Fill(double(repetedcapid), 1.);
8110 
8111  if (error1 != 0 || error2 != 0 || error3 != 0) {
8113  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
8114  h_amplError_HB->Fill(ampl, 1.);
8115  if (mdepth == 1)
8116  h_mapDepth1Error_HB->Fill(double(ieta), double(iphi));
8117  if (mdepth == 2)
8118  h_mapDepth2Error_HB->Fill(double(ieta), double(iphi));
8119  h_fiber0_HB->Fill(double(ERRORfiber), 1.);
8120  h_fiber1_HB->Fill(double(ERRORfiberChan), 1.);
8121  h_fiber2_HB->Fill(double(ERRORfiberAndChan), 1.);
8122  } else {
8123  h_amplFine_HB->Fill(ampl, 1.);
8124  }
8125  }
8126  // HE
8127  if (sub == 2) {
8128  h_errorGeneral_HE->Fill(double(errorGeneral), 1.);
8129  h_error1_HE->Fill(double(error1), 1.);
8130  h_error2_HE->Fill(double(error2), 1.);
8131  h_error3_HE->Fill(double(error3), 1.);
8132  h_error4_HE->Fill(double(error4), 1.);
8133  h_error5_HE->Fill(double(error5), 1.);
8134  h_error6_HE->Fill(double(error6), 1.);
8135  h_error7_HE->Fill(double(error7), 1.);
8136  h_repetedcapid_HE->Fill(double(repetedcapid), 1.);
8137 
8138  if (error1 != 0 || error2 != 0 || error3 != 0) {
8140  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
8141  h_amplError_HE->Fill(ampl, 1.);
8142  if (mdepth == 1)
8143  h_mapDepth1Error_HE->Fill(double(ieta), double(iphi));
8144  if (mdepth == 2)
8145  h_mapDepth2Error_HE->Fill(double(ieta), double(iphi));
8146  if (mdepth == 3)
8147  h_mapDepth3Error_HE->Fill(double(ieta), double(iphi));
8148  h_fiber0_HE->Fill(double(ERRORfiber), 1.);
8149  h_fiber1_HE->Fill(double(ERRORfiberChan), 1.);
8150  h_fiber2_HE->Fill(double(ERRORfiberAndChan), 1.);
8151  } else {
8152  h_amplFine_HE->Fill(ampl, 1.);
8153  }
8154  }
8155  // ha2->Fill(double(ieta), double(iphi));
8156 } //fillDigiErrors
8159 // ------------ method called for each event ------------
8161  CaloSamples toolOriginal; // TS
8162  // double tool[100];
8163  DetId detid = qie11df.detid();
8164  HcalDetId hcaldetid = HcalDetId(detid);
8165  int ieta = hcaldetid.ieta();
8166  if (ieta > 0)
8167  ieta -= 1;
8168  int iphi = hcaldetid.iphi() - 1;
8169  int mdepth = hcaldetid.depth();
8170  int sub = hcaldetid.subdet(); // 1-HB, 2-HE (HFDigiCollection: 4-HF)
8171  // !!!!!!
8172  int error1 = 0;
8173  // !!!!!!
8174  bool anycapid = true;
8175  // bool anyer = false;
8176  // bool anydv = true;
8177  // for help:
8178  int firstcapid = 0;
8179  int sumcapid = 0;
8180  int lastcapid = 0, capid = 0;
8181  int repetedcapid = 0;
8182  // loop over the samples in the digi
8183  nTS = qie11df.samples();
8185  for (int ii = 0; ii < nTS; ii++) {
8186  capid = qie11df[ii].capid(); // capId (0-3, sequential)
8187  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
8188  anycapid = false;
8189  if (capid != lastcapid) {
8190  } else {
8191  repetedcapid = 1;
8192  }
8193  }
8194  lastcapid = capid;
8195  if (ii == 0)
8196  firstcapid = capid;
8197  sumcapid += capid;
8198  } // for
8200  if (!anycapid)
8201  error1 = 1;
8202  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8203  double ampl = 0.;
8204  for (int ii = 0; ii < nTS; ii++) {
8205  int adc = qie11df[ii].adc();
8206 
8207  double ampldefault = adc2fC_QIE11_shunt6[adc];
8208  if (flaguseshunt_ == 1)
8209  ampldefault = adc2fC_QIE11_shunt1[adc];
8210 
8211  ampl += ampldefault; //
8212  }
8214  // Digis:HBHE
8215  if (sub == 1) {
8216  h_error1_HB->Fill(double(error1), 1.);
8217  h_repetedcapid_HB->Fill(double(repetedcapid), 1.);
8218  if (error1 != 0) {
8219  // if(error1 !=0 || error2 !=0 || error3 !=0 ) {
8221  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
8222  h_amplError_HB->Fill(ampl, 1.);
8223  if (mdepth == 1)
8224  h_mapDepth1Error_HB->Fill(double(ieta), double(iphi));
8225  if (mdepth == 2)
8226  h_mapDepth2Error_HB->Fill(double(ieta), double(iphi));
8227  if (mdepth == 3)
8228  h_mapDepth3Error_HB->Fill(double(ieta), double(iphi));
8229  if (mdepth == 4)
8230  h_mapDepth4Error_HB->Fill(double(ieta), double(iphi));
8231  h_errorGeneral_HB->Fill(double(firstcapid), 1.);
8232  } else {
8233  h_amplFine_HB->Fill(ampl, 1.);
8234  }
8235  }
8236  if (sub == 2) {
8237  h_error1_HE->Fill(double(error1), 1.);
8238  h_repetedcapid_HE->Fill(double(repetedcapid), 1.);
8239  if (error1 != 0) {
8240  // if(error1 !=0 || error2 !=0 || error3 !=0 ) {
8242  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
8243  h_amplError_HE->Fill(ampl, 1.);
8244  if (mdepth == 1)
8245  h_mapDepth1Error_HE->Fill(double(ieta), double(iphi));
8246  if (mdepth == 2)
8247  h_mapDepth2Error_HE->Fill(double(ieta), double(iphi));
8248  if (mdepth == 3)
8249  h_mapDepth3Error_HE->Fill(double(ieta), double(iphi));
8250  if (mdepth == 4)
8251  h_mapDepth4Error_HE->Fill(double(ieta), double(iphi));
8252  if (mdepth == 5)
8253  h_mapDepth5Error_HE->Fill(double(ieta), double(iphi));
8254  if (mdepth == 6)
8255  h_mapDepth6Error_HE->Fill(double(ieta), double(iphi));
8256  if (mdepth == 7)
8257  h_mapDepth7Error_HE->Fill(double(ieta), double(iphi));
8258  h_errorGeneral_HE->Fill(double(firstcapid), 1.);
8259  } else {
8260  h_amplFine_HE->Fill(ampl, 1.);
8261  }
8262  }
8263 } //fillDigiErrorsQIE11
8265 // ------------ method called for each event ------------
8267  CaloSamples toolOriginal; // TS
8268  // double tool[100];
8269  HcalDetId cell(digiItr->id());
8270  int mdepth = cell.depth();
8271  int iphi = cell.iphi() - 1;
8272  int ieta = cell.ieta();
8273  if (ieta > 0)
8274  ieta -= 1;
8275  int sub = cell.subdet(); // 1-HB, 2-HE (HFDigiCollection: 4-HF)
8276  if (mdepth > 2)
8277  std::cout << " HF DIGI ?????????????? ERROR mdepth = " << mdepth << std::endl;
8278  // !!!!!!
8279  int errorGeneral = 0;
8280  int error1 = 0;
8281  int error2 = 0;
8282  int error3 = 0;
8283  int error4 = 0;
8284  int error5 = 0;
8285  int error6 = 0;
8286  int error7 = 0;
8287  // !!!!!!
8288  bool anycapid = true;
8289  bool anyer = false;
8290  bool anydv = true;
8291  // for help:
8292  int firstcapid = 0;
8293  int sumcapid = 0;
8294  int lastcapid = 0, capid = 0;
8295  int ERRORfiber = -10;
8296  int ERRORfiberChan = -10;
8297  int ERRORfiberAndChan = -10;
8298  int repetedcapid = 0;
8299 
8300  int TSsize = 10;
8301  TSsize = digiItr->size();
8303  for (int ii = 0; ii < TSsize; ii++) {
8304  capid = (*digiItr)[ii].capid(); // capId (0-3, sequential)
8305  bool er = (*digiItr)[ii].er(); // error
8306  bool dv = (*digiItr)[ii].dv(); // valid data
8307  int fiber = (*digiItr)[ii].fiber(); // get the fiber number
8308  int fiberChan = (*digiItr)[ii].fiberChan(); // get the fiber channel number
8309  int fiberAndChan = (*digiItr)[ii].fiberAndChan(); // get the id channel
8310  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
8311  anycapid = false;
8312  ERRORfiber = fiber;
8313  ERRORfiberChan = fiberChan;
8314  ERRORfiberAndChan = fiberAndChan;
8315  if (capid != lastcapid) {
8316  } else {
8317  repetedcapid = 1;
8318  }
8319  }
8320  lastcapid = capid;
8321  if (ii == 0)
8322  firstcapid = capid;
8323  sumcapid += capid;
8324  if (er) {
8325  anyer = true;
8326  ERRORfiber = fiber;
8327  ERRORfiberChan = fiberChan;
8328  ERRORfiberAndChan = fiberAndChan;
8329  }
8330  if (!dv) {
8331  anydv = false;
8332  ERRORfiber = fiber;
8333  ERRORfiberChan = fiberChan;
8334  ERRORfiberAndChan = fiberAndChan;
8335  }
8336  } // for
8338  if (firstcapid == 0 && !anycapid)
8339  errorGeneral = 1;
8340  if (firstcapid == 1 && !anycapid)
8341  errorGeneral = 2;
8342  if (firstcapid == 2 && !anycapid)
8343  errorGeneral = 3;
8344  if (firstcapid == 3 && !anycapid)
8345  errorGeneral = 4;
8346  if (!anycapid)
8347  error1 = 1;
8348  if (anyer)
8349  error2 = 1;
8350  if (!anydv)
8351  error3 = 1;
8352  if (!anycapid && anyer)
8353  error4 = 1;
8354  if (!anycapid && !anydv)
8355  error5 = 1;
8356  if (!anycapid && anyer && !anydv)
8357  error6 = 1;
8358  if (anyer && !anydv)
8359  error7 = 1;
8361  double ampl = 0.;
8362  for (int ii = 0; ii < TSsize; ii++) {
8363  double ampldefault = adc2fC[digiItr->sample(ii).adc()];
8364  ampl += ampldefault; // fC
8365  }
8367  // Digis: HF
8368  if (sub == 4) {
8369  h_errorGeneral_HF->Fill(double(errorGeneral), 1.);
8370  h_error1_HF->Fill(double(error1), 1.);
8371  h_error2_HF->Fill(double(error2), 1.);
8372  h_error3_HF->Fill(double(error3), 1.);
8373  h_error4_HF->Fill(double(error4), 1.);
8374  h_error5_HF->Fill(double(error5), 1.);
8375  h_error6_HF->Fill(double(error6), 1.);
8376  h_error7_HF->Fill(double(error7), 1.);
8377  h_repetedcapid_HF->Fill(double(repetedcapid), 1.);
8378  if (error1 != 0 || error2 != 0 || error3 != 0) {
8380  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
8381  h_amplError_HF->Fill(ampl, 1.);
8382  if (mdepth == 1)
8383  h_mapDepth1Error_HF->Fill(double(ieta), double(iphi));
8384  if (mdepth == 2)
8385  h_mapDepth2Error_HF->Fill(double(ieta), double(iphi));
8386  h_fiber0_HF->Fill(double(ERRORfiber), 1.);
8387  h_fiber1_HF->Fill(double(ERRORfiberChan), 1.);
8388  h_fiber2_HF->Fill(double(ERRORfiberAndChan), 1.);
8389  } else {
8390  h_amplFine_HF->Fill(ampl, 1.);
8391  }
8392  }
8393 }
8398 // ------------ method called for each event ------------
8400  CaloSamples toolOriginal; // TS
8401  // double tool[100];
8402  DetId detid = qie10df.detid();
8403  HcalDetId hcaldetid = HcalDetId(detid);
8404  int ieta = hcaldetid.ieta();
8405  if (ieta > 0)
8406  ieta -= 1;
8407  int iphi = hcaldetid.iphi() - 1;
8408  int mdepth = hcaldetid.depth();
8409  int sub = hcaldetid.subdet(); // 1-HB, 2-HE (HFDigiCollection: 4-HF)
8410  // !!!!!!
8411  int error1 = 0;
8412  // !!!!!!
8413  bool anycapid = true;
8414  // bool anyer = false;
8415  // bool anydv = true;
8416  // for help:
8417  int firstcapid = 0;
8418  int sumcapid = 0;
8419  int lastcapid = 0, capid = 0;
8420  int repetedcapid = 0;
8421  // loop over the samples in the digi
8422  nTS = qie10df.samples();
8424  for (int ii = 0; ii < nTS; ii++) {
8425  capid = qie10df[ii].capid(); // capId (0-3, sequential)
8426  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
8427  anycapid = false;
8428  if (capid != lastcapid) {
8429  } else {
8430  repetedcapid = 1;
8431  }
8432  }
8433  lastcapid = capid;
8434  if (ii == 0)
8435  firstcapid = capid;
8436  sumcapid += capid;
8437  } // for
8439  if (!anycapid)
8440  error1 = 1;
8441  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8442  double ampl = 0.;
8443  for (int ii = 0; ii < nTS; ii++) {
8444  int adc = qie10df[ii].adc();
8445  double ampldefault = adc2fC_QIE10[adc];
8446  ampl += ampldefault; //
8447  }
8449  // Digis:HF
8450  if (sub == 4) {
8451  h_error1_HF->Fill(double(error1), 1.);
8452  h_repetedcapid_HF->Fill(double(repetedcapid), 1.);
8453  if (error1 != 0) {
8454  // if(error1 !=0 || error2 !=0 || error3 !=0 ) {
8456  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
8457  h_amplError_HF->Fill(ampl, 1.);
8458  if (mdepth == 1)
8459  h_mapDepth1Error_HF->Fill(double(ieta), double(iphi));
8460  if (mdepth == 2)
8461  h_mapDepth2Error_HF->Fill(double(ieta), double(iphi));
8462  if (mdepth == 3)
8463  h_mapDepth3Error_HF->Fill(double(ieta), double(iphi));
8464  if (mdepth == 4)
8465  h_mapDepth4Error_HF->Fill(double(ieta), double(iphi));
8466  h_errorGeneral_HF->Fill(double(firstcapid), 1.);
8467  } else {
8468  h_amplFine_HF->Fill(ampl, 1.);
8469  }
8470  }
8471 }
8473 // ------------ method called for each event ------------
8475  CaloSamples toolOriginal; // TS
8476  HcalDetId cell(digiItr->id());
8477  int mdepth = cell.depth();
8478  int iphi = cell.iphi() - 1;
8479  int ieta = cell.ieta();
8480  if (ieta > 0)
8481  ieta -= 1;
8482  int sub = cell.subdet(); // 1-HB, 2-HE, 3-HO, 4-HF
8483  int errorGeneral = 0;
8484  int error1 = 0;
8485  int error2 = 0;
8486  int error3 = 0;
8487  int error4 = 0;
8488  int error5 = 0;
8489  int error6 = 0;
8490  int error7 = 0;
8491  // !!!!!!
8492  bool anycapid = true;
8493  bool anyer = false;
8494  bool anydv = true;
8495  // for help:
8496  int firstcapid = 0;
8497  int sumcapid = 0;
8498  int lastcapid = 0, capid = 0;
8499  int ERRORfiber = -10;
8500  int ERRORfiberChan = -10;
8501  int ERRORfiberAndChan = -10;
8502  int repetedcapid = 0;
8503  for (int ii = 0; ii < (*digiItr).size(); ii++) {
8504  capid = (*digiItr)[ii].capid(); // capId (0-3, sequential)
8505  bool er = (*digiItr)[ii].er(); // error
8506  bool dv = (*digiItr)[ii].dv(); // valid data
8507  int fiber = (*digiItr)[ii].fiber(); // get the fiber number
8508  int fiberChan = (*digiItr)[ii].fiberChan(); // get the fiber channel number
8509  int fiberAndChan = (*digiItr)[ii].fiberAndChan(); // get the id channel
8510  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
8511  anycapid = false;
8512  ERRORfiber = fiber;
8513  ERRORfiberChan = fiberChan;
8514  ERRORfiberAndChan = fiberAndChan;
8515  if (capid != lastcapid) {
8516  } else {
8517  repetedcapid = 1;
8518  }
8519  }
8520  lastcapid = capid;
8521 
8522  if (ii == 0)
8523  firstcapid = capid;
8524  sumcapid += capid;
8525 
8526  if (er) {
8527  anyer = true;
8528  ERRORfiber = fiber;
8529  ERRORfiberChan = fiberChan;
8530  ERRORfiberAndChan = fiberAndChan;
8531  }
8532  if (!dv) {
8533  anydv = false;
8534  ERRORfiber = fiber;
8535  ERRORfiberChan = fiberChan;
8536  ERRORfiberAndChan = fiberAndChan;
8537  }
8538 
8539  } // for
8540 
8542  if (firstcapid == 0 && !anycapid)
8543  errorGeneral = 1;
8544  if (firstcapid == 1 && !anycapid)
8545  errorGeneral = 2;
8546  if (firstcapid == 2 && !anycapid)
8547  errorGeneral = 3;
8548  if (firstcapid == 3 && !anycapid)
8549  errorGeneral = 4;
8550  if (!anycapid)
8551  error1 = 1;
8552  if (anyer)
8553  error2 = 1;
8554  if (!anydv)
8555  error3 = 1;
8556 
8557  if (!anycapid && anyer)
8558  error4 = 1;
8559  if (!anycapid && !anydv)
8560  error5 = 1;
8561  if (!anycapid && anyer && !anydv)
8562  error6 = 1;
8563  if (anyer && !anydv)
8564  error7 = 1;
8566  // Energy:
8567  double ampl = 0.;
8568  for (int ii = 0; ii < (*digiItr).size(); ii++) {
8569  double ampldefault = adc2fC[digiItr->sample(ii).adc()];
8570  ampl += ampldefault; // fC
8571  }
8573  // Digis:
8574  // HO
8575  if (sub == 3) {
8576  h_errorGeneral_HO->Fill(double(errorGeneral), 1.);
8577  h_error1_HO->Fill(double(error1), 1.);
8578  h_error2_HO->Fill(double(error2), 1.);
8579  h_error3_HO->Fill(double(error3), 1.);
8580  h_error4_HO->Fill(double(error4), 1.);
8581  h_error5_HO->Fill(double(error5), 1.);
8582  h_error6_HO->Fill(double(error6), 1.);
8583  h_error7_HO->Fill(double(error7), 1.);
8584  h_repetedcapid_HO->Fill(double(repetedcapid), 1.);
8585 
8586  if (error1 != 0 || error2 != 0 || error3 != 0) {
8588  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
8589  h_amplError_HO->Fill(ampl, 1.);
8590  if (mdepth == 4)
8591  h_mapDepth4Error_HO->Fill(double(ieta), double(iphi));
8592  // to be divided by h_mapDepth4_HO
8593 
8594  if (mdepth != 4)
8595  std::cout << " mdepth HO = " << mdepth << std::endl;
8596  h_fiber0_HO->Fill(double(ERRORfiber), 1.);
8597  h_fiber1_HO->Fill(double(ERRORfiberChan), 1.);
8598  h_fiber2_HO->Fill(double(ERRORfiberAndChan), 1.);
8599  } else {
8600  h_amplFine_HO->Fill(ampl, 1.);
8601  }
8602  }
8603 }
8606  CaloSamples toolOriginal; // TS
8607  double tool[100];
8608  double toolwithPedSubtr[100]; // TS
8609  double lintoolwithoutPedSubtr[100]; // TS
8610  HcalDetId cell(digiItr->id());
8611  int mdepth = cell.depth();
8612  int iphi = cell.iphi() - 1; // 0-71
8613  int ieta0 = cell.ieta(); //-41 +41 !=0
8614  int ieta = ieta0;
8615  if (ieta > 0)
8616  ieta -= 1; //-41 +41
8617  int sub = cell.subdet(); // 1-HB, 2-HE (HFDigiCollection: 4-HF)
8618  const HcalPedestal* pedestal00 = conditions->getPedestal(cell);
8619  const HcalGain* gain = conditions->getGain(cell);
8620  // const HcalGainWidth* gainWidth = conditions->getGainWidth(cell);
8621  const HcalRespCorr* respcorr = conditions->getHcalRespCorr(cell);
8622  const HcalTimeCorr* timecorr = conditions->getHcalTimeCorr(cell);
8623  const HcalLUTCorr* lutcorr = conditions->getHcalLUTCorr(cell);
8624  // HcalCalibrations calib = conditions->getHcalCalibrations(cell);
8625  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
8626  const HcalPedestalWidth* pedw = conditions->getPedestalWidth(cell);
8627  HcalCoderDb coder(*channelCoder, *shape);
8628  if (useADCfC_)
8629  coder.adc2fC(*digiItr, toolOriginal);
8630  double pedestalaver9 = 0.;
8631  double pedestalaver4 = 0.;
8632  double pedestal0 = 0.;
8633  double pedestal1 = 0.;
8634  double pedestal2 = 0.;
8635  double pedestal3 = 0.;
8636  double pedestalwaver9 = 0.;
8637  double pedestalwaver4 = 0.;
8638  double pedestalw0 = 0.;
8639  double pedestalw1 = 0.;
8640  double pedestalw2 = 0.;
8641  double pedestalw3 = 0.;
8642  double difpedestal0 = 0.;
8643  double difpedestal1 = 0.;
8644  double difpedestal2 = 0.;
8645  double difpedestal3 = 0.;
8646 
8647  double amplitudewithPedSubtr1 = 0.;
8648  double amplitudewithPedSubtr2 = 0.;
8649  double amplitudewithPedSubtr3 = 0.;
8650  double amplitudewithPedSubtr4 = 0.;
8651  double amplitude = 0.;
8652  double absamplitude = 0.;
8653  double amplitude345 = 0.;
8654  double ampl = 0.;
8655  double linamplitudewithoutPedSubtr = 0.;
8656  double timew = 0.;
8657  double timeww = 0.;
8658  double max_signal = -100.;
8659  int ts_with_max_signal = -100;
8660  int c0 = 0;
8661  int c1 = 0;
8662  int c2 = 0;
8663  int c3 = 0;
8664  int c4 = 0;
8665  double errorBtype = 0.;
8666 
8667  int TSsize = 10; //HEHB for Run2
8668  TSsize = digiItr->size();
8669  if ((*digiItr).size() != 10)
8670  errorBtype = 1.;
8671  // ii = 0 to 9
8672  for (int ii = 0; ii < TSsize; ii++) {
8673  // for (int ii=0; ii<digiItr->size(); ii++) {
8674  double ampldefaultwithPedSubtr = 0.;
8675  double linampldefaultwithoutPedSubtr = 0.;
8676  double ampldefault = 0.;
8677  double ampldefault0 = 0.;
8678  double ampldefault1 = 0.;
8679  double ampldefault2 = 0.;
8680  ampldefault0 = adc2fC[digiItr->sample(ii).adc()]; // massive ADCcounts
8681  if (useADCfC_)
8682  ampldefault1 = toolOriginal[ii]; //adcfC
8683  ampldefault2 = (*digiItr)[ii].adc(); //ADCcounts linearized
8684  if (useADCmassive_) {
8685  ampldefault = ampldefault0;
8686  }
8687  if (useADCfC_) {
8688  ampldefault = ampldefault1;
8689  }
8690  if (useADCcounts_) {
8691  ampldefault = ampldefault2;
8692  }
8693  ampldefaultwithPedSubtr = ampldefault0;
8694  linampldefaultwithoutPedSubtr = ampldefault2;
8695 
8696  int capid = ((*digiItr)[ii]).capid();
8697  // double pedestal = calib.pedestal(capid);
8698  double pedestalINI = pedestal00->getValue(capid);
8699  double pedestal = pedestal00->getValue(capid);
8700  double pedestalw = pedw->getSigma(capid, capid);
8701  ampldefaultwithPedSubtr -= pedestal; // pedestal subtraction
8703  ampldefault -= pedestal; // pedestal subtraction
8704  // ampldefault*= calib.respcorrgain(capid) ; // fC --> GeV
8705  tool[ii] = ampldefault;
8706  toolwithPedSubtr[ii] = ampldefaultwithPedSubtr;
8707  lintoolwithoutPedSubtr[ii] = linampldefaultwithoutPedSubtr;
8708 
8709  pedestalaver9 += pedestal;
8710  pedestalwaver9 += pedestalw * pedestalw;
8711 
8712  if (capid == 0 && c0 == 0) {
8713  c0++;
8714  c4++;
8715  pedestalaver4 += pedestal;
8716  pedestal0 = pedestal;
8717  pedestalw0 = pedestalw;
8718  pedestalwaver4 += pedestalw * pedestalw;
8719  difpedestal0 = pedestal - pedestalINI;
8720  }
8721 
8722  if (capid == 1 && c1 == 0) {
8723  c1++;
8724  c4++;
8725  pedestalaver4 += pedestal;
8726  pedestal1 = pedestal;
8727  pedestalw1 = pedestalw;
8728  pedestalwaver4 += pedestalw * pedestalw;
8729  difpedestal1 = pedestal - pedestalINI;
8730  }
8731  if (capid == 2 && c2 == 0) {
8732  c2++;
8733  c4++;
8734  pedestalaver4 += pedestal;
8735  pedestal2 = pedestal;
8736  pedestalw2 = pedestalw;
8737  pedestalwaver4 += pedestalw * pedestalw;
8738  difpedestal2 = pedestal - pedestalINI;
8739  }
8740  if (capid == 3 && c3 == 0) {
8741  c3++;
8742  c4++;
8743  pedestalaver4 += pedestal;
8744  pedestal3 = pedestal;
8745  pedestalw3 = pedestalw;
8746  pedestalwaver4 += pedestalw * pedestalw;
8747  difpedestal3 = pedestal - pedestalINI;
8748  }
8749 
8750  if (max_signal < ampldefault) {
8751  max_signal = ampldefault;
8752  ts_with_max_signal = ii;
8753  }
8755  // TS = 1 to 10: 1 2 3 4 5 6 7 8 9 10
8756  // ii = 0 to 9: 0 1 2 3 4 5 6 7 8 9
8757  // var.1 ----------------------
8758  // var.2 ----------------
8759  // var.3 ----------
8760  // var.4 -------
8761  //
8762  // TS = 2-9 for raddam only var.1
8763  if (ii > 0 && ii < 9)
8764  amplitudewithPedSubtr1 += ampldefaultwithPedSubtr; //
8765  // TS = 3-8 for raddam only var.2
8766  if (ii > 1 && ii < 8)
8767  amplitudewithPedSubtr2 += ampldefaultwithPedSubtr; //
8768  // TS = 4-7 for raddam only var.3
8769  if (ii > 2 && ii < 7)
8770  amplitudewithPedSubtr3 += ampldefaultwithPedSubtr; //
8771  // TS = 4-6 for raddam only var.4
8772  if (ii > 2 && ii < 6)
8773  amplitudewithPedSubtr4 += ampldefaultwithPedSubtr; //
8774  //
8775  amplitude += ampldefault; //
8776  absamplitude += abs(ampldefault); //
8777 
8778  if (ii == 3 || ii == 4 || ii == 5)
8779  amplitude345 += ampldefault;
8780  if (flagcpuoptimization_ == 0) {
8782  } //flagcpuoptimization
8783  timew += (ii + 1) * abs(ampldefault);
8784  timeww += (ii + 1) * ampldefault;
8785  } //for 1
8787  // sub=1||2 HBHE
8788  if (sub == 1 || sub == 2) {
8789  amplitudechannel0[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.; // 0-neta ; 0-71 HBHE
8790  amplitudechannel[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude; // 0-neta ; 0-71 HBHE
8791  amplitudechannel2[sub - 1][mdepth - 1][ieta + 41][iphi] += pow(amplitude, 2); // 0-neta ; 0-71 HBHE
8792  }
8793  pedestalaver9 /= TSsize;
8794  pedestalaver4 /= c4;
8795  pedestalwaver9 = sqrt(pedestalwaver9 / TSsize);
8796  pedestalwaver4 = sqrt(pedestalwaver4 / c4);
8797  if (ts_with_max_signal > -1 && ts_with_max_signal < 10)
8798  ampl = tool[ts_with_max_signal];
8799  if (ts_with_max_signal + 2 > -1 && ts_with_max_signal + 2 < 10)
8800  ampl += tool[ts_with_max_signal + 2];
8801  if (ts_with_max_signal + 1 > -1 && ts_with_max_signal + 1 < 10)
8802  ampl += tool[ts_with_max_signal + 1];
8803  if (ts_with_max_signal - 1 > -1 && ts_with_max_signal - 1 < 10)
8804  ampl += tool[ts_with_max_signal - 1];
8805 
8807  if (ts_with_max_signal > -1 && ts_with_max_signal < 10)
8808  linamplitudewithoutPedSubtr = lintoolwithoutPedSubtr[ts_with_max_signal];
8809  if (ts_with_max_signal + 2 > -1 && ts_with_max_signal + 2 < 10)
8810  linamplitudewithoutPedSubtr += lintoolwithoutPedSubtr[ts_with_max_signal + 2];
8811  if (ts_with_max_signal + 1 > -1 && ts_with_max_signal + 1 < 10)
8812  linamplitudewithoutPedSubtr += lintoolwithoutPedSubtr[ts_with_max_signal + 1];
8813  if (ts_with_max_signal - 1 > -1 && ts_with_max_signal - 1 < 10)
8814  linamplitudewithoutPedSubtr += lintoolwithoutPedSubtr[ts_with_max_signal - 1];
8815 
8816  double ratio = 0.;
8817  if (amplitude != 0.)
8818  ratio = ampl / amplitude;
8819  if (ratio < 0. || ratio > 1.02)
8820  ratio = 0.;
8821  double aveamplitude = 0.;
8822  double aveamplitudew = 0.;
8823  if (absamplitude > 0 && timew > 0)
8824  aveamplitude = timew / absamplitude; // average_TS +1
8825  if (amplitude > 0 && timeww > 0)
8826  aveamplitudew = timeww / amplitude; // average_TS +1
8827  double rmsamp = 0.;
8828  // and CapIdErrors:
8829  int error = 0;
8830  bool anycapid = true;
8831  bool anyer = false;
8832  bool anydv = true;
8833  int lastcapid = 0;
8834  int capid = 0;
8835  for (int ii = 0; ii < TSsize; ii++) {
8836  double aaaaaa = (ii + 1) - aveamplitudew;
8837  double aaaaaa2 = aaaaaa * aaaaaa;
8838  double ampldefault = tool[ii];
8839  rmsamp += (aaaaaa2 * ampldefault); // fC
8840  capid = ((*digiItr)[ii]).capid();
8841  bool er = (*digiItr)[ii].er(); // error
8842  bool dv = (*digiItr)[ii].dv(); // valid data
8843  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
8844  anycapid = false;
8845  }
8846  // std::cout << " ii = " << ii << " capid = " << capid << " ((lastcapid+1)%4) = " << ((lastcapid+1)%4) << std::endl;
8847  lastcapid = capid;
8848  if (er) {
8849  anyer = true;
8850  }
8851  if (!dv) {
8852  anydv = false;
8853  }
8854  } //for 2
8855  if (!anycapid || anyer || !anydv)
8856  error = 1;
8857 
8858  double rmsamplitude = 0.;
8859  if ((amplitude > 0 && rmsamp > 0) || (amplitude < 0 && rmsamp < 0))
8860  rmsamplitude = sqrt(rmsamp / amplitude);
8861  double aveamplitude1 = aveamplitude - 1; // means iTS=0-9
8862 
8863  // CapIdErrors end /////////////////////////////////////////////////////////
8864 
8865  // AZ 1.10.2015:
8866  if (error == 1) {
8867  if (sub == 1 && mdepth == 1)
8869  if (sub == 1 && mdepth == 2)
8871  if (sub == 2 && mdepth == 1)
8873  if (sub == 2 && mdepth == 2)
8875  if (sub == 2 && mdepth == 3)
8877  }
8878  if (error != 1) {
8879  if (sub == 1 && mdepth == 1)
8881  if (sub == 1 && mdepth == 2)
8883  if (sub == 2 && mdepth == 1)
8885  if (sub == 2 && mdepth == 2)
8887  if (sub == 2 && mdepth == 3)
8889  }
8890 
8891  for (int ii = 0; ii < TSsize; ii++) {
8892  // for (int ii=0; ii<10; ii++) {
8893  double ampldefault = tool[ii];
8895  if (sub == 1) {
8896  if (amplitude > 120) {
8897  h_shape_Ahigh_HB0->Fill(float(ii), ampldefault);
8898  h_shape0_Ahigh_HB0->Fill(float(ii), 1.);
8899  } else {
8900  h_shape_Alow_HB0->Fill(float(ii), ampldefault);
8901  h_shape0_Alow_HB0->Fill(float(ii), 1.);
8902  } //HB0
8904  if (pedestal2 < pedestalHBMax_ || pedestal3 < pedestalHBMax_ || pedestal2 < pedestalHBMax_ ||
8905  pedestal3 < pedestalHBMax_) {
8906  h_shape_Ahigh_HB1->Fill(float(ii), ampldefault);
8907  h_shape0_Ahigh_HB1->Fill(float(ii), 1.);
8908  } else {
8909  h_shape_Alow_HB1->Fill(float(ii), ampldefault);
8910  h_shape0_Alow_HB1->Fill(float(ii), 1.);
8911  } //HB1
8912  if (error == 0) {
8913  h_shape_Ahigh_HB2->Fill(float(ii), ampldefault);
8914  h_shape0_Ahigh_HB2->Fill(float(ii), 1.);
8915  } else {
8916  h_shape_Alow_HB2->Fill(float(ii), ampldefault);
8917  h_shape0_Alow_HB2->Fill(float(ii), 1.);
8918  } //HB2
8920  if (pedestalw0 < pedestalwHBMax_ || pedestalw1 < pedestalwHBMax_ || pedestalw2 < pedestalwHBMax_ ||
8921  pedestalw3 < pedestalwHBMax_) {
8922  h_shape_Ahigh_HB3->Fill(float(ii), ampldefault);
8923  h_shape0_Ahigh_HB3->Fill(float(ii), 1.);
8924  } else {
8925  h_shape_Alow_HB3->Fill(float(ii), ampldefault);
8926  h_shape0_Alow_HB3->Fill(float(ii), 1.);
8927  } //HB3
8928 
8929  } // sub HB
8930 
8931  } //for 3 over TSs
8932 
8933  if (sub == 1) {
8934  // bad_channels with C,A,W,P,pW,
8935  if (error == 1 || amplitude < ADCAmplHBMin_ || amplitude > ADCAmplHBMax_ || rmsamplitude < rmsHBMin_ ||
8936  rmsamplitude > rmsHBMax_ || pedestal0 < pedestalHBMax_ || pedestal1 < pedestalHBMax_ ||
8937  pedestal2 < pedestalHBMax_ || pedestal3 < pedestalHBMax_ || pedestalw0 < pedestalwHBMax_ ||
8938  pedestalw1 < pedestalwHBMax_ || pedestalw2 < pedestalwHBMax_ || pedestalw3 < pedestalwHBMax_) {
8939  for (int ii = 0; ii < TSsize; ii++) {
8940  double ampldefault = tool[ii];
8941  h_shape_bad_channels_HB->Fill(float(ii), ampldefault);
8942  h_shape0_bad_channels_HB->Fill(float(ii), 1.);
8943  }
8944  }
8945  // good_channels with C,A,W,P,pW
8946  else {
8947  for (int ii = 0; ii < TSsize; ii++) {
8948  double ampldefault = tool[ii];
8949  h_shape_good_channels_HB->Fill(float(ii), ampldefault);
8950  h_shape0_good_channels_HB->Fill(float(ii), 1.);
8951  }
8952  }
8953  } // sub HB
8954  if (sub == 2) {
8955  // bad_channels with C,A,W,P,pW,
8956  if (error == 1 || amplitude < ADCAmplHEMin_ || amplitude > ADCAmplHEMax_ || rmsamplitude < rmsHEMin_ ||
8957  rmsamplitude > rmsHEMax_ || pedestal0 < pedestalHEMax_ || pedestal1 < pedestalHEMax_ ||
8958  pedestal2 < pedestalHEMax_ || pedestal3 < pedestalHEMax_ || pedestalw0 < pedestalwHEMax_ ||
8959  pedestalw1 < pedestalwHEMax_ || pedestalw2 < pedestalwHEMax_ || pedestalw3 < pedestalwHEMax_) {
8960  for (int ii = 0; ii < TSsize; ii++) {
8961  double ampldefault = tool[ii];
8962  h_shape_bad_channels_HE->Fill(float(ii), ampldefault);
8963  h_shape0_bad_channels_HE->Fill(float(ii), 1.);
8964  }
8965  }
8966  // good_channels with C,A,W,P,pW,
8967  else {
8968  for (int ii = 0; ii < TSsize; ii++) {
8969  double ampldefault = tool[ii];
8970  h_shape_good_channels_HE->Fill(float(ii), ampldefault);
8971  h_shape0_good_channels_HE->Fill(float(ii), 1.);
8972  }
8973  }
8974  } // sub HE
8975 
8977  sum0Estimator[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
8978  // for Error B-type
8979  sumEstimator6[sub - 1][mdepth - 1][ieta + 41][iphi] += errorBtype;
8980  sumEstimator0[sub - 1][mdepth - 1][ieta + 41][iphi] += pedestal0; //Pedestals
8981  // HB
8982  if (sub == 1) {
8984  // // // // // // // // // HB PedestalCorrelations :
8985  double mypedestal = pedestal0;
8986  double mypedestalw = pedestalw0;
8987  h2_pedvsampl_HB->Fill(mypedestal, amplitude);
8988  h2_pedwvsampl_HB->Fill(mypedestalw, amplitude);
8989  h_pedvsampl_HB->Fill(mypedestal, amplitude);
8990  h_pedwvsampl_HB->Fill(mypedestalw, amplitude);
8991  h_pedvsampl0_HB->Fill(mypedestal, 1.);
8992  h_pedwvsampl0_HB->Fill(mypedestalw, 1.);
8993 
8994  h2_amplvsped_HB->Fill(amplitude, mypedestal);
8995  h2_amplvspedw_HB->Fill(amplitude, mypedestalw);
8996  h_amplvsped_HB->Fill(amplitude, mypedestal);
8997  h_amplvspedw_HB->Fill(amplitude, mypedestalw);
8998  h_amplvsped0_HB->Fill(amplitude, 1.);
8999  } //
9000  // // // // // // // // // HB Pedestals:
9001  if (studyPedestalsHist_) {
9002  h_pedestal0_HB->Fill(pedestal0, 1.);
9003  h_pedestal1_HB->Fill(pedestal1, 1.);
9004  h_pedestal2_HB->Fill(pedestal2, 1.);
9005  h_pedestal3_HB->Fill(pedestal3, 1.);
9006  h_pedestalaver4_HB->Fill(pedestalaver4, 1.);
9007  h_pedestalaver9_HB->Fill(pedestalaver9, 1.);
9008  h_pedestalw0_HB->Fill(pedestalw0, 1.);
9009  h_pedestalw1_HB->Fill(pedestalw1, 1.);
9010  h_pedestalw2_HB->Fill(pedestalw2, 1.);
9011  h_pedestalw3_HB->Fill(pedestalw3, 1.);
9012  h_pedestalwaver4_HB->Fill(pedestalwaver4, 1.);
9013  h_pedestalwaver9_HB->Fill(pedestalwaver9, 1.);
9014  // for averaged values:
9015  if (mdepth == 1) {
9016  h_mapDepth1Ped0_HB->Fill(double(ieta), double(iphi), pedestal0);
9017  h_mapDepth1Ped1_HB->Fill(double(ieta), double(iphi), pedestal1);
9018  h_mapDepth1Ped2_HB->Fill(double(ieta), double(iphi), pedestal2);
9019  h_mapDepth1Ped3_HB->Fill(double(ieta), double(iphi), pedestal3);
9020  h_mapDepth1Pedw0_HB->Fill(double(ieta), double(iphi), pedestalw0);
9021  h_mapDepth1Pedw1_HB->Fill(double(ieta), double(iphi), pedestalw1);
9022  h_mapDepth1Pedw2_HB->Fill(double(ieta), double(iphi), pedestalw2);
9023  h_mapDepth1Pedw3_HB->Fill(double(ieta), double(iphi), pedestalw3);
9024  }
9025  if (mdepth == 2) {
9026  h_mapDepth2Ped0_HB->Fill(double(ieta), double(iphi), pedestal0);
9027  h_mapDepth2Ped1_HB->Fill(double(ieta), double(iphi), pedestal1);
9028  h_mapDepth2Ped2_HB->Fill(double(ieta), double(iphi), pedestal2);
9029  h_mapDepth2Ped3_HB->Fill(double(ieta), double(iphi), pedestal3);
9030  h_mapDepth2Pedw0_HB->Fill(double(ieta), double(iphi), pedestalw0);
9031  h_mapDepth2Pedw1_HB->Fill(double(ieta), double(iphi), pedestalw1);
9032  h_mapDepth2Pedw2_HB->Fill(double(ieta), double(iphi), pedestalw2);
9033  h_mapDepth2Pedw3_HB->Fill(double(ieta), double(iphi), pedestalw3);
9034  }
9035  if (pedestalw0 < pedestalwHBMax_ || pedestalw1 < pedestalwHBMax_ || pedestalw2 < pedestalwHBMax_ ||
9036  pedestalw3 < pedestalwHBMax_) {
9037  if (mdepth == 1)
9038  h_mapDepth1pedestalw_HB->Fill(double(ieta), double(iphi), 1.);
9039  if (mdepth == 2)
9040  h_mapDepth2pedestalw_HB->Fill(double(ieta), double(iphi), 1.);
9041  if (mdepth == 3)
9042  h_mapDepth3pedestalw_HB->Fill(double(ieta), double(iphi), 1.);
9043  if (mdepth == 4)
9044  h_mapDepth4pedestalw_HB->Fill(double(ieta), double(iphi), 1.);
9045  }
9046  if (pedestal0 < pedestalHBMax_ || pedestal1 < pedestalHBMax_ || pedestal2 < pedestalHBMax_ ||
9047  pedestal3 < pedestalHBMax_) {
9048  if (mdepth == 1)
9049  h_mapDepth1pedestal_HB->Fill(double(ieta), double(iphi), 1.);
9050  if (mdepth == 2)
9051  h_mapDepth2pedestal_HB->Fill(double(ieta), double(iphi), 1.);
9052  if (mdepth == 3)
9053  h_mapDepth3pedestal_HB->Fill(double(ieta), double(iphi), 1.);
9054  if (mdepth == 4)
9055  h_mapDepth4pedestal_HB->Fill(double(ieta), double(iphi), 1.);
9056  }
9057  for (int ii = 0; ii < TSsize; ii++) {
9058  h_pedestal00_HB->Fill(pedestal00->getValue(ii), 1.);
9059  h_gain_HB->Fill(gain->getValue(ii), 1.);
9060  }
9061  h_respcorr_HB->Fill(respcorr->getValue(), 1.);
9062  h_timecorr_HB->Fill(timecorr->getValue(), 1.);
9063  h_lutcorr_HB->Fill(lutcorr->getValue(), 1.);
9064  h_difpedestal0_HB->Fill(difpedestal0, 1.);
9065  h_difpedestal1_HB->Fill(difpedestal1, 1.);
9066  h_difpedestal2_HB->Fill(difpedestal2, 1.);
9067  h_difpedestal3_HB->Fill(difpedestal3, 1.);
9068  } //
9069  // // // // // // // // // HB ADCAmpl:
9070  if (studyADCAmplHist_) {
9071  h_ADCAmpl345Zoom_HB->Fill(amplitude345, 1.);
9072  h_ADCAmpl345Zoom1_HB->Fill(amplitude345, 1.);
9073  h_ADCAmpl345_HB->Fill(amplitude345, 1.);
9074  if (error == 0) {
9076  h_ADCAmpl345_HBCapIdNoError->Fill(amplitude345, 1.);
9077  }
9078  if (error == 1) {
9079  h_ADCAmpl_HBCapIdError->Fill(amplitude, 1.);
9080  h_ADCAmpl345_HBCapIdError->Fill(amplitude345, 1.);
9081  }
9082  h_ADCAmplZoom_HB->Fill(amplitude, 1.);
9083  h_ADCAmplZoom1_HB->Fill(amplitude, 1.);
9084  h_ADCAmpl_HB->Fill(amplitude, 1.);
9085 
9086  h_AmplitudeHBrest->Fill(amplitude, 1.);
9087  h_AmplitudeHBrest1->Fill(amplitude, 1.);
9088  h_AmplitudeHBrest6->Fill(amplitude, 1.);
9089 
9090  if (amplitude < ADCAmplHBMin_ || amplitude > ADCAmplHBMax_) {
9092  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9093  if (mdepth == 1)
9094  h_mapDepth1ADCAmpl225_HB->Fill(double(ieta), double(iphi), 1.);
9095  if (mdepth == 2)
9096  h_mapDepth2ADCAmpl225_HB->Fill(double(ieta), double(iphi), 1.);
9097  } // if
9098  // if(amplitude >400.) averSIGNALoccupancy_HB += 1.;
9099  if (amplitude < 35.) {
9100  if (mdepth == 1)
9101  h_mapDepth1ADCAmpl225Copy_HB->Fill(double(ieta), double(iphi), 1.);
9102  if (mdepth == 2)
9103  h_mapDepth2ADCAmpl225Copy_HB->Fill(double(ieta), double(iphi), 1.);
9104  } // if
9105  // for averaged values:
9106  if (mdepth == 1)
9107  h_mapDepth1ADCAmpl_HB->Fill(double(ieta), double(iphi), amplitude);
9108  if (mdepth == 2)
9109  h_mapDepth2ADCAmpl_HB->Fill(double(ieta), double(iphi), amplitude);
9110  if (mdepth == 1)
9111  h_mapDepth1ADCAmpl12_HB->Fill(double(ieta), double(iphi), ampl);
9112  if (mdepth == 2)
9113  h_mapDepth2ADCAmpl12_HB->Fill(double(ieta), double(iphi), ampl);
9114  h_bcnvsamplitude_HB->Fill(float(bcn), amplitude);
9115  h_bcnvsamplitude0_HB->Fill(float(bcn), 1.);
9117  h_orbitNumvsamplitude0_HB->Fill(float(orbitNum), 1.);
9119  sumEstimator1[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude;
9120  } //if(studyADCAmplHist_
9122 
9123  // // // // // // // // // HB TSmean:
9124  if (studyTSmeanShapeHist_) {
9125  h_TSmeanA_HB->Fill(aveamplitude1, 1.);
9126  if (aveamplitude1 < TSmeanHBMin_ || aveamplitude1 > TSmeanHBMax_) {
9128  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9129  if (mdepth == 1)
9130  h_mapDepth1TSmeanA225_HB->Fill(double(ieta), double(iphi), 1.);
9131  if (mdepth == 2)
9132  h_mapDepth2TSmeanA225_HB->Fill(double(ieta), double(iphi), 1.);
9133  } // if
9134  // for averaged values:
9135  if (mdepth == 1)
9136  h_mapDepth1TSmeanA_HB->Fill(double(ieta), double(iphi), aveamplitude1);
9137  if (mdepth == 2)
9138  h_mapDepth2TSmeanA_HB->Fill(double(ieta), double(iphi), aveamplitude1);
9140  sumEstimator2[sub - 1][mdepth - 1][ieta + 41][iphi] += aveamplitude1;
9141  } //if(studyTSmeanShapeHist_
9143 
9144  // // // // // // // // // HB TSmax:
9145  if (studyTSmaxShapeHist_) {
9146  h_TSmaxA_HB->Fill(float(ts_with_max_signal), 1.);
9147  if (ts_with_max_signal < TSpeakHBMin_ || ts_with_max_signal > TSpeakHBMax_) {
9149  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9150  if (mdepth == 1)
9151  h_mapDepth1TSmaxA225_HB->Fill(double(ieta), double(iphi), 1.);
9152  if (mdepth == 2)
9153  h_mapDepth2TSmaxA225_HB->Fill(double(ieta), double(iphi), 1.);
9154  } // if
9155  // for averaged values:
9156  if (mdepth == 1)
9157  h_mapDepth1TSmaxA_HB->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
9158  if (mdepth == 2)
9159  h_mapDepth2TSmaxA_HB->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
9161  sumEstimator3[sub - 1][mdepth - 1][ieta + 41][iphi] += float(ts_with_max_signal);
9162  } //if(studyTSmaxShapeHist_
9164 
9165  // // // // // // // // // HB RMS:
9166  if (studyRMSshapeHist_) {
9167  h_Amplitude_HB->Fill(rmsamplitude, 1.);
9168  if (rmsamplitude < rmsHBMin_ || rmsamplitude > rmsHBMax_) {
9170  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9171  if (mdepth == 1)
9172  h_mapDepth1Amplitude225_HB->Fill(double(ieta), double(iphi), 1.);
9173  if (mdepth == 2)
9174  h_mapDepth2Amplitude225_HB->Fill(double(ieta), double(iphi), 1.);
9175  } // if
9176  // for averaged values:
9177  if (mdepth == 1)
9178  h_mapDepth1Amplitude_HB->Fill(double(ieta), double(iphi), rmsamplitude);
9179  if (mdepth == 2)
9180  h_mapDepth2Amplitude_HB->Fill(double(ieta), double(iphi), rmsamplitude);
9182  sumEstimator4[sub - 1][mdepth - 1][ieta + 41][iphi] += rmsamplitude;
9183  } //if(studyRMSshapeHist_)
9185 
9186  // // // // // // // // // HB Ratio:
9187  if (studyRatioShapeHist_) {
9188  h_Ampl_HB->Fill(ratio, 1.);
9189  if (ratio < ratioHBMin_ || ratio > ratioHBMax_) {
9191  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9192  if (mdepth == 1)
9193  h_mapDepth1Ampl047_HB->Fill(double(ieta), double(iphi), 1.);
9194  if (mdepth == 2)
9195  h_mapDepth2Ampl047_HB->Fill(double(ieta), double(iphi), 1.);
9196  // //
9197  } //if(ratio
9198  // for averaged values:
9199  if (mdepth == 1)
9200  h_mapDepth1Ampl_HB->Fill(double(ieta), double(iphi), ratio);
9201  if (mdepth == 2)
9202  h_mapDepth2Ampl_HB->Fill(double(ieta), double(iphi), ratio);
9204  sumEstimator5[sub - 1][mdepth - 1][ieta + 41][iphi] += ratio;
9205  } //if(studyRatioShapeHist_)
9207 
9208  // // // // // // // // // HB DiffAmplitude:
9209  if (studyDiffAmplHist_) {
9210  if (mdepth == 1)
9211  h_mapDepth1AmplE34_HB->Fill(double(ieta), double(iphi), amplitude);
9212  if (mdepth == 2)
9213  h_mapDepth2AmplE34_HB->Fill(double(ieta), double(iphi), amplitude);
9214  } // if(studyDiffAmplHist_)
9215 
9217  if (mdepth == 1)
9218  h_mapDepth1_HB->Fill(double(ieta), double(iphi), 1.);
9219  if (mdepth == 2)
9220  h_mapDepth2_HB->Fill(double(ieta), double(iphi), 1.);
9221  } //if ( sub == 1 )
9222 
9223  // HE
9224  if (sub == 2) {
9225  // // // // // // // // // HE PedestalCorrelations :
9227  double mypedestal = pedestal0;
9228  double mypedestalw = pedestalw0;
9229  h2_pedvsampl_HE->Fill(mypedestal, amplitude);
9230  h2_pedwvsampl_HE->Fill(mypedestalw, amplitude);
9231  h_pedvsampl_HE->Fill(mypedestal, amplitude);
9232  h_pedwvsampl_HE->Fill(mypedestalw, amplitude);
9233  h_pedvsampl0_HE->Fill(mypedestal, 1.);
9234  h_pedwvsampl0_HE->Fill(mypedestalw, 1.);
9235  } //
9236  // // // // // // // // // HE Pedestals:
9237  if (studyPedestalsHist_) {
9238  h_pedestal0_HE->Fill(pedestal0, 1.);
9239  h_pedestal1_HE->Fill(pedestal1, 1.);
9240  h_pedestal2_HE->Fill(pedestal2, 1.);
9241  h_pedestal3_HE->Fill(pedestal3, 1.);
9242  h_pedestalaver4_HE->Fill(pedestalaver4, 1.);
9243  h_pedestalaver9_HE->Fill(pedestalaver9, 1.);
9244  h_pedestalw0_HE->Fill(pedestalw0, 1.);
9245  h_pedestalw1_HE->Fill(pedestalw1, 1.);
9246  h_pedestalw2_HE->Fill(pedestalw2, 1.);
9247  h_pedestalw3_HE->Fill(pedestalw3, 1.);
9248  h_pedestalwaver4_HE->Fill(pedestalwaver4, 1.);
9249  h_pedestalwaver9_HE->Fill(pedestalwaver9, 1.);
9250  // for averaged values:
9251  if (mdepth == 1) {
9252  h_mapDepth1Ped0_HE->Fill(double(ieta), double(iphi), pedestal0);
9253  h_mapDepth1Ped1_HE->Fill(double(ieta), double(iphi), pedestal1);
9254  h_mapDepth1Ped2_HE->Fill(double(ieta), double(iphi), pedestal2);
9255  h_mapDepth1Ped3_HE->Fill(double(ieta), double(iphi), pedestal3);
9256  h_mapDepth1Pedw0_HE->Fill(double(ieta), double(iphi), pedestalw0);
9257  h_mapDepth1Pedw1_HE->Fill(double(ieta), double(iphi), pedestalw1);
9258  h_mapDepth1Pedw2_HE->Fill(double(ieta), double(iphi), pedestalw2);
9259  h_mapDepth1Pedw3_HE->Fill(double(ieta), double(iphi), pedestalw3);
9260  }
9261  if (mdepth == 2) {
9262  h_mapDepth2Ped0_HE->Fill(double(ieta), double(iphi), pedestal0);
9263  h_mapDepth2Ped1_HE->Fill(double(ieta), double(iphi), pedestal1);
9264  h_mapDepth2Ped2_HE->Fill(double(ieta), double(iphi), pedestal2);
9265  h_mapDepth2Ped3_HE->Fill(double(ieta), double(iphi), pedestal3);
9266  h_mapDepth2Pedw0_HE->Fill(double(ieta), double(iphi), pedestalw0);
9267  h_mapDepth2Pedw1_HE->Fill(double(ieta), double(iphi), pedestalw1);
9268  h_mapDepth2Pedw2_HE->Fill(double(ieta), double(iphi), pedestalw2);
9269  h_mapDepth2Pedw3_HE->Fill(double(ieta), double(iphi), pedestalw3);
9270  }
9271  if (mdepth == 3) {
9272  h_mapDepth3Ped0_HE->Fill(double(ieta), double(iphi), pedestal0);
9273  h_mapDepth3Ped1_HE->Fill(double(ieta), double(iphi), pedestal1);
9274  h_mapDepth3Ped2_HE->Fill(double(ieta), double(iphi), pedestal2);
9275  h_mapDepth3Ped3_HE->Fill(double(ieta), double(iphi), pedestal3);
9276  h_mapDepth3Pedw0_HE->Fill(double(ieta), double(iphi), pedestalw0);
9277  h_mapDepth3Pedw1_HE->Fill(double(ieta), double(iphi), pedestalw1);
9278  h_mapDepth3Pedw2_HE->Fill(double(ieta), double(iphi), pedestalw2);
9279  h_mapDepth3Pedw3_HE->Fill(double(ieta), double(iphi), pedestalw3);
9280  }
9281  if (pedestalw0 < pedestalwHEMax_ || pedestalw1 < pedestalwHEMax_ || pedestalw2 < pedestalwHEMax_ ||
9282  pedestalw3 < pedestalwHEMax_) {
9283  if (mdepth == 1)
9284  h_mapDepth1pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
9285  if (mdepth == 2)
9286  h_mapDepth2pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
9287  if (mdepth == 3)
9288  h_mapDepth3pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
9289  }
9290  if (pedestal0 < pedestalHEMax_ || pedestal1 < pedestalHEMax_ || pedestal2 < pedestalHEMax_ ||
9291  pedestal3 < pedestalHEMax_) {
9292  if (mdepth == 1)
9293  h_mapDepth1pedestal_HE->Fill(double(ieta), double(iphi), 1.);
9294  if (mdepth == 2)
9295  h_mapDepth2pedestal_HE->Fill(double(ieta), double(iphi), 1.);
9296  if (mdepth == 3)
9297  h_mapDepth3pedestal_HE->Fill(double(ieta), double(iphi), 1.);
9298  }
9299  for (int ii = 0; ii < TSsize; ii++) {
9300  h_pedestal00_HE->Fill(pedestal00->getValue(ii), 1.);
9301  h_gain_HE->Fill(gain->getValue(ii), 1.);
9302  }
9303  h_respcorr_HE->Fill(respcorr->getValue(), 1.);
9304  h_timecorr_HE->Fill(timecorr->getValue(), 1.);
9305  h_lutcorr_HE->Fill(lutcorr->getValue(), 1.);
9306  } //
9307 
9308  // h_mapDepth1ADCAmpl12SiPM_HE
9309  // // // // // // // // // HE ADCAmpl:
9310  if (studyADCAmplHist_) {
9311  h_ADCAmpl345Zoom_HE->Fill(ampl, 1.);
9312  h_ADCAmpl345Zoom1_HE->Fill(amplitude345, 1.);
9313  h_ADCAmpl345_HE->Fill(amplitude345, 1.);
9314  h_ADCAmpl_HE->Fill(amplitude, 1.);
9315 
9316  h_ADCAmplrest_HE->Fill(amplitude, 1.);
9317  h_ADCAmplrest1_HE->Fill(amplitude, 1.);
9318  h_ADCAmplrest6_HE->Fill(amplitude, 1.);
9319 
9320  h_ADCAmplZoom1_HE->Fill(amplitude, 1.);
9321  if (amplitude < ADCAmplHEMin_ || amplitude > ADCAmplHEMax_) {
9323  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9324  if (mdepth == 1)
9325  h_mapDepth1ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
9326  if (mdepth == 2)
9327  h_mapDepth2ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
9328  if (mdepth == 3)
9329  h_mapDepth3ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
9330  } // if
9331  // if(amplitude > 700.) averSIGNALoccupancy_HE += 1.;
9332  if (amplitude < 500.) {
9333  if (mdepth == 1)
9334  h_mapDepth1ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
9335  if (mdepth == 2)
9336  h_mapDepth2ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
9337  if (mdepth == 3)
9338  h_mapDepth3ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
9339  } // if
9340  // for averaged values:
9341  if (mdepth == 1)
9342  h_mapDepth1ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
9343  if (mdepth == 2)
9344  h_mapDepth2ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
9345  if (mdepth == 3)
9346  h_mapDepth3ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
9347 
9348  if (mdepth == 1) {
9349  h_mapDepth1ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
9350  h_mapDepth1linADCAmpl12_HE->Fill(double(ieta), double(iphi), linamplitudewithoutPedSubtr);
9351  }
9352  if (mdepth == 2) {
9353  h_mapDepth2ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
9354  h_mapDepth2linADCAmpl12_HE->Fill(double(ieta), double(iphi), linamplitudewithoutPedSubtr);
9355  }
9356  if (mdepth == 3) {
9357  h_mapDepth3ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
9358  h_mapDepth3linADCAmpl12_HE->Fill(double(ieta), double(iphi), linamplitudewithoutPedSubtr);
9359  }
9360 
9363  h_bcnvsamplitude_HE->Fill(float(bcn), amplitude);
9364  h_bcnvsamplitude0_HE->Fill(float(bcn), 1.);
9366  h_orbitNumvsamplitude0_HE->Fill(float(orbitNum), 1.);
9367 
9369 
9371  sumEstimator1[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude;
9372 
9373  } //if(studyADCAmplHist_
9375  // // // // // // // // // HE TSmean:
9376  if (studyTSmeanShapeHist_) {
9377  h_TSmeanA_HE->Fill(aveamplitude1, 1.);
9378  if (aveamplitude1 < TSmeanHEMin_ || aveamplitude1 > TSmeanHEMax_) {
9380  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9381  if (mdepth == 1)
9382  h_mapDepth1TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
9383  if (mdepth == 2)
9384  h_mapDepth2TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
9385  if (mdepth == 3)
9386  h_mapDepth3TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
9387  } // if
9388  // for averaged values:
9389  if (mdepth == 1)
9390  h_mapDepth1TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
9391  if (mdepth == 2)
9392  h_mapDepth2TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
9393  if (mdepth == 3)
9394  h_mapDepth3TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
9396  sumEstimator2[sub - 1][mdepth - 1][ieta + 41][iphi] += aveamplitude1;
9397  } //if(studyTSmeanShapeHist_) {
9399  // // // // // // // // // HE TSmax:
9400  if (studyTSmaxShapeHist_) {
9401  h_TSmaxA_HE->Fill(float(ts_with_max_signal), 1.);
9402  if (ts_with_max_signal < TSpeakHEMin_ || ts_with_max_signal > TSpeakHEMax_) {
9404  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9405  if (mdepth == 1)
9406  h_mapDepth1TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
9407  if (mdepth == 2)
9408  h_mapDepth2TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
9409  if (mdepth == 3)
9410  h_mapDepth3TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
9411  } // if
9412  // for averaged values:
9413  if (mdepth == 1)
9414  h_mapDepth1TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
9415  if (mdepth == 2)
9416  h_mapDepth2TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
9417  if (mdepth == 3)
9418  h_mapDepth3TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
9420  sumEstimator3[sub - 1][mdepth - 1][ieta + 41][iphi] += float(ts_with_max_signal);
9421  } //if(studyTSmaxShapeHist_) {
9423  // // // // // // // // // HE RMS:
9424  if (studyRMSshapeHist_) {
9425  h_Amplitude_HE->Fill(rmsamplitude, 1.);
9426  if (rmsamplitude < rmsHEMin_ || rmsamplitude > rmsHEMax_) {
9428  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9429  if (mdepth == 1)
9430  h_mapDepth1Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
9431  if (mdepth == 2)
9432  h_mapDepth2Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
9433  if (mdepth == 3)
9434  h_mapDepth3Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
9435  }
9436  // for averaged values:
9437  if (mdepth == 1)
9438  h_mapDepth1Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
9439  if (mdepth == 2)
9440  h_mapDepth2Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
9441  if (mdepth == 3)
9442  h_mapDepth3Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
9444  sumEstimator4[sub - 1][mdepth - 1][ieta + 41][iphi] += rmsamplitude;
9445  } //if(studyRMSshapeHist_)
9447 
9448  // // // // // // // // // HE Ratio:
9449  if (studyRatioShapeHist_) {
9450  h_Ampl_HE->Fill(ratio, 1.);
9451  if (ratio < ratioHEMin_ || ratio > ratioHEMax_) {
9453  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
9454  if (mdepth == 1)
9455  h_mapDepth1Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
9456  if (mdepth == 2)
9457  h_mapDepth2Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
9458  if (mdepth == 3)
9459  h_mapDepth3Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
9460  }
9461  // for averaged values:
9462  if (mdepth == 1)
9463  h_mapDepth1Ampl_HE->Fill(double(ieta), double(iphi), ratio);
9464  if (mdepth == 2)
9465  h_mapDepth2Ampl_HE->Fill(double(ieta), double(iphi), ratio);
9466  if (mdepth == 3)
9467  h_mapDepth3Ampl_HE->Fill(double(ieta), double(iphi), ratio);
9469  sumEstimator5[sub - 1][mdepth - 1][ieta + 41][iphi] += ratio;
9470  } //if(studyRatioShapeHist_)
9472  // // // // // // // // // HE DiffAmplitude:
9473  if (studyDiffAmplHist_) {
9474  // gain stability:
9475  if (mdepth == 1)
9476  h_mapDepth1AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
9477  if (mdepth == 2)
9478  h_mapDepth2AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
9479  if (mdepth == 3)
9480  h_mapDepth3AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
9481 
9482  } // if(studyDiffAmplHist_)
9483 
9484  // RADDAM filling:
9485  if (flagLaserRaddam_ > 0) {
9486  double amplitudewithPedSubtr = 0.;
9487 
9488  //for cut on A_channel:
9489  if (ts_with_max_signal > -1 && ts_with_max_signal < 10)
9490  amplitudewithPedSubtr = toolwithPedSubtr[ts_with_max_signal];
9491  if (ts_with_max_signal + 2 > -1 && ts_with_max_signal + 2 < 10)
9492  amplitudewithPedSubtr += toolwithPedSubtr[ts_with_max_signal + 2];
9493  if (ts_with_max_signal + 1 > -1 && ts_with_max_signal + 1 < 10)
9494  amplitudewithPedSubtr += toolwithPedSubtr[ts_with_max_signal + 1];
9495  if (ts_with_max_signal - 1 > -1 && ts_with_max_signal - 1 < 10)
9496  amplitudewithPedSubtr += toolwithPedSubtr[ts_with_max_signal - 1];
9497 
9498  h_AamplitudewithPedSubtr_RADDAM_HE->Fill(amplitudewithPedSubtr);
9499  h_AamplitudewithPedSubtr_RADDAM_HEzoom0->Fill(amplitudewithPedSubtr);
9500  h_AamplitudewithPedSubtr_RADDAM_HEzoom1->Fill(amplitudewithPedSubtr);
9501 
9502  if (amplitudewithPedSubtr > 50.) {
9503  if (flagLaserRaddam_ > 1) {
9504  mapRADDAM_HE[mdepth - 1][ieta + 41][iphi] += amplitudewithPedSubtr;
9505  ++mapRADDAM0_HE[mdepth - 1][ieta + 41][iphi];
9506  }
9507 
9508  if (mdepth == 1) {
9509  h_mapDepth1RADDAM_HE->Fill(double(ieta), double(iphi), amplitudewithPedSubtr);
9510  h_mapDepth1RADDAM0_HE->Fill(double(ieta), double(iphi), 1.);
9511  h_A_Depth1RADDAM_HE->Fill(amplitudewithPedSubtr);
9512  }
9513  if (mdepth == 2) {
9514  h_mapDepth2RADDAM_HE->Fill(double(ieta), double(iphi), amplitudewithPedSubtr);
9515  h_mapDepth2RADDAM0_HE->Fill(double(ieta), double(iphi), 1.);
9516  h_A_Depth2RADDAM_HE->Fill(amplitudewithPedSubtr);
9517  }
9518  if (mdepth == 3) {
9519  h_mapDepth3RADDAM_HE->Fill(double(ieta), double(iphi), amplitudewithPedSubtr);
9520  h_mapDepth3RADDAM0_HE->Fill(double(ieta), double(iphi), 1.);
9521  h_A_Depth3RADDAM_HE->Fill(amplitudewithPedSubtr);
9522  }
9523 
9524  // (d1 & eta 17-29) L1
9525  int LLLLLL111111 = 0;
9526  if ((mdepth == 1 && fabs(ieta0) > 16 && fabs(ieta0) < 30))
9527  LLLLLL111111 = 1;
9528  // (d2 & eta 17-26) && (d3 & eta 27-28) L2
9529  int LLLLLL222222 = 0;
9530  if ((mdepth == 2 && fabs(ieta0) > 16 && fabs(ieta0) < 27) ||
9531  (mdepth == 3 && fabs(ieta0) > 26 && fabs(ieta0) < 29))
9532  LLLLLL222222 = 1;
9533  //
9534  if (LLLLLL111111 == 1) {
9535  //forStudy h_mapLayer1RADDAM_HE->Fill(fabs(double(ieta0)), amplitudewithPedSubtr); h_mapLayer1RADDAM0_HE->Fill(fabs(double(ieta0)), 1.); h_A_Layer1RADDAM_HE->Fill(amplitudewithPedSubtr);
9536  h_sigLayer1RADDAM_HE->Fill(double(ieta0), amplitudewithPedSubtr);
9537  h_sigLayer1RADDAM0_HE->Fill(double(ieta0), 1.);
9538  }
9539  if (LLLLLL222222 == 1) {
9540  //forStudy h_mapLayer2RADDAM_HE->Fill(fabs(double(ieta0)), amplitudewithPedSubtr); h_mapLayer2RADDAM0_HE->Fill(fabs(double(ieta0)), 1.); h_A_Layer2RADDAM_HE->Fill(amplitudewithPedSubtr);
9541  h_sigLayer2RADDAM_HE->Fill(double(ieta0), amplitudewithPedSubtr);
9542  h_sigLayer2RADDAM0_HE->Fill(double(ieta0), 1.);
9543  }
9544 
9545  //
9546  if (mdepth == 3 && fabs(ieta0) == 16) {
9547  h_mapDepth3RADDAM16_HE->Fill(amplitudewithPedSubtr);
9548  // forStudy h_mapDepth3RADDAM160_HE->Fill(1.);
9549  }
9550  //
9551  } //amplitude > 60.
9552  } // END RADDAM
9553 
9555  if (mdepth == 1)
9556  h_mapDepth1_HE->Fill(double(ieta), double(iphi), 1.);
9557  if (mdepth == 2)
9558  h_mapDepth2_HE->Fill(double(ieta), double(iphi), 1.);
9559  if (mdepth == 3)
9560  h_mapDepth3_HE->Fill(double(ieta), double(iphi), 1.);
9561  } //if ( sub == 2 )
9562  //
9563 } // fillDigiAmplitude
9567  CaloSamples toolOriginal; // TS
9568  double tool[100];
9569  DetId detid = qie11df.detid();
9570  HcalDetId hcaldetid = HcalDetId(detid);
9571  int ieta = hcaldetid.ieta();
9572  if (ieta > 0)
9573  ieta -= 1;
9574  int iphi = hcaldetid.iphi() - 1;
9575  int mdepth = hcaldetid.depth();
9576  int sub = hcaldetid.subdet(); // 1-HB, 2-HE QIE11DigiCollection
9577  nTS = qie11df.samples();
9579  if (mdepth == 0 || sub > 4)
9580  return;
9581  if (mdepth > 3 && flagupgradeqie1011_ == 3)
9582  return;
9583  if (mdepth > 3 && flagupgradeqie1011_ == 7)
9584  return;
9585  if (mdepth > 3 && flagupgradeqie1011_ == 8)
9586  return;
9587  if (mdepth > 3 && flagupgradeqie1011_ == 9)
9588  return;
9589 
9590  // for some CMSSW versions and GT this line uncommented, can help to run job
9591  //if(mdepth ==4 && sub==1 && (ieta == -16 || ieta == 15) ) return;// HB depth4 eta=-16, 15 since I did:if(ieta > 0) ieta -= 1;
9594  const HcalGain* gain = conditions->getGain(hcaldetid);
9595  // const HcalGainWidth* gainWidth = conditions->getGainWidth(hcaldetid);
9596  const HcalRespCorr* respcorr = conditions->getHcalRespCorr(hcaldetid);
9597  const HcalTimeCorr* timecorr = conditions->getHcalTimeCorr(hcaldetid);
9598  const HcalLUTCorr* lutcorr = conditions->getHcalLUTCorr(hcaldetid);
9599  const HcalQIECoder* channelCoder = conditions->getHcalCoder(hcaldetid);
9600  const HcalPedestalWidth* pedw = conditions->getPedestalWidth(hcaldetid);
9601  const HcalPedestal* pedestal00 = conditions->getPedestal(hcaldetid);
9602  HcalCoderDb coder(*channelCoder, *shape);
9603  if (useADCfC_)
9604  coder.adc2fC(qie11df, toolOriginal);
9605  double pedestalaver9 = 0.;
9606  double pedestalaver4 = 0.;
9607  double pedestal0 = 0.;
9608  double pedestal1 = 0.;
9609  double pedestal2 = 0.;
9610  double pedestal3 = 0.;
9611  double pedestalwaver9 = 0.;
9612  double pedestalwaver4 = 0.;
9613  double pedestalw0 = 0.;
9614  double pedestalw1 = 0.;
9615  double pedestalw2 = 0.;
9616  double pedestalw3 = 0.;
9617  double difpedestal0 = 0.;
9618  double difpedestal1 = 0.;
9619  double difpedestal2 = 0.;
9620  double difpedestal3 = 0.;
9621 
9622  double amplitude = 0.;
9623  double amplitude0 = 0.;
9624  double absamplitude = 0.;
9625  double tocampl = 0.;
9626 
9627  double amplitude345 = 0.;
9628  double ampl = 0.;
9629  double ampl3ts = 0.;
9630  double amplmaxts = 0.;
9631  double timew = 0.;
9632  double timeww = 0.;
9633  double max_signal = -100.;
9634  int ts_with_max_signal = -100;
9635  int c0 = 0;
9636  int c1 = 0;
9637  int c2 = 0;
9638  int c3 = 0;
9639  int c4 = 0;
9640  double errorBtype = 0.;
9641 
9642  int TSsize = 8; // sub= 1 HB
9643  if (sub == 2)
9644  TSsize = 8; // sub = 2 HE
9645  if (nTS != TSsize)
9646  errorBtype = 1.;
9647  TSsize = nTS; //nTS = qie11df.samples();
9649  // double ADC_ped = 0.;
9650  int flagTS2 = 0;
9651  for (int ii = 0; ii < TSsize; ii++) {
9652  double ampldefault = 0.;
9653  double tocdefault = 0.;
9654  double ampldefault0 = 0.;
9655  double ampldefault1 = 0.;
9656  double ampldefault2 = 0.;
9657 
9658  ampldefault0 = adc2fC_QIE11_shunt6[qie11df[ii].adc()]; // massive !!!!!! (use for local runs as default shunt6)
9659  if (flaguseshunt_ == 1)
9660  ampldefault0 = adc2fC_QIE11_shunt1[qie11df[ii].adc()]; // massive !!!!!!
9661  if (useADCfC_)
9662  ampldefault1 = toolOriginal[ii]; //adcfC
9663  ampldefault2 = qie11df[ii].adc(); //ADCcounts
9664 
9665  if (useADCmassive_) {
9666  ampldefault = ampldefault0;
9667  } // !!!!!!
9668  if (useADCfC_) {
9669  ampldefault = ampldefault1;
9670  }
9671  if (useADCcounts_) {
9672  ampldefault = ampldefault2;
9673  }
9674  tocdefault = ampldefault;
9675 
9676  int capid = (qie11df[ii]).capid();
9677  double pedestal = pedestal00->getValue(capid);
9678  double pedestalw = pedw->getSigma(capid, capid);
9679  double pedestalINI = pedestal00->getValue(capid);
9680  tocdefault -= pedestal; // pedestal subtraction
9682  ampldefault -= pedestal; // pedestal subtraction
9683  tool[ii] = ampldefault;
9684  pedestalaver9 += pedestal;
9685  pedestalwaver9 += pedestalw * pedestalw;
9686 
9687  if (capid == 0 && c0 == 0) {
9688  c0++;
9689  c4++;
9690  pedestalaver4 += pedestal;
9691  pedestal0 = pedestal;
9692  pedestalw0 = pedestalw;
9693  pedestalwaver4 += pedestalw * pedestalw;
9694  difpedestal0 = pedestal - pedestalINI;
9695  }
9696 
9697  if (capid == 1 && c1 == 0) {
9698  c1++;
9699  c4++;
9700  pedestalaver4 += pedestal;
9701  pedestal1 = pedestal;
9702  pedestalw1 = pedestalw;
9703  pedestalwaver4 += pedestalw * pedestalw;
9704  difpedestal1 = pedestal - pedestalINI;
9705  }
9706  if (capid == 2 && c2 == 0) {
9707  c2++;
9708  c4++;
9709  pedestalaver4 += pedestal;
9710  pedestal2 = pedestal;
9711  pedestalw2 = pedestalw;
9712  pedestalwaver4 += pedestalw * pedestalw;
9713  difpedestal2 = pedestal - pedestalINI;
9714  }
9715  if (capid == 3 && c3 == 0) {
9716  c3++;
9717  c4++;
9718  pedestalaver4 += pedestal;
9719  pedestal3 = pedestal;
9720  pedestalw3 = pedestalw;
9721  pedestalwaver4 += pedestalw * pedestalw;
9722  difpedestal3 = pedestal - pedestalINI;
9723  }
9724 
9725  if (max_signal < ampldefault) {
9726  max_signal = ampldefault;
9727  ts_with_max_signal = ii;
9728  }
9729  amplitude += ampldefault; //
9730  absamplitude += abs(ampldefault); //
9731  tocampl += tocdefault; //
9732 
9733  if (ii == 1 || ii == 2 || ii == 3 || ii == 4 || ii == 5 || ii == 6 || ii == 7 || ii == 8)
9734  amplitude345 += ampldefault;
9735 
9736  if (flagcpuoptimization_ == 0) {
9737  } //flagcpuoptimization
9738 
9739  timew += (ii + 1) * abs(ampldefault);
9740  timeww += (ii + 1) * ampldefault;
9741 
9742  if (ii == 2 && ampldefault > 0.)
9743  flagTS2 = 1;
9744  } //for 1
9746  amplitude0 = amplitude;
9747 
9748  pedestalaver9 /= TSsize;
9749  pedestalaver4 /= c4;
9750  pedestalwaver9 = sqrt(pedestalwaver9 / TSsize);
9751  pedestalwaver4 = sqrt(pedestalwaver4 / c4);
9752 
9753  // ------------ to get signal in TS: -2 max +1 ------------
9754  if (ts_with_max_signal > -1 && ts_with_max_signal < 10) {
9755  ampl = tool[ts_with_max_signal];
9756  ampl3ts = tool[ts_with_max_signal];
9757  amplmaxts = tool[ts_with_max_signal];
9758  }
9759  if (ts_with_max_signal - 1 > -1 && ts_with_max_signal - 1 < 10) {
9760  ampl += tool[ts_with_max_signal - 1];
9761  ampl3ts += tool[ts_with_max_signal - 1];
9762  }
9763  if (ts_with_max_signal + 1 > -1 && ts_with_max_signal + 1 < 10) {
9764  ampl += tool[ts_with_max_signal + 1];
9765  ampl3ts += tool[ts_with_max_signal + 1];
9766  }
9767  if (ts_with_max_signal + 2 > -1 && ts_with_max_signal + 2 < 10) {
9768  ampl += tool[ts_with_max_signal + 2];
9769  }
9770  // HE charge correction for SiPMs:
9771  if (flagsipmcorrection_ != 0) {
9772  if (sub == 2) {
9773  double xa = amplitude / 40.;
9774  double xb = ampl / 40.;
9775  double xc = amplitude345 / 40.;
9776  double xd = ampl3ts / 40.;
9777  double xe = amplmaxts / 40.;
9778  double txa = tocampl / 40.;
9779  // ADDI case:
9780  if (((ieta == -16 || ieta == 15) && mdepth == 4) ||
9781  ((ieta == -17 || ieta == 16) && (mdepth == 2 || mdepth == 3)) ||
9782  ((ieta == -18 || ieta == 17) && mdepth == 5)) {
9783  double c0 = 1.000000;
9784  double b1 = 2.59096e-05;
9785  double a2 = 4.60721e-11;
9786  double corrforxa = a2 * xa * xa + b1 * xa + c0;
9787  double corrforxb = a2 * xb * xb + b1 * xb + c0;
9788  double corrforxc = a2 * xc * xc + b1 * xc + c0;
9789  double corrforxd = a2 * xd * xd + b1 * xd + c0;
9790  double corrforxe = a2 * xe * xe + b1 * xe + c0;
9791  double corrfortxa = a2 * txa * txa + b1 * txa + c0;
9792  h_corrforxaADDI_HE->Fill(amplitude, corrforxa);
9793  h_corrforxaADDI0_HE->Fill(amplitude, 1.);
9794  amplitude *= corrforxa;
9795  ampl *= corrforxb;
9796  amplitude345 *= corrforxc;
9797  ampl3ts *= corrforxd;
9798  amplmaxts *= corrforxe;
9799  tocampl *= corrfortxa;
9800  }
9801  // MAIN case:
9802  else {
9803  double c0 = 1.000000;
9804  double b1 = 2.71238e-05;
9805  double a2 = 1.32877e-10;
9806  double corrforxa = a2 * xa * xa + b1 * xa + c0;
9807  double corrforxb = a2 * xb * xb + b1 * xb + c0;
9808  double corrforxc = a2 * xc * xc + b1 * xc + c0;
9809  double corrforxd = a2 * xd * xd + b1 * xd + c0;
9810  double corrforxe = a2 * xe * xe + b1 * xe + c0;
9811  double corrfortxa = a2 * txa * txa + b1 * txa + c0;
9812  h_corrforxaMAIN_HE->Fill(amplitude, corrforxa);
9813  h_corrforxaMAIN0_HE->Fill(amplitude, 1.);
9814  amplitude *= corrforxa;
9815  ampl *= corrforxb;
9816  amplitude345 *= corrforxc;
9817  ampl3ts *= corrforxd;
9818  amplmaxts *= corrforxe;
9819  tocampl *= corrfortxa;
9820  }
9821  } // sub == 2 HE charge correction end
9822  } //flagsipmcorrection_
9824  // sub=1||2 HBHE
9825  if (sub == 1 || sub == 2) {
9826  amplitudechannel0[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.; // 0-neta ; 0-71 HBHE
9827  amplitudechannel[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude; // 0-neta ; 0-71 HBHE
9828  amplitudechannel2[sub - 1][mdepth - 1][ieta + 41][iphi] += pow(amplitude, 2); // 0-neta ; 0-71 HBHE
9829  }
9830  tocamplchannel[sub - 1][mdepth - 1][ieta + 41][iphi] += tocampl; // 0-neta ; 0-71 HBHE
9831 
9832  double ratio = 0.;
9833  // if(amplallTS != 0.) ratio = ampl/amplallTS;
9834  if (amplitude != 0.)
9835  ratio = ampl / amplitude;
9836  if (ratio < 0. || ratio > 1.02)
9837  ratio = 0.;
9838  double aveamplitude = 0.;
9839  double aveamplitudew = 0.;
9840  if (absamplitude > 0 && timew > 0)
9841  aveamplitude = timew / absamplitude; // average_TS +1
9842  if (amplitude0 > 0 && timeww > 0)
9843  aveamplitudew = timeww / amplitude0; // average_TS +1
9844  double rmsamp = 0.;
9845  // and CapIdErrors:
9846  int error = 0;
9847  bool anycapid = true;
9848  int lastcapid = 0;
9849  int capid = 0;
9850  for (int ii = 0; ii < TSsize; ii++) {
9851  double aaaaaa = (ii + 1) - aveamplitudew;
9852  double aaaaaa2 = aaaaaa * aaaaaa;
9853  double ampldefault = tool[ii];
9854  rmsamp += (aaaaaa2 * ampldefault); // fC
9855  capid = (qie11df[ii]).capid();
9856  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
9857  anycapid = false;
9858  }
9859  lastcapid = capid;
9860  } //for 2
9861 
9862  if (!anycapid)
9863  error = 1;
9864  double rmsamplitude = 0.;
9865  if ((amplitude0 > 0 && rmsamp > 0) || (amplitude0 < 0 && rmsamp < 0))
9866  rmsamplitude = sqrt(rmsamp / amplitude0);
9867  double aveamplitude1 = aveamplitude - 1; // means iTS=0-9
9868  // CapIdErrors end /////////////////////////////////////////////////////////
9869 
9870  // AZ 1.10.2015:
9871  if (error == 1) {
9872  if (sub == 1 && mdepth == 1)
9874  if (sub == 1 && mdepth == 2)
9876  if (sub == 2 && mdepth == 1)
9878  if (sub == 2 && mdepth == 2)
9880  if (sub == 2 && mdepth == 3)
9882  }
9883  if (error != 1) {
9884  if (sub == 1 && mdepth == 1)
9886  if (sub == 1 && mdepth == 2)
9888  if (sub == 2 && mdepth == 1)
9890  if (sub == 2 && mdepth == 2)
9892  if (sub == 2 && mdepth == 3)
9894  }
9895 
9896  for (int ii = 0; ii < TSsize; ii++) {
9897  // for (int ii=0; ii<10; ii++) {
9898  double ampldefault = tool[ii];
9900  if (sub == 1) {
9901  if (amplitude0 > 120) {
9902  h_shape_Ahigh_HB0->Fill(float(ii), ampldefault);
9903  h_shape0_Ahigh_HB0->Fill(float(ii), 1.);
9904  } else {
9905  h_shape_Alow_HB0->Fill(float(ii), ampldefault);
9906  h_shape0_Alow_HB0->Fill(float(ii), 1.);
9907  } //HB0
9909  if (pedestal2 < pedestalHBMax_ || pedestal3 < pedestalHBMax_ || pedestal2 < pedestalHBMax_ ||
9910  pedestal3 < pedestalHBMax_) {
9911  h_shape_Ahigh_HB1->Fill(float(ii), ampldefault);
9912  h_shape0_Ahigh_HB1->Fill(float(ii), 1.);
9913  } else {
9914  h_shape_Alow_HB1->Fill(float(ii), ampldefault);
9915  h_shape0_Alow_HB1->Fill(float(ii), 1.);
9916  } //HB1
9917  if (error == 0) {
9918  h_shape_Ahigh_HB2->Fill(float(ii), ampldefault);
9919  h_shape0_Ahigh_HB2->Fill(float(ii), 1.);
9920  } else {
9921  h_shape_Alow_HB2->Fill(float(ii), ampldefault);
9922  h_shape0_Alow_HB2->Fill(float(ii), 1.);
9923  } //HB2
9925  if (pedestalw0 < pedestalwHBMax_ || pedestalw1 < pedestalwHBMax_ || pedestalw2 < pedestalwHBMax_ ||
9926  pedestalw3 < pedestalwHBMax_) {
9927  h_shape_Ahigh_HB3->Fill(float(ii), ampldefault);
9928  h_shape0_Ahigh_HB3->Fill(float(ii), 1.);
9929  } else {
9930  h_shape_Alow_HB3->Fill(float(ii), ampldefault);
9931  h_shape0_Alow_HB3->Fill(float(ii), 1.);
9932  } //HB3
9933 
9934  } // sub HB
9935 
9936  } //for 3 over TSs
9937 
9938  if (sub == 1) {
9939  // bad_channels with C,A,W,P,pW,
9940  if (error == 1 || amplitude0 < ADCAmplHBMin_ || amplitude0 > ADCAmplHBMax_ || rmsamplitude < rmsHBMin_ ||
9941  rmsamplitude > rmsHBMax_ || pedestal0 < pedestalHBMax_ || pedestal1 < pedestalHBMax_ ||
9942  pedestal2 < pedestalHBMax_ || pedestal3 < pedestalHBMax_ || pedestalw0 < pedestalwHBMax_ ||
9943  pedestalw1 < pedestalwHBMax_ || pedestalw2 < pedestalwHBMax_ || pedestalw3 < pedestalwHBMax_) {
9944  for (int ii = 0; ii < TSsize; ii++) {
9945  double ampldefault = tool[ii];
9946  h_shape_bad_channels_HB->Fill(float(ii), ampldefault);
9947  h_shape0_bad_channels_HB->Fill(float(ii), 1.);
9948  }
9949  }
9950  // good_channels with C,A,W,P,pW
9951  else {
9952  for (int ii = 0; ii < TSsize; ii++) {
9953  double ampldefault = tool[ii];
9954  h_shape_good_channels_HB->Fill(float(ii), ampldefault);
9955  h_shape0_good_channels_HB->Fill(float(ii), 1.);
9956  }
9957  }
9958  } // sub HB
9959 
9960  // HE starts:
9961  if (sub == 2) {
9962  // shape bad_channels with C,A,W,P,pW,
9963  if (error == 1 || amplitude0 < ADCAmplHEMin_ || amplitude0 > ADCAmplHEMax_ || rmsamplitude < rmsHEMin_ ||
9964  rmsamplitude > rmsHEMax_ || pedestal0 < pedestalHEMax_ || pedestal1 < pedestalHEMax_ ||
9965  pedestal2 < pedestalHEMax_ || pedestal3 < pedestalHEMax_ || pedestalw0 < pedestalwHEMax_ ||
9966  pedestalw1 < pedestalwHEMax_ || pedestalw2 < pedestalwHEMax_ || pedestalw3 < pedestalwHEMax_) {
9967  for (int ii = 0; ii < TSsize; ii++) {
9968  double ampldefault = tool[ii];
9969  h_shape_bad_channels_HE->Fill(float(ii), ampldefault);
9970  h_shape0_bad_channels_HE->Fill(float(ii), 1.);
9971  }
9972  }
9973  // shape good_channels with C,A,W,P,pW,
9974  else {
9975  for (int ii = 0; ii < TSsize; ii++) {
9976  double ampldefault = tool[ii];
9977  h_shape_good_channels_HE->Fill(float(ii), ampldefault);
9978  h_shape0_good_channels_HE->Fill(float(ii), 1.);
9979  } // ii
9980  } // else for good channels
9981  } // sub HE
9983  sum0Estimator[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
9984  // for Error B-type
9985  sumEstimator6[sub - 1][mdepth - 1][ieta + 41][iphi] += errorBtype;
9986  // sumEstimator0[sub-1][mdepth-1][ieta+41][iphi] += pedestalw0;//Sig_Pedestals
9987  sumEstimator0[sub - 1][mdepth - 1][ieta + 41][iphi] += pedestal0; //Pedestals
9988  // HB
9989  if (sub == 1) {
9991  // // // // // // // // // HB PedestalCorrelations :
9992  double mypedestal = pedestal0;
9993  double mypedestalw = pedestalw0;
9994  h2_pedvsampl_HB->Fill(mypedestal, amplitude);
9995  h2_pedwvsampl_HB->Fill(mypedestalw, amplitude);
9996  h_pedvsampl_HB->Fill(mypedestal, amplitude);
9997  h_pedwvsampl_HB->Fill(mypedestalw, amplitude);
9998  h_pedvsampl0_HB->Fill(mypedestal, 1.);
9999  h_pedwvsampl0_HB->Fill(mypedestalw, 1.);
10000 
10001  h2_amplvsped_HB->Fill(amplitude, mypedestal);
10002  h2_amplvspedw_HB->Fill(amplitude, mypedestalw);
10003  h_amplvsped_HB->Fill(amplitude, mypedestal);
10004  h_amplvspedw_HB->Fill(amplitude, mypedestalw);
10005  h_amplvsped0_HB->Fill(amplitude, 1.);
10006  } //
10007  // // // // // // // // // HB Pedestals:
10008  if (studyPedestalsHist_) {
10009  h_pedestal0_HB->Fill(pedestal0, 1.);
10010  h_pedestal1_HB->Fill(pedestal1, 1.);
10011  h_pedestal2_HB->Fill(pedestal2, 1.);
10012  h_pedestal3_HB->Fill(pedestal3, 1.);
10013  h_pedestalaver4_HB->Fill(pedestalaver4, 1.);
10014  h_pedestalaver9_HB->Fill(pedestalaver9, 1.);
10015  h_pedestalw0_HB->Fill(pedestalw0, 1.);
10016  h_pedestalw1_HB->Fill(pedestalw1, 1.);
10017  h_pedestalw2_HB->Fill(pedestalw2, 1.);
10018  h_pedestalw3_HB->Fill(pedestalw3, 1.);
10019  h_pedestalwaver4_HB->Fill(pedestalwaver4, 1.);
10020  h_pedestalwaver9_HB->Fill(pedestalwaver9, 1.);
10021  // for averaged values:
10022  if (mdepth == 1) {
10023  h_mapDepth1Ped0_HB->Fill(double(ieta), double(iphi), pedestal0);
10024  h_mapDepth1Ped1_HB->Fill(double(ieta), double(iphi), pedestal1);
10025  h_mapDepth1Ped2_HB->Fill(double(ieta), double(iphi), pedestal2);
10026  h_mapDepth1Ped3_HB->Fill(double(ieta), double(iphi), pedestal3);
10027  h_mapDepth1Pedw0_HB->Fill(double(ieta), double(iphi), pedestalw0);
10028  h_mapDepth1Pedw1_HB->Fill(double(ieta), double(iphi), pedestalw1);
10029  h_mapDepth1Pedw2_HB->Fill(double(ieta), double(iphi), pedestalw2);
10030  h_mapDepth1Pedw3_HB->Fill(double(ieta), double(iphi), pedestalw3);
10031  }
10032  if (mdepth == 2) {
10033  h_mapDepth2Ped0_HB->Fill(double(ieta), double(iphi), pedestal0);
10034  h_mapDepth2Ped1_HB->Fill(double(ieta), double(iphi), pedestal1);
10035  h_mapDepth2Ped2_HB->Fill(double(ieta), double(iphi), pedestal2);
10036  h_mapDepth2Ped3_HB->Fill(double(ieta), double(iphi), pedestal3);
10037  h_mapDepth2Pedw0_HB->Fill(double(ieta), double(iphi), pedestalw0);
10038  h_mapDepth2Pedw1_HB->Fill(double(ieta), double(iphi), pedestalw1);
10039  h_mapDepth2Pedw2_HB->Fill(double(ieta), double(iphi), pedestalw2);
10040  h_mapDepth2Pedw3_HB->Fill(double(ieta), double(iphi), pedestalw3);
10041  }
10042  if (pedestalw0 < pedestalwHBMax_ || pedestalw1 < pedestalwHBMax_ || pedestalw2 < pedestalwHBMax_ ||
10043  pedestalw3 < pedestalwHBMax_) {
10044  if (mdepth == 1)
10045  h_mapDepth1pedestalw_HB->Fill(double(ieta), double(iphi), 1.);
10046  if (mdepth == 2)
10047  h_mapDepth2pedestalw_HB->Fill(double(ieta), double(iphi), 1.);
10048  if (mdepth == 3)
10049  h_mapDepth3pedestalw_HB->Fill(double(ieta), double(iphi), 1.);
10050  if (mdepth == 3)
10051  h_mapDepth4pedestalw_HB->Fill(double(ieta), double(iphi), 1.);
10052  }
10053  if (pedestal0 < pedestalHBMax_ || pedestal1 < pedestalHBMax_ || pedestal2 < pedestalHBMax_ ||
10054  pedestal3 < pedestalHBMax_) {
10055  if (mdepth == 1)
10056  h_mapDepth1pedestal_HB->Fill(double(ieta), double(iphi), 1.);
10057  if (mdepth == 2)
10058  h_mapDepth2pedestal_HB->Fill(double(ieta), double(iphi), 1.);
10059  if (mdepth == 3)
10060  h_mapDepth3pedestal_HB->Fill(double(ieta), double(iphi), 1.);
10061  if (mdepth == 4)
10062  h_mapDepth4pedestal_HB->Fill(double(ieta), double(iphi), 1.);
10063  }
10064  for (int ii = 0; ii < TSsize; ii++) {
10065  h_pedestal00_HB->Fill(pedestal00->getValue(ii), 1.);
10066  h_gain_HB->Fill(gain->getValue(ii), 1.);
10067  }
10068  h_respcorr_HB->Fill(respcorr->getValue(), 1.);
10069  h_timecorr_HB->Fill(timecorr->getValue(), 1.);
10070  h_lutcorr_HB->Fill(lutcorr->getValue(), 1.);
10071  h_difpedestal0_HB->Fill(difpedestal0, 1.);
10072  h_difpedestal1_HB->Fill(difpedestal1, 1.);
10073  h_difpedestal2_HB->Fill(difpedestal2, 1.);
10074  h_difpedestal3_HB->Fill(difpedestal3, 1.);
10075  } //
10076  // // // // // // // // // HB ADCAmpl:
10077  if (studyADCAmplHist_) {
10078  h_ADCAmpl345Zoom_HB->Fill(amplitude345, 1.);
10079  h_ADCAmpl345Zoom1_HB->Fill(amplitude345, 1.);
10080  h_ADCAmpl345_HB->Fill(amplitude345, 1.);
10081  if (error == 0) {
10083  h_ADCAmpl345_HBCapIdNoError->Fill(amplitude345, 1.);
10084  }
10085  if (error == 1) {
10086  h_ADCAmpl_HBCapIdError->Fill(amplitude, 1.);
10087  h_ADCAmpl345_HBCapIdError->Fill(amplitude345, 1.);
10088  }
10089  h_ADCAmplZoom_HB->Fill(amplitude, 1.);
10090  h_ADCAmplZoom1_HB->Fill(amplitude, 1.);
10091  h_ADCAmpl_HB->Fill(amplitude, 1.);
10092 
10093  h_AmplitudeHBrest->Fill(amplitude, 1.);
10094  h_AmplitudeHBrest1->Fill(amplitude, 1.);
10095  h_AmplitudeHBrest6->Fill(amplitude, 1.);
10096 
10097  if (amplitude < ADCAmplHBMin_ || amplitude > ADCAmplHBMax_) {
10099  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10100  if (mdepth == 1)
10101  h_mapDepth1ADCAmpl225_HB->Fill(double(ieta), double(iphi), 1.);
10102  if (mdepth == 2)
10103  h_mapDepth2ADCAmpl225_HB->Fill(double(ieta), double(iphi), 1.);
10104  if (mdepth == 3)
10105  h_mapDepth3ADCAmpl225_HB->Fill(double(ieta), double(iphi), 1.);
10106  if (mdepth == 4)
10107  h_mapDepth4ADCAmpl225_HB->Fill(double(ieta), double(iphi), 1.);
10108  } // if
10109  // if(amplitude >400.) averSIGNALoccupancy_HB += 1.;
10110  if (amplitude < 35.) {
10111  if (mdepth == 1)
10112  h_mapDepth1ADCAmpl225Copy_HB->Fill(double(ieta), double(iphi), 1.);
10113  if (mdepth == 2)
10114  h_mapDepth2ADCAmpl225Copy_HB->Fill(double(ieta), double(iphi), 1.);
10115  if (mdepth == 3)
10116  h_mapDepth3ADCAmpl225Copy_HB->Fill(double(ieta), double(iphi), 1.);
10117  if (mdepth == 4)
10118  h_mapDepth4ADCAmpl225Copy_HB->Fill(double(ieta), double(iphi), 1.);
10119  } // if
10120  // for averaged values:
10121  if (mdepth == 1)
10122  h_mapDepth1ADCAmpl_HB->Fill(double(ieta), double(iphi), amplitude);
10123  if (mdepth == 2)
10124  h_mapDepth2ADCAmpl_HB->Fill(double(ieta), double(iphi), amplitude);
10125  if (mdepth == 3)
10126  h_mapDepth3ADCAmpl_HB->Fill(double(ieta), double(iphi), amplitude);
10127  if (mdepth == 4)
10128  h_mapDepth4ADCAmpl_HB->Fill(double(ieta), double(iphi), amplitude);
10129  if (mdepth == 1)
10130  h_mapDepth1ADCAmpl12_HB->Fill(double(ieta), double(iphi), ampl);
10131  if (mdepth == 2)
10132  h_mapDepth2ADCAmpl12_HB->Fill(double(ieta), double(iphi), ampl);
10133  if (mdepth == 3)
10134  h_mapDepth3ADCAmpl12_HB->Fill(double(ieta), double(iphi), ampl);
10135  if (mdepth == 4)
10136  h_mapDepth4ADCAmpl12_HB->Fill(double(ieta), double(iphi), ampl);
10139  h_bcnvsamplitude_HB->Fill(float(bcn), amplitude);
10140  h_bcnvsamplitude0_HB->Fill(float(bcn), 1.);
10142  h_orbitNumvsamplitude0_HB->Fill(float(orbitNum), 1.);
10144  sumEstimator1[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude;
10145  } //if(studyADCAmplHist_
10147 
10148  // // // // // // // // // HB TSmean:
10149  if (studyTSmeanShapeHist_) {
10150  h_TSmeanA_HB->Fill(aveamplitude1, 1.);
10151  if (aveamplitude1 < TSmeanHBMin_ || aveamplitude1 > TSmeanHBMax_) {
10153  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10154  if (mdepth == 1)
10155  h_mapDepth1TSmeanA225_HB->Fill(double(ieta), double(iphi), 1.);
10156  if (mdepth == 2)
10157  h_mapDepth2TSmeanA225_HB->Fill(double(ieta), double(iphi), 1.);
10158  if (mdepth == 3)
10159  h_mapDepth3TSmeanA225_HB->Fill(double(ieta), double(iphi), 1.);
10160  if (mdepth == 4)
10161  h_mapDepth4TSmeanA225_HB->Fill(double(ieta), double(iphi), 1.);
10162  } // if
10163  // for averaged values:
10164  if (mdepth == 1)
10165  h_mapDepth1TSmeanA_HB->Fill(double(ieta), double(iphi), aveamplitude1);
10166  if (mdepth == 2)
10167  h_mapDepth2TSmeanA_HB->Fill(double(ieta), double(iphi), aveamplitude1);
10168  if (mdepth == 3)
10169  h_mapDepth3TSmeanA_HB->Fill(double(ieta), double(iphi), aveamplitude1);
10170  if (mdepth == 4)
10171  h_mapDepth4TSmeanA_HB->Fill(double(ieta), double(iphi), aveamplitude1);
10173  sumEstimator2[sub - 1][mdepth - 1][ieta + 41][iphi] += aveamplitude1;
10174  } //if(studyTSmeanShapeHist_
10176 
10177  // // // // // // // // // HB TSmax:
10178  if (studyTSmaxShapeHist_) {
10179  h_TSmaxA_HB->Fill(float(ts_with_max_signal), 1.);
10180  if (ts_with_max_signal < TSpeakHBMin_ || ts_with_max_signal > TSpeakHBMax_) {
10182  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10183  if (mdepth == 1)
10184  h_mapDepth1TSmaxA225_HB->Fill(double(ieta), double(iphi), 1.);
10185  if (mdepth == 2)
10186  h_mapDepth2TSmaxA225_HB->Fill(double(ieta), double(iphi), 1.);
10187  if (mdepth == 3)
10188  h_mapDepth3TSmaxA225_HB->Fill(double(ieta), double(iphi), 1.);
10189  if (mdepth == 4)
10190  h_mapDepth4TSmaxA225_HB->Fill(double(ieta), double(iphi), 1.);
10191  } // if
10192  // for averaged values:
10193  if (mdepth == 1)
10194  h_mapDepth1TSmaxA_HB->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10195  if (mdepth == 2)
10196  h_mapDepth2TSmaxA_HB->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10197  if (mdepth == 3)
10198  h_mapDepth3TSmaxA_HB->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10199  if (mdepth == 4)
10200  h_mapDepth4TSmaxA_HB->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10202  sumEstimator3[sub - 1][mdepth - 1][ieta + 41][iphi] += float(ts_with_max_signal);
10203  } //if(studyTSmaxShapeHist_
10205 
10206  // // // // // // // // // HB RMS:
10207  if (studyRMSshapeHist_) {
10208  h_Amplitude_HB->Fill(rmsamplitude, 1.);
10209  if (rmsamplitude < rmsHBMin_ || rmsamplitude > rmsHBMax_) {
10211  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10212  if (mdepth == 1)
10213  h_mapDepth1Amplitude225_HB->Fill(double(ieta), double(iphi), 1.);
10214  if (mdepth == 2)
10215  h_mapDepth2Amplitude225_HB->Fill(double(ieta), double(iphi), 1.);
10216  if (mdepth == 3)
10217  h_mapDepth3Amplitude225_HB->Fill(double(ieta), double(iphi), 1.);
10218  if (mdepth == 4)
10219  h_mapDepth4Amplitude225_HB->Fill(double(ieta), double(iphi), 1.);
10220  } // if
10221  // for averaged values:
10222  if (mdepth == 1)
10223  h_mapDepth1Amplitude_HB->Fill(double(ieta), double(iphi), rmsamplitude);
10224  if (mdepth == 2)
10225  h_mapDepth2Amplitude_HB->Fill(double(ieta), double(iphi), rmsamplitude);
10226  if (mdepth == 3)
10227  h_mapDepth3Amplitude_HB->Fill(double(ieta), double(iphi), rmsamplitude);
10228  if (mdepth == 4)
10229  h_mapDepth4Amplitude_HB->Fill(double(ieta), double(iphi), rmsamplitude);
10231  sumEstimator4[sub - 1][mdepth - 1][ieta + 41][iphi] += rmsamplitude;
10232  } //if(studyRMSshapeHist_)
10234 
10235  // // // // // // // // // HB Ratio:
10236  if (studyRatioShapeHist_) {
10237  h_Ampl_HB->Fill(ratio, 1.);
10238  if (ratio < ratioHBMin_ || ratio > ratioHBMax_) {
10240  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10241  if (mdepth == 1)
10242  h_mapDepth1Ampl047_HB->Fill(double(ieta), double(iphi), 1.);
10243  if (mdepth == 2)
10244  h_mapDepth2Ampl047_HB->Fill(double(ieta), double(iphi), 1.);
10245  if (mdepth == 3)
10246  h_mapDepth3Ampl047_HB->Fill(double(ieta), double(iphi), 1.);
10247  if (mdepth == 4)
10248  h_mapDepth4Ampl047_HB->Fill(double(ieta), double(iphi), 1.);
10249  // //
10250  } //if(ratio
10251  // for averaged values:
10252  if (mdepth == 1)
10253  h_mapDepth1Ampl_HB->Fill(double(ieta), double(iphi), ratio);
10254  if (mdepth == 2)
10255  h_mapDepth2Ampl_HB->Fill(double(ieta), double(iphi), ratio);
10256  if (mdepth == 3)
10257  h_mapDepth3Ampl_HB->Fill(double(ieta), double(iphi), ratio);
10258  if (mdepth == 4)
10259  h_mapDepth4Ampl_HB->Fill(double(ieta), double(iphi), ratio);
10261  sumEstimator5[sub - 1][mdepth - 1][ieta + 41][iphi] += ratio;
10262  } //if(studyRatioShapeHist_)
10264 
10265  // // // // // // // // // HB DiffAmplitude:
10266  if (studyDiffAmplHist_) {
10267  if (mdepth == 1)
10268  h_mapDepth1AmplE34_HB->Fill(double(ieta), double(iphi), amplitude);
10269  if (mdepth == 2)
10270  h_mapDepth2AmplE34_HB->Fill(double(ieta), double(iphi), amplitude);
10271  if (mdepth == 3)
10272  h_mapDepth3AmplE34_HB->Fill(double(ieta), double(iphi), amplitude);
10273  if (mdepth == 4)
10274  h_mapDepth4AmplE34_HB->Fill(double(ieta), double(iphi), amplitude);
10275  } // if(studyDiffAmplHist_)
10276 
10278  if (mdepth == 1)
10279  h_mapDepth1_HB->Fill(double(ieta), double(iphi), 1.);
10280  if (mdepth == 2)
10281  h_mapDepth2_HB->Fill(double(ieta), double(iphi), 1.);
10282  if (mdepth == 3)
10283  h_mapDepth3_HB->Fill(double(ieta), double(iphi), 1.);
10284  if (mdepth == 4)
10285  h_mapDepth4_HB->Fill(double(ieta), double(iphi), 1.);
10286 
10287  if (flagTS2 == 1) {
10288  if (mdepth == 1)
10289  h_mapDepth1TS2_HB->Fill(double(ieta), double(iphi), 1.);
10290  if (mdepth == 2)
10291  h_mapDepth2TS2_HB->Fill(double(ieta), double(iphi), 1.);
10292  if (mdepth == 3)
10293  h_mapDepth3TS2_HB->Fill(double(ieta), double(iphi), 1.);
10294  if (mdepth == 4)
10295  h_mapDepth4TS2_HB->Fill(double(ieta), double(iphi), 1.);
10296  } // select entries only in TS=2
10297 
10298  } //if ( sub == 1 )
10299 
10300  // HE QIE11
10301  if (sub == 2) {
10302  // // // // // // // // // HE QIE11 PedestalCorrelations :
10304  // double mypedestal = pedestalaver9;
10305  // double mypedestalw = pedestalwaver9;
10306  double mypedestal = pedestal0;
10307  double mypedestalw = pedestalw0;
10308  h2_pedvsampl_HE->Fill(mypedestal, amplitude);
10309  h2_pedwvsampl_HE->Fill(mypedestalw, amplitude);
10310  h_pedvsampl_HE->Fill(mypedestal, amplitude);
10311  h_pedwvsampl_HE->Fill(mypedestalw, amplitude);
10312  h_pedvsampl0_HE->Fill(mypedestal, 1.);
10313  h_pedwvsampl0_HE->Fill(mypedestalw, 1.);
10314  } //
10315  // // // // // // // // // HE QIE11 Pedestals:
10316  if (studyPedestalsHist_) {
10317  h_pedestal0_HE->Fill(pedestal0, 1.);
10318  h_pedestal1_HE->Fill(pedestal1, 1.);
10319  h_pedestal2_HE->Fill(pedestal2, 1.);
10320  h_pedestal3_HE->Fill(pedestal3, 1.);
10321  h_pedestalaver4_HE->Fill(pedestalaver4, 1.);
10322  h_pedestalaver9_HE->Fill(pedestalaver9, 1.);
10323  h_pedestalw0_HE->Fill(pedestalw0, 1.);
10324  h_pedestalw1_HE->Fill(pedestalw1, 1.);
10325  h_pedestalw2_HE->Fill(pedestalw2, 1.);
10326  h_pedestalw3_HE->Fill(pedestalw3, 1.);
10327  h_pedestalwaver4_HE->Fill(pedestalwaver4, 1.);
10328  h_pedestalwaver9_HE->Fill(pedestalwaver9, 1.);
10329  // for averaged values:
10330  if (mdepth == 1) {
10331  h_mapDepth1Ped0_HE->Fill(double(ieta), double(iphi), pedestal0);
10332  h_mapDepth1Ped1_HE->Fill(double(ieta), double(iphi), pedestal1);
10333  h_mapDepth1Ped2_HE->Fill(double(ieta), double(iphi), pedestal2);
10334  h_mapDepth1Ped3_HE->Fill(double(ieta), double(iphi), pedestal3);
10335  h_mapDepth1Pedw0_HE->Fill(double(ieta), double(iphi), pedestalw0);
10336  h_mapDepth1Pedw1_HE->Fill(double(ieta), double(iphi), pedestalw1);
10337  h_mapDepth1Pedw2_HE->Fill(double(ieta), double(iphi), pedestalw2);
10338  h_mapDepth1Pedw3_HE->Fill(double(ieta), double(iphi), pedestalw3);
10339  }
10340  if (mdepth == 2) {
10341  h_mapDepth2Ped0_HE->Fill(double(ieta), double(iphi), pedestal0);
10342  h_mapDepth2Ped1_HE->Fill(double(ieta), double(iphi), pedestal1);
10343  h_mapDepth2Ped2_HE->Fill(double(ieta), double(iphi), pedestal2);
10344  h_mapDepth2Ped3_HE->Fill(double(ieta), double(iphi), pedestal3);
10345  h_mapDepth2Pedw0_HE->Fill(double(ieta), double(iphi), pedestalw0);
10346  h_mapDepth2Pedw1_HE->Fill(double(ieta), double(iphi), pedestalw1);
10347  h_mapDepth2Pedw2_HE->Fill(double(ieta), double(iphi), pedestalw2);
10348  h_mapDepth2Pedw3_HE->Fill(double(ieta), double(iphi), pedestalw3);
10349  }
10350  if (mdepth == 3) {
10351  h_mapDepth3Ped0_HE->Fill(double(ieta), double(iphi), pedestal0);
10352  h_mapDepth3Ped1_HE->Fill(double(ieta), double(iphi), pedestal1);
10353  h_mapDepth3Ped2_HE->Fill(double(ieta), double(iphi), pedestal2);
10354  h_mapDepth3Ped3_HE->Fill(double(ieta), double(iphi), pedestal3);
10355  h_mapDepth3Pedw0_HE->Fill(double(ieta), double(iphi), pedestalw0);
10356  h_mapDepth3Pedw1_HE->Fill(double(ieta), double(iphi), pedestalw1);
10357  h_mapDepth3Pedw2_HE->Fill(double(ieta), double(iphi), pedestalw2);
10358  h_mapDepth3Pedw3_HE->Fill(double(ieta), double(iphi), pedestalw3);
10359  }
10360  if (pedestalw0 < pedestalwHEMax_ || pedestalw1 < pedestalwHEMax_ || pedestalw2 < pedestalwHEMax_ ||
10361  pedestalw3 < pedestalwHEMax_) {
10362  if (mdepth == 1)
10363  h_mapDepth1pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
10364  if (mdepth == 2)
10365  h_mapDepth2pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
10366  if (mdepth == 3)
10367  h_mapDepth3pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
10368  if (mdepth == 4)
10369  h_mapDepth4pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
10370  if (mdepth == 5)
10371  h_mapDepth5pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
10372  if (mdepth == 6)
10373  h_mapDepth6pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
10374  if (mdepth == 7)
10375  h_mapDepth7pedestalw_HE->Fill(double(ieta), double(iphi), 1.);
10376  }
10377  if (pedestal0 < pedestalHEMax_ || pedestal1 < pedestalHEMax_ || pedestal2 < pedestalHEMax_ ||
10378  pedestal3 < pedestalHEMax_) {
10379  if (mdepth == 1)
10380  h_mapDepth1pedestal_HE->Fill(double(ieta), double(iphi), 1.);
10381  if (mdepth == 2)
10382  h_mapDepth2pedestal_HE->Fill(double(ieta), double(iphi), 1.);
10383  if (mdepth == 3)
10384  h_mapDepth3pedestal_HE->Fill(double(ieta), double(iphi), 1.);
10385  if (mdepth == 4)
10386  h_mapDepth4pedestal_HE->Fill(double(ieta), double(iphi), 1.);
10387  if (mdepth == 5)
10388  h_mapDepth5pedestal_HE->Fill(double(ieta), double(iphi), 1.);
10389  if (mdepth == 6)
10390  h_mapDepth6pedestal_HE->Fill(double(ieta), double(iphi), 1.);
10391  if (mdepth == 7)
10392  h_mapDepth7pedestal_HE->Fill(double(ieta), double(iphi), 1.);
10393  }
10394  for (int ii = 0; ii < TSsize; ii++) {
10395  h_pedestal00_HE->Fill(pedestal00->getValue(ii), 1.);
10396  h_gain_HE->Fill(gain->getValue(ii), 1.);
10397  }
10398  h_respcorr_HE->Fill(respcorr->getValue(), 1.);
10399  h_timecorr_HE->Fill(timecorr->getValue(), 1.);
10400  h_lutcorr_HE->Fill(lutcorr->getValue(), 1.);
10401  } //
10402  // // // // // // // // // HE QIE11 ADCAmpl:
10403  if (studyADCAmplHist_) {
10404  h_ADCAmpl345_HE->Fill(amplitude345, 1.);
10405  h_ADCAmpl_HE->Fill(amplitude, 1.);
10406  // if( ieta <0) h_ADCAmpl_HEM->Fill(amplitude,1.);
10407  // if( ieta >0) h_ADCAmpl_HEP->Fill(amplitude,1.);
10408  h_ADCAmplrest_HE->Fill(amplitude, 1.);
10409  h_ADCAmplrest1_HE->Fill(amplitude, 1.);
10410  h_ADCAmplrest6_HE->Fill(amplitude, 1.);
10411 
10412  if (amplitude < ADCAmplHEMin_ || amplitude > ADCAmplHEMax_) {
10414  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10415  if (mdepth == 1)
10416  h_mapDepth1ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
10417  if (mdepth == 2)
10418  h_mapDepth2ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
10419  if (mdepth == 3)
10420  h_mapDepth3ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
10421  if (mdepth == 4)
10422  h_mapDepth4ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
10423  if (mdepth == 5)
10424  h_mapDepth5ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
10425  if (mdepth == 6)
10426  h_mapDepth6ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
10427  if (mdepth == 7)
10428  h_mapDepth7ADCAmpl225_HE->Fill(double(ieta), double(iphi), 1.);
10429  } // if
10430  // if(amplitude > 700.) averSIGNALoccupancy_HE += 1.;
10431  if (amplitude < 500.) {
10432  if (mdepth == 1)
10433  h_mapDepth1ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
10434  if (mdepth == 2)
10435  h_mapDepth2ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
10436  if (mdepth == 3)
10437  h_mapDepth3ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
10438  if (mdepth == 4)
10439  h_mapDepth4ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
10440  if (mdepth == 5)
10441  h_mapDepth5ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
10442  if (mdepth == 6)
10443  h_mapDepth6ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
10444  if (mdepth == 7)
10445  h_mapDepth7ADCAmpl225Copy_HE->Fill(double(ieta), double(iphi), 1.);
10446  } // if
10447 
10448  h_ADCAmplZoom1_HE->Fill(amplitude, 1.); // for amplitude allTS
10449  h_ADCAmpl345Zoom1_HE->Fill(ampl3ts, 1.); // for ampl3ts 3TSs
10450  h_ADCAmpl345Zoom_HE->Fill(ampl, 1.); // for ampl 4TSs
10451 
10452  if (amplitude > 110 && amplitude < 150) {
10453  h_mapADCAmplfirstpeak_HE->Fill(double(ieta), double(iphi), amplitude);
10454  h_mapADCAmplfirstpeak0_HE->Fill(double(ieta), double(iphi), 1.);
10455  } else if (amplitude > 150 && amplitude < 190) {
10456  h_mapADCAmplsecondpeak_HE->Fill(double(ieta), double(iphi), amplitude);
10457  h_mapADCAmplsecondpeak0_HE->Fill(double(ieta), double(iphi), 1.);
10458  }
10459 
10460  if (ampl3ts > 70 && ampl3ts < 110) {
10461  h_mapADCAmpl11firstpeak_HE->Fill(double(ieta), double(iphi), ampl3ts);
10462  h_mapADCAmpl11firstpeak0_HE->Fill(double(ieta), double(iphi), 1.);
10463  } else if (ampl3ts > 110 && ampl3ts < 150) {
10464  h_mapADCAmpl11secondpeak_HE->Fill(double(ieta), double(iphi), ampl3ts);
10465  h_mapADCAmpl11secondpeak0_HE->Fill(double(ieta), double(iphi), 1.);
10466  }
10467  if (ampl > 87 && ampl < 127) {
10468  h_mapADCAmpl12firstpeak_HE->Fill(double(ieta), double(iphi), ampl);
10469  h_mapADCAmpl12firstpeak0_HE->Fill(double(ieta), double(iphi), 1.);
10470  } else if (ampl > 127 && ampl < 167) {
10471  h_mapADCAmpl12secondpeak_HE->Fill(double(ieta), double(iphi), ampl);
10472  h_mapADCAmpl12secondpeak0_HE->Fill(double(ieta), double(iphi), 1.);
10473  }
10474  // for averaged values of every channel:
10475  if (mdepth == 1)
10476  h_mapDepth1ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
10477  if (mdepth == 2)
10478  h_mapDepth2ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
10479  if (mdepth == 3)
10480  h_mapDepth3ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
10481  if (mdepth == 4)
10482  h_mapDepth4ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
10483  if (mdepth == 5)
10484  h_mapDepth5ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
10485  if (mdepth == 6)
10486  h_mapDepth6ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
10487  if (mdepth == 7)
10488  h_mapDepth7ADCAmpl_HE->Fill(double(ieta), double(iphi), amplitude);
10489  if (mdepth == 1)
10490  h_mapDepth1ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
10491  if (mdepth == 2)
10492  h_mapDepth2ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
10493  if (mdepth == 3)
10494  h_mapDepth3ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
10495  if (mdepth == 4)
10496  h_mapDepth4ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
10497  if (mdepth == 5)
10498  h_mapDepth5ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
10499  if (mdepth == 6)
10500  h_mapDepth6ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
10501  if (mdepth == 7)
10502  h_mapDepth7ADCAmpl12_HE->Fill(double(ieta), double(iphi), ampl);
10503  // for averaged values of SiPM channels only:
10504  if (mdepth == 1)
10505  h_mapDepth1ADCAmplSiPM_HE->Fill(double(ieta), double(iphi), amplitude);
10506  if (mdepth == 2)
10507  h_mapDepth2ADCAmplSiPM_HE->Fill(double(ieta), double(iphi), amplitude);
10508  if (mdepth == 3)
10509  h_mapDepth3ADCAmplSiPM_HE->Fill(double(ieta), double(iphi), amplitude);
10510  if (mdepth == 1)
10511  h_mapDepth1ADCAmpl12SiPM_HE->Fill(double(ieta), double(iphi), ampl);
10512  if (mdepth == 2)
10513  h_mapDepth2ADCAmpl12SiPM_HE->Fill(double(ieta), double(iphi), ampl);
10514  if (mdepth == 3)
10515  h_mapDepth3ADCAmpl12SiPM_HE->Fill(double(ieta), double(iphi), ampl);
10516  //
10519  h_bcnvsamplitude_HE->Fill(float(bcn), amplitude);
10520  h_bcnvsamplitude0_HE->Fill(float(bcn), 1.);
10522  h_orbitNumvsamplitude0_HE->Fill(float(orbitNum), 1.);
10524  sumEstimator1[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude;
10525  } //if(studyADCAmplHist_
10526  // // // // // // // // // HE QIE11 TSmean:
10527  if (studyTSmeanShapeHist_) {
10528  h_TSmeanA_HE->Fill(aveamplitude1, 1.);
10529  if (aveamplitude1 < TSmeanHEMin_ || aveamplitude1 > TSmeanHEMax_) {
10531  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10532  if (mdepth == 1)
10533  h_mapDepth1TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
10534  if (mdepth == 2)
10535  h_mapDepth2TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
10536  if (mdepth == 3)
10537  h_mapDepth3TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
10538  if (mdepth == 4)
10539  h_mapDepth4TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
10540  if (mdepth == 5)
10541  h_mapDepth5TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
10542  if (mdepth == 6)
10543  h_mapDepth6TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
10544  if (mdepth == 7)
10545  h_mapDepth7TSmeanA225_HE->Fill(double(ieta), double(iphi), 1.);
10546  } // if
10547  // for averaged values:
10548  if (mdepth == 1)
10549  h_mapDepth1TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
10550  if (mdepth == 2)
10551  h_mapDepth2TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
10552  if (mdepth == 3)
10553  h_mapDepth3TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
10554  if (mdepth == 4)
10555  h_mapDepth4TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
10556  if (mdepth == 5)
10557  h_mapDepth5TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
10558  if (mdepth == 6)
10559  h_mapDepth6TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
10560  if (mdepth == 7)
10561  h_mapDepth7TSmeanA_HE->Fill(double(ieta), double(iphi), aveamplitude1);
10563  sumEstimator2[sub - 1][mdepth - 1][ieta + 41][iphi] += aveamplitude1;
10564  } //if(studyTSmeanShapeHist_) {
10566  // // // // // // // // // HE QIE11 TSmax:
10567  if (studyTSmaxShapeHist_) {
10568  h_TSmaxA_HE->Fill(float(ts_with_max_signal), 1.);
10569  if (ts_with_max_signal < TSpeakHEMin_ || ts_with_max_signal > TSpeakHEMax_) {
10571  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10572  if (mdepth == 1)
10573  h_mapDepth1TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
10574  if (mdepth == 2)
10575  h_mapDepth2TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
10576  if (mdepth == 3)
10577  h_mapDepth3TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
10578  if (mdepth == 4)
10579  h_mapDepth4TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
10580  if (mdepth == 5)
10581  h_mapDepth5TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
10582  if (mdepth == 6)
10583  h_mapDepth6TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
10584  if (mdepth == 7)
10585  h_mapDepth7TSmaxA225_HE->Fill(double(ieta), double(iphi), 1.);
10586  } // if
10587  // for averaged values:
10588  if (mdepth == 1)
10589  h_mapDepth1TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10590  if (mdepth == 2)
10591  h_mapDepth2TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10592  if (mdepth == 3)
10593  h_mapDepth3TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10594  if (mdepth == 4)
10595  h_mapDepth4TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10596  if (mdepth == 5)
10597  h_mapDepth5TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10598  if (mdepth == 6)
10599  h_mapDepth6TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10600  if (mdepth == 7)
10601  h_mapDepth7TSmaxA_HE->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
10603  sumEstimator3[sub - 1][mdepth - 1][ieta + 41][iphi] += float(ts_with_max_signal);
10604  } //if(studyTSmaxShapeHist_) {
10606  // // // // // // // // // HE QIE11 RMS:
10607  if (studyRMSshapeHist_) {
10608  h_Amplitude_HE->Fill(rmsamplitude, 1.);
10609  if (rmsamplitude < rmsHEMin_ || rmsamplitude > rmsHEMax_) {
10611  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10612  if (mdepth == 1)
10613  h_mapDepth1Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
10614  if (mdepth == 2)
10615  h_mapDepth2Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
10616  if (mdepth == 3)
10617  h_mapDepth3Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
10618  if (mdepth == 4)
10619  h_mapDepth4Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
10620  if (mdepth == 5)
10621  h_mapDepth5Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
10622  if (mdepth == 6)
10623  h_mapDepth6Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
10624  if (mdepth == 7)
10625  h_mapDepth7Amplitude225_HE->Fill(double(ieta), double(iphi), 1.);
10626  }
10627  // for averaged values:
10628  if (mdepth == 1)
10629  h_mapDepth1Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
10630  if (mdepth == 2)
10631  h_mapDepth2Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
10632  if (mdepth == 3)
10633  h_mapDepth3Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
10634  if (mdepth == 4)
10635  h_mapDepth4Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
10636  if (mdepth == 5)
10637  h_mapDepth5Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
10638  if (mdepth == 6)
10639  h_mapDepth6Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
10640  if (mdepth == 7)
10641  h_mapDepth7Amplitude_HE->Fill(double(ieta), double(iphi), rmsamplitude);
10643  sumEstimator4[sub - 1][mdepth - 1][ieta + 41][iphi] += rmsamplitude;
10644  } //if(studyRMSshapeHist_)
10646 
10647  // // // // // // // // // HE QIE11 Ratio:
10648  if (studyRatioShapeHist_) {
10649  h_Ampl_HE->Fill(ratio, 1.);
10650  if (ratio < ratioHEMin_ || ratio > ratioHEMax_) {
10652  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
10653  if (mdepth == 1)
10654  h_mapDepth1Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
10655  if (mdepth == 2)
10656  h_mapDepth2Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
10657  if (mdepth == 3)
10658  h_mapDepth3Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
10659  if (mdepth == 4)
10660  h_mapDepth4Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
10661  if (mdepth == 5)
10662  h_mapDepth5Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
10663  if (mdepth == 6)
10664  h_mapDepth6Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
10665  if (mdepth == 7)
10666  h_mapDepth7Ampl047_HE->Fill(double(ieta), double(iphi), 1.);
10667  }
10668  // for averaged values:
10669  if (mdepth == 1)
10670  h_mapDepth1Ampl_HE->Fill(double(ieta), double(iphi), ratio);
10671  if (mdepth == 2)
10672  h_mapDepth2Ampl_HE->Fill(double(ieta), double(iphi), ratio);
10673  if (mdepth == 3)
10674  h_mapDepth3Ampl_HE->Fill(double(ieta), double(iphi), ratio);
10675  if (mdepth == 4)
10676  h_mapDepth4Ampl_HE->Fill(double(ieta), double(iphi), ratio);
10677  if (mdepth == 5)
10678  h_mapDepth5Ampl_HE->Fill(double(ieta), double(iphi), ratio);
10679  if (mdepth == 6)
10680  h_mapDepth6Ampl_HE->Fill(double(ieta), double(iphi), ratio);
10681  if (mdepth == 7)
10682  h_mapDepth7Ampl_HE->Fill(double(ieta), double(iphi), ratio);
10684  sumEstimator5[sub - 1][mdepth - 1][ieta + 41][iphi] += ratio;
10685  } //if(studyRatioShapeHist_)
10687  // // // // // // // // // HE QIE11 DiffAmplitude:
10688  if (studyDiffAmplHist_) {
10689  if (mdepth == 1)
10690  h_mapDepth1AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
10691  if (mdepth == 2)
10692  h_mapDepth2AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
10693  if (mdepth == 3)
10694  h_mapDepth3AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
10695  if (mdepth == 4)
10696  h_mapDepth4AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
10697  if (mdepth == 5)
10698  h_mapDepth5AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
10699  if (mdepth == 6)
10700  h_mapDepth6AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
10701  if (mdepth == 7)
10702  h_mapDepth7AmplE34_HE->Fill(double(ieta), double(iphi), amplitude);
10703  } // if(studyDiffAmplHist_)
10705  if (mdepth == 1)
10706  h_mapDepth1_HE->Fill(double(ieta), double(iphi), 1.);
10707  if (mdepth == 2)
10708  h_mapDepth2_HE->Fill(double(ieta), double(iphi), 1.);
10709  if (mdepth == 3)
10710  h_mapDepth3_HE->Fill(double(ieta), double(iphi), 1.);
10711  if (mdepth == 4)
10712  h_mapDepth4_HE->Fill(double(ieta), double(iphi), 1.);
10713  if (mdepth == 5)
10714  h_mapDepth5_HE->Fill(double(ieta), double(iphi), 1.);
10715  if (mdepth == 6)
10716  h_mapDepth6_HE->Fill(double(ieta), double(iphi), 1.);
10717  if (mdepth == 7)
10718  h_mapDepth7_HE->Fill(double(ieta), double(iphi), 1.);
10719 
10720  if (flagTS2 == 1) {
10721  if (mdepth == 1)
10722  h_mapDepth1TS2_HE->Fill(double(ieta), double(iphi), 1.);
10723  if (mdepth == 2)
10724  h_mapDepth2TS2_HE->Fill(double(ieta), double(iphi), 1.);
10725  if (mdepth == 3)
10726  h_mapDepth3TS2_HE->Fill(double(ieta), double(iphi), 1.);
10727  if (mdepth == 4)
10728  h_mapDepth4TS2_HE->Fill(double(ieta), double(iphi), 1.);
10729  if (mdepth == 5)
10730  h_mapDepth5TS2_HE->Fill(double(ieta), double(iphi), 1.);
10731  if (mdepth == 6)
10732  h_mapDepth6TS2_HE->Fill(double(ieta), double(iphi), 1.);
10733  if (mdepth == 7)
10734  h_mapDepth7TS2_HE->Fill(double(ieta), double(iphi), 1.);
10735  } // select entries only in TS=2
10736 
10737  } //if ( sub == 2 )
10738  //
10739 }
10742  CaloSamples toolOriginal; // TS
10743  double tool[100];
10744  HcalDetId cell(digiItr->id());
10745  int mdepth = cell.depth();
10746  int iphi = cell.iphi() - 1; // 0-71
10747  int ieta = cell.ieta();
10748  if (ieta > 0)
10749  ieta -= 1; //-41 +41
10750  int sub = cell.subdet(); // (HFDigiCollection: 4-HF)
10751  const HcalPedestal* pedestal00 = conditions->getPedestal(cell);
10752  const HcalGain* gain = conditions->getGain(cell);
10753  const HcalRespCorr* respcorr = conditions->getHcalRespCorr(cell);
10754  const HcalTimeCorr* timecorr = conditions->getHcalTimeCorr(cell);
10755  const HcalLUTCorr* lutcorr = conditions->getHcalLUTCorr(cell);
10756  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
10757  const HcalPedestalWidth* pedw = conditions->getPedestalWidth(cell);
10758  HcalCoderDb coder(*channelCoder, *shape);
10759  if (useADCfC_)
10760  coder.adc2fC(*digiItr, toolOriginal);
10761  double pedestalaver9 = 0.;
10762  double pedestalaver4 = 0.;
10763  double pedestal0 = 0.;
10764  double pedestal1 = 0.;
10765  double pedestal2 = 0.;
10766  double pedestal3 = 0.;
10767  double pedestalwaver9 = 0.;
10768  double pedestalwaver4 = 0.;
10769  double pedestalw0 = 0.;
10770  double pedestalw1 = 0.;
10771  double pedestalw2 = 0.;
10772  double pedestalw3 = 0.;
10773  double amplitude = 0.;
10774  double absamplitude = 0.;
10775  double ampl = 0.;
10776  double timew = 0.;
10777  double timeww = 0.;
10778  double max_signal = -100.;
10779  int ts_with_max_signal = -100;
10780  int c0 = 0;
10781  int c1 = 0;
10782  int c2 = 0;
10783  int c3 = 0;
10784  int c4 = 0;
10785  double errorBtype = 0.;
10786  int TSsize = 4; // HF for Run2
10787  if ((*digiItr).size() != TSsize)
10788  errorBtype = 1.;
10789  TSsize = digiItr->size();
10790  for (int ii = 0; ii < TSsize; ii++) {
10791  // for (int ii=0; ii<digiItr->size(); ii++) {
10792  double ampldefault = 0.;
10793  double ampldefault0 = 0.;
10794  double ampldefault1 = 0.;
10795  double ampldefault2 = 0.;
10796  ampldefault0 = adc2fC[digiItr->sample(ii).adc()]; // massive
10797  if (useADCfC_)
10798  ampldefault1 = toolOriginal[ii]; //adcfC
10799  ampldefault2 = (*digiItr)[ii].adc(); //ADCcounts
10800  if (useADCmassive_) {
10801  ampldefault = ampldefault0;
10802  }
10803  if (useADCfC_) {
10804  ampldefault = ampldefault1;
10805  }
10806  if (useADCcounts_) {
10807  ampldefault = ampldefault2;
10808  }
10809 
10810  int capid = ((*digiItr)[ii]).capid();
10811  // double pedestal = calib.pedestal(capid);
10812  double pedestal = pedestal00->getValue(capid);
10813  double pedestalw = pedw->getSigma(capid, capid);
10815  ampldefault -= pedestal; // pedestal subtraction
10816 
10817  tool[ii] = ampldefault;
10818 
10819  pedestalaver9 += pedestal;
10820  pedestalwaver9 += pedestalw * pedestalw;
10821 
10822  if (capid == 0 && c0 == 0) {
10823  c0++;
10824  c4++;
10825  pedestalaver4 += pedestal;
10826  pedestal0 = pedestal;
10827  pedestalw0 = pedestalw;
10828  pedestalwaver4 += pedestalw * pedestalw;
10829  }
10830 
10831  if (capid == 1 && c1 == 0) {
10832  c1++;
10833  c4++;
10834  pedestalaver4 += pedestal;
10835  pedestal1 = pedestal;
10836  pedestalw1 = pedestalw;
10837  pedestalwaver4 += pedestalw * pedestalw;
10838  }
10839  if (capid == 2 && c2 == 0) {
10840  c2++;
10841  c4++;
10842  pedestalaver4 += pedestal;
10843  pedestal2 = pedestal;
10844  pedestalw2 = pedestalw;
10845  pedestalwaver4 += pedestalw * pedestalw;
10846  }
10847  if (capid == 3 && c3 == 0) {
10848  c3++;
10849  c4++;
10850  pedestalaver4 += pedestal;
10851  pedestal3 = pedestal;
10852  pedestalw3 = pedestalw;
10853  pedestalwaver4 += pedestalw * pedestalw;
10854  }
10855 
10856  if (max_signal < ampldefault) {
10857  max_signal = ampldefault;
10858  ts_with_max_signal = ii;
10859  }
10860  amplitude += ampldefault; //
10861  absamplitude += abs(ampldefault); //
10863 
10864  if (flagcpuoptimization_ == 0) {
10865  } // if(flagcpuoptimization_== 0
10866  timew += (ii + 1) * abs(ampldefault);
10867  timeww += (ii + 1) * ampldefault;
10868  } //for 1
10870  // sub=4 HF
10871  if (sub == 4) {
10872  amplitudechannel0[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.; // 0-neta ; 0-71 HF
10873  amplitudechannel[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude; // 0-neta ; 0-71 HF
10874  amplitudechannel2[sub - 1][mdepth - 1][ieta + 41][iphi] += pow(amplitude, 2); // 0-neta ; 0-71 HF
10875  }
10876 
10877  pedestalaver9 /= TSsize;
10878  pedestalaver4 /= c4;
10879  pedestalwaver9 = sqrt(pedestalwaver9 / TSsize);
10880  pedestalwaver4 = sqrt(pedestalwaver4 / c4);
10881 
10882  // ------------ to get signal in TS: -2 max +1 ------------
10883  if (ts_with_max_signal > -1 && ts_with_max_signal < TSsize)
10884  ampl = tool[ts_with_max_signal];
10885  if (ts_with_max_signal + 2 > -1 && ts_with_max_signal + 2 < TSsize)
10886  ampl += tool[ts_with_max_signal + 2];
10887  if (ts_with_max_signal + 1 > -1 && ts_with_max_signal + 1 < TSsize)
10888  ampl += tool[ts_with_max_signal + 1];
10889  if (ts_with_max_signal - 1 > -1 && ts_with_max_signal - 1 < TSsize)
10890  ampl += tool[ts_with_max_signal - 1];
10891 
10892  double ratio = 0.;
10893  // if(amplallTS != 0.) ratio = ampl/amplallTS;
10894  if (amplitude != 0.)
10895  ratio = ampl / amplitude;
10896 
10897  if (ratio < 0. || ratio > 1.02)
10898  ratio = 0.;
10899 
10900  double aveamplitude = 0.;
10901  double aveamplitudew = 0.;
10902  if (absamplitude > 0 && timew > 0)
10903  aveamplitude = timew / absamplitude; // average_TS +1
10904  if (amplitude > 0 && timeww > 0)
10905  aveamplitudew = timeww / amplitude; // average_TS +1
10906 
10907  double rmsamp = 0.;
10908  // and CapIdErrors:
10909  int error = 0;
10910  bool anycapid = true;
10911  bool anyer = false;
10912  bool anydv = true;
10913  int lastcapid = 0;
10914  int capid = 0;
10915  for (int ii = 0; ii < TSsize; ii++) {
10916  double aaaaaa = (ii + 1) - aveamplitudew;
10917  double aaaaaa2 = aaaaaa * aaaaaa;
10918  double ampldefault = tool[ii];
10919  rmsamp += (aaaaaa2 * ampldefault); // fC
10920  capid = ((*digiItr)[ii]).capid();
10921  bool er = (*digiItr)[ii].er(); // error
10922  bool dv = (*digiItr)[ii].dv(); // valid data
10923  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
10924  anycapid = false;
10925  }
10926  // std::cout << " ii = " << ii << " capid = " << capid << " ((lastcapid+1)%4) = " << ((lastcapid+1)%4) << std::endl;
10927  lastcapid = capid;
10928  if (er) {
10929  anyer = true;
10930  }
10931  if (!dv) {
10932  anydv = false;
10933  }
10934  } //for 2
10935 
10936  if (!anycapid || anyer || !anydv)
10937  error = 1;
10938  double rmsamplitude = 0.;
10939  if ((amplitude > 0 && rmsamp > 0) || (amplitude < 0 && rmsamp < 0))
10940  rmsamplitude = sqrt(rmsamp / amplitude);
10941  double aveamplitude1 = aveamplitude - 1; // means iTS=0-9, so bad is iTS=0 and 9
10942  if (error == 1) {
10943  if (sub == 4 && mdepth == 1)
10945  if (sub == 4 && mdepth == 2)
10947  }
10948  if (error != 1) {
10949  if (sub == 4 && mdepth == 1)
10951  if (sub == 4 && mdepth == 2)
10953  }
10954 
10955  if (sub == 4) {
10956  // bad_channels with C,A,W,P,pW,
10957  if (error == 1 || amplitude < ADCAmplHFMin_ || amplitude > ADCAmplHFMax_ || rmsamplitude < rmsHFMin_ ||
10958  rmsamplitude > rmsHFMax_ || pedestal0 < pedestalHFMax_ || pedestal1 < pedestalHFMax_ ||
10959  pedestal2 < pedestalHFMax_ || pedestal3 < pedestalHFMax_ || pedestalw0 < pedestalwHFMax_ ||
10960  pedestalw1 < pedestalwHFMax_ || pedestalw2 < pedestalwHFMax_ || pedestalw3 < pedestalwHFMax_
10961 
10962  ) {
10963  for (int ii = 0; ii < TSsize; ii++) {
10964  double ampldefault = tool[ii];
10965  h_shape_bad_channels_HF->Fill(float(ii), ampldefault);
10966  h_shape0_bad_channels_HF->Fill(float(ii), 1.);
10967  }
10968  }
10969  // good_channels with C,A,W,P,pW,
10970  else {
10971  for (int ii = 0; ii < TSsize; ii++) {
10972  double ampldefault = tool[ii];
10973  h_shape_good_channels_HF->Fill(float(ii), ampldefault);
10974  h_shape0_good_channels_HF->Fill(float(ii), 1.);
10975  }
10976  }
10977  } // sub HF
10979  sum0Estimator[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
10980  sumEstimator6[sub - 1][mdepth - 1][ieta + 41][iphi] += errorBtype;
10981  sumEstimator0[sub - 1][mdepth - 1][ieta + 41][iphi] += pedestal0; // Pedestals
10982  // HF
10983  if (sub == 4) {
10984  // // // // // // // // // HF PedestalCorrelations :
10986  double mypedestal = pedestal0;
10987  double mypedestalw = pedestalw0;
10988  h2_pedvsampl_HF->Fill(mypedestal, amplitude);
10989  h2_pedwvsampl_HF->Fill(mypedestalw, amplitude);
10990  h_pedvsampl_HF->Fill(mypedestal, amplitude);
10991  h_pedwvsampl_HF->Fill(mypedestalw, amplitude);
10992  h_pedvsampl0_HF->Fill(mypedestal, 1.);
10993  h_pedwvsampl0_HF->Fill(mypedestalw, 1.);
10994  } //
10995  // // // // // // // // // HF Pedestals:
10996  if (studyPedestalsHist_) {
10997  h_pedestal0_HF->Fill(pedestal0, 1.);
10998  h_pedestal1_HF->Fill(pedestal1, 1.);
10999  h_pedestal2_HF->Fill(pedestal2, 1.);
11000  h_pedestal3_HF->Fill(pedestal3, 1.);
11001  h_pedestalaver4_HF->Fill(pedestalaver4, 1.);
11002  h_pedestalaver9_HF->Fill(pedestalaver9, 1.);
11003  h_pedestalw0_HF->Fill(pedestalw0, 1.);
11004  h_pedestalw1_HF->Fill(pedestalw1, 1.);
11005  h_pedestalw2_HF->Fill(pedestalw2, 1.);
11006  h_pedestalw3_HF->Fill(pedestalw3, 1.);
11007  h_pedestalwaver4_HF->Fill(pedestalwaver4, 1.);
11008  h_pedestalwaver9_HF->Fill(pedestalwaver9, 1.);
11009  // for averaged values:
11010  if (mdepth == 1) {
11011  h_mapDepth1Ped0_HF->Fill(double(ieta), double(iphi), pedestal0);
11012  h_mapDepth1Ped1_HF->Fill(double(ieta), double(iphi), pedestal1);
11013  h_mapDepth1Ped2_HF->Fill(double(ieta), double(iphi), pedestal2);
11014  h_mapDepth1Ped3_HF->Fill(double(ieta), double(iphi), pedestal3);
11015  h_mapDepth1Pedw0_HF->Fill(double(ieta), double(iphi), pedestalw0);
11016  h_mapDepth1Pedw1_HF->Fill(double(ieta), double(iphi), pedestalw1);
11017  h_mapDepth1Pedw2_HF->Fill(double(ieta), double(iphi), pedestalw2);
11018  h_mapDepth1Pedw3_HF->Fill(double(ieta), double(iphi), pedestalw3);
11019  }
11020  if (mdepth == 2) {
11021  h_mapDepth2Ped0_HF->Fill(double(ieta), double(iphi), pedestal0);
11022  h_mapDepth2Ped1_HF->Fill(double(ieta), double(iphi), pedestal1);
11023  h_mapDepth2Ped2_HF->Fill(double(ieta), double(iphi), pedestal2);
11024  h_mapDepth2Ped3_HF->Fill(double(ieta), double(iphi), pedestal3);
11025  h_mapDepth2Pedw0_HF->Fill(double(ieta), double(iphi), pedestalw0);
11026  h_mapDepth2Pedw1_HF->Fill(double(ieta), double(iphi), pedestalw1);
11027  h_mapDepth2Pedw2_HF->Fill(double(ieta), double(iphi), pedestalw2);
11028  h_mapDepth2Pedw3_HF->Fill(double(ieta), double(iphi), pedestalw3);
11029  }
11030 
11031  if (pedestalw0 < pedestalwHFMax_ || pedestalw1 < pedestalwHFMax_ || pedestalw2 < pedestalwHFMax_ ||
11032  pedestalw3 < pedestalwHFMax_) {
11033  if (mdepth == 1)
11034  h_mapDepth1pedestalw_HF->Fill(double(ieta), double(iphi), 1.);
11035  if (mdepth == 2)
11036  h_mapDepth2pedestalw_HF->Fill(double(ieta), double(iphi), 1.);
11037  }
11038 
11039  if (pedestal0 < pedestalHFMax_ || pedestal1 < pedestalHFMax_ || pedestal2 < pedestalHFMax_ ||
11040  pedestal3 < pedestalHFMax_) {
11041  if (mdepth == 1)
11042  h_mapDepth1pedestal_HF->Fill(double(ieta), double(iphi), 1.);
11043  if (mdepth == 2)
11044  h_mapDepth2pedestal_HF->Fill(double(ieta), double(iphi), 1.);
11045  }
11046 
11047  for (int ii = 0; ii < TSsize; ii++) {
11048  h_pedestal00_HF->Fill(pedestal00->getValue(ii), 1.);
11049  h_gain_HF->Fill(gain->getValue(ii), 1.);
11050  }
11051  h_respcorr_HF->Fill(respcorr->getValue(), 1.);
11052  h_timecorr_HF->Fill(timecorr->getValue(), 1.);
11053  h_lutcorr_HF->Fill(lutcorr->getValue(), 1.);
11054 
11055  } //
11056 
11057  // // // // // // // // // HF ADCAmpl:
11058  if (studyADCAmplHist_) {
11059  h_ADCAmpl_HF->Fill(amplitude, 1.);
11060  h_ADCAmplrest1_HF->Fill(amplitude, 1.);
11061  h_ADCAmplrest6_HF->Fill(amplitude, 1.);
11062 
11063  h_ADCAmplZoom1_HF->Fill(amplitude, 1.);
11064  if (amplitude < ADCAmplHFMin_ || amplitude > ADCAmplHFMax_) {
11066  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11067  if (mdepth == 1)
11068  h_mapDepth1ADCAmpl225_HF->Fill(double(ieta), double(iphi), 1.);
11069  if (mdepth == 2)
11070  h_mapDepth2ADCAmpl225_HF->Fill(double(ieta), double(iphi), 1.);
11071  } // if
11072  // if(amplitude >1500.) averSIGNALoccupancy_HF += 1.;
11073  if (amplitude < 20.) {
11074  if (mdepth == 1)
11075  h_mapDepth1ADCAmpl225Copy_HF->Fill(double(ieta), double(iphi), 1.);
11076  if (mdepth == 2)
11077  h_mapDepth2ADCAmpl225Copy_HF->Fill(double(ieta), double(iphi), 1.);
11078  } // if
11079 
11080  // for averaged values:
11081  if (mdepth == 1)
11082  h_mapDepth1ADCAmpl_HF->Fill(double(ieta), double(iphi), amplitude);
11083  if (mdepth == 2)
11084  h_mapDepth2ADCAmpl_HF->Fill(double(ieta), double(iphi), amplitude);
11085  if (mdepth == 1)
11086  h_mapDepth1ADCAmpl12_HF->Fill(double(ieta), double(iphi), ampl);
11087  if (mdepth == 2)
11088  h_mapDepth2ADCAmpl12_HF->Fill(double(ieta), double(iphi), ampl);
11089 
11090  h_bcnvsamplitude_HF->Fill(float(bcn), amplitude);
11091  h_bcnvsamplitude0_HF->Fill(float(bcn), 1.);
11093  h_orbitNumvsamplitude0_HF->Fill(float(orbitNum), 1.);
11095  sumEstimator1[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude;
11096  } //if(studyADCAmplHist_
11098 
11099  // // // // // // // // // HF TSmean:
11100  if (studyTSmeanShapeHist_) {
11101  h_TSmeanA_HF->Fill(aveamplitude1, 1.);
11102  if (aveamplitude1 < TSmeanHFMin_ || aveamplitude1 > TSmeanHFMax_) {
11104  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11105  if (mdepth == 1)
11106  h_mapDepth1TSmeanA225_HF->Fill(double(ieta), double(iphi), 1.);
11107  if (mdepth == 2)
11108  h_mapDepth2TSmeanA225_HF->Fill(double(ieta), double(iphi), 1.);
11109  } // if
11110  // for averaged values:
11111  if (mdepth == 1)
11112  h_mapDepth1TSmeanA_HF->Fill(double(ieta), double(iphi), aveamplitude1);
11113  if (mdepth == 2)
11114  h_mapDepth2TSmeanA_HF->Fill(double(ieta), double(iphi), aveamplitude1);
11115 
11117  sumEstimator2[sub - 1][mdepth - 1][ieta + 41][iphi] += aveamplitude1;
11118  } //if(studyTSmeanShapeHist_
11120  // // // // // // // // // HF TSmax:
11121  if (studyTSmaxShapeHist_) {
11122  h_TSmaxA_HF->Fill(float(ts_with_max_signal), 1.);
11123  if (ts_with_max_signal < TSpeakHFMin_ || ts_with_max_signal > TSpeakHFMax_) {
11125  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11126  if (mdepth == 1)
11127  h_mapDepth1TSmaxA225_HF->Fill(double(ieta), double(iphi), 1.);
11128  if (mdepth == 2)
11129  h_mapDepth2TSmaxA225_HF->Fill(double(ieta), double(iphi), 1.);
11130  } // if
11131  // for averaged values:
11132  if (mdepth == 1)
11133  h_mapDepth1TSmaxA_HF->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
11134  if (mdepth == 2)
11135  h_mapDepth2TSmaxA_HF->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
11137  sumEstimator3[sub - 1][mdepth - 1][ieta + 41][iphi] += float(ts_with_max_signal);
11138  } //if(studyTSmaxShapeHist_
11140  // // // // // // // // // HF RMS:
11141  if (studyRMSshapeHist_) {
11142  h_Amplitude_HF->Fill(rmsamplitude, 1.);
11143  if (rmsamplitude < rmsHFMin_ || rmsamplitude > rmsHFMax_) {
11145  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11146  if (mdepth == 1)
11147  h_mapDepth1Amplitude225_HF->Fill(double(ieta), double(iphi), 1.);
11148  if (mdepth == 2)
11149  h_mapDepth2Amplitude225_HF->Fill(double(ieta), double(iphi), 1.);
11150  } // if
11151  // for averaged values:
11152  if (mdepth == 1)
11153  h_mapDepth1Amplitude_HF->Fill(double(ieta), double(iphi), rmsamplitude);
11154  if (mdepth == 2)
11155  h_mapDepth2Amplitude_HF->Fill(double(ieta), double(iphi), rmsamplitude);
11157  sumEstimator4[sub - 1][mdepth - 1][ieta + 41][iphi] += rmsamplitude;
11158  } //if(studyRMSshapeHist_)
11160  // // // // // // // // // HF Ratio:
11161  if (studyRatioShapeHist_) {
11162  h_Ampl_HF->Fill(ratio, 1.);
11163  if (ratio < ratioHFMin_ || ratio > ratioHFMax_) {
11165  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11166  if (mdepth == 1)
11167  h_mapDepth1Ampl047_HF->Fill(double(ieta), double(iphi), 1.);
11168  if (mdepth == 2)
11169  h_mapDepth2Ampl047_HF->Fill(double(ieta), double(iphi), 1.);
11170  } //if(ratio
11171  // for averaged values:
11172  if (mdepth == 1)
11173  h_mapDepth1Ampl_HF->Fill(double(ieta), double(iphi), ratio);
11174  if (mdepth == 2)
11175  h_mapDepth2Ampl_HF->Fill(double(ieta), double(iphi), ratio);
11176 
11178  sumEstimator5[sub - 1][mdepth - 1][ieta + 41][iphi] += ratio;
11179  } //if(studyRatioShapeHist_)
11180 
11182  // // // // // // // // // HF DiffAmplitude:
11183  if (studyDiffAmplHist_) {
11184  if (mdepth == 1)
11185  h_mapDepth1AmplE34_HF->Fill(double(ieta), double(iphi), amplitude);
11186  if (mdepth == 2)
11187  h_mapDepth2AmplE34_HF->Fill(double(ieta), double(iphi), amplitude);
11188  } // if(studyDiffAmplHist_)
11189 
11191  if (mdepth == 1)
11192  h_mapDepth1_HF->Fill(double(ieta), double(iphi), 1.);
11193  if (mdepth == 2)
11194  h_mapDepth2_HF->Fill(double(ieta), double(iphi), 1.);
11195 
11196  } //if ( sub == 4 )
11197 
11198  //
11199 }
11200 
11203  CaloSamples toolOriginal; // TS
11204  double tool[100];
11205  DetId detid = qie10df.detid();
11206  HcalDetId hcaldetid = HcalDetId(detid);
11207  int ieta = hcaldetid.ieta();
11208  if (ieta > 0)
11209  ieta -= 1;
11210  int iphi = hcaldetid.iphi() - 1;
11211  int mdepth = hcaldetid.depth();
11212  int sub = hcaldetid.subdet(); // 1-HB, 2-HE (HFQIE10DigiCollection: 4-HF)
11213  nTS = qie10df.samples(); // ----------------------------!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11214  /*
11215  # flag HBHE8 HBHE11 HF8 HF10 comments:
11216  # 0 + + + + all
11217  # 1 + - + - old
11218  # 2 - + - + new (2018)
11219  # 3 - + - + new w/o high depthes
11220  # 4 + - + + 2016fall
11221  # 5 + - + + 2016fall w/o high depthes
11222  # 6 + + - + 2017begin
11223  # 7 + + - + 2017begin w/o high depthes in HEonly
11224  # 8 + + - + 2017begin w/o high depthes
11225  # 9 + + + + all w/o high depthes
11226 */
11227  if (mdepth == 0 || sub != 4)
11228  return;
11229  if (mdepth > 2 && flagupgradeqie1011_ == 3)
11230  return;
11231  if (mdepth > 2 && flagupgradeqie1011_ == 5)
11232  return;
11233  if (mdepth > 2 && flagupgradeqie1011_ == 8)
11234  return;
11235  if (mdepth > 2 && flagupgradeqie1011_ == 9)
11236  return;
11238  const HcalPedestal* pedestal00 = conditions->getPedestal(hcaldetid);
11239  const HcalGain* gain = conditions->getGain(hcaldetid);
11240  const HcalRespCorr* respcorr = conditions->getHcalRespCorr(hcaldetid);
11241  const HcalTimeCorr* timecorr = conditions->getHcalTimeCorr(hcaldetid);
11242  const HcalLUTCorr* lutcorr = conditions->getHcalLUTCorr(hcaldetid);
11243  const HcalQIECoder* channelCoder = conditions->getHcalCoder(hcaldetid);
11244  const HcalPedestalWidth* pedw = conditions->getPedestalWidth(hcaldetid);
11245  HcalCoderDb coder(*channelCoder, *shape);
11246  if (useADCfC_)
11247  coder.adc2fC(qie10df, toolOriginal);
11248  // double noiseADC = qie10df[0].adc();
11250  double pedestalaver9 = 0.;
11251  double pedestalaver4 = 0.;
11252  double pedestal0 = 0.;
11253  double pedestal1 = 0.;
11254  double pedestal2 = 0.;
11255  double pedestal3 = 0.;
11256  double pedestalwaver9 = 0.;
11257  double pedestalwaver4 = 0.;
11258  double pedestalw0 = 0.;
11259  double pedestalw1 = 0.;
11260  double pedestalw2 = 0.;
11261  double pedestalw3 = 0.;
11262  double amplitude = 0.;
11263  double absamplitude = 0.;
11264  double ampl = 0.;
11265  double timew = 0.;
11266  double timeww = 0.;
11267  double max_signal = -100.;
11268  int ts_with_max_signal = -100;
11269  int c0 = 0;
11270  int c1 = 0;
11271  int c2 = 0;
11272  int c3 = 0;
11273  int c4 = 0;
11274  double errorBtype = 0.;
11275 
11276  int TSsize = 3; // HF for Run3
11277  if (nTS != TSsize)
11278  errorBtype = 1.;
11279  TSsize = nTS; // ------------------------!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11280  int flagTS1 = 0;
11281  for (int ii = 0; ii < TSsize; ii++) {
11282  double ampldefault = 0.;
11283  double ampldefault0 = 0.;
11284  double ampldefault1 = 0.;
11285  double ampldefault2 = 0.;
11286  ampldefault0 = adc2fC_QIE10[qie10df[ii].adc()]; // massive
11287  if (useADCfC_)
11288  ampldefault1 = toolOriginal[ii]; //adcfC
11289  ampldefault2 = qie10df[ii].adc(); //ADCcounts
11290  if (useADCmassive_) {
11291  ampldefault = ampldefault0;
11292  }
11293  if (useADCfC_) {
11294  ampldefault = ampldefault1;
11295  }
11296  if (useADCcounts_) {
11297  ampldefault = ampldefault2;
11298  }
11299 
11300  int capid = (qie10df[ii]).capid();
11301  double pedestal = pedestal00->getValue(capid);
11302  double pedestalw = pedw->getSigma(capid, capid);
11303 
11305  ampldefault -= pedestal; // pedestal subtraction
11306 
11307  tool[ii] = ampldefault;
11308 
11309  pedestalaver9 += pedestal;
11310  pedestalwaver9 += pedestalw * pedestalw;
11311 
11312  if (capid == 0 && c0 == 0) {
11313  c0++;
11314  c4++;
11315  pedestalaver4 += pedestal;
11316  pedestal0 = pedestal;
11317  pedestalw0 = pedestalw;
11318  pedestalwaver4 += pedestalw * pedestalw;
11319  }
11320 
11321  if (capid == 1 && c1 == 0) {
11322  c1++;
11323  c4++;
11324  pedestalaver4 += pedestal;
11325  pedestal1 = pedestal;
11326  pedestalw1 = pedestalw;
11327  pedestalwaver4 += pedestalw * pedestalw;
11328  }
11329  if (capid == 2 && c2 == 0) {
11330  c2++;
11331  c4++;
11332  pedestalaver4 += pedestal;
11333  pedestal2 = pedestal;
11334  pedestalw2 = pedestalw;
11335  pedestalwaver4 += pedestalw * pedestalw;
11336  }
11337  if (capid == 3 && c3 == 0) {
11338  c3++;
11339  c4++;
11340  pedestalaver4 += pedestal;
11341  pedestal3 = pedestal;
11342  pedestalw3 = pedestalw;
11343  pedestalwaver4 += pedestalw * pedestalw;
11344  }
11345 
11346  if (max_signal < ampldefault) {
11347  max_signal = ampldefault;
11348  ts_with_max_signal = ii;
11349  }
11350  amplitude += ampldefault; //
11351  absamplitude += abs(ampldefault); //
11353  timew += (ii + 1) * abs(ampldefault);
11354  timeww += (ii + 1) * ampldefault;
11355  if (ii == 1 && ampldefault > 0.)
11356  flagTS1 = 1;
11357  } //for 1
11359  // sub=4 HF
11360  if (sub == 4) {
11361  amplitudechannel0[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.; // 0-neta ; 0-71 HF
11362  amplitudechannel[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude; // 0-neta ; 0-71 HF
11363  amplitudechannel2[sub - 1][mdepth - 1][ieta + 41][iphi] += pow(amplitude, 2); // 0-neta ; 0-71 HF
11364  } // just in case against any violations
11365 
11366  pedestalaver9 /= TSsize;
11367  pedestalaver4 /= c4;
11368  pedestalwaver9 = sqrt(pedestalwaver9 / TSsize);
11369  pedestalwaver4 = sqrt(pedestalwaver4 / c4);
11370 
11371  // ------------ to get signal in TS: -2 max +1 ------------
11372  if (ts_with_max_signal > -1 && ts_with_max_signal < TSsize)
11373  ampl = tool[ts_with_max_signal];
11374  if (ts_with_max_signal + 2 > -1 && ts_with_max_signal + 2 < TSsize)
11375  ampl += tool[ts_with_max_signal + 2];
11376  if (ts_with_max_signal + 1 > -1 && ts_with_max_signal + 1 < TSsize)
11377  ampl += tool[ts_with_max_signal + 1];
11378  if (ts_with_max_signal - 1 > -1 && ts_with_max_signal - 1 < TSsize)
11379  ampl += tool[ts_with_max_signal - 1];
11380 
11381  double ratio = 0.;
11382  // if(amplallTS != 0.) ratio = ampl/amplallTS;
11383  if (amplitude != 0.)
11384  ratio = ampl / amplitude;
11385  if (ratio < 0. || ratio > 1.02)
11386  ratio = 0.;
11387  double aveamplitude = 0.;
11388  double aveamplitudew = 0.;
11389  if (absamplitude > 0 && timew > 0)
11390  aveamplitude = timew / absamplitude; // average_TS +1
11391  if (amplitude > 0 && timeww > 0)
11392  aveamplitudew = timeww / amplitude; // average_TS +1
11393 
11394  double rmsamp = 0.;
11395  int error = 0;
11396  bool anycapid = true;
11397  int lastcapid = 0;
11398  int capid = 0;
11399  for (int ii = 0; ii < TSsize; ii++) {
11400  double aaaaaa = (ii + 1) - aveamplitudew;
11401  double aaaaaa2 = aaaaaa * aaaaaa;
11402  double ampldefault = tool[ii];
11403  rmsamp += (aaaaaa2 * ampldefault); // fC
11404  capid = (qie10df[ii]).capid();
11405  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
11406  anycapid = false;
11407  }
11408  lastcapid = capid;
11409  } //for 2
11410 
11411  if (!anycapid)
11412  error = 1;
11413  double rmsamplitude = 0.;
11414  if ((amplitude > 0 && rmsamp > 0) || (amplitude < 0 && rmsamp < 0))
11415  rmsamplitude = sqrt(rmsamp / amplitude);
11416  double aveamplitude1 = aveamplitude - 1; // means iTS=0-9, so bad is iTS=0 and 9
11417 
11418  // CapIdErrors end /////////////////////////////////////////////////////////
11419  // AZ 1.10.2015:
11420  if (error == 1) {
11421  if (sub == 4 && mdepth == 1)
11423  if (sub == 4 && mdepth == 2)
11425  }
11426  if (error != 1) {
11427  if (sub == 4 && mdepth == 1)
11429  if (sub == 4 && mdepth == 2)
11431  }
11432 
11433  if (sub == 4) {
11434  // bad_channels with C,A,W,P,pW,
11435  if (error == 1 || amplitude < ADCAmplHFMin_ || amplitude > ADCAmplHFMax_ || rmsamplitude < rmsHFMin_ ||
11436  rmsamplitude > rmsHFMax_ || pedestal0 < pedestalHFMax_ || pedestal1 < pedestalHFMax_ ||
11437  pedestal2 < pedestalHFMax_ || pedestal3 < pedestalHFMax_ || pedestalw0 < pedestalwHFMax_ ||
11438  pedestalw1 < pedestalwHFMax_ || pedestalw2 < pedestalwHFMax_ || pedestalw3 < pedestalwHFMax_
11439 
11440  ) {
11441  for (int ii = 0; ii < TSsize; ii++) {
11442  double ampldefault = tool[ii];
11443  h_shape_bad_channels_HF->Fill(float(ii), ampldefault);
11444  h_shape0_bad_channels_HF->Fill(float(ii), 1.);
11445  }
11446  }
11447  // good_channels with C,A,W,P,pW,
11448  else {
11449  for (int ii = 0; ii < TSsize; ii++) {
11450  double ampldefault = tool[ii];
11451  h_shape_good_channels_HF->Fill(float(ii), ampldefault);
11452  h_shape0_good_channels_HF->Fill(float(ii), 1.);
11453  }
11454  }
11455  } // sub HFQIE10
11457  sum0Estimator[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
11458  // for Error B-type
11459  sumEstimator6[sub - 1][mdepth - 1][ieta + 41][iphi] += errorBtype;
11460  sumEstimator0[sub - 1][mdepth - 1][ieta + 41][iphi] += pedestal0; // Pedestals
11461  // HFQIE10
11462  if (sub == 4) {
11463  // // // // // // // // // HFQIE10 PedestalCorrelations :
11465  double mypedestal = pedestal0;
11466  double mypedestalw = pedestalw0;
11467  h2_pedvsampl_HF->Fill(mypedestal, amplitude);
11468  h2_pedwvsampl_HF->Fill(mypedestalw, amplitude);
11469  h_pedvsampl_HF->Fill(mypedestal, amplitude);
11470  h_pedwvsampl_HF->Fill(mypedestalw, amplitude);
11471  h_pedvsampl0_HF->Fill(mypedestal, 1.);
11472  h_pedwvsampl0_HF->Fill(mypedestalw, 1.);
11473  } //
11474  // // // // // // // // // HFQIE10 Pedestals:
11475  if (studyPedestalsHist_) {
11476  h_pedestal0_HF->Fill(pedestal0, 1.);
11477  h_pedestal1_HF->Fill(pedestal1, 1.);
11478  h_pedestal2_HF->Fill(pedestal2, 1.);
11479  h_pedestal3_HF->Fill(pedestal3, 1.);
11480  h_pedestalaver4_HF->Fill(pedestalaver4, 1.);
11481  h_pedestalaver9_HF->Fill(pedestalaver9, 1.);
11482  h_pedestalw0_HF->Fill(pedestalw0, 1.);
11483  h_pedestalw1_HF->Fill(pedestalw1, 1.);
11484  h_pedestalw2_HF->Fill(pedestalw2, 1.);
11485  h_pedestalw3_HF->Fill(pedestalw3, 1.);
11486  h_pedestalwaver4_HF->Fill(pedestalwaver4, 1.);
11487  h_pedestalwaver9_HF->Fill(pedestalwaver9, 1.);
11488  // for averaged values:
11489  if (mdepth == 1) {
11490  h_mapDepth1Ped0_HF->Fill(double(ieta), double(iphi), pedestal0);
11491  h_mapDepth1Ped1_HF->Fill(double(ieta), double(iphi), pedestal1);
11492  h_mapDepth1Ped2_HF->Fill(double(ieta), double(iphi), pedestal2);
11493  h_mapDepth1Ped3_HF->Fill(double(ieta), double(iphi), pedestal3);
11494  h_mapDepth1Pedw0_HF->Fill(double(ieta), double(iphi), pedestalw0);
11495  h_mapDepth1Pedw1_HF->Fill(double(ieta), double(iphi), pedestalw1);
11496  h_mapDepth1Pedw2_HF->Fill(double(ieta), double(iphi), pedestalw2);
11497  h_mapDepth1Pedw3_HF->Fill(double(ieta), double(iphi), pedestalw3);
11498  }
11499  if (mdepth == 2) {
11500  h_mapDepth2Ped0_HF->Fill(double(ieta), double(iphi), pedestal0);
11501  h_mapDepth2Ped1_HF->Fill(double(ieta), double(iphi), pedestal1);
11502  h_mapDepth2Ped2_HF->Fill(double(ieta), double(iphi), pedestal2);
11503  h_mapDepth2Ped3_HF->Fill(double(ieta), double(iphi), pedestal3);
11504  h_mapDepth2Pedw0_HF->Fill(double(ieta), double(iphi), pedestalw0);
11505  h_mapDepth2Pedw1_HF->Fill(double(ieta), double(iphi), pedestalw1);
11506  h_mapDepth2Pedw2_HF->Fill(double(ieta), double(iphi), pedestalw2);
11507  h_mapDepth2Pedw3_HF->Fill(double(ieta), double(iphi), pedestalw3);
11508  }
11509 
11510  if (pedestalw0 < pedestalwHFMax_ || pedestalw1 < pedestalwHFMax_ || pedestalw2 < pedestalwHFMax_ ||
11511  pedestalw3 < pedestalwHFMax_) {
11512  if (mdepth == 1)
11513  h_mapDepth1pedestalw_HF->Fill(double(ieta), double(iphi), 1.);
11514  if (mdepth == 2)
11515  h_mapDepth2pedestalw_HF->Fill(double(ieta), double(iphi), 1.);
11516  if (mdepth == 3)
11517  h_mapDepth3pedestalw_HF->Fill(double(ieta), double(iphi), 1.);
11518  if (mdepth == 4)
11519  h_mapDepth4pedestalw_HF->Fill(double(ieta), double(iphi), 1.);
11520  }
11521 
11522  if (pedestal0 < pedestalHFMax_ || pedestal1 < pedestalHFMax_ || pedestal2 < pedestalHFMax_ ||
11523  pedestal3 < pedestalHFMax_) {
11524  if (mdepth == 1)
11525  h_mapDepth1pedestal_HF->Fill(double(ieta), double(iphi), 1.);
11526  if (mdepth == 2)
11527  h_mapDepth2pedestal_HF->Fill(double(ieta), double(iphi), 1.);
11528  if (mdepth == 3)
11529  h_mapDepth3pedestal_HF->Fill(double(ieta), double(iphi), 1.);
11530  if (mdepth == 4)
11531  h_mapDepth4pedestal_HF->Fill(double(ieta), double(iphi), 1.);
11532  }
11533 
11534  for (int ii = 0; ii < TSsize; ii++) {
11535  h_pedestal00_HF->Fill(pedestal00->getValue(ii), 1.);
11536  h_gain_HF->Fill(gain->getValue(ii), 1.);
11537  }
11538  h_respcorr_HF->Fill(respcorr->getValue(), 1.);
11539  h_timecorr_HF->Fill(timecorr->getValue(), 1.);
11540  h_lutcorr_HF->Fill(lutcorr->getValue(), 1.);
11541 
11542  } //
11543 
11544  // // // // // // // // // HFQIE10 ADCAmpl:
11545  if (studyADCAmplHist_) {
11546  h_ADCAmpl_HF->Fill(amplitude, 1.);
11547  h_ADCAmplrest1_HF->Fill(amplitude, 1.);
11548  h_ADCAmplrest6_HF->Fill(amplitude, 1.);
11549 
11550  h_ADCAmplZoom1_HF->Fill(amplitude, 1.);
11551  if (amplitude < ADCAmplHFMin_ || amplitude > ADCAmplHFMax_) {
11553  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11554  if (mdepth == 1)
11555  h_mapDepth1ADCAmpl225_HF->Fill(double(ieta), double(iphi), 1.);
11556  if (mdepth == 2)
11557  h_mapDepth2ADCAmpl225_HF->Fill(double(ieta), double(iphi), 1.);
11558  if (mdepth == 3)
11559  h_mapDepth3ADCAmpl225_HF->Fill(double(ieta), double(iphi), 1.);
11560  if (mdepth == 4)
11561  h_mapDepth4ADCAmpl225_HF->Fill(double(ieta), double(iphi), 1.);
11562  } // if
11563  // if(amplitude >1500.) averSIGNALoccupancy_HF += 1.;
11564  if (amplitude < 20.) {
11565  if (mdepth == 1)
11566  h_mapDepth1ADCAmpl225Copy_HF->Fill(double(ieta), double(iphi), 1.);
11567  if (mdepth == 2)
11568  h_mapDepth2ADCAmpl225Copy_HF->Fill(double(ieta), double(iphi), 1.);
11569  if (mdepth == 3)
11570  h_mapDepth3ADCAmpl225Copy_HF->Fill(double(ieta), double(iphi), 1.);
11571  if (mdepth == 4)
11572  h_mapDepth4ADCAmpl225Copy_HF->Fill(double(ieta), double(iphi), 1.);
11573  } // if
11574 
11575  // for averaged values:
11576  if (mdepth == 1)
11577  h_mapDepth1ADCAmpl_HF->Fill(double(ieta), double(iphi), amplitude);
11578  if (mdepth == 2)
11579  h_mapDepth2ADCAmpl_HF->Fill(double(ieta), double(iphi), amplitude);
11580  if (mdepth == 3)
11581  h_mapDepth3ADCAmpl_HF->Fill(double(ieta), double(iphi), amplitude);
11582  if (mdepth == 4)
11583  h_mapDepth4ADCAmpl_HF->Fill(double(ieta), double(iphi), amplitude);
11584  if (mdepth == 1)
11585  h_mapDepth1ADCAmpl12_HF->Fill(double(ieta), double(iphi), ampl);
11586  if (mdepth == 2)
11587  h_mapDepth2ADCAmpl12_HF->Fill(double(ieta), double(iphi), ampl);
11588  if (mdepth == 3)
11589  h_mapDepth3ADCAmpl12_HF->Fill(double(ieta), double(iphi), ampl);
11590  if (mdepth == 4)
11591  h_mapDepth4ADCAmpl12_HF->Fill(double(ieta), double(iphi), ampl);
11592 
11593  h_bcnvsamplitude_HF->Fill(float(bcn), amplitude);
11594  h_bcnvsamplitude0_HF->Fill(float(bcn), 1.);
11596  h_orbitNumvsamplitude0_HF->Fill(float(orbitNum), 1.);
11598  sumEstimator1[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude;
11599  } //if(studyADCAmplHist_
11600  // // // // // // // // // HFQIE10 TSmean:
11601  if (studyTSmeanShapeHist_) {
11602  h_TSmeanA_HF->Fill(aveamplitude1, 1.);
11603  if (aveamplitude1 < TSmeanHFMin_ || aveamplitude1 > TSmeanHFMax_) {
11605  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11606  if (mdepth == 1)
11607  h_mapDepth1TSmeanA225_HF->Fill(double(ieta), double(iphi), 1.);
11608  if (mdepth == 2)
11609  h_mapDepth2TSmeanA225_HF->Fill(double(ieta), double(iphi), 1.);
11610  if (mdepth == 3)
11611  h_mapDepth3TSmeanA225_HF->Fill(double(ieta), double(iphi), 1.);
11612  if (mdepth == 4)
11613  h_mapDepth4TSmeanA225_HF->Fill(double(ieta), double(iphi), 1.);
11614  } // if
11615  // for averaged values:
11616  if (mdepth == 1)
11617  h_mapDepth1TSmeanA_HF->Fill(double(ieta), double(iphi), aveamplitude1);
11618  if (mdepth == 2)
11619  h_mapDepth2TSmeanA_HF->Fill(double(ieta), double(iphi), aveamplitude1);
11620  if (mdepth == 3)
11621  h_mapDepth3TSmeanA_HF->Fill(double(ieta), double(iphi), aveamplitude1);
11622  if (mdepth == 4)
11623  h_mapDepth4TSmeanA_HF->Fill(double(ieta), double(iphi), aveamplitude1);
11624 
11626  sumEstimator2[sub - 1][mdepth - 1][ieta + 41][iphi] += aveamplitude1;
11627  } //if(studyTSmeanShapeHist_
11629  // // // // // // // // // HFQIE10 TSmax:
11630  if (studyTSmaxShapeHist_) {
11631  h_TSmaxA_HF->Fill(float(ts_with_max_signal), 1.);
11632  if (ts_with_max_signal < TSpeakHFMin_ || ts_with_max_signal > TSpeakHFMax_) {
11634  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11635  if (mdepth == 1)
11636  h_mapDepth1TSmaxA225_HF->Fill(double(ieta), double(iphi), 1.);
11637  if (mdepth == 2)
11638  h_mapDepth2TSmaxA225_HF->Fill(double(ieta), double(iphi), 1.);
11639  if (mdepth == 3)
11640  h_mapDepth3TSmaxA225_HF->Fill(double(ieta), double(iphi), 1.);
11641  if (mdepth == 4)
11642  h_mapDepth4TSmaxA225_HF->Fill(double(ieta), double(iphi), 1.);
11643  } // if
11644  // for averaged values:
11645  if (mdepth == 1)
11646  h_mapDepth1TSmaxA_HF->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
11647  if (mdepth == 2)
11648  h_mapDepth2TSmaxA_HF->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
11649  if (mdepth == 3)
11650  h_mapDepth3TSmaxA_HF->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
11651  if (mdepth == 4)
11652  h_mapDepth4TSmaxA_HF->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
11653 
11655  sumEstimator3[sub - 1][mdepth - 1][ieta + 41][iphi] += float(ts_with_max_signal);
11656  } //if(studyTSmaxShapeHist_
11658  // // // // // // // // // HFQIE10 RMS:
11659  if (studyRMSshapeHist_) {
11660  h_Amplitude_HF->Fill(rmsamplitude, 1.);
11661  if (rmsamplitude < rmsHFMin_ || rmsamplitude > rmsHFMax_) {
11663  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11664  if (mdepth == 1)
11665  h_mapDepth1Amplitude225_HF->Fill(double(ieta), double(iphi), 1.);
11666  if (mdepth == 2)
11667  h_mapDepth2Amplitude225_HF->Fill(double(ieta), double(iphi), 1.);
11668  if (mdepth == 3)
11669  h_mapDepth3Amplitude225_HF->Fill(double(ieta), double(iphi), 1.);
11670  if (mdepth == 4)
11671  h_mapDepth4Amplitude225_HF->Fill(double(ieta), double(iphi), 1.);
11672  } // if
11673  // for averaged values:
11674 
11675  if (mdepth == 1)
11676  h_mapDepth1Amplitude_HF->Fill(double(ieta), double(iphi), rmsamplitude);
11677  if (mdepth == 2)
11678  h_mapDepth2Amplitude_HF->Fill(double(ieta), double(iphi), rmsamplitude);
11679  if (mdepth == 3)
11680  h_mapDepth3Amplitude_HF->Fill(double(ieta), double(iphi), rmsamplitude);
11681  if (mdepth == 4)
11682  h_mapDepth4Amplitude_HF->Fill(double(ieta), double(iphi), rmsamplitude);
11684  sumEstimator4[sub - 1][mdepth - 1][ieta + 41][iphi] += rmsamplitude;
11685  } //if(studyRMSshapeHist_)
11687  // // // // // // // // // HFQIE10 Ratio:
11688  if (studyRatioShapeHist_) {
11689  h_Ampl_HF->Fill(ratio, 1.);
11690  if (ratio < ratioHFMin_ || ratio > ratioHFMax_) {
11692  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
11693  if (mdepth == 1)
11694  h_mapDepth1Ampl047_HF->Fill(double(ieta), double(iphi), 1.);
11695  if (mdepth == 2)
11696  h_mapDepth2Ampl047_HF->Fill(double(ieta), double(iphi), 1.);
11697  if (mdepth == 3)
11698  h_mapDepth3Ampl047_HF->Fill(double(ieta), double(iphi), 1.);
11699  if (mdepth == 4)
11700  h_mapDepth4Ampl047_HF->Fill(double(ieta), double(iphi), 1.);
11701  } //if(ratio
11702  // for averaged values:
11703  if (mdepth == 1)
11704  h_mapDepth1Ampl_HF->Fill(double(ieta), double(iphi), ratio);
11705  if (mdepth == 2)
11706  h_mapDepth2Ampl_HF->Fill(double(ieta), double(iphi), ratio);
11707  if (mdepth == 3)
11708  h_mapDepth3Ampl_HF->Fill(double(ieta), double(iphi), ratio);
11709  if (mdepth == 4)
11710  h_mapDepth4Ampl_HF->Fill(double(ieta), double(iphi), ratio);
11711 
11713  sumEstimator5[sub - 1][mdepth - 1][ieta + 41][iphi] += ratio;
11714  } //if(studyRatioShapeHist_)
11715 
11717  // // // // // // // // // HFQIE10 DiffAmplitude:
11718  if (studyDiffAmplHist_) {
11719  if (mdepth == 1)
11720  h_mapDepth1AmplE34_HF->Fill(double(ieta), double(iphi), amplitude);
11721  if (mdepth == 2)
11722  h_mapDepth2AmplE34_HF->Fill(double(ieta), double(iphi), amplitude);
11723  if (mdepth == 3)
11724  h_mapDepth3AmplE34_HF->Fill(double(ieta), double(iphi), amplitude);
11725  if (mdepth == 4)
11726  h_mapDepth4AmplE34_HF->Fill(double(ieta), double(iphi), amplitude);
11727  } // if(studyDiffAmplHist_)
11728 
11730  if (mdepth == 1)
11731  h_mapDepth1_HF->Fill(double(ieta), double(iphi), 1.);
11732  if (mdepth == 2)
11733  h_mapDepth2_HF->Fill(double(ieta), double(iphi), 1.);
11734  if (mdepth == 3)
11735  h_mapDepth3_HF->Fill(double(ieta), double(iphi), 1.);
11736  if (mdepth == 4)
11737  h_mapDepth4_HF->Fill(double(ieta), double(iphi), 1.);
11738 
11739  if (flagTS1 == 1) {
11740  if (mdepth == 1)
11741  h_mapDepth1TS1_HF->Fill(double(ieta), double(iphi), 1.);
11742  if (mdepth == 2)
11743  h_mapDepth2TS1_HF->Fill(double(ieta), double(iphi), 1.);
11744  if (mdepth == 3)
11745  h_mapDepth3TS1_HF->Fill(double(ieta), double(iphi), 1.);
11746  if (mdepth == 4)
11747  h_mapDepth4TS1_HF->Fill(double(ieta), double(iphi), 1.);
11748  } // for TS = 1
11749 
11750  } //if ( sub == 4 )
11751 
11752  //
11753 }
11754 
11757  CaloSamples toolOriginal; // TS
11758  double tool[100];
11759  HcalDetId cell(digiItr->id());
11760  int mdepth = cell.depth();
11761  int iphi = cell.iphi() - 1; // 0-71
11762  int ieta = cell.ieta();
11763  if (ieta > 0)
11764  ieta -= 1; //-41 +41
11765  int sub = cell.subdet(); // (HODigiCollection: 3-HO)
11766  const HcalPedestal* pedestal00 = conditions->getPedestal(cell);
11767  const HcalGain* gain = conditions->getGain(cell);
11768  const HcalRespCorr* respcorr = conditions->getHcalRespCorr(cell);
11769  const HcalTimeCorr* timecorr = conditions->getHcalTimeCorr(cell);
11770  const HcalLUTCorr* lutcorr = conditions->getHcalLUTCorr(cell);
11771  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
11772  const HcalPedestalWidth* pedw = conditions->getPedestalWidth(cell);
11773  HcalCoderDb coder(*channelCoder, *shape);
11774  if (useADCfC_)
11775  coder.adc2fC(*digiItr, toolOriginal);
11776  double pedestalaver9 = 0.;
11777  double pedestalaver4 = 0.;
11778  double pedestal0 = 0.;
11779  double pedestal1 = 0.;
11780  double pedestal2 = 0.;
11781  double pedestal3 = 0.;
11782  double pedestalwaver9 = 0.;
11783  double pedestalwaver4 = 0.;
11784  double pedestalw0 = 0.;
11785  double pedestalw1 = 0.;
11786  double pedestalw2 = 0.;
11787  double pedestalw3 = 0.;
11788  double amplitude = 0.;
11789  double absamplitude = 0.;
11790  double ampl = 0.;
11791  double timew = 0.;
11792  double timeww = 0.;
11793  double max_signal = -100.;
11794  int ts_with_max_signal = -100;
11795  int c0 = 0;
11796  int c1 = 0;
11797  int c2 = 0;
11798  int c3 = 0;
11799  int c4 = 0;
11800  double errorBtype = 0.;
11801  int TSsize = 10; //HO
11802  if ((*digiItr).size() != TSsize)
11803  errorBtype = 1.;
11804  TSsize = digiItr->size();
11805  int flagTS012 = 0;
11806  for (int ii = 0; ii < TSsize; ii++) {
11807  double ampldefault = 0.;
11808  double ampldefault0 = 0.;
11809  double ampldefault1 = 0.;
11810  double ampldefault2 = 0.;
11811  ampldefault0 = adc2fC[digiItr->sample(ii).adc()]; // massive
11812  if (useADCfC_)
11813  ampldefault1 = toolOriginal[ii]; //adcfC
11814  ampldefault2 = (*digiItr)[ii].adc(); //ADCcounts
11815  if (useADCmassive_) {
11816  ampldefault = ampldefault0;
11817  }
11818  if (useADCfC_) {
11819  ampldefault = ampldefault1;
11820  }
11821  if (useADCcounts_) {
11822  ampldefault = ampldefault2;
11823  }
11824  int capid = ((*digiItr)[ii]).capid();
11825  double pedestal = pedestal00->getValue(capid);
11826  double pedestalw = pedw->getSigma(capid, capid);
11828  ampldefault -= pedestal; // pedestal subtraction
11829  tool[ii] = ampldefault;
11830  pedestalaver9 += pedestal;
11831  pedestalwaver9 += pedestalw * pedestalw;
11832  if (capid == 0 && c0 == 0) {
11833  c0++;
11834  c4++;
11835  pedestalaver4 += pedestal;
11836  pedestal0 = pedestal;
11837  pedestalw0 = pedestalw;
11838  pedestalwaver4 += pedestalw * pedestalw;
11839  }
11840  if (capid == 1 && c1 == 0) {
11841  c1++;
11842  c4++;
11843  pedestalaver4 += pedestal;
11844  pedestal1 = pedestal;
11845  pedestalw1 = pedestalw;
11846  pedestalwaver4 += pedestalw * pedestalw;
11847  }
11848  if (capid == 2 && c2 == 0) {
11849  c2++;
11850  c4++;
11851  pedestalaver4 += pedestal;
11852  pedestal2 = pedestal;
11853  pedestalw2 = pedestalw;
11854  pedestalwaver4 += pedestalw * pedestalw;
11855  }
11856  if (capid == 3 && c3 == 0) {
11857  c3++;
11858  c4++;
11859  pedestalaver4 += pedestal;
11860  pedestal3 = pedestal;
11861  pedestalw3 = pedestalw;
11862  pedestalwaver4 += pedestalw * pedestalw;
11863  }
11864 
11865  if (max_signal < ampldefault) {
11866  max_signal = ampldefault;
11867  ts_with_max_signal = ii;
11868  }
11869  amplitude += ampldefault;
11870  absamplitude += abs(ampldefault);
11872  if (flagcpuoptimization_ == 0) {
11873  }
11874  timew += (ii + 1) * abs(ampldefault);
11875  timeww += (ii + 1) * ampldefault;
11876  if (ii < 3 && ampldefault > 0.)
11877  flagTS012 = 1;
11878  } //for 1
11879  amplitudechannel[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude; // 0-neta ; 0-71 HO
11880 
11881  pedestalaver9 /= TSsize;
11882  pedestalaver4 /= c4;
11883  pedestalwaver9 = sqrt(pedestalwaver9 / TSsize);
11884  pedestalwaver4 = sqrt(pedestalwaver4 / c4);
11885  if (ts_with_max_signal > -1 && ts_with_max_signal < 10)
11886  ampl = tool[ts_with_max_signal];
11887  if (ts_with_max_signal + 2 > -1 && ts_with_max_signal + 2 < 10)
11888  ampl += tool[ts_with_max_signal + 2];
11889  if (ts_with_max_signal + 1 > -1 && ts_with_max_signal + 1 < 10)
11890  ampl += tool[ts_with_max_signal + 1];
11891  if (ts_with_max_signal - 1 > -1 && ts_with_max_signal - 1 < 10)
11892  ampl += tool[ts_with_max_signal - 1];
11893  double ratio = 0.;
11894  if (amplitude != 0.)
11895  ratio = ampl / amplitude;
11896  if (ratio < 0. || ratio > 1.04)
11897  ratio = 0.;
11898  double aveamplitude = 0.;
11899  double aveamplitudew = 0.;
11900  if (absamplitude > 0 && timew > 0)
11901  aveamplitude = timew / absamplitude; // average_TS +1
11902  if (amplitude > 0 && timeww > 0)
11903  aveamplitudew = timeww / amplitude; // average_TS +1
11904  double rmsamp = 0.;
11905  int error = 0;
11906  bool anycapid = true;
11907  bool anyer = false;
11908  bool anydv = true;
11909  int lastcapid = 0;
11910  int capid = 0;
11911  for (int ii = 0; ii < TSsize; ii++) {
11912  double aaaaaa = (ii + 1) - aveamplitudew;
11913  double aaaaaa2 = aaaaaa * aaaaaa;
11914  double ampldefault = tool[ii];
11915  rmsamp += (aaaaaa2 * ampldefault); // fC
11916  capid = ((*digiItr)[ii]).capid();
11917  bool er = (*digiItr)[ii].er(); // error
11918  bool dv = (*digiItr)[ii].dv(); // valid data
11919  if (ii != 0 && ((lastcapid + 1) % 4) != capid) {
11920  anycapid = false;
11921  }
11922  lastcapid = capid;
11923  if (er) {
11924  anyer = true;
11925  }
11926  if (!dv) {
11927  anydv = false;
11928  }
11929  } //for 2
11930 
11931  if (!anycapid || anyer || !anydv)
11932  error = 1;
11933  double rmsamplitude = 0.;
11934  if ((amplitude > 0 && rmsamp > 0) || (amplitude < 0 && rmsamp < 0))
11935  rmsamplitude = sqrt(rmsamp / amplitude);
11936  double aveamplitude1 = aveamplitude - 1; // means iTS=0-9, so bad is iTS=0 and 9
11937  if (error == 1) {
11938  if (sub == 3 && mdepth == 4)
11940  }
11941  if (error != 1) {
11942  if (sub == 3 && mdepth == 4)
11944  }
11945 
11946  if (sub == 3) {
11947  if (error == 1 || amplitude < ADCAmplHOMin_ || amplitude > ADCAmplHOMax_ || rmsamplitude < rmsHOMin_ ||
11948  rmsamplitude > rmsHOMax_ || pedestal0 < pedestalHOMax_ || pedestal1 < pedestalHOMax_ ||
11949  pedestal2 < pedestalHOMax_ || pedestal3 < pedestalHOMax_ || pedestalw0 < pedestalwHOMax_ ||
11950  pedestalw1 < pedestalwHOMax_ || pedestalw2 < pedestalwHOMax_ || pedestalw3 < pedestalwHOMax_
11951 
11952  ) {
11953  for (int ii = 0; ii < TSsize; ii++) {
11954  double ampldefault = tool[ii];
11955  h_shape_bad_channels_HO->Fill(float(ii), ampldefault);
11956  h_shape0_bad_channels_HO->Fill(float(ii), 1.);
11957  }
11958  } else {
11959  for (int ii = 0; ii < TSsize; ii++) {
11960  double ampldefault = tool[ii];
11961  h_shape_good_channels_HO->Fill(float(ii), ampldefault);
11962  h_shape0_good_channels_HO->Fill(float(ii), 1.);
11963  }
11964  }
11965  } // sub HO
11967  sum0Estimator[sub - 1][mdepth - 1][ieta + 41][iphi] += 1.;
11968  // for Error B-type
11969  sumEstimator6[sub - 1][mdepth - 1][ieta + 41][iphi] += errorBtype;
11970  sumEstimator0[sub - 1][mdepth - 1][ieta + 41][iphi] += pedestal0; //Pedestals
11971  // HO
11972  if (sub == 3) {
11974  double mypedestal = pedestal0;
11975  double mypedestalw = pedestalw0;
11976  h2_pedvsampl_HO->Fill(mypedestal, amplitude);
11977  h2_pedwvsampl_HO->Fill(mypedestalw, amplitude);
11978  h_pedvsampl_HO->Fill(mypedestal, amplitude);
11979  h_pedwvsampl_HO->Fill(mypedestalw, amplitude);
11980  h_pedvsampl0_HO->Fill(mypedestal, 1.);
11981  h_pedwvsampl0_HO->Fill(mypedestalw, 1.);
11982  } //
11983  // // // // // // // // // HO Pedestals:
11984  if (studyPedestalsHist_) {
11985  h_pedestal0_HO->Fill(pedestal0, 1.);
11986  h_pedestal1_HO->Fill(pedestal1, 1.);
11987  h_pedestal2_HO->Fill(pedestal2, 1.);
11988  h_pedestal3_HO->Fill(pedestal3, 1.);
11989  h_pedestalaver4_HO->Fill(pedestalaver4, 1.);
11990  h_pedestalaver9_HO->Fill(pedestalaver9, 1.);
11991  h_pedestalw0_HO->Fill(pedestalw0, 1.);
11992  h_pedestalw1_HO->Fill(pedestalw1, 1.);
11993  h_pedestalw2_HO->Fill(pedestalw2, 1.);
11994  h_pedestalw3_HO->Fill(pedestalw3, 1.);
11995  h_pedestalwaver4_HO->Fill(pedestalwaver4, 1.);
11996  h_pedestalwaver9_HO->Fill(pedestalwaver9, 1.);
11997  // for averaged values:
11998  if (mdepth == 4) {
11999  h_mapDepth4Ped0_HO->Fill(double(ieta), double(iphi), pedestal0);
12000  h_mapDepth4Ped1_HO->Fill(double(ieta), double(iphi), pedestal1);
12001  h_mapDepth4Ped2_HO->Fill(double(ieta), double(iphi), pedestal2);
12002  h_mapDepth4Ped3_HO->Fill(double(ieta), double(iphi), pedestal3);
12003  h_mapDepth4Pedw0_HO->Fill(double(ieta), double(iphi), pedestalw0);
12004  h_mapDepth4Pedw1_HO->Fill(double(ieta), double(iphi), pedestalw1);
12005  h_mapDepth4Pedw2_HO->Fill(double(ieta), double(iphi), pedestalw2);
12006  h_mapDepth4Pedw3_HO->Fill(double(ieta), double(iphi), pedestalw3);
12007  }
12008  if (pedestalw0 < pedestalwHOMax_ || pedestalw1 < pedestalwHOMax_ || pedestalw2 < pedestalwHOMax_ ||
12009  pedestalw3 < pedestalwHOMax_) {
12010  if (mdepth == 4)
12011  h_mapDepth4pedestalw_HO->Fill(double(ieta), double(iphi), 1.);
12012  }
12013  if (pedestal0 < pedestalHOMax_ || pedestal1 < pedestalHOMax_ || pedestal2 < pedestalHOMax_ ||
12014  pedestal3 < pedestalHOMax_) {
12015  if (mdepth == 4)
12016  h_mapDepth4pedestal_HO->Fill(double(ieta), double(iphi), 1.);
12017  }
12018  for (int ii = 0; ii < TSsize; ii++) {
12019  h_pedestal00_HO->Fill(pedestal00->getValue(ii), 1.);
12020  h_gain_HO->Fill(gain->getValue(ii), 1.);
12021  }
12022  h_respcorr_HO->Fill(respcorr->getValue(), 1.);
12023  h_timecorr_HO->Fill(timecorr->getValue(), 1.);
12024  h_lutcorr_HO->Fill(lutcorr->getValue(), 1.);
12025  } //
12026  // // // // // // // // // HO ADCAmpl:
12027  if (studyADCAmplHist_) {
12028  h_ADCAmpl_HO->Fill(amplitude, 1.);
12029  h_ADCAmplrest1_HO->Fill(amplitude, 1.);
12030  h_ADCAmplrest6_HO->Fill(amplitude, 1.);
12031 
12032  h_ADCAmplZoom1_HO->Fill(amplitude, 1.);
12033  h_ADCAmpl_HO_copy->Fill(amplitude, 1.);
12034  if (amplitude < ADCAmplHOMin_ || amplitude > ADCAmplHOMax_) {
12036  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
12037  if (mdepth == 4)
12038  h_mapDepth4ADCAmpl225_HO->Fill(double(ieta), double(iphi), 1.);
12039  } // if
12040  // if(amplitude >2000.) averSIGNALoccupancy_HO += 1.;
12041 
12042  if (amplitude < 100.) {
12043  if (mdepth == 4)
12044  h_mapDepth4ADCAmpl225Copy_HO->Fill(double(ieta), double(iphi), 1.);
12045  } // if
12046  // for averaged values:
12047  if (mdepth == 4)
12048  h_mapDepth4ADCAmpl_HO->Fill(double(ieta), double(iphi), amplitude);
12049  if (mdepth == 4)
12050  h_mapDepth4ADCAmpl12_HO->Fill(double(ieta), double(iphi), ampl);
12051 
12052  h_bcnvsamplitude_HO->Fill(float(bcn), amplitude);
12053  h_bcnvsamplitude0_HO->Fill(float(bcn), 1.);
12054 
12056  h_orbitNumvsamplitude0_HO->Fill(float(orbitNum), 1.);
12058  sumEstimator1[sub - 1][mdepth - 1][ieta + 41][iphi] += amplitude;
12059  } //if(studyADCAmplHist_
12060  if (studyTSmeanShapeHist_) {
12061  h_TSmeanA_HO->Fill(aveamplitude1, 1.);
12062  if (aveamplitude1 < TSmeanHOMin_ || aveamplitude1 > TSmeanHOMax_) {
12064  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
12065  if (mdepth == 4)
12066  h_mapDepth4TSmeanA225_HO->Fill(double(ieta), double(iphi), 1.);
12067  } // if
12068  if (mdepth == 4)
12069  h_mapDepth4TSmeanA_HO->Fill(double(ieta), double(iphi), aveamplitude1);
12071  sumEstimator2[sub - 1][mdepth - 1][ieta + 41][iphi] += aveamplitude1;
12072  } //if(studyTSmeanShapeHist_
12073  if (studyTSmaxShapeHist_) {
12074  h_TSmaxA_HO->Fill(float(ts_with_max_signal), 1.);
12075  if (ts_with_max_signal < TSpeakHOMin_ || ts_with_max_signal > TSpeakHOMax_) {
12077  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
12078  if (mdepth == 4)
12079  h_mapDepth4TSmaxA225_HO->Fill(double(ieta), double(iphi), 1.);
12080  } // if
12081  // for averaged values:
12082  if (mdepth == 4)
12083  h_mapDepth4TSmaxA_HO->Fill(double(ieta), double(iphi), float(ts_with_max_signal));
12085  sumEstimator3[sub - 1][mdepth - 1][ieta + 41][iphi] += float(ts_with_max_signal);
12086  } //if(studyTSmaxShapeHist_
12087  if (studyRMSshapeHist_) {
12088  h_Amplitude_HO->Fill(rmsamplitude, 1.);
12089  if (rmsamplitude < rmsHOMin_ || rmsamplitude > rmsHOMax_) {
12091  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
12092  if (mdepth == 4)
12093  h_mapDepth4Amplitude225_HO->Fill(double(ieta), double(iphi), 1.);
12094  } // if
12095  if (mdepth == 4)
12096  h_mapDepth4Amplitude_HO->Fill(double(ieta), double(iphi), rmsamplitude);
12098  sumEstimator4[sub - 1][mdepth - 1][ieta + 41][iphi] += rmsamplitude;
12099  } //if(studyRMSshapeHist_)
12100  if (studyRatioShapeHist_) {
12101  h_Ampl_HO->Fill(ratio, 1.);
12102  if (ratio < ratioHOMin_ || ratio > ratioHOMax_) {
12104  ++badchannels[sub - 1][mdepth - 1][ieta + 41][iphi]; // 0-neta ; 0-71
12105  if (mdepth == 4)
12106  h_mapDepth4Ampl047_HO->Fill(double(ieta), double(iphi), 1.);
12107  } //if(ratio
12108  if (mdepth == 4)
12109  h_mapDepth4Ampl_HO->Fill(double(ieta), double(iphi), ratio);
12111  sumEstimator5[sub - 1][mdepth - 1][ieta + 41][iphi] += ratio;
12112  } //if(studyRatioShapeHist_)
12113  if (studyDiffAmplHist_) {
12114  if (mdepth == 4)
12115  h_mapDepth4AmplE34_HO->Fill(double(ieta), double(iphi), amplitude);
12116  } // if(studyDiffAmplHist_)
12117  if (mdepth == 4) {
12118  h_mapDepth4_HO->Fill(double(ieta), double(iphi), 1.);
12119  if (flagTS012 == 1)
12120  h_mapDepth4TS012_HO->Fill(double(ieta), double(iphi), 1.);
12121  }
12122  } //if ( sub == 3 )
12123 }
12124 int CMTRawAnalyzer::getRBX(int& kdet, int& keta, int& kphi) {
12125  int cal_RBX = 0;
12126  if (kdet == 1 || kdet == 2) {
12127  if (kphi == 71)
12128  cal_RBX = 0;
12129  else
12130  cal_RBX = (kphi + 1) / 4;
12131  cal_RBX = cal_RBX + 18 * (keta + 1) / 2;
12132  }
12133  if (kdet == 4) {
12134  cal_RBX = (int)(kphi / 18) + 1;
12135  }
12136  if (kdet == 3) {
12137  if (keta == -2) {
12138  if (kphi == 71)
12139  cal_RBX = 0;
12140  else
12141  cal_RBX = kphi / 12 + 1;
12142  }
12143  if (keta == -1) {
12144  if (kphi == 71)
12145  cal_RBX = 6;
12146  else
12147  cal_RBX = kphi / 12 + 1 + 6;
12148  }
12149  if (keta == 0) {
12150  if (kphi == 71)
12151  cal_RBX = 12;
12152  else
12153  cal_RBX = kphi / 6 + 1 + 12;
12154  }
12155  if (keta == 1) {
12156  if (kphi == 71)
12157  cal_RBX = 24;
12158  else
12159  cal_RBX = kphi / 12 + 1 + 24;
12160  }
12161  if (keta == 2) {
12162  if (kphi == 71)
12163  cal_RBX = 30;
12164  else
12165  cal_RBX = kphi / 12 + 1 + 30;
12166  }
12167  }
12168  return cal_RBX;
12169 }
12170 void CMTRawAnalyzer::beginRun(const edm::Run& r, const edm::EventSetup& iSetup) {}
12171 void CMTRawAnalyzer::endRun(const edm::Run& r, const edm::EventSetup& iSetup) {
12173  } // if flag...
12175  lscounterM1 = lscounter - 1;
12176  } else {
12177  lscounterM1 = ls0;
12178  }
12179  if (ls0 != -1)
12180  h_nevents_per_eachRealLS->Fill(float(lscounterM1), float(nevcounter)); //
12181  h_nevents_per_LS->Fill(float(nevcounter));
12182  h_nevents_per_LSzoom->Fill(float(nevcounter));
12184  if (nevcounter0 != 0) {
12185  for (int k0 = 0; k0 < nsub; k0++) {
12186  for (int k1 = 0; k1 < ndepth; k1++) {
12187  for (int k2 = 0; k2 < neta; k2++) {
12188  for (int k3 = 0; k3 < nphi; k3++) {
12189  int ieta = k2 - 41;
12190  if (sumEstimator0[k0][k1][k2][k3] != 0.) {
12191  double bbbc = 0.;
12192  if (flagestimatornormalization_ == 0)
12193  bbbc = sumEstimator0[k0][k1][k2][k3] / nevcounter0;
12194  if (flagestimatornormalization_ == 1)
12195  bbbc = sumEstimator0[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
12196  double bbb1 = 1.;
12197  if (flagestimatornormalization_ == 2) {
12198  bbbc = sumEstimator0[k0][k1][k2][k3];
12199  bbb1 = sum0Estimator[k0][k1][k2][k3];
12200  }
12201  if (k0 == 0) {
12202  if (k1 + 1 == 1) {
12203  h_sumPedestalLS1->Fill(bbbc / bbb1);
12204  h_2DsumPedestalLS1->Fill(double(ieta), double(k3), bbbc);
12205  h_2D0sumPedestalLS1->Fill(double(ieta), double(k3), bbb1);
12206  h_sumPedestalperLS1->Fill(float(lscounterM1), bbbc);
12207  h_sum0PedestalperLS1->Fill(float(lscounterM1), bbb1);
12208  }
12209  if (k1 + 1 == 2) {
12210  h_sumPedestalLS2->Fill(bbbc / bbb1);
12211  h_2DsumPedestalLS2->Fill(double(ieta), double(k3), bbbc);
12212  h_2D0sumPedestalLS2->Fill(double(ieta), double(k3), bbb1);
12213  h_sumPedestalperLS2->Fill(float(lscounterM1), bbbc);
12214  h_sum0PedestalperLS2->Fill(float(lscounterM1), bbb1);
12215  }
12216  }
12217  // HE:
12218  if (k0 == 1) {
12219  // HEdepth1
12220  if (k1 + 1 == 1) {
12221  h_sumPedestalLS3->Fill(bbbc / bbb1);
12222  h_2DsumPedestalLS3->Fill(double(ieta), double(k3), bbbc);
12223  h_2D0sumPedestalLS3->Fill(double(ieta), double(k3), bbb1);
12224  h_sumPedestalperLS3->Fill(float(lscounterM1), bbbc);
12225  h_sum0PedestalperLS3->Fill(float(lscounterM1), bbb1);
12226  }
12227  if (k1 + 1 == 2) {
12228  h_sumPedestalLS4->Fill(bbbc / bbb1);
12229  h_2DsumPedestalLS4->Fill(double(ieta), double(k3), bbbc);
12230  h_2D0sumPedestalLS4->Fill(double(ieta), double(k3), bbb1);
12231  h_sumPedestalperLS4->Fill(float(lscounterM1), bbbc);
12232  h_sum0PedestalperLS4->Fill(float(lscounterM1), bbb1);
12233  }
12234  if (k1 + 1 == 3) {
12235  h_sumPedestalLS5->Fill(bbbc / bbb1);
12236  h_2DsumPedestalLS5->Fill(double(ieta), double(k3), bbbc);
12237  h_2D0sumPedestalLS5->Fill(double(ieta), double(k3), bbb1);
12238  h_sumPedestalperLS5->Fill(float(lscounterM1), bbbc);
12239  h_sum0PedestalperLS5->Fill(float(lscounterM1), bbb1);
12240  }
12241  }
12242  // HF:
12243  if (k0 == 3) {
12244  // HFdepth1
12245  if (k1 + 1 == 1) {
12246  h_sumPedestalLS6->Fill(bbbc / bbb1);
12247  h_2DsumPedestalLS6->Fill(double(ieta), double(k3), bbbc);
12248  h_2D0sumPedestalLS6->Fill(double(ieta), double(k3), bbb1);
12249  h_sumPedestalperLS6->Fill(float(lscounterM1), bbbc);
12250  h_sum0PedestalperLS6->Fill(float(lscounterM1), bbb1);
12251  }
12252  if (k1 + 1 == 2) {
12253  h_sumPedestalLS7->Fill(bbbc / bbb1);
12254  h_2DsumPedestalLS7->Fill(double(ieta), double(k3), bbbc);
12255  h_2D0sumPedestalLS7->Fill(double(ieta), double(k3), bbb1);
12256  h_sumPedestalperLS7->Fill(float(lscounterM1), bbbc);
12257  h_sum0PedestalperLS7->Fill(float(lscounterM1), bbb1);
12258  }
12259  }
12260  // HO:
12261  if (k0 == 2) {
12262  // HOdepth1
12263  if (k1 + 1 == 4) {
12264  h_sumPedestalLS8->Fill(bbbc / bbb1);
12265  h_2DsumPedestalLS8->Fill(double(ieta), double(k3), bbbc);
12266  h_2D0sumPedestalLS8->Fill(double(ieta), double(k3), bbb1);
12267  h_sumPedestalperLS8->Fill(float(lscounterM1), bbbc);
12268  h_sum0PedestalperLS8->Fill(float(lscounterM1), bbb1);
12269  }
12270  }
12271  } //if(sumEstimator0[k0][k1][k2][k3] != 0.
12272  if (sumEstimator1[k0][k1][k2][k3] != 0.) {
12273  double bbbc = 0.;
12274  if (flagestimatornormalization_ == 0)
12275  bbbc = sumEstimator1[k0][k1][k2][k3] / nevcounter0;
12276  if (flagestimatornormalization_ == 1)
12277  bbbc = sumEstimator1[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
12278  double bbb1 = 1.;
12279  if (flagestimatornormalization_ == 2) {
12280  bbbc = sumEstimator1[k0][k1][k2][k3];
12281  bbb1 = sum0Estimator[k0][k1][k2][k3];
12282  }
12283  if (lscounterM1 >= lsmin_ && lscounterM1 < lsmax_) {
12284  int kkkk2 = (k2 - 1) / 4;
12285  if (k2 == 0)
12286  kkkk2 = 1.;
12287  else
12288  kkkk2 += 2; //kkkk2= 1-22
12289  int kkkk3 = (k3) / 4 + 1; //kkkk3= 1-18
12290  int ietaphi = 0;
12291  ietaphi = ((kkkk2)-1) * znphi + (kkkk3);
12292  double bbb3 = 0.;
12293  if (bbb1 != 0.)
12294  bbb3 = bbbc / bbb1;
12295  if (k0 == 0) {
12296  h_2DsumADCAmplEtaPhiLs0->Fill(float(lscounterM1), float(ietaphi), bbbc); //HB
12297  h_2DsumADCAmplEtaPhiLs00->Fill(float(lscounterM1), float(ietaphi), bbb1); //HB
12298  }
12299  if (k0 == 1) {
12300  h_2DsumADCAmplEtaPhiLs1->Fill(float(lscounterM1), float(ietaphi), bbbc); //HE
12301  h_2DsumADCAmplEtaPhiLs10->Fill(float(lscounterM1), float(ietaphi), bbb1); //HE
12302  }
12303  if (k0 == 2) {
12304  h_2DsumADCAmplEtaPhiLs2->Fill(float(lscounterM1), float(ietaphi), bbbc); //HO
12305  h_2DsumADCAmplEtaPhiLs20->Fill(float(lscounterM1), float(ietaphi), bbb1); //HO
12306  }
12307  if (k0 == 3) {
12308  h_2DsumADCAmplEtaPhiLs3->Fill(float(lscounterM1), float(ietaphi), bbbc); //HF
12309  h_2DsumADCAmplEtaPhiLs30->Fill(float(lscounterM1), float(ietaphi), bbb1); //HF
12310  }
12311 
12312  h_sumADCAmplEtaPhiLs->Fill(bbb3);
12313  h_sumADCAmplEtaPhiLs_bbbc->Fill(bbbc);
12314  h_sumADCAmplEtaPhiLs_bbb1->Fill(bbb1);
12316  h_sumADCAmplEtaPhiLs_orbitNum->Fill(float(orbitNum), 1.);
12318  h_sumADCAmplEtaPhiLs_ietaphi->Fill(float(ietaphi));
12319  } // lscounterM1 >= lsmin_ && lscounterM1 < lsmax_
12320  if (k0 == 0) {
12321  if (k1 + 1 == 1) {
12322  h_sumADCAmplLS1copy1->Fill(bbbc / bbb1);
12323  h_sumADCAmplLS1copy2->Fill(bbbc / bbb1);
12324  h_sumADCAmplLS1copy3->Fill(bbbc / bbb1);
12325  h_sumADCAmplLS1copy4->Fill(bbbc / bbb1);
12326  h_sumADCAmplLS1copy5->Fill(bbbc / bbb1);
12327  h_sumADCAmplLS1->Fill(bbbc / bbb1);
12328  if (bbbc / bbb1 > lsdep_estimator1_HBdepth1_)
12329  h_2DsumADCAmplLS1->Fill(double(ieta), double(k3), bbbc);
12330  if (bbbc / bbb1 > 2. * lsdep_estimator1_HBdepth1_)
12331  h_2DsumADCAmplLS1_LSselected->Fill(double(ieta), double(k3), bbbc);
12332  h_2D0sumADCAmplLS1->Fill(double(ieta), double(k3), bbb1);
12333  h_sumADCAmplperLS1->Fill(float(lscounterM1), bbbc);
12334  if (bbbc / bbb1 > lsdep_estimator1_HBdepth1_)
12335  h_sumCutADCAmplperLS1->Fill(float(lscounterM1), bbbc);
12336  h_sum0ADCAmplperLS1->Fill(float(lscounterM1), bbb1);
12337  }
12338  if (k1 + 1 == 2) {
12339  h_sumADCAmplLS2->Fill(bbbc / bbb1);
12340  if (bbbc / bbb1 > lsdep_estimator1_HBdepth2_)
12341  h_2DsumADCAmplLS2->Fill(double(ieta), double(k3), bbbc);
12342  if (bbbc / bbb1 > 2. * lsdep_estimator1_HBdepth2_)
12343  h_2DsumADCAmplLS2_LSselected->Fill(double(ieta), double(k3), bbbc);
12344  h_2D0sumADCAmplLS2->Fill(double(ieta), double(k3), bbb1);
12345  h_sumADCAmplperLS2->Fill(float(lscounterM1), bbbc);
12346  if (bbbc / bbb1 > lsdep_estimator1_HBdepth2_)
12347  h_sumCutADCAmplperLS2->Fill(float(lscounterM1), bbbc);
12348  h_sum0ADCAmplperLS2->Fill(float(lscounterM1), bbb1);
12349  }
12350  if (k1 + 1 == 3) {
12351  h_sumADCAmplperLSdepth3HBu->Fill(float(lscounterM1), bbbc);
12352  if (bbbc / bbb1 > lsdep_estimator1_HBdepth3_)
12353  h_sumCutADCAmplperLSdepth3HBu->Fill(float(lscounterM1), bbbc);
12354  h_sum0ADCAmplperLSdepth3HBu->Fill(float(lscounterM1), bbb1);
12355 
12356  if (bbbc / bbb1 > lsdep_estimator1_HBdepth3_)
12357  h_2DsumADCAmplLSdepth3HBu->Fill(double(ieta), double(k3), bbbc);
12358  h_2D0sumADCAmplLSdepth3HBu->Fill(double(ieta), double(k3), bbb1);
12359  } //if(k1+1 ==3)
12360  if (k1 + 1 == 4) {
12361  h_sumADCAmplperLSdepth4HBu->Fill(float(lscounterM1), bbbc);
12362  if (bbbc / bbb1 > lsdep_estimator1_HBdepth4_)
12363  h_sumCutADCAmplperLSdepth4HBu->Fill(float(lscounterM1), bbbc);
12364  h_sum0ADCAmplperLSdepth4HBu->Fill(float(lscounterM1), bbb1);
12365 
12366  if (bbbc / bbb1 > lsdep_estimator1_HBdepth4_)
12367  h_2DsumADCAmplLSdepth4HBu->Fill(double(ieta), double(k3), bbbc);
12368  h_2D0sumADCAmplLSdepth4HBu->Fill(double(ieta), double(k3), bbb1);
12369  } //if(k1+1 ==4)
12370  }
12371  if (k0 == 1) {
12372  if (k1 + 1 == 1) {
12373  h_sumADCAmplLS3->Fill(bbbc / bbb1);
12374  if (bbbc / bbb1 > lsdep_estimator1_HEdepth1_)
12375  h_2DsumADCAmplLS3->Fill(double(ieta), double(k3), bbbc);
12376  if (bbbc / bbb1 > 2. * lsdep_estimator1_HEdepth1_)
12377  h_2DsumADCAmplLS3_LSselected->Fill(double(ieta), double(k3), bbbc);
12378  h_2D0sumADCAmplLS3->Fill(double(ieta), double(k3), bbb1);
12379  h_sumADCAmplperLS3->Fill(float(lscounterM1), bbbc);
12380  if (bbbc / bbb1 > lsdep_estimator1_HEdepth1_)
12381  h_sumCutADCAmplperLS3->Fill(float(lscounterM1), bbbc);
12382  h_sum0ADCAmplperLS3->Fill(float(lscounterM1), bbb1);
12383  }
12384  if (k1 + 1 == 2) {
12385  h_sumADCAmplLS4->Fill(bbbc / bbb1);
12386  if (bbbc / bbb1 > lsdep_estimator1_HEdepth2_)
12387  h_2DsumADCAmplLS4->Fill(double(ieta), double(k3), bbbc);
12388  if (bbbc / bbb1 > 2. * lsdep_estimator1_HEdepth2_)
12389  h_2DsumADCAmplLS4_LSselected->Fill(double(ieta), double(k3), bbbc);
12390  h_2D0sumADCAmplLS4->Fill(double(ieta), double(k3), bbb1);
12391  h_sumADCAmplperLS4->Fill(float(lscounterM1), bbbc);
12392  if (bbbc / bbb1 > lsdep_estimator1_HEdepth2_)
12393  h_sumCutADCAmplperLS4->Fill(float(lscounterM1), bbbc);
12394  h_sum0ADCAmplperLS4->Fill(float(lscounterM1), bbb1);
12395  }
12396  if (k1 + 1 == 3) {
12397  h_sumADCAmplLS5->Fill(bbbc / bbb1);
12398  if (bbbc / bbb1 > lsdep_estimator1_HEdepth3_)
12399  h_2DsumADCAmplLS5->Fill(double(ieta), double(k3), bbbc);
12400  if (bbbc / bbb1 > 2. * lsdep_estimator1_HEdepth3_)
12401  h_2DsumADCAmplLS5_LSselected->Fill(double(ieta), double(k3), bbbc);
12402  h_2D0sumADCAmplLS5->Fill(double(ieta), double(k3), bbb1);
12403  h_sumADCAmplperLS5->Fill(float(lscounterM1), bbbc);
12404  if (bbbc / bbb1 > lsdep_estimator1_HEdepth3_)
12405  h_sumCutADCAmplperLS5->Fill(float(lscounterM1), bbbc);
12406  h_sum0ADCAmplperLS5->Fill(float(lscounterM1), bbb1);
12407  }
12408  if (k1 + 1 == 4) {
12409  h_sumADCAmplperLSdepth4HEu->Fill(float(lscounterM1), bbbc);
12410  if (bbbc / bbb1 > lsdep_estimator1_HEdepth4_)
12411  h_sumCutADCAmplperLSdepth4HEu->Fill(float(lscounterM1), bbbc);
12412  h_sum0ADCAmplperLSdepth4HEu->Fill(float(lscounterM1), bbb1);
12413  if (bbbc / bbb1 > lsdep_estimator1_HEdepth4_)
12414  h_2DsumADCAmplLSdepth4HEu->Fill(double(ieta), double(k3), bbbc);
12415  h_2D0sumADCAmplLSdepth4HEu->Fill(double(ieta), double(k3), bbb1);
12416  } //if(k1+1 ==4)
12417  if (k1 + 1 == 5) {
12418  h_sumADCAmplperLSdepth5HEu->Fill(float(lscounterM1), bbbc);
12419  if (bbbc / bbb1 > lsdep_estimator1_HEdepth5_)
12420  h_sumCutADCAmplperLSdepth5HEu->Fill(float(lscounterM1), bbbc);
12421  h_sum0ADCAmplperLSdepth5HEu->Fill(float(lscounterM1), bbb1);
12422  if (bbbc / bbb1 > lsdep_estimator1_HEdepth5_)
12423  h_2DsumADCAmplLSdepth5HEu->Fill(double(ieta), double(k3), bbbc);
12424  h_2D0sumADCAmplLSdepth5HEu->Fill(double(ieta), double(k3), bbb1);
12425  } //if(k1+1 ==5)
12426 
12427  if (k1 + 1 == 6) {
12428  h_sumADCAmplperLSdepth6HEu->Fill(float(lscounterM1), bbbc);
12429  if (bbbc / bbb1 > lsdep_estimator1_HEdepth6_)
12430  h_sumCutADCAmplperLSdepth6HEu->Fill(float(lscounterM1), bbbc);
12431  h_sum0ADCAmplperLSdepth6HEu->Fill(float(lscounterM1), bbb1);
12432  if (bbbc / bbb1 > lsdep_estimator1_HEdepth6_)
12433  h_2DsumADCAmplLSdepth6HEu->Fill(double(ieta), double(k3), bbbc);
12434  h_2D0sumADCAmplLSdepth6HEu->Fill(double(ieta), double(k3), bbb1);
12435  } //if(k1+1 ==6)
12436  if (k1 + 1 == 7) {
12437  h_sumADCAmplperLSdepth7HEu->Fill(float(lscounterM1), bbbc);
12438  if (bbbc / bbb1 > lsdep_estimator1_HEdepth7_)
12439  h_sumCutADCAmplperLSdepth7HEu->Fill(float(lscounterM1), bbbc);
12440  h_sum0ADCAmplperLSdepth7HEu->Fill(float(lscounterM1), bbb1);
12441  if (bbbc / bbb1 > lsdep_estimator1_HEdepth7_)
12442  h_2DsumADCAmplLSdepth7HEu->Fill(double(ieta), double(k3), bbbc);
12443  h_2D0sumADCAmplLSdepth7HEu->Fill(double(ieta), double(k3), bbb1);
12444  } //if(k1+1 ==7)
12445 
12446  } // end HE
12447 
12448  if (k0 == 3) {
12449  if (k1 + 1 == 1) {
12450  h_sumADCAmplLS6->Fill(bbbc / bbb1);
12451  if (bbbc / bbb1 > lsdep_estimator1_HFdepth1_)
12452  h_2DsumADCAmplLS6->Fill(double(ieta), double(k3), bbbc);
12453  if (bbbc / bbb1 > 2. * lsdep_estimator1_HFdepth1_)
12454  h_2DsumADCAmplLS6_LSselected->Fill(double(ieta), double(k3), bbbc);
12455  h_2D0sumADCAmplLS6->Fill(double(ieta), double(k3), bbb1);
12456  h_sumADCAmplperLS6->Fill(float(lscounterM1), bbbc);
12457  if (bbbc / bbb1 > lsdep_estimator1_HFdepth1_)
12458  h_sumCutADCAmplperLS6->Fill(float(lscounterM1), bbbc);
12459  h_sum0ADCAmplperLS6->Fill(float(lscounterM1), bbb1);
12460  }
12461  if (k1 + 1 == 2) {
12462  h_sumADCAmplLS7->Fill(bbbc / bbb1);
12463  if (bbbc / bbb1 > lsdep_estimator1_HFdepth2_)
12464  h_2DsumADCAmplLS7->Fill(double(ieta), double(k3), bbbc);
12465  if (bbbc / bbb1 > 2. * lsdep_estimator1_HFdepth2_)
12466  h_2DsumADCAmplLS7_LSselected->Fill(double(ieta), double(k3), bbbc);
12467  h_2D0sumADCAmplLS7->Fill(double(ieta), double(k3), bbb1);
12468  h_sumADCAmplperLS7->Fill(float(lscounterM1), bbbc);
12469  if (bbbc / bbb1 > lsdep_estimator1_HFdepth2_)
12470  h_sumCutADCAmplperLS7->Fill(float(lscounterM1), bbbc);
12471  h_sum0ADCAmplperLS7->Fill(float(lscounterM1), bbb1);
12472  }
12473 
12474  if (k1 + 1 == 3) {
12475  h_sumADCAmplperLS6u->Fill(float(lscounterM1), bbbc);
12476  if (bbbc / bbb1 > lsdep_estimator1_HFdepth3_)
12477  h_sumCutADCAmplperLS6u->Fill(float(lscounterM1), bbbc);
12478  h_sum0ADCAmplperLS6u->Fill(float(lscounterM1), bbb1);
12479  if (bbbc / bbb1 > lsdep_estimator1_HFdepth3_)
12480  h_2DsumADCAmplLSdepth3HFu->Fill(double(ieta), double(k3), bbbc);
12481  h_2D0sumADCAmplLSdepth3HFu->Fill(double(ieta), double(k3), bbb1);
12482  } //if(k1+1 ==3)
12483  if (k1 + 1 == 4) {
12484  h_sumADCAmplperLS7u->Fill(float(lscounterM1), bbbc);
12485  if (bbbc / bbb1 > lsdep_estimator1_HFdepth4_)
12486  h_sumCutADCAmplperLS7u->Fill(float(lscounterM1), bbbc);
12487  h_sum0ADCAmplperLS7u->Fill(float(lscounterM1), bbb1);
12488  if (bbbc / bbb1 > lsdep_estimator1_HFdepth4_)
12489  h_2DsumADCAmplLSdepth4HFu->Fill(double(ieta), double(k3), bbbc);
12490  h_2D0sumADCAmplLSdepth4HFu->Fill(double(ieta), double(k3), bbb1);
12491  } //if(k1+1 ==4)
12492  }
12493  // HO:
12494  if (k0 == 2) {
12495  // HOdepth1
12496  if (k1 + 1 == 4) {
12497  h_sumADCAmplLS8->Fill(bbbc / bbb1);
12498  if (bbbc / bbb1 > lsdep_estimator1_HOdepth4_)
12499  h_2DsumADCAmplLS8->Fill(double(ieta), double(k3), bbbc);
12500  if (bbbc / bbb1 > 2. * lsdep_estimator1_HOdepth4_)
12501  h_2DsumADCAmplLS8_LSselected->Fill(double(ieta), double(k3), bbbc);
12502  h_2D0sumADCAmplLS8->Fill(double(ieta), double(k3), bbb1);
12503  h_sumADCAmplperLS8->Fill(float(lscounterM1), bbbc);
12504  if (bbbc / bbb1 > lsdep_estimator1_HOdepth4_)
12505  h_sumCutADCAmplperLS8->Fill(float(lscounterM1), bbbc);
12506  h_sum0ADCAmplperLS8->Fill(float(lscounterM1), bbb1);
12507  }
12508  }
12509  } //if(sumEstimator1[k0][k1][k2][k3] != 0.
12510  if (sumEstimator2[k0][k1][k2][k3] != 0.) {
12511  double bbbc = 0.;
12512  if (flagestimatornormalization_ == 0)
12513  bbbc = sumEstimator2[k0][k1][k2][k3] / nevcounter0;
12514  if (flagestimatornormalization_ == 1)
12515  bbbc = sumEstimator2[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
12516  double bbb1 = 1.;
12517  if (flagestimatornormalization_ == 2) {
12518  bbbc = sumEstimator2[k0][k1][k2][k3];
12519  bbb1 = sum0Estimator[k0][k1][k2][k3];
12520  }
12521 
12522  // HB:
12523  if (k0 == 0) {
12524  // HBdepth1
12525  if (k1 + 1 == 1) {
12526  h_sumTSmeanALS1->Fill(bbbc / bbb1);
12527  if (bbbc / bbb1 > lsdep_estimator2_HBdepth1_)
12528  h_2DsumTSmeanALS1->Fill(double(ieta), double(k3), bbbc);
12529  h_2D0sumTSmeanALS1->Fill(double(ieta), double(k3), bbb1);
12530  h_sumTSmeanAperLS1->Fill(float(lscounterM1), bbbc);
12531  if (bbbc / bbb1 > lsdep_estimator2_HBdepth1_)
12532  h_sumCutTSmeanAperLS1->Fill(float(lscounterM1), bbbc);
12533  h_sum0TSmeanAperLS1->Fill(float(lscounterM1), bbb1);
12534  if (bbbc / bbb1 > 2. * lsdep_estimator2_HBdepth1_)
12535  h_sumTSmeanAperLS1_LSselected->Fill(float(lscounterM1), bbbc);
12536  }
12537  if (k1 + 1 == 2) {
12538  h_sumTSmeanALS2->Fill(bbbc / bbb1);
12539  if (bbbc / bbb1 > lsdep_estimator2_HBdepth2_)
12540  h_2DsumTSmeanALS2->Fill(double(ieta), double(k3), bbbc);
12541  h_2D0sumTSmeanALS2->Fill(double(ieta), double(k3), bbb1);
12542  h_sumTSmeanAperLS2->Fill(float(lscounterM1), bbbc);
12543  if (bbbc / bbb1 > lsdep_estimator2_HBdepth2_)
12544  h_sumCutTSmeanAperLS2->Fill(float(lscounterM1), bbbc);
12545  h_sum0TSmeanAperLS2->Fill(float(lscounterM1), bbb1);
12546  }
12547  }
12548  if (k0 == 1) {
12549  if (k1 + 1 == 1) {
12550  h_sumTSmeanALS3->Fill(bbbc / bbb1);
12551  if (bbbc / bbb1 > lsdep_estimator2_HEdepth1_)
12552  h_2DsumTSmeanALS3->Fill(double(ieta), double(k3), bbbc);
12553  h_2D0sumTSmeanALS3->Fill(double(ieta), double(k3), bbb1);
12554  h_sumTSmeanAperLS3->Fill(float(lscounterM1), bbbc);
12555  if (bbbc / bbb1 > lsdep_estimator2_HEdepth1_)
12556  h_sumCutTSmeanAperLS3->Fill(float(lscounterM1), bbbc);
12557  h_sum0TSmeanAperLS3->Fill(float(lscounterM1), bbb1);
12558  }
12559  if (k1 + 1 == 2) {
12560  h_sumTSmeanALS4->Fill(bbbc / bbb1);
12561  if (bbbc / bbb1 > lsdep_estimator2_HEdepth2_)
12562  h_2DsumTSmeanALS4->Fill(double(ieta), double(k3), bbbc);
12563  h_2D0sumTSmeanALS4->Fill(double(ieta), double(k3), bbb1);
12564  h_sumTSmeanAperLS4->Fill(float(lscounterM1), bbbc);
12565  if (bbbc / bbb1 > lsdep_estimator2_HEdepth2_)
12566  h_sumCutTSmeanAperLS4->Fill(float(lscounterM1), bbbc);
12567  h_sum0TSmeanAperLS4->Fill(float(lscounterM1), bbb1);
12568  }
12569  if (k1 + 1 == 3) {
12570  h_sumTSmeanALS5->Fill(bbbc / bbb1);
12571  if (bbbc / bbb1 > lsdep_estimator2_HEdepth3_)
12572  h_2DsumTSmeanALS5->Fill(double(ieta), double(k3), bbbc);
12573  h_2D0sumTSmeanALS5->Fill(double(ieta), double(k3), bbb1);
12574  h_sumTSmeanAperLS5->Fill(float(lscounterM1), bbbc);
12575  if (bbbc / bbb1 > lsdep_estimator2_HEdepth3_)
12576  h_sumCutTSmeanAperLS5->Fill(float(lscounterM1), bbbc);
12577  h_sum0TSmeanAperLS5->Fill(float(lscounterM1), bbb1);
12578  }
12579  }
12580  // HF:
12581  if (k0 == 3) {
12582  // HFdepth1
12583  if (k1 + 1 == 1) {
12584  h_sumTSmeanALS6->Fill(bbbc / bbb1);
12585  if (bbbc / bbb1 > lsdep_estimator2_HFdepth1_)
12586  h_2DsumTSmeanALS6->Fill(double(ieta), double(k3), bbbc);
12587  h_2D0sumTSmeanALS6->Fill(double(ieta), double(k3), bbb1);
12588  h_sumTSmeanAperLS6->Fill(float(lscounterM1), bbbc);
12589  if (bbbc / bbb1 > lsdep_estimator2_HFdepth1_)
12590  h_sumCutTSmeanAperLS6->Fill(float(lscounterM1), bbbc);
12591  h_sum0TSmeanAperLS6->Fill(float(lscounterM1), bbb1);
12592  }
12593  if (k1 + 1 == 2) {
12594  h_sumTSmeanALS7->Fill(bbbc / bbb1);
12595  if (bbbc / bbb1 > lsdep_estimator2_HFdepth2_)
12596  h_2DsumTSmeanALS7->Fill(double(ieta), double(k3), bbbc);
12597  h_2D0sumTSmeanALS7->Fill(double(ieta), double(k3), bbb1);
12598  h_sumTSmeanAperLS7->Fill(float(lscounterM1), bbbc);
12599  if (bbbc / bbb1 > lsdep_estimator2_HFdepth2_)
12600  h_sumCutTSmeanAperLS7->Fill(float(lscounterM1), bbbc);
12601  h_sum0TSmeanAperLS7->Fill(float(lscounterM1), bbb1);
12602  }
12603  }
12604  // HO:
12605  if (k0 == 2) {
12606  // HOdepth1
12607  if (k1 + 1 == 4) {
12608  h_sumTSmeanALS8->Fill(bbbc / bbb1);
12609  if (bbbc / bbb1 > lsdep_estimator2_HOdepth4_)
12610  h_2DsumTSmeanALS8->Fill(double(ieta), double(k3), bbbc);
12611  h_2D0sumTSmeanALS8->Fill(double(ieta), double(k3), bbb1);
12612  h_sumTSmeanAperLS8->Fill(float(lscounterM1), bbbc);
12613  if (bbbc / bbb1 > lsdep_estimator2_HOdepth4_)
12614  h_sumCutTSmeanAperLS8->Fill(float(lscounterM1), bbbc);
12615  h_sum0TSmeanAperLS8->Fill(float(lscounterM1), bbb1);
12616  }
12617  }
12618  } //if(sumEstimator2[k0][k1][k2][k3] != 0.
12619 
12620  // ------------------------------------------------------------------------------------------------------------------------sumEstimator3 Tx
12621  if (sumEstimator3[k0][k1][k2][k3] != 0.) {
12622  // fill histoes:
12623  double bbbc = 0.;
12624  if (flagestimatornormalization_ == 0)
12625  bbbc = sumEstimator3[k0][k1][k2][k3] / nevcounter0;
12626  if (flagestimatornormalization_ == 1)
12627  bbbc = sumEstimator3[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
12628  double bbb1 = 1.;
12629  if (flagestimatornormalization_ == 2) {
12630  bbbc = sumEstimator3[k0][k1][k2][k3];
12631  bbb1 = sum0Estimator[k0][k1][k2][k3];
12632  }
12633 
12634  // HB:
12635  if (k0 == 0) {
12636  // HBdepth1
12637  if (k1 + 1 == 1) {
12638  h_sumTSmaxALS1->Fill(bbbc / bbb1);
12639  if (bbbc / bbb1 > lsdep_estimator3_HBdepth1_)
12640  h_2DsumTSmaxALS1->Fill(double(ieta), double(k3), bbbc);
12641  h_2D0sumTSmaxALS1->Fill(double(ieta), double(k3), bbb1);
12642  h_sumTSmaxAperLS1->Fill(float(lscounterM1), bbbc);
12643  if (bbbc / bbb1 > lsdep_estimator3_HBdepth1_)
12644  h_sumCutTSmaxAperLS1->Fill(float(lscounterM1), bbbc);
12645  h_sum0TSmaxAperLS1->Fill(float(lscounterM1), bbb1);
12646  if (bbbc / bbb1 > 2. * lsdep_estimator3_HBdepth1_)
12647  h_sumTSmaxAperLS1_LSselected->Fill(float(lscounterM1), bbbc);
12648  }
12649  if (k1 + 1 == 2) {
12650  h_sumTSmaxALS2->Fill(bbbc / bbb1);
12651  if (bbbc / bbb1 > lsdep_estimator3_HBdepth2_)
12652  h_2DsumTSmaxALS2->Fill(double(ieta), double(k3), bbbc);
12653  h_2D0sumTSmaxALS2->Fill(double(ieta), double(k3), bbb1);
12654  h_sumTSmaxAperLS2->Fill(float(lscounterM1), bbbc);
12655  if (bbbc / bbb1 > lsdep_estimator3_HBdepth2_)
12656  h_sumCutTSmaxAperLS2->Fill(float(lscounterM1), bbbc);
12657  h_sum0TSmaxAperLS2->Fill(float(lscounterM1), bbb1);
12658  }
12659  }
12660  // HE:
12661  if (k0 == 1) {
12662  // HEdepth1
12663  if (k1 + 1 == 1) {
12664  h_sumTSmaxALS3->Fill(bbbc / bbb1);
12665  if (bbbc / bbb1 > lsdep_estimator3_HEdepth1_)
12666  h_2DsumTSmaxALS3->Fill(double(ieta), double(k3), bbbc);
12667  h_2D0sumTSmaxALS3->Fill(double(ieta), double(k3), bbb1);
12668  h_sumTSmaxAperLS3->Fill(float(lscounterM1), bbbc);
12669  if (bbbc / bbb1 > lsdep_estimator3_HEdepth1_)
12670  h_sumCutTSmaxAperLS3->Fill(float(lscounterM1), bbbc);
12671  h_sum0TSmaxAperLS3->Fill(float(lscounterM1), bbb1);
12672  }
12673  if (k1 + 1 == 2) {
12674  h_sumTSmaxALS4->Fill(bbbc / bbb1);
12675  if (bbbc / bbb1 > lsdep_estimator3_HEdepth2_)
12676  h_2DsumTSmaxALS4->Fill(double(ieta), double(k3), bbbc);
12677  h_2D0sumTSmaxALS4->Fill(double(ieta), double(k3), bbb1);
12678  h_sumTSmaxAperLS4->Fill(float(lscounterM1), bbbc);
12679  if (bbbc / bbb1 > lsdep_estimator3_HEdepth2_)
12680  h_sumCutTSmaxAperLS4->Fill(float(lscounterM1), bbbc);
12681  h_sum0TSmaxAperLS4->Fill(float(lscounterM1), bbb1);
12682  }
12683  if (k1 + 1 == 3) {
12684  h_sumTSmaxALS5->Fill(bbbc / bbb1);
12685  if (bbbc / bbb1 > lsdep_estimator3_HEdepth3_)
12686  h_2DsumTSmaxALS5->Fill(double(ieta), double(k3), bbbc);
12687  h_2D0sumTSmaxALS5->Fill(double(ieta), double(k3), bbb1);
12688  h_sumTSmaxAperLS5->Fill(float(lscounterM1), bbbc);
12689  if (bbbc / bbb1 > lsdep_estimator3_HEdepth3_)
12690  h_sumCutTSmaxAperLS5->Fill(float(lscounterM1), bbbc);
12691  h_sum0TSmaxAperLS5->Fill(float(lscounterM1), bbb1);
12692  }
12693  }
12694  // HF:
12695  if (k0 == 3) {
12696  // HFdepth1
12697  if (k1 + 1 == 1) {
12698  h_sumTSmaxALS6->Fill(bbbc / bbb1);
12699  if (bbbc / bbb1 > lsdep_estimator3_HFdepth1_)
12700  h_2DsumTSmaxALS6->Fill(double(ieta), double(k3), bbbc);
12701  h_2D0sumTSmaxALS6->Fill(double(ieta), double(k3), bbb1);
12702  h_sumTSmaxAperLS6->Fill(float(lscounterM1), bbbc);
12703  if (bbbc / bbb1 > lsdep_estimator3_HFdepth1_)
12704  h_sumCutTSmaxAperLS6->Fill(float(lscounterM1), bbbc);
12705  h_sum0TSmaxAperLS6->Fill(float(lscounterM1), bbb1);
12706  }
12707  if (k1 + 1 == 2) {
12708  h_sumTSmaxALS7->Fill(bbbc / bbb1);
12709  if (bbbc / bbb1 > lsdep_estimator3_HFdepth2_)
12710  h_2DsumTSmaxALS7->Fill(double(ieta), double(k3), bbbc);
12711  h_2D0sumTSmaxALS7->Fill(double(ieta), double(k3), bbb1);
12712  h_sumTSmaxAperLS7->Fill(float(lscounterM1), bbbc);
12713  if (bbbc / bbb1 > lsdep_estimator3_HFdepth2_)
12714  h_sumCutTSmaxAperLS7->Fill(float(lscounterM1), bbbc);
12715  h_sum0TSmaxAperLS7->Fill(float(lscounterM1), bbb1);
12716  }
12717  }
12718  // HO:
12719  if (k0 == 2) {
12720  // HOdepth1
12721  if (k1 + 1 == 4) {
12722  h_sumTSmaxALS8->Fill(bbbc / bbb1);
12723  if (bbbc / bbb1 > lsdep_estimator3_HOdepth4_)
12724  h_2DsumTSmaxALS8->Fill(double(ieta), double(k3), bbbc);
12725  h_2D0sumTSmaxALS8->Fill(double(ieta), double(k3), bbb1);
12726  h_sumTSmaxAperLS8->Fill(float(lscounterM1), bbbc);
12727  if (bbbc / bbb1 > lsdep_estimator3_HOdepth4_)
12728  h_sumCutTSmaxAperLS8->Fill(float(lscounterM1), bbbc);
12729  h_sum0TSmaxAperLS8->Fill(float(lscounterM1), bbb1);
12730  }
12731  }
12732  } //if(sumEstimator3[k0][k1][k2][k3] != 0.
12733 
12734  // ------------------------------------------------------------------------------------------------------------------------sumEstimator4 W
12735  if (sumEstimator4[k0][k1][k2][k3] != 0.) {
12736  // fill histoes:
12737  double bbbc = 0.;
12738  if (flagestimatornormalization_ == 0)
12739  bbbc = sumEstimator4[k0][k1][k2][k3] / nevcounter0;
12740  if (flagestimatornormalization_ == 1)
12741  bbbc = sumEstimator4[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
12742  double bbb1 = 1.;
12743  if (flagestimatornormalization_ == 2) {
12744  bbbc = sumEstimator4[k0][k1][k2][k3];
12745  bbb1 = sum0Estimator[k0][k1][k2][k3];
12746  }
12747 
12748  // HB:
12749  if (k0 == 0) {
12750  // HBdepth1
12751  if (k1 + 1 == 1) {
12752  h_sumAmplitudeLS1->Fill(bbbc / bbb1);
12753  if (bbbc / bbb1 > lsdep_estimator4_HBdepth1_)
12754  h_2DsumAmplitudeLS1->Fill(double(ieta), double(k3), bbbc);
12755  h_2D0sumAmplitudeLS1->Fill(double(ieta), double(k3), bbb1);
12756  h_sumAmplitudeperLS1->Fill(float(lscounterM1), bbbc);
12757  if (bbbc / bbb1 > lsdep_estimator4_HBdepth1_)
12758  h_sumCutAmplitudeperLS1->Fill(float(lscounterM1), bbbc);
12759  h_sum0AmplitudeperLS1->Fill(float(lscounterM1), bbb1);
12760  if (bbbc / bbb1 > 2. * lsdep_estimator4_HBdepth1_)
12761  h_sumAmplitudeperLS1_LSselected->Fill(float(lscounterM1), bbbc);
12762  }
12763  if (k1 + 1 == 2) {
12764  h_sumAmplitudeLS2->Fill(bbbc / bbb1);
12765  if (bbbc / bbb1 > lsdep_estimator4_HBdepth2_)
12766  h_2DsumAmplitudeLS2->Fill(double(ieta), double(k3), bbbc);
12767  h_2D0sumAmplitudeLS2->Fill(double(ieta), double(k3), bbb1);
12768  h_sumAmplitudeperLS2->Fill(float(lscounterM1), bbbc);
12769  if (bbbc / bbb1 > lsdep_estimator4_HBdepth2_)
12770  h_sumCutAmplitudeperLS2->Fill(float(lscounterM1), bbbc);
12771  h_sum0AmplitudeperLS2->Fill(float(lscounterM1), bbb1);
12772  }
12773  }
12774  // HE:
12775  if (k0 == 1) {
12776  // HEdepth1
12777  if (k1 + 1 == 1) {
12778  h_sumAmplitudeLS3->Fill(bbbc / bbb1);
12779  if (bbbc / bbb1 > lsdep_estimator4_HEdepth1_)
12780  h_2DsumAmplitudeLS3->Fill(double(ieta), double(k3), bbbc);
12781  h_2D0sumAmplitudeLS3->Fill(double(ieta), double(k3), bbb1);
12782  h_sumAmplitudeperLS3->Fill(float(lscounterM1), bbbc);
12783  if (bbbc / bbb1 > lsdep_estimator4_HEdepth1_)
12784  h_sumCutAmplitudeperLS3->Fill(float(lscounterM1), bbbc);
12785  h_sum0AmplitudeperLS3->Fill(float(lscounterM1), bbb1);
12786  }
12787  if (k1 + 1 == 2) {
12788  h_sumAmplitudeLS4->Fill(bbbc / bbb1);
12789  if (bbbc / bbb1 > lsdep_estimator4_HEdepth2_)
12790  h_2DsumAmplitudeLS4->Fill(double(ieta), double(k3), bbbc);
12791  h_2D0sumAmplitudeLS4->Fill(double(ieta), double(k3), bbb1);
12792  h_sumAmplitudeperLS4->Fill(float(lscounterM1), bbbc);
12793  if (bbbc / bbb1 > lsdep_estimator4_HEdepth2_)
12794  h_sumCutAmplitudeperLS4->Fill(float(lscounterM1), bbbc);
12795  h_sum0AmplitudeperLS4->Fill(float(lscounterM1), bbb1);
12796  }
12797  if (k1 + 1 == 3) {
12798  h_sumAmplitudeLS5->Fill(bbbc / bbb1);
12799  if (bbbc / bbb1 > lsdep_estimator4_HEdepth3_)
12800  h_2DsumAmplitudeLS5->Fill(double(ieta), double(k3), bbbc);
12801  h_2D0sumAmplitudeLS5->Fill(double(ieta), double(k3), bbb1);
12802  h_sumAmplitudeperLS5->Fill(float(lscounterM1), bbbc);
12803  if (bbbc / bbb1 > lsdep_estimator4_HEdepth3_)
12804  h_sumCutAmplitudeperLS5->Fill(float(lscounterM1), bbbc);
12805  h_sum0AmplitudeperLS5->Fill(float(lscounterM1), bbb1);
12806  }
12807  }
12808  // HF:
12809  if (k0 == 3) {
12810  // HFdepth1
12811  if (k1 + 1 == 1) {
12812  h_sumAmplitudeLS6->Fill(bbbc / bbb1);
12813  if (bbbc / bbb1 > lsdep_estimator4_HFdepth1_)
12814  h_2DsumAmplitudeLS6->Fill(double(ieta), double(k3), bbbc);
12815  h_2D0sumAmplitudeLS6->Fill(double(ieta), double(k3), bbb1);
12816  h_sumAmplitudeperLS6->Fill(float(lscounterM1), bbbc);
12817  if (bbbc / bbb1 > lsdep_estimator4_HFdepth1_)
12818  h_sumCutAmplitudeperLS6->Fill(float(lscounterM1), bbbc);
12819  h_sum0AmplitudeperLS6->Fill(float(lscounterM1), bbb1);
12820  }
12821  if (k1 + 1 == 2) {
12822  h_sumAmplitudeLS7->Fill(bbbc / bbb1);
12823  if (bbbc / bbb1 > lsdep_estimator4_HFdepth2_)
12824  h_2DsumAmplitudeLS7->Fill(double(ieta), double(k3), bbbc);
12825  h_2D0sumAmplitudeLS7->Fill(double(ieta), double(k3), bbb1);
12826  h_sumAmplitudeperLS7->Fill(float(lscounterM1), bbbc);
12827  if (bbbc / bbb1 > lsdep_estimator4_HFdepth2_)
12828  h_sumCutAmplitudeperLS7->Fill(float(lscounterM1), bbbc);
12829  h_sum0AmplitudeperLS7->Fill(float(lscounterM1), bbb1);
12830  }
12831  }
12832  // HO:
12833  if (k0 == 2) {
12834  // HOdepth1
12835  if (k1 + 1 == 4) {
12836  h_sumAmplitudeLS8->Fill(bbbc / bbb1);
12837  if (bbbc / bbb1 > lsdep_estimator4_HOdepth4_)
12838  h_2DsumAmplitudeLS8->Fill(double(ieta), double(k3), bbbc);
12839  h_2D0sumAmplitudeLS8->Fill(double(ieta), double(k3), bbb1);
12840  h_sumAmplitudeperLS8->Fill(float(lscounterM1), bbbc);
12841  if (bbbc / bbb1 > lsdep_estimator4_HOdepth4_)
12842  h_sumCutAmplitudeperLS8->Fill(float(lscounterM1), bbbc);
12843  h_sum0AmplitudeperLS8->Fill(float(lscounterM1), bbb1);
12844  }
12845  }
12846  } //if(sumEstimator4[k0][k1][k2][k3] != 0.
12847 
12848  // ------------------------------------------------------------------------------------------------------------------------sumEstimator5 R
12849  if (sumEstimator5[k0][k1][k2][k3] != 0.) {
12850  // fill histoes:
12851  double bbbc = 0.;
12852  if (flagestimatornormalization_ == 0)
12853  bbbc = sumEstimator5[k0][k1][k2][k3] / nevcounter0;
12854  if (flagestimatornormalization_ == 1)
12855  bbbc = sumEstimator5[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
12856  double bbb1 = 1.;
12857  if (flagestimatornormalization_ == 2) {
12858  bbbc = sumEstimator5[k0][k1][k2][k3];
12859  bbb1 = sum0Estimator[k0][k1][k2][k3];
12860  }
12861 
12862  // HB:
12863  if (k0 == 0) {
12864  // HBdepth1
12865  if (k1 + 1 == 1) {
12866  h_sumAmplLS1->Fill(bbbc / bbb1);
12867  if (bbbc / bbb1 > lsdep_estimator5_HBdepth1_)
12868  h_2DsumAmplLS1->Fill(double(ieta), double(k3), bbbc);
12869  h_2D0sumAmplLS1->Fill(double(ieta), double(k3), bbb1);
12870  h_sumAmplperLS1->Fill(float(lscounterM1), bbbc);
12871  if (bbbc / bbb1 > lsdep_estimator5_HBdepth1_)
12872  h_sumCutAmplperLS1->Fill(float(lscounterM1), bbbc);
12873  h_sum0AmplperLS1->Fill(float(lscounterM1), bbb1);
12874  if (bbbc / bbb1 > 2. * lsdep_estimator5_HBdepth1_)
12875  h_sumAmplperLS1_LSselected->Fill(float(lscounterM1), bbbc);
12876  }
12877  if (k1 + 1 == 2) {
12878  h_sumAmplLS2->Fill(bbbc / bbb1);
12879  if (bbbc / bbb1 > lsdep_estimator5_HBdepth2_)
12880  h_2DsumAmplLS2->Fill(double(ieta), double(k3), bbbc);
12881  h_2D0sumAmplLS2->Fill(double(ieta), double(k3), bbb1);
12882  h_sumAmplperLS2->Fill(float(lscounterM1), bbbc);
12883  if (bbbc / bbb1 > lsdep_estimator5_HBdepth2_)
12884  h_sumCutAmplperLS2->Fill(float(lscounterM1), bbbc);
12885  h_sum0AmplperLS2->Fill(float(lscounterM1), bbb1);
12886  }
12887  }
12888  // HE:
12889  if (k0 == 1) {
12890  // HEdepth1
12891  if (k1 + 1 == 1) {
12892  h_sumAmplLS3->Fill(bbbc / bbb1);
12893  if (bbbc / bbb1 > lsdep_estimator5_HEdepth1_)
12894  h_2DsumAmplLS3->Fill(double(ieta), double(k3), bbbc);
12895  h_2D0sumAmplLS3->Fill(double(ieta), double(k3), bbb1);
12896  h_sumAmplperLS3->Fill(float(lscounterM1), bbbc);
12897  if (bbbc / bbb1 > lsdep_estimator5_HEdepth1_)
12898  h_sumCutAmplperLS3->Fill(float(lscounterM1), bbbc);
12899  h_sum0AmplperLS3->Fill(float(lscounterM1), bbb1);
12900  }
12901  if (k1 + 1 == 2) {
12902  h_sumAmplLS4->Fill(bbbc / bbb1);
12903  if (bbbc / bbb1 > lsdep_estimator5_HEdepth2_)
12904  h_2DsumAmplLS4->Fill(double(ieta), double(k3), bbbc);
12905  h_2D0sumAmplLS4->Fill(double(ieta), double(k3), bbb1);
12906  h_sumAmplperLS4->Fill(float(lscounterM1), bbbc);
12907  if (bbbc / bbb1 > lsdep_estimator5_HEdepth2_)
12908  h_sumCutAmplperLS4->Fill(float(lscounterM1), bbbc);
12909  h_sum0AmplperLS4->Fill(float(lscounterM1), bbb1);
12910  }
12911  if (k1 + 1 == 3) {
12912  h_sumAmplLS5->Fill(bbbc / bbb1);
12913  if (bbbc / bbb1 > lsdep_estimator5_HEdepth3_)
12914  h_2DsumAmplLS5->Fill(double(ieta), double(k3), bbbc);
12915  h_2D0sumAmplLS5->Fill(double(ieta), double(k3), bbb1);
12916  h_sumAmplperLS5->Fill(float(lscounterM1), bbbc);
12917  if (bbbc / bbb1 > lsdep_estimator5_HEdepth3_)
12918  h_sumCutAmplperLS5->Fill(float(lscounterM1), bbbc);
12919  h_sum0AmplperLS5->Fill(float(lscounterM1), bbb1);
12920  }
12921  }
12922  // HF:
12923  if (k0 == 3) {
12924  // HFdepth1
12925  if (k1 + 1 == 1) {
12926  h_sumAmplLS6->Fill(bbbc / bbb1);
12927  if (bbbc / bbb1 > lsdep_estimator5_HFdepth1_)
12928  h_2DsumAmplLS6->Fill(double(ieta), double(k3), bbbc);
12929  h_2D0sumAmplLS6->Fill(double(ieta), double(k3), bbb1);
12930  h_sumAmplperLS6->Fill(float(lscounterM1), bbbc);
12931  if (bbbc / bbb1 > lsdep_estimator5_HFdepth1_)
12932  h_sumCutAmplperLS6->Fill(float(lscounterM1), bbbc);
12933  h_sum0AmplperLS6->Fill(float(lscounterM1), bbb1);
12934  }
12935  if (k1 + 1 == 2) {
12936  h_sumAmplLS7->Fill(bbbc / bbb1);
12937  if (bbbc / bbb1 > lsdep_estimator5_HFdepth2_)
12938  h_2DsumAmplLS7->Fill(double(ieta), double(k3), bbbc);
12939  h_2D0sumAmplLS7->Fill(double(ieta), double(k3), bbb1);
12940  h_sumAmplperLS7->Fill(float(lscounterM1), bbbc);
12941  if (bbbc / bbb1 > lsdep_estimator5_HFdepth2_)
12942  h_sumCutAmplperLS7->Fill(float(lscounterM1), bbbc);
12943  h_sum0AmplperLS7->Fill(float(lscounterM1), bbb1);
12944  }
12945  }
12946  // HO:
12947  if (k0 == 2) {
12948  // HOdepth1
12949  if (k1 + 1 == 4) {
12950  h_sumAmplLS8->Fill(bbbc / bbb1);
12951  if (bbbc / bbb1 > lsdep_estimator5_HOdepth4_)
12952  h_2DsumAmplLS8->Fill(double(ieta), double(k3), bbbc);
12953  h_2D0sumAmplLS8->Fill(double(ieta), double(k3), bbb1);
12954  h_sumAmplperLS8->Fill(float(lscounterM1), bbbc);
12955  if (bbbc / bbb1 > lsdep_estimator5_HOdepth4_)
12956  h_sumCutAmplperLS8->Fill(float(lscounterM1), bbbc);
12957  h_sum0AmplperLS8->Fill(float(lscounterM1), bbb1);
12958  }
12959  }
12960  } //if(sumEstimator5[k0][k1][k2][k3] != 0.
12961  // ------------------------------------------------------------------------------------------------------------------------sumEstimator6 (Error-B)
12962  if (sumEstimator6[k0][k1][k2][k3] != 0.) {
12963  // fill histoes:
12964  double bbbc = 0.;
12965  if (flagestimatornormalization_ == 0)
12966  bbbc = sumEstimator6[k0][k1][k2][k3] / nevcounter0;
12967  if (flagestimatornormalization_ == 1)
12968  bbbc = sumEstimator6[k0][k1][k2][k3] / sum0Estimator[k0][k1][k2][k3];
12969  double bbb1 = 1.;
12970  if (flagestimatornormalization_ == 2) {
12971  bbbc = sumEstimator6[k0][k1][k2][k3];
12972  bbb1 = sum0Estimator[k0][k1][k2][k3];
12973  }
12974 
12975  // HB:
12976  if (k0 == 0) {
12977  // HBdepth1
12978  if (k1 + 1 == 1) {
12979  h_sumErrorBLS1->Fill(bbbc / bbb1);
12980  h_2DsumErrorBLS1->Fill(double(ieta), double(k3), bbbc);
12981  h_2D0sumErrorBLS1->Fill(double(ieta), double(k3), bbb1);
12982  h_sumErrorBperLS1->Fill(float(lscounterM1), bbbc);
12983  h_sum0ErrorBperLS1->Fill(float(lscounterM1), bbb1);
12984  }
12985  if (k1 + 1 == 2) {
12986  h_sumErrorBLS2->Fill(bbbc / bbb1);
12987  h_2DsumErrorBLS2->Fill(double(ieta), double(k3), bbbc);
12988  h_2D0sumErrorBLS2->Fill(double(ieta), double(k3), bbb1);
12989  h_sumErrorBperLS2->Fill(float(lscounterM1), bbbc);
12990  h_sum0ErrorBperLS2->Fill(float(lscounterM1), bbb1);
12991  }
12992  }
12993  // HE:
12994  if (k0 == 1) {
12995  // HEdepth1
12996  if (k1 + 1 == 1) {
12997  h_sumErrorBLS3->Fill(bbbc / bbb1);
12998  h_2DsumErrorBLS3->Fill(double(ieta), double(k3), bbbc);
12999  h_2D0sumErrorBLS3->Fill(double(ieta), double(k3), bbb1);
13000  h_sumErrorBperLS3->Fill(float(lscounterM1), bbbc);
13001  h_sum0ErrorBperLS3->Fill(float(lscounterM1), bbb1);
13002  }
13003  if (k1 + 1 == 2) {
13004  h_sumErrorBLS4->Fill(bbbc / bbb1);
13005  h_2DsumErrorBLS4->Fill(double(ieta), double(k3), bbbc);
13006  h_2D0sumErrorBLS4->Fill(double(ieta), double(k3), bbb1);
13007  h_sumErrorBperLS4->Fill(float(lscounterM1), bbbc);
13008  h_sum0ErrorBperLS4->Fill(float(lscounterM1), bbb1);
13009  }
13010  if (k1 + 1 == 3) {
13011  h_sumErrorBLS5->Fill(bbbc / bbb1);
13012  h_2DsumErrorBLS5->Fill(double(ieta), double(k3), bbbc);
13013  h_2D0sumErrorBLS5->Fill(double(ieta), double(k3), bbb1);
13014  h_sumErrorBperLS5->Fill(float(lscounterM1), bbbc);
13015  h_sum0ErrorBperLS5->Fill(float(lscounterM1), bbb1);
13016  }
13017  }
13018  // HF:
13019  if (k0 == 3) {
13020  // HFdepth1
13021  if (k1 + 1 == 1) {
13022  h_sumErrorBLS6->Fill(bbbc / bbb1);
13023  h_2DsumErrorBLS6->Fill(double(ieta), double(k3), bbbc);
13024  h_2D0sumErrorBLS6->Fill(double(ieta), double(k3), bbb1);
13025  h_sumErrorBperLS6->Fill(float(lscounterM1), bbbc);
13026  h_sum0ErrorBperLS6->Fill(float(lscounterM1), bbb1);
13027  }
13028  if (k1 + 1 == 2) {
13029  h_sumErrorBLS7->Fill(bbbc / bbb1);
13030  h_2DsumErrorBLS7->Fill(double(ieta), double(k3), bbbc);
13031  h_2D0sumErrorBLS7->Fill(double(ieta), double(k3), bbb1);
13032  h_sumErrorBperLS7->Fill(float(lscounterM1), bbbc);
13033  h_sum0ErrorBperLS7->Fill(float(lscounterM1), bbb1);
13034  }
13035  }
13036  // HO:
13037  if (k0 == 2) {
13038  // HOdepth4
13039  if (k1 + 1 == 4) {
13040  h_sumErrorBLS8->Fill(bbbc / bbb1);
13041  h_2DsumErrorBLS8->Fill(double(ieta), double(k3), bbbc);
13042  h_2D0sumErrorBLS8->Fill(double(ieta), double(k3), bbb1);
13043  h_sumErrorBperLS8->Fill(float(lscounterM1), bbbc);
13044  h_sum0ErrorBperLS8->Fill(float(lscounterM1), bbb1);
13045  }
13046  }
13048  } //if(sumEstimator6[k0][k1][k2][k3] != 0.
13049 
13052  } //for
13053  } //for
13054  } //for
13055  } //for
13056 
13057  //------------------------------------------------------ averSIGNAL
13066 
13071 
13072  //------------------------------------------------------
13081 
13086 
13087  //------------------------------------------------------ averNOSIGNAL
13096 
13101 
13102  //------------------------------------------------------
13111 
13116 
13117  h_maxxSUMAmpl_HB->Fill(float(lscounterM1), maxxSUM1);
13118  h_maxxSUMAmpl_HE->Fill(float(lscounterM1), maxxSUM2);
13119  h_maxxSUMAmpl_HO->Fill(float(lscounterM1), maxxSUM3);
13120  h_maxxSUMAmpl_HF->Fill(float(lscounterM1), maxxSUM4);
13121  maxxSUM1 = 0.;
13122  maxxSUM2 = 0.;
13123  maxxSUM3 = 0.;
13124  maxxSUM4 = 0.;
13125  //------------------------------------------------------
13126  h_maxxOCCUP_HB->Fill(float(lscounterM1), maxxOCCUP1);
13127  h_maxxOCCUP_HE->Fill(float(lscounterM1), maxxOCCUP2);
13128  h_maxxOCCUP_HO->Fill(float(lscounterM1), maxxOCCUP3);
13129  h_maxxOCCUP_HF->Fill(float(lscounterM1), maxxOCCUP4);
13130  maxxOCCUP1 = 0.;
13131  maxxOCCUP2 = 0.;
13132  maxxOCCUP3 = 0.;
13133  maxxOCCUP4 = 0.;
13134 
13135  } //if( nevcounter0 != 0 )
13137 
13138  std::cout << " ==== Edn of run " << std::endl;
13139 }
13141 //
13143 //
13146  HcalLogicalMap lmap = gen.createMap(topo);
13147 
13148  // HcalElectronicsMap emap=lmap.generateHcalElectronicsMap();
13149 
13150  // const HcalElectronicsMap* emap=conditions->getHcalMapping();
13151  const HcalElectronicsMap* emap;
13152  emap = conditions->getHcalMapping();
13153 
13154  std::string subdet = "";
13155 
13156  MAPfile << "#define LogEleMapdb_h" << std::endl;
13157  MAPfile << "#include <algorithm>" << std::endl;
13158  MAPfile << "#include <iostream>" << std::endl;
13159  MAPfile << "#include <vector>" << std::endl;
13160  MAPfile << "#include <string>" << std::endl;
13161  MAPfile << "#include <sstream>" << std::endl;
13162  MAPfile << std::endl;
13163 
13164  MAPfile << "struct Cell {" << std::endl;
13165  MAPfile << " std::string subdet;" << std::endl;
13166  MAPfile << " int Eta;" << std::endl;
13167  MAPfile << " int Phi;" << std::endl;
13168  MAPfile << " int Depth;" << std::endl;
13169  MAPfile << " std::string RBX;" << std::endl;
13170  MAPfile << " int RM;" << std::endl;
13171  MAPfile << " int Pixel;" << std::endl;
13172  MAPfile << " int RMfiber;" << std::endl;
13173  MAPfile << " int FiberCh;" << std::endl;
13174  MAPfile << " int QIE;" << std::endl;
13175  MAPfile << " int ADC;" << std::endl;
13176  MAPfile << " int VMECardID;" << std::endl;
13177  MAPfile << " int dccID;" << std::endl;
13178  MAPfile << " int Spigot;" << std::endl;
13179  MAPfile << " int FiberIndex;" << std::endl;
13180  MAPfile << " int HtrSlot;" << std::endl;
13181  MAPfile << " int HtrTB;" << std::endl;
13182  MAPfile << std::endl;
13183 
13184  MAPfile << "// the function check, if \"par\" == \"val\" for this cell" << std::endl;
13185  MAPfile << " bool check(const std::string par, const int val) const " << std::endl;
13186  MAPfile << " {" << std::endl;
13187  MAPfile << " if (par == \"Eta\") return (val == Eta);" << std::endl;
13188  MAPfile << " else if (par == \"Phi\") return (val == Phi);" << std::endl;
13189  MAPfile << " else if (par == \"Depth\") return (val == Depth);" << std::endl;
13190  MAPfile << " else if (par == \"RM\") return (val == RM);" << std::endl;
13191  MAPfile << " else if (par == \"Pixel\") return (val == Pixel);" << std::endl;
13192  MAPfile << " else if (par == \"RMfiber\") return (val == RMfiber);" << std::endl;
13193  MAPfile << " else if (par == \"FiberCh\") return (val == FiberCh);" << std::endl;
13194  MAPfile << " else if (par == \"QIE\") return (val == QIE);" << std::endl;
13195  MAPfile << " else if (par == \"ADC\") return (val == ADC);" << std::endl;
13196  MAPfile << " else if (par == \"VMECardID\") return (val == VMECardID);" << std::endl;
13197  MAPfile << " else if (par == \"dccID\") return (val == dccID);" << std::endl;
13198  MAPfile << " else if (par == \"Spigot\") return (val == Spigot);" << std::endl;
13199  MAPfile << " else if (par == \"FiberIndex\") return (val == FiberIndex);" << std::endl;
13200  MAPfile << " else if (par == \"HtrSlot\") return (val == HtrSlot);" << std::endl;
13201  MAPfile << " else if (par == \"HtrTB\") return (val == HtrTB);" << std::endl;
13202  MAPfile << " else return false;" << std::endl;
13203  MAPfile << " }" << std::endl;
13204  MAPfile << std::endl;
13205 
13206  MAPfile << " bool check(const std::string par, const std::string val) const" << std::endl;
13207  MAPfile << " {" << std::endl;
13208  MAPfile << " if (par == \"subdet\") return (val == subdet);" << std::endl;
13209  MAPfile << " else if (par == \"RBX\") return (val == RBX);" << std::endl;
13210  MAPfile << " else return false;" << std::endl;
13211  MAPfile << " }" << std::endl;
13212 
13213  MAPfile << "};" << std::endl;
13214  MAPfile << std::endl;
13215 
13216  MAPfile << "const Cell AllCells[] = {" << std::endl;
13217  MAPfile << "//{ SD, Eta, Phi, Depth, RBX, RM, PIXEL, RMfiber, Fiber Ch., QIE, ADC, VMECrateId, dccid, spigot, "
13218  "fiberIndex, htrSlot, htrTopBottom }"
13219  << std::endl;
13220 
13221  // HB
13222 
13223  for (int eta = -16; eta < 0; eta++) {
13224  for (int phi = 1; phi <= nphi; phi++) {
13225  for (int depth = 1; depth <= 2; depth++) {
13226  HcalDetId* detid = nullptr;
13227  detid = new HcalDetId(HcalBarrel, eta, phi, depth);
13228  subdet = "HB";
13229  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13230  HcalElectronicsId emap_entry = emap->lookup(*detid);
13231  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() << " , " << detid->iphi() - 1 << " , "
13232  << detid->depth() << " ,";
13233  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13234  << lmap_entry.rmFiber() << " , ";
13235  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13236  << " , ";
13237  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13238  << " , " << emap_entry.fiberIndex() << " , ";
13239  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13240  MAPfile << "}," << std::endl;
13241  delete detid;
13242  } //Depth
13243  } //Phi
13244  } //Eta
13245  for (int eta = 1; eta <= 16; eta++) {
13246  for (int phi = 1; phi <= nphi; phi++) {
13247  for (int depth = 1; depth <= 2; depth++) {
13248  HcalDetId* detid = nullptr;
13249  detid = new HcalDetId(HcalBarrel, eta, phi, depth);
13250  subdet = "HB";
13251  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13252  HcalElectronicsId emap_entry = emap->lookup(*detid);
13253  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() - 1 << " , " << detid->iphi() - 1 << " , "
13254  << detid->depth() << " ,";
13255  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13256  << lmap_entry.rmFiber() << " , ";
13257  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13258  << " , ";
13259  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13260  << " , " << emap_entry.fiberIndex() << " , ";
13261  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13262  MAPfile << "}," << std::endl;
13263  delete detid;
13264  } //Depth
13265  } //Phi
13266  } //Eta
13267 
13268  // HE
13269  for (int eta = -20; eta <= -20; eta++) {
13270  for (int phi = nphi; phi <= nphi; phi++) {
13271  for (int depth = 1; depth <= 2; depth++) {
13272  HcalDetId* detid = nullptr;
13273  detid = new HcalDetId(HcalEndcap, eta, phi, depth);
13274  subdet = "HE";
13275  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13276  HcalElectronicsId emap_entry = emap->lookup(*detid);
13277  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() << " , " << detid->iphi() - 1 << " , "
13278  << detid->depth() << " ,";
13279  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13280  << lmap_entry.rmFiber() << " , ";
13281  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13282  << " , ";
13283  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13284  << " , " << emap_entry.fiberIndex() << " , ";
13285  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13286  MAPfile << "}," << std::endl;
13287  delete detid;
13288  } //Depth
13289  } //Phi
13290  } //Eta
13291 
13292  for (int eta = -19; eta <= -16; eta++) {
13293  for (int phi = nphi; phi <= nphi; phi++) {
13294  for (int depth = 1; depth <= 3; depth++) {
13295  HcalDetId* detid = nullptr;
13296  detid = new HcalDetId(HcalEndcap, eta, phi, depth);
13297  subdet = "HE";
13298  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13299  HcalElectronicsId emap_entry = emap->lookup(*detid);
13300  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() << " , " << detid->iphi() - 1 << " , "
13301  << detid->depth() << " ,";
13302  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13303  << lmap_entry.rmFiber() << " , ";
13304  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13305  << " , ";
13306  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13307  << " , " << emap_entry.fiberIndex() << " , ";
13308  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13309  MAPfile << "}," << std::endl;
13310  delete detid;
13311  } //Depth
13312  } //Phi
13313  } //Eta
13314  for (int eta = -29; eta <= -16; eta++) {
13315  for (int phi = 1; phi <= 71; phi++) {
13316  for (int depth = 1; depth <= 3; depth++) {
13317  HcalDetId* detid = nullptr;
13318  detid = new HcalDetId(HcalEndcap, eta, phi, depth);
13319  subdet = "HE";
13320  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13321  HcalElectronicsId emap_entry = emap->lookup(*detid);
13322  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() << " , " << detid->iphi() - 1 << " , "
13323  << detid->depth() << " ,";
13324  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13325  << lmap_entry.rmFiber() << " , ";
13326  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13327  << " , ";
13328  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13329  << " , " << emap_entry.fiberIndex() << " , ";
13330  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13331  MAPfile << "}," << std::endl;
13332  delete detid;
13333  } //Depth
13334  } //Phi
13335  } //Eta
13336  for (int eta = 16; eta <= 29; eta++) {
13337  for (int phi = 1; phi <= nphi; phi++) {
13338  for (int depth = 1; depth <= 3; depth++) {
13339  HcalDetId* detid = nullptr;
13340  detid = new HcalDetId(HcalEndcap, eta, phi, depth);
13341  subdet = "HE";
13342  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13343  HcalElectronicsId emap_entry = emap->lookup(*detid);
13344  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() << " , " << detid->iphi() - 1 << " , "
13345  << detid->depth() << " ,";
13346  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13347  << lmap_entry.rmFiber() << " , ";
13348  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13349  << " , ";
13350  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13351  << " , " << emap_entry.fiberIndex() << " , ";
13352  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13353  MAPfile << "}," << std::endl;
13354  delete detid;
13355  } //Depth
13356  } //Phi
13357  } //Eta
13358 
13359  // HF
13360 
13361  for (int eta = -41; eta <= -29; eta++) {
13362  for (int phi = 1; phi <= nphi; phi += 2) {
13363  for (int depth = 1; depth <= 2; depth++) {
13364  HcalDetId* detid = nullptr;
13365  detid = new HcalDetId(HcalForward, eta, phi, depth);
13366  subdet = "HF";
13367  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13368  HcalElectronicsId emap_entry = emap->lookup(*detid);
13369  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() << " , " << detid->iphi() - 1 << " , "
13370  << detid->depth() << " ,";
13371  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13372  << lmap_entry.rmFiber() << " , ";
13373  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13374  << " , ";
13375  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13376  << " , " << emap_entry.fiberIndex() << " , ";
13377  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13378  MAPfile << "}," << std::endl;
13379  delete detid;
13380  } //Depth
13381  } //Phi
13382  } //Eta
13383 
13384  for (int eta = 29; eta <= 41; eta++) {
13385  for (int phi = 1; phi <= nphi; phi += 2) {
13386  for (int depth = 1; depth <= 2; depth++) {
13387  HcalDetId* detid = nullptr;
13388  detid = new HcalDetId(HcalForward, eta, phi, depth);
13389  subdet = "HF";
13390  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13391  HcalElectronicsId emap_entry = emap->lookup(*detid);
13392  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() << " , " << detid->iphi() - 1 << " , "
13393  << detid->depth() << " ,";
13394  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13395  << lmap_entry.rmFiber() << " , ";
13396  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13397  << " , ";
13398  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13399  << " , " << emap_entry.fiberIndex() << " , ";
13400  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13401  MAPfile << "}," << std::endl;
13402  delete detid;
13403  } //Depth
13404  } //Phi
13405  } //Eta
13406 
13407  // HO
13408 
13409  for (int eta = -15; eta < 0; eta++) {
13410  for (int phi = 1; phi <= nphi; phi++) {
13411  for (int depth = 4; depth <= 4; depth++) {
13412  HcalDetId* detid = nullptr;
13413  detid = new HcalDetId(HcalOuter, eta, phi, depth);
13414  subdet = "HO";
13415  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13416  HcalElectronicsId emap_entry = emap->lookup(*detid);
13417  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() << " , " << detid->iphi() - 1 << " , "
13418  << detid->depth() << " ,";
13419  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13420  << lmap_entry.rmFiber() << " , ";
13421  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13422  << " , ";
13423  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13424  << " , " << emap_entry.fiberIndex() << " , ";
13425  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13426  MAPfile << "}," << std::endl;
13427  delete detid;
13428  } //Depth
13429  } //Phi
13430  } //Eta
13431 
13432  for (int eta = 1; eta <= 15; eta++) {
13433  for (int phi = 1; phi <= nphi; phi++) {
13434  for (int depth = 4; depth <= 4; depth++) {
13435  HcalDetId* detid = nullptr;
13436  detid = new HcalDetId(HcalOuter, eta, phi, depth);
13437  subdet = "HO";
13438  HcalFrontEndId lmap_entry = lmap.getHcalFrontEndId(*detid);
13439  HcalElectronicsId emap_entry = emap->lookup(*detid);
13440  MAPfile << " {\"" << subdet << "\" , " << detid->ieta() - 1 << " , " << detid->iphi() - 1 << " , "
13441  << detid->depth() << " ,";
13442  MAPfile << "\"" << lmap_entry.rbx() << "\" , " << lmap_entry.rm() << " , " << lmap_entry.pixel() << " , "
13443  << lmap_entry.rmFiber() << " , ";
13444  MAPfile << lmap_entry.fiberChannel() << " , " << lmap_entry.qieCard() << " , " << lmap_entry.adc()
13445  << " , ";
13446  MAPfile << emap_entry.readoutVMECrateId() << " , " << emap_entry.dccid() << " , " << emap_entry.spigot()
13447  << " , " << emap_entry.fiberIndex() << " , ";
13448  MAPfile << emap_entry.htrSlot() << " , " << emap_entry.htrTopBottom();
13449  MAPfile << "}," << std::endl;
13450  delete detid;
13451  } //Depth
13452  } //Phi
13453  } //Eta
13454  MAPfile << "};" << std::endl;
13455  MAPfile << std::endl;
13456 
13457  MAPfile << "// macro for array length calculation" << std::endl;
13458  MAPfile << "#define DIM(a) (sizeof(a)/sizeof(a[0]))" << std::endl;
13459  MAPfile << std::endl;
13460 
13461  MAPfile << "// class for cells array managing" << std::endl;
13462  MAPfile << "class CellDB {" << std::endl;
13463  MAPfile << "public:" << std::endl;
13464  MAPfile << " CellDB()" << std::endl;
13465  MAPfile << " : cells(AllCells, AllCells + DIM(AllCells))" << std::endl;
13466  MAPfile << "{}" << std::endl;
13467  MAPfile << std::endl;
13468 
13469  MAPfile << "// return i-th cell" << std::endl;
13470  MAPfile << "Cell operator [] (int i) const {return cells[i];}" << std::endl;
13471 
13472  MAPfile << "// number of cells in database" << std::endl;
13473  MAPfile << "int size() const {return cells.size();}" << std::endl;
13474  MAPfile << std::endl;
13475 
13476  MAPfile << "// select cells for which \"par\" == \"val\"" << std::endl;
13477  MAPfile << "template<typename T>" << std::endl;
13478  MAPfile << "CellDB find(const std::string par, const T val) const" << std::endl;
13479  MAPfile << "{" << std::endl;
13480  MAPfile << " std::vector<Cell> s;" << std::endl;
13481  MAPfile << " for (size_t i = 0; i < cells.size(); ++i)" << std::endl;
13482  MAPfile << " if (cells[i].check(par, val))" << std::endl;
13483  MAPfile << " s.push_back(cells[i]);" << std::endl;
13484  MAPfile << " return CellDB(s);" << std::endl;
13485  MAPfile << "} " << std::endl;
13486  MAPfile << std::endl;
13487  MAPfile << "private:" << std::endl;
13488  MAPfile << " CellDB( const std::vector<Cell> s)" << std::endl;
13489  MAPfile << " : cells(s)" << std::endl;
13490  MAPfile << "{}" << std::endl;
13491  MAPfile << "std::vector<Cell> cells;" << std::endl;
13492  MAPfile << "};" << std::endl;
13493  MAPfile.close();
13494  std::cout << "===== Finish writing Channel MAP =====" << std::endl;
13495 }
13496 
13497 double CMTRawAnalyzer::dR(double eta1, double phi1, double eta2, double phi2) {
13498  double deltaphi = phi1 - phi2;
13499  if (phi2 > phi1) {
13500  deltaphi = phi2 - phi1;
13501  }
13502  if (deltaphi > M_PI) {
13503  deltaphi = 2. * M_PI - deltaphi;
13504  }
13505  double deltaeta = eta2 - eta1;
13506  double tmp = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
13507  return tmp;
13508 }
13509 
13510 double CMTRawAnalyzer::phi12(double phi1, double en1, double phi2, double en2) {
13511  // weighted mean value of phi1 and phi2
13512 
13513  double a1 = phi1;
13514  double a2 = phi2;
13515 
13516  if (a1 > 0.5 * M_PI && a2 < 0.)
13517  a2 += 2 * M_PI;
13518  if (a2 > 0.5 * M_PI && a1 < 0.)
13519  a1 += 2 * M_PI;
13520  double tmp = (a1 * en1 + a2 * en2) / (en1 + en2);
13521  if (tmp > M_PI)
13522  tmp -= 2. * M_PI;
13523 
13524  return tmp;
13525 }
13526 
13527 double CMTRawAnalyzer::dPhiWsign(double phi1, double phi2) {
13528  // clockwise phi2 w.r.t phi1 means "+" phi distance
13529  // anti-clockwise phi2 w.r.t phi1 means "-" phi distance
13530 
13531  double a1 = phi1;
13532  double a2 = phi2;
13533  double tmp = a2 - a1;
13534  if (a1 * a2 < 0.) {
13535  if (a1 > 0.5 * M_PI)
13536  tmp += 2. * M_PI;
13537  if (a2 > 0.5 * M_PI)
13538  tmp -= 2. * M_PI;
13539  }
13540  return tmp;
13541 }
13542 
13545 //define this as a plug-in
TH2F * h_mapDepth4Pedw1_HO
TH2F * h_mapDepth4AmplE34_HO
double lsdep_estimator2_HEdepth3_
TH1F * h_averSIGNALsumamplitude_HO
TH1F * h_runnbadchannels_depth1_HF
TH2F * h_recNoiseEnergy0_HF1
TH2F * h_2D0Ataildepth2_HB
TH1F * h_sumAmplitudeperLS8
double lsdep_estimator3_HFdepth1_
TH1F * h_nevents_per_LSzoom
TH1F * h_sum0PedestalperLS3
double amplitudechannel2[nsub][ndepth][neta][nphi]
static const std::string kSharedResource
Definition: TFileService.h:76
TH1F * h_sumCutADCAmplperLSdepth6HEu
TH1F * h_bcnnbadchannels_depth4_HO
TH2F * h_recNoiseEnergy1_HB1
TH2F * h_2DsumAmplitudeLS5
TH1F * h_RatioOccupancy_HFM
TH2F * h_mapDepth6Amplitude225_HE
TH2F * h_2DsumADCAmplEtaPhiLs3
TH2F * h_mapWidthCalib047_HE
TH1F * h_averSIGNALsumamplitude_HF
TH2F * h_recSignalEnergy1_HF3
bool studyRunDependenceHist_
const int nphi
TH2F * h_mapDepth4TSmeanA225_HE
TH2F * h_mapDepth1TSmaxA225_HE
TH1F * h_sum0ADCAmplperLS3_P1
double const adc2fC_QIE11_shunt6[256]
TH2F * h_mapDepth3TSmaxA225_HE
TH1F * h_sum0ADCAmplperLS5
TH1F * h_sumADCAmplperLS7u
TH1F * h_shape0_good_channels_HO
TH1F * h_bcnbadrate0_depth4_HO
double adc2fC_QIE10[256]
constexpr DetId detid() const
Get the detector id.
TH2F * h_mapDepth3ADCAmpl225Copy_HF
TH1F * h_bcnvsamplitude_HE
TH1F * h_RatioOccupancy_HOM
TH2F * h_amplitudechannel0_HE4
TH1F * h_sum0ADCAmplperLS8_M2
TH2F * h_mapDepth1linADCAmpl12_HE
TH2F * h_amplitudechannel1_HB4
TH2F * h_mapDepth2Amplitude_HB
double lsdep_estimator4_HEdepth3_
TH1F * h_runnbadchannels_depth4_HO
TH1F * h_RatioOccupancy_HOP
TH1F * h_runnbadchannels_depth1_HE
TH2F * h_mapDepth5TS2_HE
double calib3[ndepth][neta][nphi]
TH2F * h_mapDepth2Error_HB
constexpr int readoutVMECrateId() const
get the readout VME crate number
weight_default_t b1[25]
Definition: b1.h:9
TH2F * h_mapDepth2Ampl047_HE
edm::EDGetTokenT< QIE10DigiCollection > tok_qie10_
TH1F * h_runbadrate0_depth3_HE
TH2F * h_amplitudechannel0_HB4
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
TH1F * h_orbitNumvsamplitude_HF
int rm() const
TH2F * h_mapDepth1Error_HF
TH2F * h_mapDepth5TSmeanA_HE
int fiberChannel() const
TH2F * h_recNoiseEnergy1_HE5
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TH1F * h_bcnvsamplitude0_HB
int flagToUseDigiCollectionsORNot_
TH2F * h_recSignalEnergy1_HE5
TH2F * h_mapDepth2AmplE34_HE
TH2F * h_recSignalEnergy0_HF1
TH1F * h_ADCAmpl345Zoom_HB
TH2F * h_mapTSmeanCalib_HF
TH1F * h_averNOSIGNALsumamplitude_HO
TH1F * h_runbadrate0_depth4_HO
TH2F * h_mapDepth3TS2_HB
TH1F * h_bcnbadrate0_depth1_HF
TH2F * h_mapGetRMSOverNormalizedSignal0_HE
TH2F * h_amplitudechannel0_HE3
double calibrTSmaxHOMin_
TH2F * h_mapDepth5TSmaxA_HE
TH2F * h_mapDepth2TS1_HF
TH1F * h_ndepthesperamplitudebins_HE
const HcalDbService * conditions
TH1F * h_AmplitudeHEtest6
TH1F * h_pedestalwaver9_HE
TH2F * h_2DsumADCAmplLS1_LSselected
const HcalPedestal * getPedestal(const HcalGenericDetId &fId) const
double calibrTSmaxHOMax_
TH1F * h_sumADCAmplperLS8_P2
TH2F * h_mapDepth1Amplitude225_HE
TH1F * h_averNOSIGNALsumamplitude_HE
TH1F * h_sum0ADCAmplperLS6_M2
TH2F * h_mapDepth4ADCAmpl225_HB
double mapRADDAM_HE[ndepth][neta][nphi]
TH2F * h_recSignalEnergy1_HB4
TH2F * h_2DsumADCAmplLS8_LSselected
TH1F * h_sumADCAmplperLS6_P1
TH2F * h_mapDepth3Pedw2_HE
TH1F * h_AmplitudeHBrest1
double calibrRatioHBMin_
TH1F * h_sumamplitude_depth2_HE0
TH2F * h_mapCapCalib047_HE
TH1F * h_sumCutTSmeanAperLS4
double lsdep_estimator2_HBdepth1_
TH2F * h_mapDepth4TS2_HE
TH2F * h_mapTSmeanCalib047_HO
TH2F * h_amplitudechannel1_HF3
TH2F * h_mapDepth3Error_HB
TH1F * h_Amplitude_notCapIdErrors_HO4
TH2F * h_mapGetRMSOverNormalizedSignal_HF
TH1F * h_sumCutAmplitudeperLS1
TH2F * h_amplitudechannel1_HB2
double calib0[ndepth][neta][nphi]
TH2F * h_amplitudechannel0_HB3
TH1F * h_sumamplitudechannel_HB
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheNoise_
TH2F * h_mapDepth4Pedw0_HO
double lsdep_estimator2_HOdepth4_
float calibt[ndepth][neta][nphi]
TH2F * h_mapDepth1TS2_HB
TH1F * h_sumamplitude_depth1_HE
TH1F * h_sumCutTSmaxAperLS1
TH1F * h_sumADCAmplperLSdepth4HBu
TH2F * h_mapDepth1Pedw2_HE
TH1F * h_sumCutADCAmplperLSdepth4HEu
TH2F * h_mapDepth3pedestalw_HB
TH2F * h_recNoiseEnergy2_HF1
TH1F * h_pedestalwaver4_HB
TH1F * h_ADCAmpl345Zoom1_HE
TH2F * h_recSignalEnergy0_HF4
double lsdep_estimator3_HBdepth2_
TH2F * h_recNoiseEnergy1_HB4
CMTRawAnalyzer(const edm::ParameterSet &)
float getValue() const
Definition: HcalLUTCorr.h:22
TH2F * h_recSignalEnergy0_HE6
TH2F * h_amplitudechannel1_HF4
TH1F * h_averSIGNALoccupancy_HB
TH2F * h_mapDepth2TSmaxA225_HE
TH2F * h_mapDepth2Amplitude225_HF
TH1F * h_errorGeneral_HE
TH2F * h_mapDepth4Amplitude_HF
TH2F * h_mapDepth2Error_HF
void fillDigiAmplitudeHO(HODigiCollection::const_iterator &digiItr)
TH1F * h_sumADCAmplEtaPhiLs
TH2F * h_mapDepth4ADCAmpl12_HF
TH1F * h_runbadrate_depth2_HE
TH1F * h_Eta16Depth3RADDAM_HED2P
TH2F * h_amplitudechannel0_HE7
TH2F * h_mapDepth2Pedw3_HF
TH2F * h_mapDepth4ADCAmpl225Copy_HB
double averSIGNALsumamplitude_HO
TH2F * h_2DsumADCAmplLSdepth3HFu
void fillDigiErrors(HBHEDigiCollection::const_iterator &digiItr)
TH2F * h_recNoiseEnergy1_HE6
double lsdep_estimator3_HBdepth1_
TH1F * h_numberofhitsHEtest
double sum0Estimator[nsub][ndepth][neta][nphi]
TH2F * h_mapAiForLS_bad_HE
double calibrRatioHOMax_
TH1F * h_AmplitudeHEtest1
int qieCard() const
double lsdep_estimator1_HFdepth3_
TH2F * h_2DsumADCAmplLSdepth5HEu
TH1F * h_sumamplitude_depth4_HO
TH2F * h_2DsumAmplitudeLS1
TH1F * h_sum0ADCAmplperLS7u
TH1F * h_runnbadchannels_depth3_HE
TH2F * h_amplitudechannel2_HF1
TH2F * h_mapDepth1ADCAmpl12_HF
TH2F * h_mapDepth4TS2_HB
TH1F * h_AmplitudeHBrest6
TH2F * h_mapDepth4AmplE34_HE
TH2F * h_mapDepth3ADCAmpl12_HF
TH1F * h_sigLayer1RADDAM6_HED2
double calibrTSmaxHBMin_
double mapRADDAM_HED2[ndepth][neta]
TH2F * h_mapDepth1Pedw1_HE
TH2F * h_2D0sumPedestalLS1
TH2F * h_mapAiForLS_good_HE
TH2F * h_2DsumADCAmplLSdepth4HBu
TH2F * h_mapDepth2ADCAmpl225_HE
TH1F * h_bcnnbadchannels_depth2_HF
TH2F * h_mapDepth2ADCAmpl225_HB
TH2F * h_recSignalEnergy1_HE2
TH1F * h_A_Depth2RADDAM_HE
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalPedestal.h:20
TH1F * h_sumPedestalperLS4
TH2F * h_mapADCCalib047_HE
TH2F * h_mapDepth4Pedw3_HO
TH1F * h_shape_good_channels_HE
TH1F * h_sumADCAmplperLS1_P1
TH1F * h_sum0AmplitudeperLS1
TH2F * h_amplitudechannel2_HE6
int calibcapiderror[ndepth][neta][nphi]
TH2F * h_mapDepth3TS2_HE
TH1F * h_sumphiEta16Depth3RADDAM_HED2
TH2F * h_2D0sumPedestalLS6
edm::InputTag inputTag_
TH2F * h_mapDepth1Error_HB
int flagIterativeMethodCalibrationGroupDigi_
double maprphinorm[nsub][ndepth][neta][nphi]
TH1F * h_gsmdifferencefit4_HE
TH2F * h_recSignalEnergy2_HB2
TH2F * h_mapDepth6ADCAmpl12_HE
TH2F * h_mapADCAmpl11firstpeak_HE
TH1F * h_eventoccupancy_HF
TH2F * h_2DsumAmplitudeLS6
int mapRADDAM0_HE[ndepth][neta][nphi]
TH1F * h_runbadrate_depth1_HB
double lsdep_estimator3_HOdepth4_
double calibrTSmaxHEMax_
TH2F * h_recNoiseEnergy2_HE5
TH2F * h_recNoiseEnergy2_HE6
TH1F * h_gsmdifferencefit5_HE
TH2F * h_mapDepth2Amplitude225_HE
TH1F * h_Amplitude_notCapIdErrors_HB1
TH1F * h_runnbadchannelsC_depth1_HE
TH2F * h_recNoiseEnergy0_HF3
double amplitudechannel[nsub][ndepth][neta][nphi]
double averSIGNALoccupancy_HO
TH1F * h_Amplitude_forCapIdErrors_HB1
TH1F * h_runbadrateC_depth2_HB
TH2F * h_mapDepth3Error_HE
TH2F * h_mapCapCalib047_HO
double lsdep_estimator4_HFdepth2_
TH2F * h_mapCapCalib047_HB
TH1F * h_pedestalwaver4_HO
TH2F * h_mapDepth3Amplitude225_HB
TH2F * h_mapDepth4Amplitude225_HB
TH2F * h_recSignalEnergy1_HF2
TH2F * h_amplitudechannel0_HE2
TH2F * h_mapDepth2Pedw3_HE
TH1F * h_runnbadchannelsC_depth1_HF
double calibrWidthHEMin_
TH2F * h_mapDepth4Ampl047_HF
TH1F * h_sumamplitude_depth4_HO0
TH1F * h_shape0_bad_channels_HB
TH1F * h_AmplitudeHBtest
TH1F * h_RatioOccupancy_HEP
TH1F * h_Eta16Depth3RADDAM_HED2ALL
TH2F * h_amplitudechannel1_HE5
TH2F * h_mapDepth1TSmaxA_HF
TH2F * h_recNoiseEnergy0_HE6
TH1F * h_sigLayer1RADDAM6_HE
TH1F * h_shape0_good_channels_HB
double calibrTSmeanHOMax_
TH2F * h_2D0sumPedestalLS4
TH1F * h_sigLayer1RADDAM0_HE
TH2F * h_mapDepth7ADCAmpl_HE
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
TH2F * h_2DsumADCAmplEtaPhiLs0
double lsdep_estimator2_HEdepth1_
TH2F * h_mapDepth4ADCAmpl_HE
TH1F * h_sumamplitude_depth2_HB
TH1F * h_NphiForEta16Depth3RADDAM_HED2ALL
TH2F * h_2DsumAmplitudeLS4
TH2F * h_recNoiseEnergy1_HE3
TH2F * h_mapDepth4ADCAmpl12_HE
double phi12(double phi1, double en1, double phi2, double en2)
TH1F * h_energyhitNoise_HE
double lsdep_estimator1_HBdepth1_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
TH2F * h_mapDepth4Error_HB
std::vector< T >::const_iterator const_iterator
TH2F * h_2D0Ataildepth1_HB
TH1F * h_sum0ADCAmplperLSdepth5HEu
TH2F * h_mapDepth3ADCAmpl_HF
TH1F * h_gsmdifferencefit3_HE
const HcalQIEShape * shape
TH1F * h_sumamplitude_depth2_HE
double lsdep_estimator1_HFdepth4_
TH2F * h_mapDepth2linADCAmpl12_HE
TH2F * h_mapGetRMSOverNormalizedSignal0_HO
TH2F * h_mapDepth2TS2_HB
TH2F * h_recNoiseEnergy1_HF4
TH2F * h_mapDepth1Ampl047_HB
TH2F * h_mapDepth2Amplitude225_HB
TH2F * h_mapTSmeanCalib047_HB
TH2F * h_recNoiseEnergy0_HB4
TH2F * h_mapDepth4Amplitude_HO
TH2F * h_recNoiseEnergy0_HE2
edm::EDGetTokenT< HFRecHitCollection > tok_hfSignal_
TH2F * h_mapDepth1AmplE34_HF
TH2F * h_mapDepth4pedestal_HB
double recSignalEnergy2[nsub][ndepth][neta][nphi]
TH2F * h_recSignalEnergy1_HB2
TH2F * h_amplitudechannel2_HE7
TH2F * h_mapDepth3Ampl047_HE
TH2F * h_mapDepth1ADCAmpl225_HE
TH2F * h_mapDepth7ADCAmpl225_HE
double averSIGNALoccupancy_HB
TH2F * h_2D0sumAmplitudeLS2
TH1F * h_nbadchannels_depth3_HE
TH1F * h_sum0ADCAmplperLS6_P2
TH1F * h_Amplitude_forCapIdErrors_HE3
TH2F * h_mapDepth4TSmeanA225_HB
TH1F * h_sumamplitude_depth2_HB0
TH1F * h_sumAmplperLS1_LSselected
TH1F * h_corrforxaMAIN0_HE
TH2F * h_mapDepth2ADCAmpl_HF
TH1F * h_sumamplitude_depth1_HF1
TH2F * h_mapGetRMSOverNormalizedSignal_HE
double lsdep_estimator1_HEdepth4_
TH1F * h_Amplitude_forCapIdErrors_HF1
TH2F * h_2DsumAmplitudeLS3
TH1F * h_sum0PedestalperLS1
TH2F * h_mapDepth2TSmaxA_HB
TH1F * h_sum0ADCAmplperLSdepth3HBu
TH2F * h_mapDepth3Amplitude_HE
TH1F * h_ADCAmpl345Zoom_HE
TH2F * h_mapDepth5TSmeanA225_HE
TH2F * h_recNoiseEnergy0_HE7
TH2F * h_recNoiseEnergy2_HB1
TH2F * h_recNoiseEnergy0_HB2
TH2F * h_mapTSmaxCalib047_HB
TH1F * h_Amplitude_notCapIdErrors_HF2
TH1F * h_sumADCAmplperLS8_P1
TH2F * h_mapDepth1AmplE34_HB
TH2F * h_recSignalEnergy2_HE7
TH1F * h_sum0TSmeanAperLS7
double lsdep_estimator2_HEdepth2_
TH2F * h_mapDepth4Error_HO
double sumEstimator3[nsub][ndepth][neta][nphi]
const HcalElectronicsMap * getHcalMapping() const
TH2F * h_recSignalEnergy0_HE2
TH2F * h_mapDepth2ADCAmpl_HB
TH2F * h_mapDepth1TSmaxA225_HF
TH2F * h_recNoiseEnergy1_HB3
double lsdep_estimator4_HBdepth2_
TH2F * h_mapDepth7TSmeanA225_HE
double lsdep_estimator1_HEdepth3_
TH1F * h_AmplitudeHEtest
TH2F * h_mapDepth1ADCAmpl225_HF
TH1F * h_Amplitude_forCapIdErrors_HE1
TH2F * h_mapDepth4Amplitude225_HF
TH2F * h_mapDepth2pedestal_HB
double lsdep_estimator3_HEdepth2_
TH2F * h_mapGetRMSOverNormalizedSignal_HO
TH2F * h_mapDepth1Pedw3_HE
void fillDigiAmplitudeQIE11(QIE11DataFrame qie11df)
TH2F * h_2D0sumADCAmplLSdepth4HFu
double calibrTSmeanHFMin_
TH1F * h_sumamplitude_depth1_HB
constexpr int htrSlot() const
get the htr slot
TH1F * h_sumPedestalperLS1
TH1F * h_sumAmplitudeperLS1
void fillDigiErrorsHF(HFDigiCollection::const_iterator &digiItr)
TH2F * h_mapDepth3ADCAmpl225_HB
TH1F * h_nbadchannels_depth2_HB
double lsdep_estimator5_HEdepth1_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheSignal_
TH1F * h_shape_good_channels_HF
TH2F * h_mapDepth2Pedw1_HE
TH2F * h_amplitudechannel2_HF3
double lsdep_estimator1_HFdepth2_
TH2F * h_mapDepth4TSmaxA225_HF
TH2F * h_recNoiseEnergy1_HE1
TH1F * h_sigLayer2RADDAM6_HE
TH2F * h_recSignalEnergy2_HE6
TH2F * h_mapDepth4TSmeanA_HB
TH2F * h_mapDepth1RADDAM0_HE
TH2F * h_2DsumADCAmplLSdepth3HBu
TH2F * h_2D0sumADCAmplLSdepth6HEu
TH2F * h_recSignalEnergy1_HE1
TH1F * h_sum0ADCAmplperLS8_P2
TH1F * h_nbadchannels_depth1_HB
TH2F * h_recNoiseEnergy1_HB2
TH2F * h_mapDepth3Ampl_HB
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
TH1F * h_sum0ADCAmplperLS3_P2
TH2F * h_mapDepth4ADCAmpl_HB
TH1F * h_energyhitSignal_HB
TH1F * h_runnbadchannelsC_depth2_HE
TH1F * h_bcnvsamplitude_HB
TH2F * h_amplitudechannel0_HF2
TH2F * h_mapDepth5ADCAmpl225_HE
TH1F * h_sumADCAmplperLS3_M2
TH1F * h_sum0ADCAmplperLS1_P2
TH2F * h_mapDepth1TSmeanA225_HE
TH2F * h_recSignalEnergy1_HE3
int flagfitshunt1pedorledlowintensity_
TH2F * h_mapDepth2Pedw3_HB
TH1F * h_sumamplitude_depth3_HE
TH1F * h_sumCutTSmeanAperLS8
TH2F * h_mapDepth1TSmeanA_HB
TH2F * h_mapDepth4pedestal_HE
TH1F * h_Amplitude_forCapIdErrors_HB2
TH2F * h_mapDepth4Ampl047_HB
TH2F * h_mapDepth1ADCAmpl12_HE
TH2F * h_2DsumADCAmplEtaPhiLs1
TH2F * h_2DsumADCAmplLS4_LSselected
TH1F * h_nbadchannels_depth2_HE
TH1F * h_sumADCAmplLS1copy1
double dPhiWsign(double phi1, double phi2)
TH1F * h_sum0ADCAmplperLS3_M1
TH2F * h_recNoiseEnergy0_HB3
double tocamplchannel[nsub][ndepth][neta][nphi]
double calib2[ndepth][neta][nphi]
TH2F * h_mapDepth4ADCAmpl225_HF
TH1F * h_sum0PedestalperLS8
TH1F * h_sumADCAmplperLS6u
double calibrWidthHBMax_
TH1F * h_runbadrate_depth4_HO
double lsdep_estimator2_HFdepth2_
TH2F * h_mapDepth1Ampl_HB
double averNOSIGNALsumamplitude_HO
TH2F * h_mapDepth4Ampl047_HO
TH1F * h_Amplitude_notCapIdErrors_HE3
TH2F * h_mapDepth2Pedw1_HB
constexpr DetId detid() const
Get the detector id.
TH2F * h_mapDepth2Ampl047_HB
TH2F * h_mapDepth1TSmaxA_HB
TH2F * h_mapDepth2pedestalw_HF
TH2F * h_mapADCAmpl11firstpeak0_HE
const int nsub
TH1F * h_sumCutAmplitudeperLS7
edm::Service< TFileService > fs_
TH2F * h_mapCapCalib047_HF
TH1F * h_sum0AmplitudeperLS2
TH1F * h_bcnvsamplitude0_HF
double lsdep_estimator1_HEdepth5_
double calibrTSmeanHEMax_
TH2F * h_mapDepth7ADCAmpl225Copy_HE
TH1F * h_sumCutTSmaxAperLS2
constexpr float energy() const
Definition: CaloRecHit.h:29
TH1F * h_sumCutTSmeanAperLS3
TH2F * h_mapDepth2ADCAmplSiPM_HE
TH2F * h_mapDepth3pedestal_HB
TH2F * h_amplitudechannel1_HB1
TH2F * h_mapDepth4ADCAmpl225Copy_HO
TH2F * h_mapenophinorm_HE2
TH2F * h_2DsumADCAmplLSdepth4HEu
TH1F * h_sum0PedestalperLS6
TH2F * h_mapDepth4pedestalw_HF
TH1F * h_sum0ADCAmplperLS3_M2
TH2F * h_amplitudechannel0_HB1
TH2F * h_recSignalEnergy2_HF2
TH1F * h_sumCutTSmeanAperLS7
TH2F * h_recSignalEnergy0_HF3
TH2F * h_amplitudechannel1_HE4
TH2F * h_recSignalEnergy1_HE7
double calibrWidthHEMax_
double calibrRatioHOMin_
TH1F * h_sumADCAmplperLS6_P2
TH2F * h_mapADCAmpl11secondpeak_HE
TH1F * h_nbadchannels_depth4_HO
TH2F * h_mapWidthCalib047_HB
TH2F * h_amplitudechannel2_HE5
TH1F * h_sumPedestalperLS3
TH1F * h_sumADCAmplLS1copy2
TH1F * h_sumCutADCAmplperLS5
TH1F * h_repetedcapid_HF
TH1F * h_runbadrate0_depth2_HB
double sumEstimator5[nsub][ndepth][neta][nphi]
TH1F * h_sumADCAmplperLSdepth6HEu
TH2F * h_recSignalEnergy2_HE3
TH1F * h_runbadrate_depth1_HF
T getUntrackedParameter(std::string const &, T const &) const
TH2F * h_mapDepth4TSmaxA_HB
TH1F * h_sum0ADCAmplperLS6_M1
TH2F * h_mapDepth4Error_HE
TH1F * h_sumCutADCAmplperLSdepth7HEu
TH1F * h_pedestalwaver9_HF
TH2F * h_recSignalEnergy1_HE6
double lsdep_estimator2_HFdepth1_
edm::EDGetTokenT< HFRecHitCollection > tok_hfNoise_
TH2F * h_mapDepth1TSmeanA225_HF
TH2F * h_mapDepth5AmplE34_HE
double lsdep_estimator1_HBdepth3_
TH2F * h_mapAiForLS_good_HF
TH2F * h_mapDepth4TS1_HF
TH2F * h_map0AiForLS_bad_HB
TH2F * h_mapWidthCalib047_HO
void fillDigiErrorsQIE11(QIE11DataFrame qie11df)
TH1F * h_sigLayer1RADDAM5_HED2
double calibrWidthHOMin_
TH2F * h_mapDepth1ADCAmpl225_HB
TH2F * h_mapDepth2Error_HE
TH1F * h_sumamplitude_depth2_HF
TH2F * h_amplitudechannel2_HB4
TH2F * h_mapenophinorm2_HE1
TH2F * h_mapDepth2TSmeanA225_HE
TH2F * h_mapDepth4TSmaxA_HO
TH1F * h_shape0_bad_channels_HF
TH2F * h_amplitudechannel0_HE6
TH2F * h_mapDepth1Pedw3_HB
TH1F * h_pedestalwaver9_HO
TH2F * h_mapDepth1TSmaxA_HE
TH2F * h_mapDepth3ADCAmpl12_HE
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
Definition: HcalCoderDb.cc:73
TH2F * h_mapDepth4AmplE34_HB
TH2F * h_mapDepth1pedestal_HB
TH1F * h_Amplitude_forCapIdErrors_HE2
TH1F * h_bcnvsamplitude_HO
TH2F * h_mapDepth3TSmaxA225_HB
TH1F * h_sumamplitudechannel_HE
double averNOSIGNALoccupancy_HB
const int zneta
TH2F * h_mapDepth4TSmeanA_HF
TH2F * h_mapADCAmplfirstpeak_HE
TH2F * h_mapDepth4ADCAmpl225Copy_HF
TH1F * h_sum0PedestalperLS4
TH2F * h_recNoiseEnergy0_HE5
TH2F * h_mapDepth7TSmeanA_HE
TH1F * h_nbadchannels_depth2_HF
TH1F * h_sum0AmplitudeperLS5
TH2F * h_mapDepth3ADCAmpl225_HF
TH2F * h_amplitudechannel0_HF4
TH1F * h_orbitNumvsamplitude0_HE
TH1F * h_sigLayer2RADDAM5_HED2
TH2F * h_recSignalEnergy0_HB2
TH1F * h_eventoccupancy_HB
TH2F * h_2D0sumAmplitudeLS1
TH1F * h_sumADCAmplperLS3_M1
TH2F * h_recSignalEnergy2_HE4
TH1F * h_shape0_good_channels_HE
TH2F * h_mapADCCalib047_HO
TH1F * h_eventoccupancy_HE
double lsdep_estimator1_HOdepth4_
int iEvent
Definition: GenABIO.cc:224
TH1F * h_sumADCAmplEtaPhiLs_ietaphi
double lsdep_estimator4_HOdepth4_
TH1F * h_mapDepth3RADDAM16_HE
TH1F * h_sum0ADCAmplperLSdepth4HBu
TH1F * h_shape_bad_channels_HO
TH1F * h_Amplitude_forCapIdErrors_HF2
TH1F * h_RatioOccupancy_HBP
double lsdep_estimator4_HBdepth1_
TH1F * h_sumCutADCAmplperLS6
TH2F * h_2D0sumPedestalLS8
TH2F * h_recSignalEnergy0_HB1
TH1F * h_runbadrateC_depth2_HE
TH2F * h_recSignalEnergy1_HE4
TH1F * h_sumADCAmplperLS8_M2
TH1F * h_sumamplitudechannel_HF
const int npfit
TH2F * h_mapDepth2ADCAmpl12SiPM_HE
TH2F * h_mapDepth1pedestalw_HB
TH2F * h_mapDepth2RADDAM_HE
double calibrRatioHEMin_
TH2F * h_mapDepth6pedestal_HE
TH2F * h_mapDepth3TSmeanA225_HF
TH2F * h_mapDepth4ADCAmpl12_HB
TH2F * h_2D0sumPedestalLS7
TH2F * h_mapDepth1Amplitude_HF
TH1F * h_sumADCAmplLS1copy5
const int neta
std::ofstream MAPfile
TH2F * h_2D0sumADCAmplLSdepth3HFu
const HcalTopology * topo
TH2F * h_amplitudechannel2_HF4
TH1F * h_runbadrateC_depth2_HF
double forallestimators_amplitude_bigger_
TH1F * h_sum0AmplitudeperLS8
TH2F * h_mapDepth5Ampl047_HE
TH1F * h_sum0AmplitudeperLS3
TH1F * h_ADCAmpl345Zoom1_HB
double lsdep_estimator5_HFdepth2_
TH1F * h_runbadrate_depth2_HF
TH2F * h_mapDepth3Amplitude_HB
TH1F * h_energyhitNoise_HB
TH1F * h_sumADCAmplperLS1_M1
TH1F * h_totalAmplitudeHEperEvent
TH2F * h_mapDepth3RADDAM_HE
TH2F * h_mapDepth3ADCAmpl225Copy_HE
TH1F * h_sumADCAmplperLSdepth3HBu
const HcalRespCorr * getHcalRespCorr(const HcalGenericDetId &fId) const
TH1F * h_energyhitSignal_HF
TH2F * h_mapDepth5pedestalw_HE
TH1F * h_runbadrateC_depth1_HF
TH2F * h_mapWidthCalib047_HF
TH2F * h_recSignalEnergy2_HE2
TH2F * h_amplitudechannel0_HE1
TH1F * h_runnbadchannelsC_depth2_HF
int getRBX(int &i, int &j, int &k)
TH1F * h_sumCutAmplitudeperLS8
TH2F * h_mapAiForLS_bad_HF
TH2F * h_mapDepth7Ampl047_HE
TH1F * h_sumCutTSmeanAperLS1
TH1F * h_sum0ADCAmplperLS1
TH1F * h_sumamplitude_depth2_HE1
TH1F * h_sumADCAmplperLS8_M1
TH2F * h_mapDepth2TSmaxA_HE
TH1F * h_bcnnbadchannels_depth1_HB
constexpr int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
TH2F * h_mapDepth2Amplitude_HF
TH2F * h_mapADCAmpl12secondpeak_HE
T sqrt(T t)
Definition: SSEVec.h:19
TH2F * h_mapDepth1TSmeanA225_HB
double calibrTSmaxHEMin_
double calibrRatioHFMax_
TH2F * h_recNoiseEnergy0_HE4
TH2F * h_amplitudechannel2_HB3
TH1F * h_runnbadchannels_depth2_HB
TH2F * h_mapDepth3Amplitude_HF
const edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tokTopo_
TH2F * h_mapDepth4Amplitude225_HO
TH1F * h_sumamplitude_depth1_HB0
TH1F * h_sumamplitude_depth3_HE1
TH1F * h_corrforxaADDI0_HE
TH2F * h_mapDepth5ADCAmpl12_HE
TH1F * h_eventamplitude_HO
double lsdep_estimator4_HFdepth1_
TH2F * h_mapDepth5ADCAmpl_HE
TH1F * h_AmplitudeHBrest
TH1F * h_sum0ADCAmplperLS8_P1
TH1F * h_totalAmplitudeHOperEvent
int pixel() const
TH2F * h_mapDepth1Ampl047_HE
TH1F * h_sumCutADCAmplperLS2
TH2F * h_mapDepth3Pedw3_HE
TH2F * h_mapDepth4Ampl_HB
TH1F * h_errorGeneral_HB
TH1F * h_sumAmplitudeperLS6
TH1F * h_errorGeneral_HO
TH1F * h_AamplitudewithPedSubtr_RADDAM_HEzoom0
TH2F * h_mapDepth6Amplitude_HE
TH2F * h_mapenophinorm_HE5
TH2F * h_map0AiForLS_bad_HF
TH2F * h_recSignalEnergy2_HF3
TH1F * h_sumCutTSmeanAperLS5
TH1F * h_sum0ADCAmplperLS2
TH1F * h_shape_good_channels_HO
double averNOSIGNALsumamplitude_HB
TH2F * h_mapDepth1Pedw1_HB
bool usePedestalSubtraction_
TH2F * h_mapDepth2Pedw2_HF
TH2F * h_mapTSmeanCalib047_HF
TH1F * h_totalAmplitudeHO
float getValue() const
Definition: HcalTimeCorr.h:19
TH1F * h_numberofhitsHFtest
TH2F * h_mapTSmaxCalib047_HE
TH1F * h_runbadrate0_depth1_HF
TH2F * h_mapDepth2Pedw0_HF
TH2F * h_amplitudechannel0_HF1
double calibrTSmeanHOMin_
TH1F * h_NphiForEta16Depth3RADDAM_HED2P
TH1F * h_sigLayer2RADDAM_HE
TH2F * h_mapDepth4ADCAmpl_HO
TH1F * h_sum0ADCAmplperLS6_P1
TH2F * h_recNoiseEnergy0_HB1
TH1F * h_AmplitudeHOtest
TH2F * h_amplitudechannel0_HF3
TH2F * h_mapDepth2ADCAmpl225Copy_HB
TH2F * h_mapDepth7pedestalw_HE
TH1F * h_sumCutADCAmplperLSdepth3HBu
TH2F * h_amplitudechannel1_HF1
TH1F * h_ADCAmpl_HBCapIdNoError
void analyze(const edm::Event &, const edm::EventSetup &) override
double caliba[ndepth][neta][nphi]
std::string rbx() const
const float bphi
TH2F * h_2D0sumAmplitudeLS8
TH1F * h_sumCutADCAmplperLS3
double averNOSIGNALoccupancy_HE
TH2F * h_recSignalEnergy1_HB3
TH2F * h_recSignalEnergy0_HB3
TH2F * h_mapDepth6ADCAmpl225_HE
TH2F * h_recSignalEnergy1_HB1
TH2F * h_recNoiseEnergy1_HF1
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const float anpfit
TH2F * h_mapDepth7TS2_HE
TH1F * h_ADCAmplrest1_HF
TH1F * h_Amplitude_notCapIdErrors_HB2
TH1F * h_energyhitSignal_HE
TH1F * h_runbadrateC_depth1_HE
TH1F * h_orbitNumvsamplitude0_HF
double sumEstimator1[nsub][ndepth][neta][nphi]
TH2F * h_2DsumAmplitudeLS8
TH2F * h_mapDepth3Amplitude225_HF
TH2F * h_mapDepth3TSmeanA225_HE
static const float adc2fC[128]
TH1F * h_sumADCAmplperLS1_P2
TH2F * h_mapDepth2Ampl_HB
TH1F * h_runbadrate0_depth2_HF
TH2F * h_mapDepth2Amplitude_HE
TH1F * h_sum0ADCAmplperLS6
double calibw[ndepth][neta][nphi]
TH1F * h_nevents_per_eachLS
TH2F * h_recSignalEnergy2_HF4
TH2F * h_recSignalEnergy0_HF2
edm::EDGetTokenT< QIE11DigiCollection > tok_qie11_
TH2F * h_2DsumADCAmplEtaPhiLs20
TH1F * h_ADCAmpl345_HBCapIdNoError
TH2F * h_amplitudechannel1_HE6
TH2F * h_amplitudechannel2_HE3
TH2F * h_mapDepth7Amplitude225_HE
TH2F * h_mapDepth3ADCAmpl12_HB
TH1F * h_sum0TSmeanAperLS6
const int znphi
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
double lsdep_estimator1_HBdepth2_
TH2F * h_2D0sumADCAmplLSdepth3HBu
TH1F * h_runbadrate_depth1_HE
TH1F * h_sumADCAmplperLS6_M1
TH2F * h_recNoiseEnergy2_HF3
const HcalLUTCorr * getHcalLUTCorr(const HcalGenericDetId &fId) const
TH2F * h_amplitudechannel2_HE1
TH2F * h_mapDepth2TSmeanA225_HB
TH2F * h_mapDepth1ADCAmpl12_HB
TH2F * h_mapDepth1Pedw2_HF
double averNOSIGNALsumamplitude_HF
TH2F * h_mapDepth5Amplitude225_HE
TH2F * h_mapDepth2ADCAmpl12_HB
TH2F * h_map0AiForLS_good_HF
TH2F * h_mapenophinorm2_HE7
TH2F * h_mapDepth2TSmeanA225_HF
TH2F * h_mapDepth5TSmaxA225_HE
TH1F * h_averNOSIGNALoccupancy_HO
TH1F * h_runnbadchannelsC_depth2_HB
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const_iterator begin() const
TH1F * h_sumphiEta16Depth3RADDAM_HED2ALL
TH2F * h_recNoiseEnergy2_HE7
TH1F * h_sum0ADCAmplperLS8
TH2F * h_mapenophinorm_HE1
TH1F * h_sumAmplitudeperLS1_LSselected
TH2F * h_mapDepth1Pedw0_HF
#define NUMADCS
TH2F * h_mapDepth2TSmaxA_HF
TH1F * h_sumCutAmplitudeperLS3
double lsdep_estimator5_HBdepth2_
TH1F * h_sumamplitude_depth3_HE0
bool usecontinuousnumbering_
TH1F * h_AmplitudeHBtest1
TH2F * h_mapDepth3pedestalw_HE
TH1F * h_averNOSIGNALoccupancy_HB
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
TH1F * h_ADCAmpl_HBCapIdError
TH2F * h_2DsumADCAmplLS3_LSselected
TH1F * h_runnbadchannels_depth2_HE
TH1F * h_sumADCAmplperLSdepth5HEu
TH1F * h_averSIGNALoccupancy_HO
TH1F * h_totalAmplitudeHE
double calibrWidthHFMin_
TH2F * h_mapDepth7TSmaxA225_HE
TH2F * h_mapDepth6TS2_HE
TH1F * h_sumADCAmplLS1copy4
TH2F * h_mapDepth7pedestal_HE
TH1F * h_sumCutADCAmplperLS8
TH1F * h_lsnumber_per_eachLS
TH2F * h_mapADCCalib047_HF
double amplitudechannel0[nsub][ndepth][neta][nphi]
TH2F * h_recNoiseEnergy1_HF2
TH1F * h_Amplitude_forCapIdErrors_HO4
int flagestimatornormalization_
TH1F * h_orbitNumvsamplitude0_HO
TH2F * h_mapADCAmpl12firstpeak_HE
TH2F * h_mapADCAmplfirstpeak0_HE
TH1F * h_pedestalwaver4_HE
double recSignalEnergy0[nsub][ndepth][neta][nphi]
TH2F * h_recNoiseEnergy2_HE1
def gen(fragment, howMuch)
Production test section ####.
TH2F * h_recNoiseEnergy1_HF3
TH2F * h_mapDepth2TSmaxA225_HB
TH1F * h_sumAmplitudeperLS3
TH2F * h_mapDepth4TSmaxA225_HB
TH2F * h_mapDepth6TSmeanA_HE
TH1F * h_sumCutADCAmplperLS6u
TH2F * h_map0AiForLS_bad_HO
double recSignalEnergy1[nsub][ndepth][neta][nphi]
TH1F * h_sumADCAmplperLS1_M2
TH1F * h_sumTSmeanAperLS1_LSselected
double lsdep_estimator1_HBdepth4_
TH1F * h_sumADCAmplperLS3_P1
TH1F * h_sumADCAmplLS1copy3
TH2F * h_mapDepth2Pedw2_HB
TH1F * h_sum0ADCAmplperLSdepth7HEu
TH1F * h_runbadrate_depth3_HE
TH2F * h_mapAiForLS_good_HB
TH1F * h_runbadrate0_depth2_HE
double averNOSIGNALoccupancy_HO
TH1F * h_sigLayer1RADDAM_HE
TH2F * h_mapADCAmpl12secondpeak0_HE
TH1F * h_sumCutADCAmplperLSdepth4HBu
TH1F * h_sumPedestalperLS7
TH2F * h_mapDepth5Error_HE
TH1F * h_shape_bad_channels_HF
double recNoiseEnergy0[nsub][ndepth][neta][nphi]
TH2F * h_mapDepth4TS012_HO
TH1F * h_sum0ADCAmplperLS7
TH2F * h_mapDepth3ADCAmpl225_HE
TH2F * h_mapDepth4ADCAmpl12_HO
ii
Definition: cuy.py:589
TH2F * h_mapDepth1AmplE34_HE
TH2F * h_mapAiForLS_good_HO
TH1F * h_bcnbadrate0_depth2_HF
#define M_PI
TH2F * h_mapDepth4AmplE34_HF
TH1F * h_sum0PedestalperLS5
TH2F * h_2D0sumAmplitudeLS5
TH2F * h_mapDepth2TSmaxA225_HF
TH2F * h_mapDepth3Ampl047_HB
TH1F * h_sumCutTSmeanAperLS2
TH1F * h_sumamplitude_depth2_HB1
TH2F * h_mapADCAmplsecondpeak_HE
TH2F * h_mapDepth3pedestalw_HF
float TS_data[100]
TH2F * h_mapDepth2TSmeanA_HE
TH1F * h_sumamplitude_depth1_HE1
double lsdep_estimator4_HEdepth2_
TH2F * h_amplitudechannel2_HB1
TH2F * h_mapDepth1ADCAmpl_HB
TH1F * h_bcnbadrate0_depth2_HB
TH2F * h_2DsumADCAmplEtaPhiLs10
TH2F * h_recSignalEnergy2_HB3
TH1F * h_runnbadchannelsC_depth3_HE
const_iterator end() const
TH2F * h_mapDepth6pedestalw_HE
TH2F * h_mapDepth3TSmeanA_HB
const HcalFrontEndId getHcalFrontEndId(const DetId &)
double sumEstimator0[nsub][ndepth][neta][nphi]
TH2F * h_2DsumAmplitudeLS2
TH2F * h_amplitudechannel1_HE2
TH2F * h_map0AiForLS_good_HO
TH2F * h_2D0sumPedestalLS5
double lsdep_estimator5_HBdepth1_
TH2F * h_mapADCAmpl12firstpeak0_HE
TH2F * h_mapDepth1Error_HE
double sumEstimator2[nsub][ndepth][neta][nphi]
TH2F * h_mapTSmaxCalib047_HF
TH1F * h_sum0TSmeanAperLS4
TH2F * h_mapDepth3pedestal_HF
TH2F * h_mapDepth3ADCAmpl_HB
TH2F * h_recSignalEnergy2_HF1
TH1F * h_sumADCAmplEtaPhiLs_bbbc
TH1F * h_pedestalwaver4_HF
TH2F * h_recNoiseEnergy2_HE3
TH2F * h_mapADCCalib047_HB
TH2F * h_mapDepth1Amplitude_HE
TH2F * h_mapDepth1ADCAmpl225Copy_HB
TH2F * h_mapDepth2AmplE34_HB
double lsdep_estimator3_HEdepth1_
Definition: DetId.h:17
TH2F * h_mapDepth1Pedw0_HB
TH2F * h_2D0sumPedestalLS3
TH1F * h_sumAmplitudeperLS4
TH2F * h_2DsumADCAmplEtaPhiLs00
TH1F * h_energyhitNoise_HF
constexpr int samples() const
total number of samples in the digi
TH2F * h_mapDepth3Error_HF
TH2F * h_amplitudechannel2_HB2
TH2F * h_mapDepth3TSmaxA_HF
TH1F * h_runbadrate_depth2_HB
TH2F * h_2D0sumPedestalLS2
TH1F * h_Amplitude_notCapIdErrors_HE1
TH2F * h_mapADCAmpl11secondpeak0_HE
TH2F * h_recNoiseEnergy0_HE3
TH1F * h_sum0AmplitudeperLS4
TH2F * h_mapDepth4TSmaxA_HF
double lsdep_estimator5_HFdepth1_
TH2F * h_2DsumADCAmplEtaPhiLs2
TH2F * h_recNoiseEnergy2_HE4
TH2F * h_mapDepth1Pedw1_HF
TH1F * h_repetedcapid_HB
TH1F * h_eventamplitude_HB
TH1F * h_pedestalwaver9_HB
TH1F * h_sumamplitude_depth2_HF0
TH2F * h_recSignalEnergy0_HE4
~CMTRawAnalyzer() override
TH2F * h_mapenophinorm2_HE5
TH2F * h_mapDepth4Amplitude_HE
TH1F * h_sum0ADCAmplperLS3
float getValue() const
Definition: HcalRespCorr.h:19
TH2F * h_2D0sumAmplitudeLS6
void fillDigiAmplitudeHF(HFDigiCollection::const_iterator &digiItr)
TH2F * h_mapDepth3Amplitude225_HE
TH1F * h_sumamplitude_depth1_HF0
TH1F * h_sum0TSmeanAperLS3
TH1F * h_sumCutADCAmplperLS4
TH2F * h_map0AiForLS_bad_HE
TH1F * h_sumCutADCAmplperLS7u
double lsdep_estimator5_HOdepth4_
TH2F * h_recNoiseEnergy2_HF4
TH1F * h_sumAmplitudeperLS5
TH2F * h_recSignalEnergy0_HE1
TH2F * h_mapDepth2ADCAmpl225Copy_HE
TH2F * h_mapenophinorm_HE4
TH2F * h_mapDepth1Pedw3_HF
TH2F * h_mapDepth2TSmeanA_HB
TH2F * h_mapTSmeanCalib_HB
int flagIterativeMethodCalibrationGroupReco_
TH2F * h_mapDepth7AmplE34_HE
TH2F * h_amplitudechannel1_HB3
void beginRun(const edm::Run &r, const edm::EventSetup &iSetup) override
void beginJob() override
TH2F * h_mapenophinorm_HE6
TH1F * h_nbadchannels_depth1_HE
TH2F * h_mapDepth3TSmeanA_HF
TH1F * h_sumPedestalperLS2
TH2F * h_mapTSmeanCalib047_HE
TH1F * h_sumTSmaxAperLS1_LSselected
TH1F * h_runbadrateC_depth4_HO
TH1F * h_sumamplitude_depth4_HO1
TH1F * h_runnbadchannels_depth1_HB
TH2F * h_mapDepth3Ampl047_HF
TH1F * h_runnbadchannelsC_depth1_HB
TH1F * h_sum0TSmeanAperLS2
TH2F * h_mapenophinorm_HE7
TH1F * h_bcnbadrate0_depth1_HE
TH1F * h_averNOSIGNALsumamplitude_HF
double sumEstimator6[nsub][ndepth][neta][nphi]
TH2F * h_2DsumADCAmplLS6_LSselected
double lsdep_estimator1_HEdepth6_
TH1F * h_sumCutTSmaxAperLS6
TH2F * h_mapDepth7Error_HE
const HcalGain * getGain(const HcalGenericDetId &fId) const
TH2F * h_2D0sumADCAmplLSdepth4HBu
TH2F * h_recNoiseEnergy1_HE2
TH1F * h_sumCutTSmaxAperLS8
TH2F * h_mapDepth4TSmeanA_HO
constexpr int dccid() const
get the (Hcal local) DCC id for VME, crate number for uTCA
TH1F * h_averSIGNALsumamplitude_HE
TH2F * h_mapRatioCalib047_HF
TH2F * h_mapDepth1TS2_HE
double signal3[ndepth][neta][nphi]
TH1F * h_bcnbadrate0_depth1_HB
TH2F * h_2D0sumAmplitudeLS7
TH1F * h_bcnnbadchannels_depth2_HB
TH2F * h_mapDepth1Pedw2_HB
TH1F * h_sumCutADCAmplperLS1
TH2F * h_mapDepth6TSmaxA225_HE
TH2F * h_mapDepth4pedestalw_HO
TH1F * h_Eta16Depth3RADDAM_HED2
TH1F * h_sumamplitude_depth1_HB1
TH2F * h_mapDepth2TSmeanA_HF
double averSIGNALoccupancy_HE
TH2F * h_amplitudechannel2_HF2
double lsdep_estimator1_HEdepth2_
TH2F * h_mapDepth6ADCAmpl_HE
TH2F * h_mapDepth5Amplitude_HE
TH2F * h_mapDepth3TSmaxA225_HF
TH2F * h_mapDepth4Error_HF
TH2F * h_mapDepth1ADCAmpl_HF
TH1F * h_sum0PedestalperLS7
TH1F * h_runnbadchannelsC_depth4_HO
double lsdep_estimator1_HFdepth1_
TH2F * h_mapDepth4pedestalw_HB
TH1F * h_sigLayer1RADDAM5_HE
TH2F * h_mapDepth4pedestalw_HE
int badchannels[nsub][ndepth][neta][nphi]
TH1F * h_sum0ADCAmplperLS1_P1
TH1F * h_eventoccupancy_HO
TH1F * h_orbitNumvsamplitude_HB
TH2F * h_amplitudechannel1_HE7
TH1F * h_shape0_good_channels_HF
TH2F * h_mapRatioCalib047_HO
TH2F * h_mapDepth1ADCAmpl12SiPM_HE
TH1F * h_sumphiEta16Depth3RADDAM_HED2P
TH2F * h_2D0sumADCAmplLSdepth5HEu
int rmFiber() const
TH2F * h_mapDepth2pedestal_HF
TH2F * h_mapDepth7TSmaxA_HE
TH2F * h_mapDepth6ADCAmpl225Copy_HE
TH1F * h_repetedcapid_HO
TH1F * h_errorGeneral_HF
TH2F * h_mapDepth3TSmaxA_HB
TH1F * h_RatioOccupancy_HEM
TH1F * h_sumCutAmplitudeperLS6
TH1F * h_bcnnbadchannels_depth1_HF
TH2F * h_recNoiseEnergy2_HB3
bool isValid() const
Definition: HandleBase.h:70
TH2F * h_mapDepth1Amplitude225_HB
TH2F * h_2DsumADCAmplLS5_LSselected
TH1F * h_averNOSIGNALsumamplitude_HB
TH2F * h_mapDepth2Pedw2_HE
TH1F * h_sumCutTSmaxAperLS3
TH1F * h_sumPedestalperLS6
TH2F * h_recNoiseEnergy0_HF2
TH2F * h_mapDepth1pedestalw_HE
TH1F * h_bcnnbadchannels_depth1_HE
TH2F * h_2DsumADCAmplLSdepth6HEu
double averNOSIGNALoccupancy_HF
TH2F * h_mapTSmeanCalib_HE
TH2F * h_mapDepth1ADCAmpl225Copy_HE
TH1F * h_totalAmplitudeHF
TH1F * h_sum0TSmeanAperLS1
TH1F * h_averNOSIGNALoccupancy_HE
edm::EDGetTokenT< HFDigiCollection > tok_hf_
TH2F * h_mapDepth2ADCAmpl225_HF
TH1F * h_runbadrateC_depth3_HE
TH2F * h_recSignalEnergy2_HB4
double calibrTSmaxHFMin_
double lsdep_estimator5_HEdepth2_
double signal[ndepth][neta][nphi]
TH1F * h_sumADCAmplEtaPhiLs_lscounterM1orbitNum
constexpr int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
TH1F * h_RatioOccupancy_HFP
TH1F * h_totalAmplitudeHB
TH2F * h_mapenophinorm_HE3
double lsdep_estimator3_HFdepth2_
TH1F * h_shape_bad_channels_HE
TH2F * h_mapDepth4Ampl047_HE
TH2F * h_mapDepth1Pedw0_HE
TH1F * h_numberofhitsHBtest
TH1F * h_eventamplitude_HE
TH2F * h_mapGetRMSOverNormalizedSignal_HB
TH2F * h_mapDepth1Ampl047_HF
double lsdep_estimator1_HEdepth1_
TH2F * h_mapDepth6TSmeanA225_HE
TH1F * h_averSIGNALoccupancy_HF
TH1F * h_A_Depth3RADDAM_HE
TH1F * h_bcnvsamplitude_HF
TH2F * h_mapDepth3Pedw1_HE
TH2F * h_recSignalEnergy1_HF4
virtual void fillMAP()
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
TH2F * h_recNoiseEnergy0_HF4
TH1F * h_sigLayer2RADDAM6_HED2
TH1F * h_sumCutTSmeanAperLS6
TH2F * h_mapDepth4Pedw2_HO
TH2F * h_mapDepth6TSmaxA_HE
double calibrTSmeanHEMin_
TH2F * h_mapDepth2ADCAmpl12_HF
double calibrTSmeanHBMin_
TH2F * h_2D0sumAmplitudeLS3
TH2F * h_2DsumADCAmplLS7_LSselected
int mapRADDAM_HED20[ndepth][neta]
TH2F * h_mapDepth2pedestalw_HE
TH1F * h_RatioOccupancy_HBM
TH1F * h_sum0ADCAmplperLSdepth4HEu
long int gsmdepth1sipm[npfit][neta][nphi][ndepth]
TH2F * h_mapDepth2RADDAM0_HE
TH2F * h_mapDepth7Amplitude_HE
TH2F * h_mapDepth1pedestalw_HF
TH1F * h_ADCAmplZoom1_HF
constexpr int spigot() const
get the spigot (input number on DCC, AMC card number for uTCA)
TH1F * h_sumamplitude_depth1_HE0
TH2F * h_mapDepth1pedestal_HF
TH2F * h_mapDepth5pedestal_HE
void fillDigiErrorsHO(HODigiCollection::const_iterator &digiItr)
TH1F * h_A_Depth1RADDAM_HE
TH1F * h_averNOSIGNALoccupancy_HF
TH1F * h_sumamplitude_depth1_HF
TH1F * h_runbadrate0_depth1_HE
TH2F * h_mapenophinorm2_HE4
TH1F * h_sum0ADCAmplperLS8_M1
TH2F * h_2DsumADCAmplLS2_LSselected
TH2F * h_mapDepth3TSmeanA225_HB
TH2F * h_mapDepth4pedestal_HF
TH1F * h_sum0AmplitudeperLS6
double lsdep_estimator2_HBdepth2_
TH2F * h_mapDepth2pedestalw_HB
TH2F * h_2DsumADCAmplEtaPhiLs30
TH2F * h_mapDepth6Ampl047_HE
TH1F * h_sum0ADCAmplperLS6u
TH2F * h_mapDepth4ADCAmpl225_HE
double calibrTSmaxHBMax_
TH2F * h_recNoiseEnergy2_HB2
edm::EDGetTokenT< HODigiCollection > tok_ho_
TH2F * h_mapAiForLS_bad_HO
TH1F * h_bcnbadrate0_depth3_HE
TH1F * h_sumADCAmplEtaPhiLs_orbitNum
TH2F * h_mapDepth3TS1_HF
TH1F * h_AmplitudeHBtest6
TH2F * h_mapDepth4TSmaxA225_HE
TH2F * h_recNoiseEnergy2_HB4
TH2F * h_mapADCAmplsecondpeak0_HE
TH2F * h_mapDepth2ADCAmpl225Copy_HF
TH1F * h_gsmdifferencefit2_HE
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TH1F * h_averSIGNALsumamplitude_HB
double calibrTSmaxHFMax_
TH1F * h_sumCutAmplitudeperLS2
TH2F * h_mapDepth2Ampl047_HF
TH1F * h_sum0ADCAmplperLS4
TH2F * h_mapDepth3ADCAmplSiPM_HE
TH1F * h_ADCAmpl345_HBCapIdError
void fillDigiErrorsHFQIE10(QIE10DataFrame qie10df)
TH1F * h_bcnnbadchannels_depth2_HE
void endRun(const edm::Run &r, const edm::EventSetup &iSetup) override
double calibrTSmeanHBMax_
TH2F * h_mapDepth2ADCAmpl_HE
TH1F * h_AmplitudeHFtest
TH2F * h_mapDepth3AmplE34_HF
TH2F * h_mapDepth4ADCAmpl225Copy_HE
TH2F * h_mapDepth2TS2_HE
TH1F * h_sumADCAmplEtaPhiLs_bbb1
TH2F * h_mapDepth1pedestal_HE
TH1F * h_sumAmplitudeperLS2
TH2F * h_amplitudechannel1_HE3
TH1F * h_AamplitudewithPedSubtr_RADDAM_HE
TH1F * h_bcnnbadchannels_depth3_HE
TH2F * h_mapDepth1TSmeanA_HF
double lsdep_estimator3_HEdepth3_
TH1F * h_gsmdifferencefit6_HE
TH1F * h_ADCAmplrest6_HF
const int ndepth
double lsdep_estimator4_HEdepth1_
TH1F * h_repetedcapid_HE
TH1F * h_sumCutAmplitudeperLS5
TH1F * h_sum0ADCAmplperLS1_M2
TH1F * h_AamplitudewithPedSubtr_RADDAM_HEzoom1
double averNOSIGNALsumamplitude_HE
TH1F * h_sigLayer2RADDAM0_HE
TH1F * h_sumamplitudechannel_HO
TH1F * h_sumAmplitudeperLS7
TH2F * h_recSignalEnergy1_HF1
TH1F * h_sum0ADCAmplperLS1_M1
TH2F * h_mapDepth1TSmaxA225_HB
TH1F * h_orbitNumvsamplitude0_HB
TH2F * h_mapDepth2ADCAmpl12_HE
double recNoiseEnergy1[nsub][ndepth][neta][nphi]
TH2F * h_recNoiseEnergy1_HE7
double sumEstimator4[nsub][ndepth][neta][nphi]
double calibrRatioHBMax_
TH2F * h_mapDepth2Pedw0_HB
double calibrWidthHFMax_
double averSIGNALsumamplitude_HB
TH2F * h_amplitudechannel2_HE4
TH1F * h_sumCutTSmaxAperLS7
double averSIGNALsumamplitude_HF
TH2F * h_mapTSmeanCalib_HO
TH2F * h_mapDepth2AmplE34_HF
void fillDigiAmplitudeHFQIE10(QIE10DataFrame qie10df)
TH1F * h_eventamplitude_HF
TH1F * h_sum0ADCAmplperLSdepth6HEu
TH2F * h_mapDepth3pedestal_HE
TH1F * h_numberofhitsHOtest
TH1F * h_sumamplitude_depth2_HF1
TH1F * h_totalAmplitudeHFperEvent
TH1F * h_orbitNumvsamplitude_HO
TH2F * h_mapDepth3ADCAmpl_HE
TH1F * h_totalAmplitudeHBperEvent
TH2F * h_2DsumAmplitudeLS7
TH2F * h_mapGetRMSOverNormalizedSignal0_HB
TH2F * h_mapDepth1ADCAmpl225Copy_HF
TH2F * h_recSignalEnergy2_HB1
TH2F * h_mapenophinorm2_HE3
TH2F * h_mapDepth1TS1_HF
int adc() const
TH2F * h_recSignalEnergy2_HE1
double lsdep_estimator5_HEdepth3_
TH2F * h_recSignalEnergy0_HB4
double const adc2fC_QIE11_shunt1[256]
TH1F * h_runbadrate0_depth1_HB
TH1F * h_sum0AmplitudeperLS7
TH2F * h_mapDepth4ADCAmpl_HF
TH2F * h_mapDepth3linADCAmpl12_HE
TH2F * h_recSignalEnergy0_HE5
tmp
align.sh
Definition: createJobs.py:716
TH1F * h_shape_good_channels_HB
TH2F * h_map0AiForLS_good_HE
double calibrRatioHEMax_
double calibrWidthHBMin_
TH2F * h_recSignalEnergy0_HE7
TH1F * h_nevents_per_eachRealLS
double lsdep_estimator1_HEdepth7_
TH1F * h_amplitudeaveragedbydepthes_HE
TH1F * h_sumADCAmplperLS3_P2
TH2F * h_mapDepth4Amplitude_HB
TH2F * h_mapRatioCalib047_HB
TH2F * h_mapDepth1ADCAmpl_HE
TH1F * h_shape0_bad_channels_HE
TH1F * h_shape0_bad_channels_HO
TH2F * h_amplitudechannel1_HF2
TH2F * h_mapDepth2Pedw0_HE
TH2F * h_2D0sumADCAmplLSdepth7HEu
TH2F * h_mapDepth6Error_HE
TH1F * h_sumADCAmplperLSdepth4HEu
TH2F * h_2D0sumADCAmplLSdepth4HEu
TH1F * h_sumPedestalperLS5
TH2F * h_mapDepth1Amplitude225_HF
TH1F * h_sumCutTSmaxAperLS5
TH2F * h_mapDepth3ADCAmpl12SiPM_HE
TH2F * h_mapTSmaxCalib047_HO
const HcalTimeCorr * getHcalTimeCorr(const HcalGenericDetId &fId) const
TH1F * h_sigLayer2RADDAM5_HE
double calibrTSmeanHFMax_
TH2F * h_amplitudechannel0_HB2
TH2F * h_mapDepth4TSmeanA225_HF
TH2F * h_mapDepth4TSmaxA_HE
TH2F * h_mapGetRMSOverNormalizedSignal0_HF
double averSIGNALsumamplitude_HE
TH2F * h_mapDepth4ADCAmpl225_HO
TH2F * h_2DsumADCAmplLSdepth7HEu
TH2F * h_mapDepth3Pedw0_HE
Readout chain identification for Hcal.
TH1F * h_sumADCAmplperLS6_M2
TH1F * h_bcnvsamplitude0_HE
TH1F * h_sum0TSmeanAperLS5
TH1F * h_bcnbadrate0_depth2_HE
TH2F * h_mapAiForLS_bad_HB
TH2F * h_mapDepth2Pedw1_HF
TH2F * h_mapDepth1RADDAM_HE
TH1F * h_NphiForEta16Depth3RADDAM_HED2
TH2F * h_mapDepth4TSmeanA225_HO
TH2F * h_recNoiseEnergy2_HF2
TH1F * h_sumCutTSmaxAperLS4
TH2F * h_mapDepth4TSmaxA225_HO
TH1F * h_Amplitude_notCapIdErrors_HE2
TH2F * h_mapDepth5ADCAmpl225Copy_HE
TH2F * h_mapDepth7ADCAmpl12_HE
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
TH1F * h_gsmdifferencefit1_HE
TH2F * h_recNoiseEnergy0_HE1
TH2F * h_mapenophinorm2_HE2
double calibrWidthHOMax_
TH2F * h_mapDepth1ADCAmplSiPM_HE
TH1F * h_ADCAmplZoom1_HB
TH1F * h_sum0PedestalperLS2
TH2F * h_mapDepth3AmplE34_HB
TH2F * h_2D0sumAmplitudeLS4
TH1F * h_sumADCAmplEtaPhiLs_lscounterM1
TH2F * h_mapDepth6AmplE34_HE
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
TH1F * h_sum0TSmeanAperLS8
TH2F * h_mapDepth1TSmeanA_HE
TH2F * h_mapDepth3ADCAmpl225Copy_HB
TH2F * h_recNoiseEnergy1_HE4
TH2F * h_mapenophinorm2_HE6
TH1F * h_runbadrateC_depth1_HB
TH2F * h_amplitudechannel1_HE1
TH1F * h_shape_bad_channels_HB
double calibrRatioHFMin_
constexpr int samples() const
total number of samples in the digi
TH1F * h_Amplitude_notCapIdErrors_HF1
double averSIGNALoccupancy_HF
TH2F * h_mapDepth3AmplE34_HE
TH2F * h_recNoiseEnergy2_HE2
TH2F * h_mapDepth3TSmeanA_HE
const edm::ESGetToken< HcalDbService, HcalDbRecord > tokDB_
TH2F * h_mapDepth4pedestal_HO
TH2F * h_mapDepth4TSmeanA_HE
Definition: Run.h:45
void endJob() override
TH2F * h_mapDepth1Amplitude_HB
double dR(double eta1, double phi1, double eta2, double phi2)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
TH1F * h_sumPedestalperLS8
TH2F * h_mapDepth4Amplitude225_HE
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
TH2F * h_recSignalEnergy2_HE5
TH1F * h_orbitNumvsamplitude_HE
TH1F * h_sumADCAmplperLSdepth7HEu
double recNoiseEnergy2[nsub][ndepth][neta][nphi]
TH2F * h_mapDepth3RADDAM0_HE
TH2F * h_mapDepth2pedestal_HE
void fillDigiAmplitude(HBHEDigiCollection::const_iterator &digiItr)
TH2F * h_amplitudechannel0_HE5
TH1F * h_averSIGNALoccupancy_HE
TH1F * h_runnbadchannels_depth2_HF
TH2F * h_2DsumADCAmplLSdepth4HFu
TH1F * h_bcnvsamplitude0_HO
TH1F * h_sumCutADCAmplperLSdepth5HEu
TH1F * h_nbadchannels_depth1_HF
TH2F * h_recSignalEnergy0_HE3
TH2F * h_map0AiForLS_good_HB
TH2F * h_mapRatioCalib047_HE
TH2F * h_amplitudechannel2_HE2
TH2F * h_mapDepth3TSmaxA_HE
TH1F * h_sumCutADCAmplperLS7
TH1F * h_sumCutAmplitudeperLS4
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
bool studyPedestalCorrelations_