CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalClusterEnergyCorrectionObjectSpecific Class Reference
Inheritance diagram for EcalClusterEnergyCorrectionObjectSpecific:
EcalClusterFunctionBaseClass

Public Member Functions

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

Private Member Functions

float fBremEta (float sigmaPhiSigmaEta, float eta, int algorithm) const
 
float fEnergy (float e, int algorithm) const
 
float fEt (float et, int algorithm) const
 
float fEta (float energy, float eta, int algorithm) const
 

Private Attributes

const EcalClusterEnergyCorrectionObjectSpecificParametersparams_ = nullptr
 
const edm::ESGetToken< EcalClusterEnergyCorrectionObjectSpecificParameters, EcalClusterEnergyCorrectionObjectSpecificParametersRcdparamsToken_
 

Detailed Description

Function that provides supercluster energy correction due to Bremsstrahlung loss

$Id: EcalClusterEnergyCorrectionObjectSpecific.h $Date: $Revision:

Author
Nicolas Chanon, October 2011

Definition at line 17 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

Constructor & Destructor Documentation

◆ EcalClusterEnergyCorrectionObjectSpecific()

EcalClusterEnergyCorrectionObjectSpecific::EcalClusterEnergyCorrectionObjectSpecific ( const edm::ParameterSet ,
edm::ConsumesCollector  iC 
)
inline

Definition at line 19 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

20  : paramsToken_(iC.esConsumes()) {}
const edm::ESGetToken< EcalClusterEnergyCorrectionObjectSpecificParameters, EcalClusterEnergyCorrectionObjectSpecificParametersRcd > paramsToken_

Member Function Documentation

◆ checkInit()

void EcalClusterEnergyCorrectionObjectSpecific::checkInit ( ) const

Definition at line 48 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

References Exception, and params_.

48  {
49  if (!params_) {
50  // non-initialized function parameters: throw exception
51  throw cms::Exception("EcalClusterEnergyCorrectionObjectSpecific::checkInit()")
52  << "Trying to access an uninitialized correction function.\n"
53  "Please call `init( edm::EventSetup &)' before any use of the function.\n";
54  }
55 }
const EcalClusterEnergyCorrectionObjectSpecificParameters * params_

◆ fBremEta()

float EcalClusterEnergyCorrectionObjectSpecific::fBremEta ( float  sigmaPhiSigmaEta,
float  eta,
int  algorithm 
) const
private

Definition at line 81 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

References funct::abs(), qcdUeDQM_cfi::algorithm, PVValHelper::eta, JetChargeProducer_cfi::exp, l1tTowerCalibrationProducer_cfi::iEta, l1tHGCalTowerMapProducer_cfi::nBinsEta, pfMETCorrectionType0_cfi::par0, pfMETCorrectionType0_cfi::par1, pfMETCorrectionType0_cfi::par2, pfMETCorrectionType0_cfi::par3, EcalFunParams::params(), and params_.

Referenced by getValue().

