CMS 3D CMS Logo

List of all members | Public Member Functions
EcalClusterEnergyCorrection Class Reference

#include <EcalClusterEnergyCorrection.h>

Inheritance diagram for EcalClusterEnergyCorrection:
EcalClusterEnergyCorrectionBaseClass EcalClusterFunctionBaseClass

Public Member Functions

 EcalClusterEnergyCorrection (const edm::ParameterSet &)
 
float fBrem (float e, float eta, int algorithm) const
 
float fEta (float e, float eta, int algorithm) const
 
float fEtEta (float et, float eta, int algorithm) const
 
float getValue (const reco::SuperCluster &, const int mode) const override
 
float getValue (const reco::BasicCluster &, const EcalRecHitCollection &) const override
 
- Public Member Functions inherited from EcalClusterEnergyCorrectionBaseClass
void checkInit () const
 
 EcalClusterEnergyCorrectionBaseClass ()
 
 EcalClusterEnergyCorrectionBaseClass (const edm::ParameterSet &)
 
const EcalClusterEnergyCorrectionParametersgetParameters () const
 
void init (const edm::EventSetup &es) override
 
 ~EcalClusterEnergyCorrectionBaseClass () override
 
- Public Member Functions inherited from EcalClusterFunctionBaseClass
virtual float getValue (const reco::CaloCluster &) const
 
virtual ~EcalClusterFunctionBaseClass ()
 

Additional Inherited Members

- Protected Attributes inherited from EcalClusterEnergyCorrectionBaseClass
edm::ESHandle< EcalClusterEnergyCorrectionParametersesParams_
 
const EcalClusterEnergyCorrectionParametersparams_
 

Detailed Description

Function that provides supercluster energy correction due to Bremsstrahlung loss

$Id: EcalClusterEnergyCorrection.h $Date: $Revision:

Author
Yurii Maravin, KSU, March 2009

Definition at line 15 of file EcalClusterEnergyCorrection.h.

Constructor & Destructor Documentation

EcalClusterEnergyCorrection::EcalClusterEnergyCorrection ( const edm::ParameterSet )
inline

Definition at line 17 of file EcalClusterEnergyCorrection.h.

References getValue(), and ALCARECOPromptCalibProdSiPixelAli0T_cff::mode.

17 {};

Member Function Documentation

float EcalClusterEnergyCorrection::fBrem ( float  e,
float  eta,
int  algorithm 
) const

Definition at line 22 of file EcalClusterEnergyCorrection.cc.

References a, b, EnergyCorrector::c, MillePedeFileConverter_cfg::e, PFRecoTauDiscriminationByIsolation_cfi::offset, p1, p2, p3, p4, EcalFunParams::params(), EcalClusterEnergyCorrectionBaseClass::params_, electronIdCutBased_cfi::threshold, and y.

Referenced by getValue().

23 {
24  // brem == phiWidth/etaWidth of the SuperCluster
25  // e == energy of the SuperCluster
26  // first parabola (for br > threshold)
27  // p0 + p1*x + p2*x^2
28  // second parabola (for br <= threshold)
29  // ax^2 + bx + c, make y and y' the same in threshold
30  // y = p0 + p1*threshold + p2*threshold^2
31  // yprime = p1 + 2*p2*threshold
32  // a = p3
33  // b = yprime - 2*a*threshold
34  // c = y - a*threshold^2 - b*threshold
35 
36  int offset;
37  if ( algorithm == 0 ) offset = 0;
38  else if ( algorithm == 1 ) offset = 20;
39  else {
40  // not supported, produce no correction
41  return e;
42  }
43 
44  //Make No Corrections if brem is invalid!
45  if ( brem == 0 ) return e;
46 
47  float bremLowThr = (params_->params())[2 + offset];
48  float bremHighThr = (params_->params())[3 + offset];
49  if ( brem < bremLowThr ) brem = bremLowThr;
50  if ( brem > bremHighThr ) brem = bremHighThr;
51 
52  // Parameters provided in cfg file
53  float p0 = (params_->params())[4 + offset];
54  float p1 = (params_->params())[5 + offset];
55  float p2 = (params_->params())[6 + offset];
56  float p3 = (params_->params())[7 + offset];
57  float p4 = (params_->params())[8 + offset];
58  //
59  float threshold = p4;
60 
61  float y = p0*threshold*threshold + p1*threshold + p2;
62  float yprime = 2*p0*threshold + p1;
63  float a = p3;
64  float b = yprime - 2*a*threshold;
65  float c = y - a*threshold*threshold - b*threshold;
66 
67  float fCorr = 1;
68  if ( brem < threshold )
69  fCorr = p0*brem*brem + p1*brem + p2;
70  else
71  fCorr = a*brem*brem + b*brem + c;
72 
73  //std::cout << "ECEC fBrem " << e/fCorr << std::endl;
74  return e/fCorr;
75 }
double p4[4]
Definition: TauolaWrapper.h:92
EcalFunctionParameters & params()
double p2[4]
Definition: TauolaWrapper.h:90
double b
Definition: hdecay.h:120
double p1[4]
Definition: TauolaWrapper.h:89
double a
Definition: hdecay.h:121
const EcalClusterEnergyCorrectionParameters * params_
double p3[4]
Definition: TauolaWrapper.h:91
float EcalClusterEnergyCorrection::fEta ( float  e,
float  eta,
int  algorithm 
) const

