CMS 3D CMS Logo

List of all members | Public Member Functions
EcalClusterEnergyUncertaintyObjectSpecific Class Reference

#include <EcalClusterEnergyUncertaintyObjectSpecific.h>

Inheritance diagram for EcalClusterEnergyUncertaintyObjectSpecific:
EcalClusterEnergyUncertaintyObjectSpecificBaseClass EcalClusterFunctionBaseClass

Public Member Functions

 EcalClusterEnergyUncertaintyObjectSpecific (const edm::ParameterSet &)
 
float getValue (const reco::SuperCluster &, const int mode) const override
 
float getValue (const reco::BasicCluster &, const EcalRecHitCollection &) const override
 
- Public Member Functions inherited from EcalClusterEnergyUncertaintyObjectSpecificBaseClass
void checkInit () const
 
 EcalClusterEnergyUncertaintyObjectSpecificBaseClass ()
 
 EcalClusterEnergyUncertaintyObjectSpecificBaseClass (const edm::ParameterSet &)
 
void init (const edm::EventSetup &es) override
 
 ~EcalClusterEnergyUncertaintyObjectSpecificBaseClass () override
 
- Public Member Functions inherited from EcalClusterFunctionBaseClass
virtual float getValue (const reco::CaloCluster &) const
 
virtual ~EcalClusterFunctionBaseClass ()
 

Detailed Description

Definition at line 17 of file EcalClusterEnergyUncertaintyObjectSpecific.h.

Constructor & Destructor Documentation

EcalClusterEnergyUncertaintyObjectSpecific::EcalClusterEnergyUncertaintyObjectSpecific ( const edm::ParameterSet )
inline

Member Function Documentation

float EcalClusterEnergyUncertaintyObjectSpecific::getValue ( const reco::SuperCluster superCluster,
const int  mode 
) const
overridevirtual

Implements EcalClusterEnergyUncertaintyObjectSpecificBaseClass.

Definition at line 4 of file EcalClusterEnergyUncertaintyObjectSpecific.cc.

References EcalClusterEnergyUncertaintyObjectSpecificBaseClass::checkInit(), DEFINE_EDM_PLUGIN, reco::CaloCluster::energy(), stringResolutionProvider_cfi::et, PVValHelper::eta, reco::CaloCluster::eta(), MuonErrorMatrixAnalyzer_cfi::EtaBins, reco::SuperCluster::etaWidth(), RecoTauPiZeroBuilderPlugins_cfi::par0, RecoTauPiZeroBuilderPlugins_cfi::par1, and reco::SuperCluster::phiWidth().

Referenced by EcalClusterEnergyUncertaintyObjectSpecific().

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