CMS 3D CMS Logo

EcalClusterEnergyUncertaintyObjectSpecific.cc
Go to the documentation of this file.
1 
15 
17 public:
19 
20  // check initialization
21  void checkInit() const {}
22 
23  // compute the correction
24  float getValue(const reco::SuperCluster &, const int mode) const override;
25  float getValue(const reco::BasicCluster &, const EcalRecHitCollection &) const override { return 0.; };
26 
27  // set parameters
28  void init(const edm::EventSetup &es) override {}
29 };
30 
32  const int mode) const {
33  checkInit();
34 
35  // mode = 0 returns electron energy uncertainty
36 
37  float en = superCluster.energy();
38  float eta = fabs(superCluster.eta());
39  float et = en / cosh(eta);
40  float brem = superCluster.etaWidth() != 0 ? superCluster.phiWidth() / superCluster.etaWidth() : 0;
41 
42  const int nBinsEta = 6;
43  const float EtaBins[nBinsEta + 1] = {0.0, 0.7, 1.15, 1.44, 1.56, 2.0, 2.5};
44 
45  const int nBinsBrem = 6;
46  const float BremBins[nBinsBrem + 1] = {0.8, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0};
47 
48  float par0[nBinsEta][nBinsBrem];
49  float par1[nBinsEta][nBinsBrem];
50  float par2[nBinsEta][nBinsBrem];
51  float par3[nBinsEta][nBinsBrem];
52 
53  par0[0][0] = 0.00640519;
54  par1[0][0] = 0.257578;
55  par2[0][0] = 1.72437;
56  par3[0][0] = 4.04686e-06;
57 
58  par0[0][1] = 0.00709569;
59  par1[0][1] = 0.279844;
60  par2[0][1] = 1.13789;
61  par3[0][1] = 1.16239e-05;
62 
63  par0[0][2] = 0.0075544;
64  par1[0][2] = 0.341346;
65  par2[0][2] = 0.513396;
66  par3[0][2] = 2.90054e-06;
67 
68  par0[0][3] = 0.00659365;
69  par1[0][3] = 0.517649;
70  par2[0][3] = -3.1847;
71  par3[0][3] = 7.37152e-07;
72 
73  par0[0][4] = 0.00771696;
74  par1[0][4] = 0.492897;
75  par2[0][4] = -1.42222;
76  par3[0][4] = 0.000358677;
77 
78  par0[0][5] = 0.00561532;
79  par1[0][5] = 0.655138;
80  par2[0][5] = -3.29839;
81  par3[0][5] = 6.25898e-07;
82 
83  par0[1][0] = 0.00273646;
84  par1[1][0] = 0.714568;
85  par2[1][0] = -4.82956;
86  par3[1][0] = 4.45878e-07;
87 
88  par0[1][1] = 0.00679797;
89  par1[1][1] = 0.472856;
90  par2[1][1] = -0.281699;
91  par3[1][1] = 5.46479e-05;
92 
93  par0[1][2] = 0.00845532;
94  par1[1][2] = 0.611624;
95  par2[1][2] = -1.10104;
96  par3[1][2] = 1.16803e-05;
97 
98  par0[1][3] = 0.00831068;
99  par1[1][3] = 0.853653;
100  par2[1][3] = -4.23761;
101  par3[1][3] = 2.61247e-05;
102 
103  par0[1][4] = 0.00845457;
104  par1[1][4] = 0.984985;
105  par2[1][4] = -5.19548;
106  par3[1][4] = 2.05044e-07;
107 
108  par0[1][5] = 0.0110227;
109  par1[1][5] = 1.00356;
110  par2[1][5] = -4.31936;
111  par3[1][5] = 0.14384;
112 
113  par0[2][0] = -0.00192618;
114  par1[2][0] = 1.69986;
115  par2[2][0] = -16.4355;
116  par3[2][0] = 1.94946e-06;
117 
118  par0[2][1] = 0.0067622;
119  par1[2][1] = 0.792209;
120  par2[2][1] = -1.18521;
121  par3[2][1] = 0.066577;
122 
123  par0[2][2] = 0.00761595;
124  par1[2][2] = 1.03058;
125  par2[2][2] = -4.17237;
126  par3[2][2] = 0.168543;
127 
128  par0[2][3] = 0.0119179;
129  par1[2][3] = 0.910145;
130  par2[2][3] = -2.14122;
131  par3[2][3] = 0.00342264;
132 
133  par0[2][4] = 0.0139921;
134  par1[2][4] = 1.01488;
135  par2[2][4] = -2.46637;
136  par3[2][4] = 0.0458434;
137 
138  par0[2][5] = 0.013724;
139  par1[2][5] = 1.49078;
140  par2[2][5] = -6.60661;
141  par3[2][5] = 0.297821;
142 
143  par0[3][0] = -0.00197909;
144  par1[3][0] = 4.40696;
145  par2[3][0] = -4.88737;
146  par3[3][0] = 4.99999;
147 
148  par0[3][1] = 0.0340196;
149  par1[3][1] = 3.86278;
150  par2[3][1] = -10.899;
151  par3[3][1] = 0.130098;
152 
153  par0[3][2] = 0.0102397;
154  par1[3][2] = 8.99643;
155  par2[3][2] = -31.5122;
156  par3[3][2] = 0.00118335;
157 
158  par0[3][3] = 0.0110891;
159  par1[3][3] = 8.01794;
160  par2[3][3] = -21.9038;
161  par3[3][3] = 0.000245975;
162 
163  par0[3][4] = 0.0328931;
164  par1[3][4] = 4.73441;
165  par2[3][4] = -12.1148;
166  par3[3][4] = 3.01721e-05;
167 
168  par0[3][5] = 0.0395614;
169  par1[3][5] = 3.54327;
170  par2[3][5] = -12.6514;
171  par3[3][5] = 0.119761;
172 
173  par0[4][0] = 0.0121809;
174  par1[4][0] = 0.965608;
175  par2[4][0] = -4.19667;
176  par3[4][0] = 0.129896;
177 
178  par0[4][1] = 0.0168951;
179  par1[4][1] = 1.0218;
180  par2[4][1] = -4.03078;
181  par3[4][1] = 0.374291;
182 
183  par0[4][2] = 0.0213549;
184  par1[4][2] = 1.29613;
185  par2[4][2] = -4.89024;
186  par3[4][2] = 0.0297165;
187 
188  par0[4][3] = 0.0262602;
189  par1[4][3] = 1.41674;
190  par2[4][3] = -5.94928;
191  par3[4][3] = 0.19298;
192 
193  par0[4][4] = 0.0334892;
194  par1[4][4] = 1.48572;
195  par2[4][4] = -5.3175;
196  par3[4][4] = 0.0157013;
197 
198  par0[4][5] = 0.0347093;
199  par1[4][5] = 1.63127;
200  par2[4][5] = -7.27426;
201  par3[4][5] = 0.201164;
202 
203  par0[5][0] = 0.0185321;
204  par1[5][0] = 0.255205;
205  par2[5][0] = 1.56798;
206  par3[5][0] = 5.07655e-11;
207 
208  par0[5][1] = 0.0182718;
209  par1[5][1] = 0.459086;
210  par2[5][1] = -0.48198;
211  par3[5][1] = 0.00114946;
212 
213  par0[5][2] = 0.0175505;
214  par1[5][2] = 0.92848;
215  par2[5][2] = -4.52737;
216  par3[5][2] = 0.154827;
217 
218  par0[5][3] = 0.0233833;
219  par1[5][3] = 0.804105;
220  par2[5][3] = -3.75131;
221  par3[5][3] = 2.84172;
222 
223  par0[5][4] = 0.0334892;
224  par1[5][4] = 1.48572;
225  par2[5][4] = -5.3175;
226  par3[5][4] = 0.0157013;
227 
228  par0[5][5] = 0.0347093;
229  par1[5][5] = 1.63127;
230  par2[5][5] = -7.27426;
231  par3[5][5] = 0.201164;
232 
233  int iEtaSl = -1;
234  for (int iEta = 0; iEta < nBinsEta; ++iEta) {
235  if (EtaBins[iEta] <= eta && eta < EtaBins[iEta + 1]) {
236  iEtaSl = iEta;
237  }
238  }
239 
240  int iBremSl = -1;
241  for (int iBrem = 0; iBrem < nBinsBrem; ++iBrem) {
242  if (BremBins[iBrem] <= brem && brem < BremBins[iBrem + 1]) {
243  iBremSl = iBrem;
244  }
245  }
246 
247  //this code is confusing as it has no concept of under and overflow bins
248  //we will use Et as an example but also applies to eta
249  //underflow is 1st bin (naively currently labeled as 0 to 0.7, its really <0.7)
250  //overflow is the final bin (naviely currently labeled as 5 to 10, its really >=5)
251  //logic: if brem is 0<=brem <0.7 it will be already set to the 1st bin, this checks if its <0
252  //logic: if brem is 5<=brem<10 it will be set to the last bin so this then checks if its >5 at which point
253  //it also assigns it to the last bin. The value of 5 will have already been assigned in the for
254  //loop above to the last bin so its okay that its a >5 test
255  if (eta > EtaBins[nBinsEta - 1])
256  iEtaSl = nBinsEta - 1;
257  if (brem < BremBins[0])
258  iBremSl = 0;
259  if (brem > BremBins[nBinsBrem - 1])
260  iBremSl = nBinsBrem - 1;
261 
262  float uncertainty = 0;
263  if (et <= 5)
264  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (5 - par2[iEtaSl][iBremSl]) +
265  par3[iEtaSl][iBremSl] / ((5 - par2[iEtaSl][iBremSl]) * (5 - par2[iEtaSl][iBremSl]));
266  if (et >= 200)
267  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (200 - par2[iEtaSl][iBremSl]) +
268  par3[iEtaSl][iBremSl] / ((200 - par2[iEtaSl][iBremSl]) * (200 - par2[iEtaSl][iBremSl]));
269 
270  if (et > 5 && et < 200)
271  uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl] / (et - par2[iEtaSl][iBremSl]) +
272  par3[iEtaSl][iBremSl] / ((et - par2[iEtaSl][iBremSl]) * (et - par2[iEtaSl][iBremSl]));
273 
274  return (uncertainty * en);
275 }
276 
280  "EcalClusterEnergyUncertaintyObjectSpecific");
reco::SuperCluster
Definition: SuperCluster.h:18
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
edm::SortedCollection< EcalRecHit >
EcalClusterFunctionBaseClass.h
pfMETCorrectionType0_cfi.par1
par1
Definition: pfMETCorrectionType0_cfi.py:48
EcalClusterEnergyUncertaintyObjectSpecific::checkInit
void checkInit() const
Definition: EcalClusterEnergyUncertaintyObjectSpecific.cc:21
reco::SuperCluster::phiWidth
double phiWidth() const
obtain phi and eta width of the Super Cluster
Definition: SuperCluster.h:66
pfMETCorrectionType0_cfi.par3
par3
Definition: pfMETCorrectionType0_cfi.py:50
EcalClusterEnergyUncertaintyObjectSpecific::EcalClusterEnergyUncertaintyObjectSpecific
EcalClusterEnergyUncertaintyObjectSpecific(const edm::ParameterSet &)
Definition: EcalClusterEnergyUncertaintyObjectSpecific.cc:18
PVValHelper::eta
Definition: PVValidationHelpers.h:69
reco::CaloCluster
Definition: CaloCluster.h:31
hgcalTowerMapProducer_cfi.nBinsEta
nBinsEta
Definition: hgcalTowerMapProducer_cfi.py:9
EcalClusterEnergyUncertaintyParameters.h
EcalClusterFunctionFactory.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
EcalClusterFunctionFactory
MuonErrorMatrixAnalyzer_cfi.EtaBins
EtaBins
Definition: MuonErrorMatrixAnalyzer_cfi.py:15
EcalClusterEnergyUncertaintyObjectSpecific
Definition: EcalClusterEnergyUncertaintyObjectSpecific.cc:16
edm::ParameterSet
Definition: ParameterSet.h:36
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
pfMETCorrectionType0_cfi.par2
par2
Definition: pfMETCorrectionType0_cfi.py:49
EcalClusterEnergyUncertaintyObjectSpecific::getValue
float getValue(const reco::SuperCluster &, const int mode) const override
Definition: EcalClusterEnergyUncertaintyObjectSpecific.cc:31
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::EventSetup
Definition: EventSetup.h:57
EcalClusterEnergyUncertaintyObjectSpecific::getValue
float getValue(const reco::BasicCluster &, const EcalRecHitCollection &) const override
Definition: EcalClusterEnergyUncertaintyObjectSpecific.cc:25
fitWZ.par0
par0
Definition: fitWZ.py:52
EventSetup.h
reco::SuperCluster::etaWidth
double etaWidth() const
Definition: SuperCluster.h:67
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
EcalClusterFunctionBaseClass
Definition: EcalClusterFunctionBaseClass.h:26
EcalClusterEnergyUncertaintyObjectSpecific::init
void init(const edm::EventSetup &es) override
Definition: EcalClusterEnergyUncertaintyObjectSpecific.cc:28