Definition at line 5 of file EcalClusterEnergyCorrection.cc.

References p1, EcalFunParams::params(), and EcalClusterEnergyCorrectionBaseClass::params_.

Referenced by getValue().

6 {
7 
8  // this correction is setup only for EB
9  if ( algorithm != 0 ) return energy;
10 
11  float ieta = fabs(eta)*(5/0.087);
12  float p0 = (params_->params())[0]; // should be 40.2198
13  float p1 = (params_->params())[1]; // should be -3.03103e-6
14 
15  float correctedEnergy = energy;
16  if ( ieta < p0 ) correctedEnergy = energy;
17  else correctedEnergy = energy/(1.0 + p1*(ieta-p0)*(ieta-p0));
18  //std::cout << "ECEC fEta = " << correctedEnergy << std::endl;
19  return correctedEnergy;
20 }
EcalFunctionParameters & params()
double p1[4]
Definition: TauolaWrapper.h:89
const EcalClusterEnergyCorrectionParameters * params_
float EcalClusterEnergyCorrection::fEtEta ( float  et,
float  eta,
int  algorithm 
) const

Definition at line 78 of file EcalClusterEnergyCorrection.cc.

References stringResolutionProvider_cfi::et, PFRecoTauDiscriminationByIsolation_cfi::offset, p1, p2, p3, EcalFunParams::params(), EcalClusterEnergyCorrectionBaseClass::params_, and mathSSE::sqrt().

Referenced by getValue().

79 {
80  // et -- Et of the SuperCluster (with respect to (0,0,0))
81  // eta -- eta of the SuperCluster
82 
83  //std::cout << "fEtEta, mode = " << algorithm << std::endl;
84  //std::cout << "ECEC: p0 " << (params_->params())[9] << " " << (params_->params())[10] << " " << (params_->params())[11] << " " << (params_->params())[12] << std::endl;
85  //std::cout << "ECEC: p1 " << (params_->params())[13] << " " << (params_->params())[14] << " " << (params_->params())[15] << " " << (params_->params())[16] << std::endl;
86  //std::cout << "ECEC: fcorr " << (params_->params())[17] << " " << (params_->params())[18] << " " << (params_->params())[19] << std::endl;
87 
88  float fCorr = 0.;
89  int offset;
90  if ( algorithm == 0 ) offset = 0;
91  else if ( algorithm == 1 ) offset = 20;
92  else if ( algorithm == 10 ) offset = 28;
93  else if ( algorithm == 11 ) offset = 39;
94  else {
95  // not supported, produce no correction
96  return et;
97  }
98 
99  // Barrel
100  if ( algorithm == 0 || algorithm == 10 ) {
101  float p0 = (params_->params())[ 9 + offset] + (params_->params())[10 + offset]/ (et + (params_->params())[11 + offset]) + (params_->params())[12 + offset]/(et*et);
102  float p1 = (params_->params())[13 + offset] + (params_->params())[14 + offset]/ (et + (params_->params())[15 + offset]) + (params_->params())[16 + offset]/(et*et);
103 
104  fCorr = p0 + p1 * atan((params_->params())[17 + offset]*((params_->params())[18 + offset]-fabs(eta))) + (params_->params())[19 + offset] * fabs(eta);
105 
106  } else if ( algorithm == 1 || algorithm == 11 ) { // Endcap
107  float p0 = (params_->params())[ 9 + offset] + (params_->params())[10 + offset]/sqrt(et);
108  float p1 = (params_->params())[11 + offset] + (params_->params())[12 + offset]/sqrt(et);
109  float p2 = (params_->params())[13 + offset] + (params_->params())[14 + offset]/sqrt(et);
110  float p3 = (params_->params())[15 + offset] + (params_->params())[16 + offset]/sqrt(et);
111 
112  fCorr = p0 + p1*fabs(eta) + p2*eta*eta + p3/fabs(eta);
113  }
114 
115  // cap the correction at 50%
116  if ( fCorr < 0.5 ) fCorr = 0.5;
117  if ( fCorr > 1.5 ) fCorr = 1.5;
118 
119  //std::cout << "ECEC fEtEta " << et/fCorr << std::endl;
120  return et/fCorr;
121 }
T sqrt(T t)
Definition: SSEVec.h:18
EcalFunctionParameters & params()
double p2[4]
Definition: TauolaWrapper.h:90
et
define resolution functions of each parameter
double p1[4]
Definition: TauolaWrapper.h:89
const EcalClusterEnergyCorrectionParameters * params_
double p3[4]
Definition: TauolaWrapper.h:91
float EcalClusterEnergyCorrection::getValue ( const reco::SuperCluster superCluster,
const int  mode 
) const
overridevirtual

