CMS 3D CMS Logo

EnergyUncertaintyPhotonSpecific.cc
Go to the documentation of this file.
2 #include "TMath.h"
3 
4 #include <iostream>
5 
7 
9 
11 
13  double et = energy / cosh(eta);
14 
15  const int nBinsEta = 6;
16  const double EtaBins[nBinsEta + 1] = {0.0, 0.7, 1.15, 1.44, 1.56, 2.0, 2.5};
17 
18  const int nBinsBrem = 6;
19  const double BremBins[nBinsBrem + 1] = {0.8, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0};
20 
21  float par0[nBinsEta][nBinsBrem];
22  float par1[nBinsEta][nBinsBrem];
23  float par2[nBinsEta][nBinsBrem];
24  float par3[nBinsEta][nBinsBrem];
25 
26  par0[0][0] = 0.0232291;
27  par1[0][0] = 0;
28  par2[0][0] = 0;
29  par3[0][0] = 0;
30 
31  par0[0][1] = 0.00703187;
32  par1[0][1] = 0.646644;
33  par2[0][1] = -7.4698;
34  par3[0][1] = 5.53373e-08;
35 
36  par0[0][2] = 0.00692465;
37  par1[0][2] = 0.292698;
38  par2[0][2] = 4.16907;
39  par3[0][2] = 5.61149e-06;
40 
41  par0[0][3] = 0.00855993;
42  par1[0][3] = 0.280843;
43  par2[0][3] = 4.25527;
44  par3[0][3] = 9.6404e-07;
45 
46  par0[0][4] = 0.00795058;
47  par1[0][4] = 0.370007;
48  par2[0][4] = 3.03429;
49  par3[0][4] = 4.43986e-07;
50 
51  par0[0][5] = 0.0107494;
52  par1[0][5] = 0.276159;
53  par2[0][5] = 4.44532;
54  par3[0][5] = 2.58822e-06;
55 
56  par0[1][0] = 0.0614866;
57  par1[1][0] = 0;
58  par2[1][0] = 0;
59  par3[1][0] = 0;
60 
61  par0[1][1] = 0.00894211;
62  par1[1][1] = 0.466937;
63  par2[1][1] = 3.33434;
64  par3[1][1] = 0.000114835;
65 
66  par0[1][2] = 0.0102959;
67  par1[1][2] = 0.313568;
68  par2[1][2] = 6.34301;
69  par3[1][2] = 2.86726e-07;
70 
71  par0[1][3] = 0.0128934;
72  par1[1][3] = 0.302943;
73  par2[1][3] = 6.35598;
74  par3[1][3] = 0.00190694;
75 
76  par0[1][4] = 0.0130199;
77  par1[1][4] = 0.505135;
78  par2[1][4] = 2.52964;
79  par3[1][4] = 0.120204;
80 
81  par0[1][5] = 0.0180839;
82  par1[1][5] = 0.382134;
83  par2[1][5] = 5.3388;
84  par3[1][5] = 3.59921e-07;
85 
86  par0[2][0] = 0.0291343;
87  par1[2][0] = 0;
88  par2[2][0] = 0;
89  par3[2][0] = 0;
90 
91  par0[2][1] = 0.00876269;
92  par1[2][1] = 0.375159;
93  par2[2][1] = 7.11411;
94  par3[2][1] = 0.0438575;
95 
96  par0[2][2] = 0.0120863;
97  par1[2][2] = 0.397635;
98  par2[2][2] = 5.97451;
99  par3[2][2] = 0.0469782;
100 
101  par0[2][3] = 0.0112655;
102  par1[2][3] = 0.856565;
103  par2[2][3] = -5.76122;
104  par3[2][3] = 4.99993;
105 
106  par0[2][4] = 0.0168267;
107  par1[2][4] = 0.636468;
108  par2[2][4] = -1.54548;
109  par3[2][4] = 4.99992;
110 
111  par0[2][5] = 0.0168059;
112  par1[2][5] = 1.09268;
113  par2[2][5] = -0.547554;
114  par3[2][5] = 0.0952985;
115 
116  par0[3][0] = 0.158403;
117  par1[3][0] = 0;
118  par2[3][0] = 0;
119  par3[3][0] = 0;
120 
121  par0[3][1] = 0.0717431;
122  par1[3][1] = 1.66981;
123  par2[3][1] = 6.86275;
124  par3[3][1] = 0.00543544;
125 
126  par0[3][2] = 0.0385666;
127  par1[3][2] = 3.6319;
128  par2[3][2] = -3.76633;
129  par3[3][2] = 6.56718e-05;
130 
131  par0[3][3] = 0.0142631;
132  par1[3][3] = 8.85991;
133  par2[3][3] = -32.6073;
134  par3[3][3] = 0.00119538;
135 
136  par0[3][4] = 0.0421638;
137  par1[3][4] = 3.1289;
138  par2[3][4] = -6.58653;
139  par3[3][4] = 1.10125e-05;
140 
141  par0[3][5] = 0.046331;
142  par1[3][5] = 1.29951;
143  par2[3][5] = 1.76117;
144  par3[3][5] = 0.00204206;
145 
146  par0[4][0] = 0.0483944;
147  par1[4][0] = 0;
148  par2[4][0] = 0;
149  par3[4][0] = 0;
150 
151  par0[4][1] = 0.0168516;
152  par1[4][1] = 1.19617;
153  par2[4][1] = -6.78666;
154  par3[4][1] = 4.98192;
155 
156  par0[4][2] = 0.0243039;
157  par1[4][2] = 0.994626;
158  par2[4][2] = -4.26073;
159  par3[4][2] = 4.99984;
160 
161  par0[4][3] = 0.031795;
162  par1[4][3] = 0.875925;
163  par2[4][3] = 1.43183;
164  par3[4][3] = 0.0920944;
165 
166  par0[4][4] = 0.0414953;
167  par1[4][4] = 0.654605;
168  par2[4][4] = 4.45367;
169  par3[4][4] = 0.030385;
170 
171  par0[4][5] = 0.058031;
172  par1[4][5] = 0.292915;
173  par2[4][5] = 8.48307;
174  par3[4][5] = 0.0134321;
175 
176  par0[5][0] = 0.107158;
177  par1[5][0] = 0;
178  par2[5][0] = 0;
179  par3[5][0] = 0;
180 
181  par0[5][1] = 0.021685;
182  par1[5][1] = 0.574207;
183  par2[5][1] = -0.566981;
184  par3[5][1] = 0.0120609;
185 
186  par0[5][2] = 0.0196619;
187  par1[5][2] = 0.940217;
188  par2[5][2] = -6.05845;
189  par3[5][2] = 0.000193818;
190 
191  par0[5][3] = 0.0324734;
192  par1[5][3] = 0.574766;
193  par2[5][3] = -5.23571;
194  par3[5][3] = 4.9419;
195 
196  par0[5][4] = 0.0414953;
197  par1[5][4] = 0.654605;
198  par2[5][4] = 4.45367;
199  par3[5][4] = 0.030385;
200 
201  par0[5][5] = 0.058031;
202  par1[5][5] = 0.292915;
203  par2[5][5] = 8.48307;
204  par3[5][5] = 0.0134321;
205 
206  int iEtaSl = -1;
207  for (int iEta = 0; iEta < nBinsEta; ++iEta) {
208  if (EtaBins[iEta] <= TMath::Abs(eta) && TMath::Abs(eta) < EtaBins[iEta + 1]) {
209  iEtaSl = iEta;
210  }
211  }
212 
213  int iBremSl = -1;
214  for (int iBrem = 0; iBrem < nBinsBrem; ++iBrem) {
215  if (BremBins[iBrem] <= brem && brem < BremBins[iBrem + 1]) {
216  iBremSl = iBrem;
217  }
218  }
219 
220  if (TMath::Abs(eta) > 2.5)
221  iEtaSl = nBinsEta - 1;
222  if (brem < BremBins[0])
223  iBremSl = 0;
224  if (brem > BremBins[nBinsBrem - 1])
225  iBremSl = nBinsBrem - 1;
226 
227  float uncertainty = 0;
228  if (et < 5)
229  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (5 - par2[iEtaSl][iBremSl]) +
230  par3[iEtaSl][iBremSl] / ((5 - par2[iEtaSl][iBremSl]) * (5 - par2[iEtaSl][iBremSl]));
231  if (et > 200)
232  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (200 - par2[iEtaSl][iBremSl]) +
233  par3[iEtaSl][iBremSl] / ((200 - par2[iEtaSl][iBremSl]) * (200 - par2[iEtaSl][iBremSl]));
234 
235  if (et > 5 && et < 200)
236  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (et - par2[iEtaSl][iBremSl]) +
237  par3[iEtaSl][iBremSl] / ((et - par2[iEtaSl][iBremSl]) * (et - par2[iEtaSl][iBremSl]));
238 
239  return (uncertainty * energy);
240 }
241 
243  double et = energy / cosh(eta);
244 
245  const int nBinsEta = 6;
246  const double EtaBins[nBinsEta + 1] = {0.0, 0.7, 1.15, 1.44, 1.56, 2.0, 2.5};
247 
248  const int nBinsBrem = 6;
249  const double BremBins[nBinsBrem + 1] = {0.8, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0};
250 
251  float par0[nBinsEta][nBinsBrem];
252  float par1[nBinsEta][nBinsBrem];
253  float par2[nBinsEta][nBinsBrem];
254  float par3[nBinsEta][nBinsBrem];
255 
256  par0[0][0] = 0.00806753;
257  par1[0][0] = 0.143754;
258  par2[0][0] = -0.00368104;
259  par3[0][0] = 0.219829;
260 
261  par0[0][1] = 0.00899298;
262  par1[0][1] = 0.10159;
263  par2[0][1] = 4.70884;
264  par3[0][1] = 9.07419e-08;
265 
266  par0[0][2] = 0;
267  par1[0][2] = 0;
268  par2[0][2] = 0;
269  par3[0][2] = 0;
270 
271  par0[0][3] = 0;
272  par1[0][3] = 0;
273  par2[0][3] = 0;
274  par3[0][3] = 0;
275 
276  par0[0][4] = 0;
277  par1[0][4] = 0;
278  par2[0][4] = 0;
279  par3[0][4] = 0;
280 
281  par0[0][5] = 0;
282  par1[0][5] = 0;
283  par2[0][5] = 0;
284  par3[0][5] = 0;
285 
286  par0[1][0] = 0.00880649;
287  par1[1][0] = 0.0716169;
288  par2[1][0] = 5.23856;
289  par3[1][0] = 0.00632907;
290 
291  par0[1][1] = 0.00972275;
292  par1[1][1] = 0.0752675;
293  par2[1][1] = 3.35623;
294  par3[1][1] = 2.49397e-07;
295 
296  par0[1][2] = 0;
297  par1[1][2] = 0;
298  par2[1][2] = 0;
299  par3[1][2] = 0;
300 
301  par0[1][3] = 0;
302  par1[1][3] = 0;
303  par2[1][3] = 0;
304  par3[1][3] = 0;
305 
306  par0[1][4] = 0;
307  par1[1][4] = 0;
308  par2[1][4] = 0;
309  par3[1][4] = 0;
310 
311  par0[1][5] = 0;
312  par1[1][5] = 0;
313  par2[1][5] = 0;
314  par3[1][5] = 0;
315 
316  par0[2][0] = 0.0101474;
317  par1[2][0] = -0.332171;
318  par2[2][0] = -31.8456;
319  par3[2][0] = 22.543;
320 
321  par0[2][1] = 0.0109109;
322  par1[2][1] = 0.0425903;
323  par2[2][1] = 6.52561;
324  par3[2][1] = 2.18593e-08;
325 
326  par0[2][2] = 0;
327  par1[2][2] = 0;
328  par2[2][2] = 0;
329  par3[2][2] = 0;
330 
331  par0[2][3] = 0;
332  par1[2][3] = 0;
333  par2[2][3] = 0;
334  par3[2][3] = 0;
335 
336  par0[2][4] = 0;
337  par1[2][4] = 0;
338  par2[2][4] = 0;
339  par3[2][4] = 0;
340 
341  par0[2][5] = 0;
342  par1[2][5] = 0;
343  par2[2][5] = 0;
344  par3[2][5] = 0;
345 
346  par0[3][0] = 0.00343003;
347  par1[3][0] = 11.5791;
348  par2[3][0] = -112.084;
349  par3[3][0] = -863.968;
350 
351  par0[3][1] = 0.0372159;
352  par1[3][1] = 1.44028;
353  par2[3][1] = -40;
354  par3[3][1] = 0.00102639;
355 
356  par0[3][2] = 0;
357  par1[3][2] = 0;
358  par2[3][2] = 0;
359  par3[3][2] = 0;
360 
361  par0[3][3] = 0;
362  par1[3][3] = 0;
363  par2[3][3] = 0;
364  par3[3][3] = 0;
365 
366  par0[3][4] = 0;
367  par1[3][4] = 0;
368  par2[3][4] = 0;
369  par3[3][4] = 0;
370 
371  par0[3][5] = 0;
372  par1[3][5] = 0;
373  par2[3][5] = 0;
374  par3[3][5] = 0;
375 
376  par0[4][0] = 0.0192411;
377  par1[4][0] = 0.0511006;
378  par2[4][0] = 7.56304;
379  par3[4][0] = 0.00331583;
380 
381  par0[4][1] = 0.0195124;
382  par1[4][1] = 0.104321;
383  par2[4][1] = 5.71476;
384  par3[4][1] = 6.12472e-06;
385 
386  par0[4][2] = 0;
387  par1[4][2] = 0;
388  par2[4][2] = 0;
389  par3[4][2] = 0;
390 
391  par0[4][3] = 0;
392  par1[4][3] = 0;
393  par2[4][3] = 0;
394  par3[4][3] = 0;
395 
396  par0[4][4] = 0;
397  par1[4][4] = 0;
398  par2[4][4] = 0;
399  par3[4][4] = 0;
400 
401  par0[4][5] = 0;
402  par1[4][5] = 0;
403  par2[4][5] = 0;
404  par3[4][5] = 0;
405 
406  par0[5][0] = 0.0203644;
407  par1[5][0] = -0.050789;
408  par2[5][0] = -7.96854;
409  par3[5][0] = 4.71223;
410 
411  par0[5][1] = 0.0198718;
412  par1[5][1] = 0.106859;
413  par2[5][1] = 3.54235;
414  par3[5][1] = 6.89631e-06;
415 
416  par0[5][2] = 0;
417  par1[5][2] = 0;
418  par2[5][2] = 0;
419  par3[5][2] = 0;
420 
421  par0[5][3] = 0;
422  par1[5][3] = 0;
423  par2[5][3] = 0;
424  par3[5][3] = 0;
425 
426  par0[5][4] = 0;
427  par1[5][4] = 0;
428  par2[5][4] = 0;
429  par3[5][4] = 0;
430 
431  par0[5][5] = 0;
432  par1[5][5] = 0;
433  par2[5][5] = 0;
434  par3[5][5] = 0;
435 
436  int iEtaSl = -1;
437  for (int iEta = 0; iEta < nBinsEta; ++iEta) {
438  if (EtaBins[iEta] <= TMath::Abs(eta) && TMath::Abs(eta) < EtaBins[iEta + 1]) {
439  iEtaSl = iEta;
440  }
441  }
442 
443  int iBremSl = -1;
444  for (int iBrem = 0; iBrem < nBinsBrem; ++iBrem) {
445  if (BremBins[iBrem] <= brem && brem < BremBins[iBrem + 1]) {
446  iBremSl = iBrem;
447  }
448  }
449 
450  if (TMath::Abs(eta) > 2.5)
451  iEtaSl = nBinsEta - 1;
452  if (brem < BremBins[0])
453  iBremSl = 0;
454  if (brem > BremBins[nBinsBrem - 1])
455  iBremSl = nBinsBrem - 1;
456  if (brem > 2)
457  iBremSl = 1;
458 
459  float uncertainty = 0;
460  if (iBremSl >= 0 && iBremSl < nBinsBrem && iEtaSl >= 0 && iEtaSl < nBinsEta) {
461  if (et < 5)
462  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (5 - par2[iEtaSl][iBremSl]) +
463  par3[iEtaSl][iBremSl] / ((5 - par2[iEtaSl][iBremSl]) * (5 - par2[iEtaSl][iBremSl]));
464  else if (et > 200)
465  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (200 - par2[iEtaSl][iBremSl]) +
466  par3[iEtaSl][iBremSl] / ((200 - par2[iEtaSl][iBremSl]) * (200 - par2[iEtaSl][iBremSl]));
467  else if (et >= 5 && et <= 200)
468  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (et - par2[iEtaSl][iBremSl]) +
469  par3[iEtaSl][iBremSl] / ((et - par2[iEtaSl][iBremSl]) * (et - par2[iEtaSl][iBremSl]));
470  }
471 
472  return (uncertainty * energy);
473 }
EnergyUncertaintyPhotonSpecific::~EnergyUncertaintyPhotonSpecific
~EnergyUncertaintyPhotonSpecific()
Definition: EnergyUncertaintyPhotonSpecific.cc:8
EnergyUncertaintyPhotonSpecific::EnergyUncertaintyPhotonSpecific
EnergyUncertaintyPhotonSpecific(const edm::ParameterSet &config)
Definition: EnergyUncertaintyPhotonSpecific.cc:6
EnergyUncertaintyPhotonSpecific.h
pfMETCorrectionType0_cfi.par1
par1
Definition: pfMETCorrectionType0_cfi.py:48
config
Definition: config.py:1
EnergyUncertaintyPhotonSpecific::computePhotonEnergyUncertainty_lowR9
double computePhotonEnergyUncertainty_lowR9(double eta, double brem, double energy)
Definition: EnergyUncertaintyPhotonSpecific.cc:12
Abs
T Abs(T a)
Definition: MathUtil.h:49
pfMETCorrectionType0_cfi.par3
par3
Definition: pfMETCorrectionType0_cfi.py:50
EnergyUncertaintyPhotonSpecific::computePhotonEnergyUncertainty_highR9
double computePhotonEnergyUncertainty_highR9(double eta, double brem, double energy)
Definition: EnergyUncertaintyPhotonSpecific.cc:242
PVValHelper::eta
Definition: PVValidationHelpers.h:69
EnergyUncertaintyPhotonSpecific::init
void init(const edm::EventSetup &theEventSetup)
Definition: EnergyUncertaintyPhotonSpecific.cc:10
hgcalTowerMapProducer_cfi.nBinsEta
nBinsEta
Definition: hgcalTowerMapProducer_cfi.py:9
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
MuonErrorMatrixAnalyzer_cfi.EtaBins
EtaBins
Definition: MuonErrorMatrixAnalyzer_cfi.py:15
edm::ParameterSet
Definition: ParameterSet.h:36
pfMETCorrectionType0_cfi.par2
par2
Definition: pfMETCorrectionType0_cfi.py:49
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::EventSetup
Definition: EventSetup.h:57
fitWZ.par0
par0
Definition: fitWZ.py:52
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60