81  {
82  const float etaCrackMin = 1.44;
83  const float etaCrackMax = 1.56;
84 
85  //STD
86  const int nBinsEta = 14;
87  float leftEta[nBinsEta] = {0.02, 0.25, 0.46, 0.81, 0.91, 1.01, 1.16, etaCrackMax, 1.653, 1.8, 2.0, 2.2, 2.3, 2.4};
88  float rightEta[nBinsEta] = {0.25, 0.42, 0.77, 0.91, 1.01, 1.13, etaCrackMin, 1.653, 1.8, 2.0, 2.2, 2.3, 2.4, 2.5};
89 
90  float xcorr[nBinsEta];
91 
92  float par0[nBinsEta];
93  float par1[nBinsEta];
94  float par2[nBinsEta];
95  float par3[nBinsEta];
96  float par4[nBinsEta];
97 
98  float sigmaPhiSigmaEtaMin = 0.8;
99  float sigmaPhiSigmaEtaMax = 5.;
100 
101  float sigmaPhiSigmaEtaFit = -1;
102 
103  // extra protections
104  // fix sigmaPhiSigmaEta boundaries
105  if (sigmaPhiSigmaEta < sigmaPhiSigmaEtaMin)
106  sigmaPhiSigmaEta = sigmaPhiSigmaEtaMin;
107  if (sigmaPhiSigmaEta > sigmaPhiSigmaEtaMax)
108  sigmaPhiSigmaEta = sigmaPhiSigmaEtaMax;
109 
110  // eta = 0
111  if (std::abs(eta) < leftEta[0]) {
112  eta = 0.02;
113  }
114  // outside acceptance
115  if (std::abs(eta) >= rightEta[nBinsEta - 1]) {
116  eta = 2.49;
117  } //if (DBG) std::cout << " WARNING [applyScCorrections]: std::abs(eta) >= rightEta[nBinsEta-1] " << std::endl;}
118 
119  int tmpEta = -1;
120  for (int iEta = 0; iEta < nBinsEta; ++iEta) {
121  if (leftEta[iEta] <= std::abs(eta) && std::abs(eta) < rightEta[iEta]) {
122  tmpEta = iEta;
123  }
124  }
125 
126  if (algorithm == 0) { //Electrons
127 
128  xcorr[0] = (params_->params())[2];
129  xcorr[1] = (params_->params())[3];
130  xcorr[2] = (params_->params())[4];
131  xcorr[3] = (params_->params())[5];
132  xcorr[4] = (params_->params())[6];
133  xcorr[5] = (params_->params())[7];
134  xcorr[6] = (params_->params())[8];
135  xcorr[7] = (params_->params())[9];
136  xcorr[8] = (params_->params())[10];
137  xcorr[9] = (params_->params())[11];
138  xcorr[10] = (params_->params())[12];
139  xcorr[11] = (params_->params())[13];
140  xcorr[12] = (params_->params())[14];
141  xcorr[13] = (params_->params())[15];
142 
143  par0[0] = (params_->params())[16];
144  par1[0] = (params_->params())[17];
145  par2[0] = (params_->params())[18];
146  par3[0] = (params_->params())[19]; //should be 0 (not used)
147  par4[0] = (params_->params())[20]; //should be 0 (not used)
148 
149  par0[1] = (params_->params())[21];
150  par1[1] = (params_->params())[22];
151  par2[1] = (params_->params())[23];
152  par3[1] = (params_->params())[24];
153  par4[1] = (params_->params())[25];
154 
155  par0[2] = (params_->params())[26];
156  par1[2] = (params_->params())[27];
157  par2[2] = (params_->params())[28];
158  par3[2] = (params_->params())[29]; //should be 0 (not used)
159  par4[2] = (params_->params())[30]; //should be 0 (not used)
160 
161  par0[3] = (params_->params())[31];
162  par1[3] = (params_->params())[32];
163  par2[3] = (params_->params())[33];
164  par2[4] = (params_->params())[34]; //should be 0 (not used)
165  par2[5] = (params_->params())[35]; //should be 0 (not used)
166 
167  par0[4] = (params_->params())[36];
168  par1[4] = (params_->params())[37];
169  par2[4] = (params_->params())[38];
170  par3[4] = (params_->params())[39]; //should be 0 (not used)
171  par4[4] = (params_->params())[40]; //should be 0 (not used)
172 
173  par0[5] = (params_->params())[41];
174  par1[5] = (params_->params())[42];
175  par2[5] = (params_->params())[43];
176  par3[5] = (params_->params())[44]; //should be 0 (not used)
177  par4[5] = (params_->params())[45]; //should be 0 (not used)
178 
179  par0[6] = (params_->params())[46];
180  par1[6] = (params_->params())[47];
181  par2[6] = (params_->params())[48];
182  par3[6] = (params_->params())[49]; //should be 0 (not used)
183  par4[6] = (params_->params())[50]; //should be 0 (not used)
184 
185  par0[7] = (params_->params())[51];
186  par1[7] = (params_->params())[52];
187  par2[7] = (params_->params())[53];
188  par3[7] = (params_->params())[54]; //should be 0 (not used)
189  par4[7] = (params_->params())[55]; //should be 0 (not used)
190 
191  par0[8] = (params_->params())[56];
192  par1[8] = (params_->params())[57];
193  par2[8] = (params_->params())[58];
194  par3[8] = (params_->params())[59]; //should be 0 (not used)
195  par4[8] = (params_->params())[60]; //should be 0 (not used)
196 
197  par0[9] = (params_->params())[61];
198  par1[9] = (params_->params())[62];
199  par2[9] = (params_->params())[63];
200  par3[9] = (params_->params())[64]; //should be 0 (not used)
201  par4[9] = (params_->params())[65]; //should be 0 (not used)
202 
203  par0[10] = (params_->params())[66];
204  par1[10] = (params_->params())[67];
205  par2[10] = (params_->params())[68];
206  par3[10] = (params_->params())[69]; //should be 0 (not used)
207  par4[10] = (params_->params())[70]; //should be 0 (not used)
208 
209  par0[11] = (params_->params())[71];
210  par1[11] = (params_->params())[72];
211  par2[11] = (params_->params())[73];
212  par3[11] = (params_->params())[74]; //should be 0 (not used)
213  par4[11] = (params_->params())[75]; //should be 0 (not used)
214 
215  par0[12] = (params_->params())[76];
216  par1[12] = (params_->params())[77];
217  par2[12] = (params_->params())[78];
218  par3[12] = (params_->params())[79]; //should be 0 (not used)
219  par4[12] = (params_->params())[80]; //should be 0 (not used)
220 
221  par0[13] = (params_->params())[81];
222  par1[13] = (params_->params())[82];
223  par2[13] = (params_->params())[83];
224  par3[13] = (params_->params())[84]; //should be 0 (not used)
225  par4[13] = (params_->params())[85]; //should be 0 (not used)
226 
227  sigmaPhiSigmaEtaFit = 1.2;
228  }
229 
230  if (algorithm == 1) { //Photons
231 
232  xcorr[0] = (params_->params())[86];
233  xcorr[1] = (params_->params())[87];
234  xcorr[2] = (params_->params())[88];
235  xcorr[3] = (params_->params())[89];
236  xcorr[4] = (params_->params())[90];
237  xcorr[5] = (params_->params())[91];
238  xcorr[6] = (params_->params())[92];
239  xcorr[7] = (params_->params())[93];
240  xcorr[8] = (params_->params())[94];
241  xcorr[9] = (params_->params())[95];
242  xcorr[10] = (params_->params())[96];
243  xcorr[11] = (params_->params())[97];
244  xcorr[12] = (params_->params())[98];
245  xcorr[13] = (params_->params())[99];
246 
247  par0[0] = (params_->params())[100];
248  par1[0] = (params_->params())[101];
249  par2[0] = (params_->params())[102];
250  par3[0] = (params_->params())[103];
251  par4[0] = (params_->params())[104];
252 
253  par0[1] = (params_->params())[105];
254  par1[1] = (params_->params())[106];
255  par2[1] = (params_->params())[107];
256  par3[1] = (params_->params())[108];
257  par4[1] = (params_->params())[109];
258 
259  par0[2] = (params_->params())[110];
260  par1[2] = (params_->params())[111];
261  par2[2] = (params_->params())[112];
262  par3[2] = (params_->params())[113];
263  par4[2] = (params_->params())[114];
264 
265  par0[3] = (params_->params())[115];
266  par1[3] = (params_->params())[116];
267  par2[3] = (params_->params())[117];
268  par3[3] = (params_->params())[118];
269  par4[3] = (params_->params())[119];
270 
271  par0[4] = (params_->params())[120];
272  par1[4] = (params_->params())[121];
273  par2[4] = (params_->params())[122];
274  par3[4] = (params_->params())[123];
275  par4[4] = (params_->params())[124];
276 
277  par0[5] = (params_->params())[125];
278  par1[5] = (params_->params())[126];
279  par2[5] = (params_->params())[127];
280  par3[5] = (params_->params())[128];
281  par4[5] = (params_->params())[129];
282 
283  par0[6] = (params_->params())[130];
284  par1[6] = (params_->params())[131];
285  par2[6] = (params_->params())[132];
286  par3[6] = (params_->params())[133];
287  par4[6] = (params_->params())[134];
288 
289  par0[7] = (params_->params())[135];
290  par1[7] = (params_->params())[136];
291  par2[7] = (params_->params())[137];
292  par3[7] = (params_->params())[138];
293  par4[7] = (params_->params())[139];
294 
295  par0[8] = (params_->params())[140];
296  par1[8] = (params_->params())[141];
297  par2[8] = (params_->params())[142];
298  par3[8] = (params_->params())[143];
299  par4[8] = (params_->params())[144];
300 
301  par0[9] = (params_->params())[145];
302  par1[9] = (params_->params())[146];
303  par2[9] = (params_->params())[147];
304  par3[9] = (params_->params())[148];
305  par4[9] = (params_->params())[149];
306 
307  par0[10] = (params_->params())[150];
308  par1[10] = (params_->params())[151];
309  par2[10] = (params_->params())[152];
310  par3[10] = (params_->params())[153];
311  par4[10] = (params_->params())[154];
312 
313  par0[11] = (params_->params())[155];
314  par1[11] = (params_->params())[156];
315  par2[11] = (params_->params())[157];
316  par3[11] = (params_->params())[158];
317  par4[11] = (params_->params())[159];
318 
319  par0[12] = (params_->params())[160];
320  par1[12] = (params_->params())[161];
321  par2[12] = (params_->params())[162];
322  par3[12] = (params_->params())[163];
323  par4[12] = (params_->params())[164];
324 
325  par0[13] = (params_->params())[165];
326  par1[13] = (params_->params())[166];
327  par2[13] = (params_->params())[167];
328  par3[13] = (params_->params())[168];
329  par4[13] = (params_->params())[169];
330 
331  sigmaPhiSigmaEtaFit = 1.;
332  }
333 
334  // Interpolation
335  float tmpInter = 1;
336  // In eta cracks/gaps
337  if (tmpEta == -1) { // need to interpolate
338  for (int iEta = 0; iEta < nBinsEta - 1; ++iEta) {
339  if (rightEta[iEta] <= std::abs(eta) && std::abs(eta) < leftEta[iEta + 1]) {
340  if (sigmaPhiSigmaEta >= sigmaPhiSigmaEtaFit) {
341  if (algorithm == 0) { //electron
342  tmpInter = (par0[iEta] + sigmaPhiSigmaEta * par1[iEta] + sigmaPhiSigmaEta * sigmaPhiSigmaEta * par2[iEta] +
343  par0[iEta + 1] + sigmaPhiSigmaEta * par1[iEta + 1] +
344  sigmaPhiSigmaEta * sigmaPhiSigmaEta * par2[iEta + 1]) /
345  2.;
346  }
347  if (algorithm == 1) { //photon
348  tmpInter = (par0[iEta] * (1. - exp(-(sigmaPhiSigmaEta - par4[iEta]) / par1[iEta])) * par2[iEta] *
349  sigmaPhiSigmaEta +
350  par3[iEta] +
351  par0[iEta + 1] * (1. - exp(-(sigmaPhiSigmaEta - par4[iEta + 1]) / par1[iEta + 1])) *
352  par2[iEta + 1] * sigmaPhiSigmaEta +
353  par3[iEta + 1]) /
354  2.;
355  }
356  } else
357  tmpInter = (xcorr[iEta] + xcorr[iEta + 1]) / 2.;
358  }
359  }
360  return tmpInter;
361  }
362 
363  if (sigmaPhiSigmaEta >= sigmaPhiSigmaEtaFit) {
364  if (algorithm == 0)
365  return par0[tmpEta] + sigmaPhiSigmaEta * par1[tmpEta] + sigmaPhiSigmaEta * sigmaPhiSigmaEta * par2[tmpEta];
366  if (algorithm == 1)
367  return par0[tmpEta] * (1. - exp(-(sigmaPhiSigmaEta - par4[tmpEta]) / par1[tmpEta])) * par2[tmpEta] *
368  sigmaPhiSigmaEta +
369  par3[tmpEta];
370  } else
371  return xcorr[tmpEta];
372 
373  return 1.;
374 }
const EcalClusterEnergyCorrectionObjectSpecificParameters * params_
EcalFunctionParameters & params()
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ fEnergy()