Implements EcalClusterEnergyCorrectionBaseClass.

Definition at line 124 of file EcalClusterEnergyCorrection.cc.

References electronCleaner_cfi::algorithm, EcalClusterEnergyCorrectionBaseClass::checkInit(), DEFINE_EDM_PLUGIN, reco::CaloCluster::energy(), PVValHelper::eta, reco::CaloCluster::eta(), reco::SuperCluster::etaWidth(), fBrem(), fEta(), fEtEta(), reco::SuperCluster::phiWidth(), reco::SuperCluster::preshowerEnergy(), and reco::SuperCluster::rawEnergy().

Referenced by EcalClusterEnergyCorrection().

125 {
126  // mode flags:
127  // hybrid modes: 1 - return f(eta) correction in GeV
128  // 2 - return f(eta) + f(brem) correction
129  // 3 - return f(eta) + f(brem) + f(et, eta) correction
130  // multi5x5: 4 - return f(brem) correction
131  // 5 - return f(brem) + f(et, eta) correction
132 
133  // special cases: mode = 10 -- return f(et, eta) correction with respect to already corrected SC in barrel
134  // mode = 11 -- return f(et, eta) correction with respect to already corrected SC in endcap
135 
136  checkInit();
137 
138  float eta = fabs(superCluster.eta());
139  float brem = superCluster.phiWidth()/superCluster.etaWidth();
140  int algorithm = -1;
141 
142  if ( mode <= 3 || mode == 10 ) {
143  // algorithm: hybrid
144  algorithm = 0;
145 
146  float energy = superCluster.rawEnergy();
147  if ( mode == 10 ) {
148  algorithm = 10;
149  energy = superCluster.energy();
150  }
151  float correctedEnergy = fEta(energy, eta, algorithm);
152 
153  if ( mode == 1 ) {
154  return correctedEnergy - energy;
155 
156  } else {
157  // now apply F(brem)
158  correctedEnergy = fBrem(correctedEnergy, brem, algorithm);
159  if ( mode == 2 ) {
160  return correctedEnergy - energy;
161  }
162 
163  float correctedEt = correctedEnergy/cosh(eta);
164  correctedEt = fEtEta(correctedEt, eta, algorithm);
165  correctedEnergy = correctedEt*cosh(eta);
166  return correctedEnergy - energy;
167  }
168  } else if ( mode == 4 || mode == 5 || mode == 11 ) {
169  algorithm = 1;
170 
171  float energy = superCluster.rawEnergy() + superCluster.preshowerEnergy();
172  if ( mode == 11 ) {
173  algorithm = 11;
174  energy = superCluster.energy();
175  }
176 
177  float correctedEnergy = fBrem(energy, brem, algorithm);
178  if ( mode == 4 ) {
179  return correctedEnergy - energy;
180  }
181 
182  float correctedEt = correctedEnergy/cosh(eta);
183  correctedEt = fEtEta(correctedEt, eta, algorithm);
184  correctedEnergy = correctedEt*cosh(eta);
185  return correctedEnergy - energy;
186 
187  } else {
188 
189  // perform no correction
190  return 0;
191  }
192 
193 }
float fEtEta(float et, float eta, int algorithm) const
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:166
double etaWidth() const
Definition: SuperCluster.h:56
double energy() const
cluster energy
Definition: CaloCluster.h:124
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:47
float fBrem(float e, float eta, int algorithm) const
float fEta(float e, float eta, int algorithm) const
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:50
float EcalClusterEnergyCorrection::getValue ( const reco::BasicCluster ,
const EcalRecHitCollection  
) const
inlineoverridevirtual