float EcalClusterEnergyCorrectionObjectSpecific::fEnergy ( float  e,
int  algorithm 
) const
private

Definition at line 471 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

References qcdUeDQM_cfi::algorithm, JetChargeProducer_cfi::exp, pfMETCorrectionType0_cfi::par0, pfMETCorrectionType0_cfi::par1, pfMETCorrectionType0_cfi::par2, pfMETCorrectionType0_cfi::par3, EcalFunParams::params(), and params_.

Referenced by getValue().

471  {
472  float par0 = -1;
473  float par1 = -1;
474  float par2 = -1;
475  float par3 = -1;
476  float par4 = -1;
477 
478  if (algorithm == 0) { //Electrons EB
479  return 1.;
480  }
481 
482  if (algorithm == 1) { //Electrons EE
483 
484  par0 = (params_->params())[198];
485  par1 = (params_->params())[199];
486  par2 = (params_->params())[200];
487  par3 = (params_->params())[201];
488  par4 = (params_->params())[202];
489 
490  if (E > par0)
491  E = par0;
492  if (E < 0)
493  return 1.;
494  if (0 <= E && E <= par0)
495  return (par1 + E * par2) * (1 - par3 * exp(E / par4));
496  }
497 
498  if (algorithm == 2) { //Photons EB
499  return 1.;
500  }
501 
502  if (algorithm == 3) { //Photons EE
503 
504  par0 = (params_->params())[203];
505  par1 = (params_->params())[204];
506  par2 = (params_->params())[205];
507  //assignments to 'par3'&'par4' have been deleted from here as they serve no purpose and cause dead assignment errors
508 
509  if (E > par0)
510  E = par0;
511  if (E < 0)
512  return 1.;
513  if (0 <= E && E <= par0)
514  return par1 + E * par2;
515  }
516 
517  return 1.;
518 }
const EcalClusterEnergyCorrectionObjectSpecificParameters * params_
EcalFunctionParameters & params()

◆ fEt()

float EcalClusterEnergyCorrectionObjectSpecific::fEt ( float  et,
int  algorithm 
) const
private

Definition at line 376 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

References qcdUeDQM_cfi::algorithm, ET, JetChargeProducer_cfi::exp, pfMETCorrectionType0_cfi::par0, pfMETCorrectionType0_cfi::par1, pfMETCorrectionType0_cfi::par2, pfMETCorrectionType0_cfi::par3, EcalFunParams::params(), and params_.

Referenced by getValue().

376  {
377  float par0 = -1;
378  float par1 = -1;
379  float par2 = -1;
380  float par3 = -1;
381  float par4 = -1;
382  float par5 = -1;
383  float par6 = -1;
384 
385  if (algorithm == 0) { //Electrons EB
386 
387  par0 = (params_->params())[170];
388  par1 = (params_->params())[171];
389  par2 = (params_->params())[172];
390  par3 = (params_->params())[173];
391  par4 = (params_->params())[174];
392  //assignments to 'par5'&'par6' have been deleted from here as they serve no purpose and cause dead assignment errors
393 
394  if (ET > 200)
395  ET = 200;
396  if (ET < 5)
397  return 1.;
398  if (5 <= ET && ET < 10)
399  return par0;
400  if (10 <= ET && ET <= 200)
401  return (par1 + ET * par2) * (1 - par3 * exp(ET / par4));
402  }
403 
404  if (algorithm == 1) { //Electrons EE
405 
406  par0 = (params_->params())[177];
407  par1 = (params_->params())[178];
408  par2 = (params_->params())[179];
409  par3 = (params_->params())[180];
410  par4 = (params_->params())[181];
411  //assignments to variables 'par5'&'par6' have been deleted from here as they serve no purpose and cause dead assignment errors
412 
413  if (ET > 200)
414  ET = 200;
415  if (ET < 5)
416  return 1.;
417  if (5 <= ET && ET < 10)
418  return par0;
419  if (10 <= ET && ET <= 200)
420  return (par1 + ET * par2) * (1 - par3 * exp(ET / par4));
421  }
422 
423  if (algorithm == 2) { //Photons EB
424 
425  par0 = (params_->params())[184];
426  par1 = (params_->params())[185];
427  par2 = (params_->params())[186];
428  par3 = (params_->params())[187];
429  par4 = (params_->params())[188];
430  //assignments to 'par5'&'par6' have been deleted from here as they serve no purpose and cause dead assignment errors
431 
432  if (ET < 5)
433  return 1.;
434  if (5 <= ET && ET < 10)
435  return par0;
436  if (10 <= ET && ET < 20)
437  return par1;
438  if (20 <= ET && ET < 140)
439  return par2 + par3 * ET;
440  if (140 <= ET)
441  return par4;
442  }
443 
444  if (algorithm == 3) { //Photons EE
445 
446  par0 = (params_->params())[191];
447  par1 = (params_->params())[192];
448  par2 = (params_->params())[193];
449  par3 = (params_->params())[194];
450  par4 = (params_->params())[195];
451  par5 = (params_->params())[196];
452  par6 = (params_->params())[197];
453 
454  if (ET < 5)
455  return 1.;
456  if (5 <= ET && ET < 10)
457  return par0;
458  if (10 <= ET && ET < 20)
459  return par1;
460  if (20 <= ET && ET < 30)
461  return par2;
462  if (30 <= ET && ET < 200)
463  return par3 + par4 * ET + par5 * ET * ET;
464  if (200 <= ET)
465  return par6;
466  }
467 
468  return 1.;
469 }
const EcalClusterEnergyCorrectionObjectSpecificParameters * params_
EcalFunctionParameters & params()
#define ET

◆ fEta()

float EcalClusterEnergyCorrectionObjectSpecific::fEta ( float  energy,
float  eta,
int  algorithm 
) const
private

Definition at line 59 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

References qcdUeDQM_cfi::algorithm, hcalRecHitTable_cff::energy, PVValHelper::eta, hcalRecHitTable_cff::ieta, LaserDQM_cfg::p1, EcalFunParams::params(), and params_.

Referenced by getValue().

59  {
60  //std::cout << "fEta function" << std::endl;
61 
62  // this correction is setup only for EB
63  if (algorithm != 0)
64  return energy;
65 
66  float ieta = fabs(eta) * (5 / 0.087);
67  float p0 = (params_->params())[0]; // should be 40.2198
68  float p1 = (params_->params())[1]; // should be -3.03103e-6
69 
70  //std::cout << "ieta=" << ieta << std::endl;
71 
72  float correctedEnergy = energy;
73  if (ieta < p0)
74  correctedEnergy = energy;
75  else
76  correctedEnergy = energy / (1.0 + p1 * (ieta - p0) * (ieta - p0));
77  //std::cout << "ECEC fEta = " << correctedEnergy << std::endl;
78  return correctedEnergy;
79 }
const EcalClusterEnergyCorrectionObjectSpecificParameters * params_
EcalFunctionParameters & params()

◆ getParameters()

const EcalClusterEnergyCorrectionObjectSpecificParameters* EcalClusterEnergyCorrectionObjectSpecific::getParameters ( ) const
inline

Definition at line 23 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

References params_.

23 { return params_; }
const EcalClusterEnergyCorrectionObjectSpecificParameters * params_

◆ getValue() [1/2]

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

Implements EcalClusterFunctionBaseClass.

Definition at line 520 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

References alignCSCRings::corr, EcalBarrel, EcalEndcap, hcalRecHitTable_cff::energy, EgHLTOffHistBins_cfi::et, reco::CaloCluster::eta(), reco::SuperCluster::etaWidth(), JetChargeProducer_cfi::exp, fBremEta(), fEnergy(), fEt(), fEta(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, reco::SuperCluster::phiWidth(), reco::SuperCluster::preshowerEnergy(), reco::SuperCluster::rawEnergy(), reco::SuperCluster::seed(), and funct::sin().

521  {
522  float corr = 1.;
523  float corr2 = 1.;
524  float energy = 0;
525 
526  int subdet = superCluster.seed()->hitsAndFractions()[0].first.subdetId();
527  //std::cout << "subdet="<< subdet<< std::endl;
528 
529  //std::cout << "rawEnergy=" << superCluster.rawEnergy() << " SCeta=" << superCluster.eta() << std::endl;
530 
531  if (subdet == EcalBarrel) {
532  float cetacorr = fEta(superCluster.rawEnergy(), superCluster.eta(), 0) / superCluster.rawEnergy();
533  //std::cout << "cetacorr=" <<cetacorr<< std::endl;
534 
535  energy = superCluster.rawEnergy() * cetacorr; //previously in CMSSW
536  //energy = superCluster.rawEnergy()*fEta(e5x5, superCluster.seed()->eta(), 0)/e5x5;
537  } else if (subdet == EcalEndcap) {
538  energy = superCluster.rawEnergy() + superCluster.preshowerEnergy();
539  }
540 
541  float newEnergy = energy;
542 
543  if (mode == 0) { //Electron
544 
545  corr = fBremEta(superCluster.phiWidth() / superCluster.etaWidth(), superCluster.eta(), 0);
546 
547  float et = energy * std::sin(2 * std::atan(std::exp(-superCluster.eta()))) / corr;
548 
549  if (subdet == EcalBarrel)
550  corr2 = corr * fEt(et, 0);
551  if (subdet == EcalEndcap)
552  corr2 = corr * fEnergy(energy / corr, 1);
553 
554  newEnergy = energy / corr2;
555  }
556 
557  if (mode == 1) { //low R9 Photons
558 
559  corr = fBremEta(superCluster.phiWidth() / superCluster.etaWidth(), superCluster.eta(), 1);
560 
561  float et = energy * std::sin(2 * std::atan(std::exp(-superCluster.eta()))) / corr;
562 
563  if (subdet == EcalBarrel)
564  corr2 = corr * fEt(et, 2);
565  if (subdet == EcalEndcap)
566  corr2 = corr * fEnergy(energy / corr, 3);
567 
568  newEnergy = energy / corr2;
569  }
570 
571  return newEnergy;
572 }
float fEta(float energy, float eta, int algorithm) const
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:60
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double phiWidth() const
obtain phi and eta width of the Super Cluster
Definition: SuperCluster.h:68
dictionary corr
double etaWidth() const
Definition: SuperCluster.h:69
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:79
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:180
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:63
float fBremEta(float sigmaPhiSigmaEta, float eta, int algorithm) const

◆ getValue() [2/2]

float EcalClusterEnergyCorrectionObjectSpecific::getValue ( const reco::BasicCluster ,
const EcalRecHitCollection  
) const
inlineoverridevirtual

Implements EcalClusterFunctionBaseClass.

Definition at line 29 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

29 { return 0.; };

◆ init()

void EcalClusterEnergyCorrectionObjectSpecific::init ( const edm::EventSetup es)
overridevirtual

Implements EcalClusterFunctionBaseClass.

Definition at line 46 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

References edm::EventSetup::getData(), params_, and paramsToken_.

46 { params_ = &es.getData(paramsToken_); }
const EcalClusterEnergyCorrectionObjectSpecificParameters * params_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::ESGetToken< EcalClusterEnergyCorrectionObjectSpecificParameters, EcalClusterEnergyCorrectionObjectSpecificParametersRcd > paramsToken_

Member Data Documentation

◆ params_

const EcalClusterEnergyCorrectionObjectSpecificParameters* EcalClusterEnergyCorrectionObjectSpecific::params_ = nullptr
private

◆ paramsToken_

Definition at line 42 of file EcalClusterEnergyCorrectionObjectSpecific.cc.

Referenced by init().