CMS 3D CMS Logo

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

Public Member Functions

void checkInit () const
 
 EcalClusterEnergyCorrection (const edm::ParameterSet &)
 
const EcalClusterEnergyCorrectionParametersgetParameters () const
 
float getValue (const reco::BasicCluster &, const EcalRecHitCollection &) const override
 
float getValue (const reco::SuperCluster &, const int mode) 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 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
 

Private Attributes

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 16 of file EcalClusterEnergyCorrection.cc.

Constructor & Destructor Documentation

◆ EcalClusterEnergyCorrection()

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

Definition at line 18 of file EcalClusterEnergyCorrection.cc.

18 {};

Member Function Documentation

◆ checkInit()

void EcalClusterEnergyCorrection::checkInit ( ) const

Definition at line 248 of file EcalClusterEnergyCorrection.cc.

248  {
249  if (!params_) {
250  // non-initialized function parameters: throw exception
251  throw cms::Exception("EcalClusterEnergyCorrection::checkInit()")
252  << "Trying to access an uninitialized crack correction function.\n"
253  "Please call `init( edm::EventSetup &)' before any use of the function.\n";
254  }
255 }

References Exception, and params_.

Referenced by getValue().

◆ fBrem()

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

Definition at line 61 of file EcalClusterEnergyCorrection.cc.

61  {
62  // brem == phiWidth/etaWidth of the SuperCluster
63  // e == energy of the SuperCluster
64  // first parabola (for br > threshold)
65  // p0 + p1*x + p2*x^2
66  // second parabola (for br <= threshold)
67  // ax^2 + bx + c, make y and y' the same in threshold
68  // y = p0 + p1*threshold + p2*threshold^2
69  // yprime = p1 + 2*p2*threshold
70  // a = p3
71  // b = yprime - 2*a*threshold
72  // c = y - a*threshold^2 - b*threshold
73 
74  int offset;
75  if (algorithm == 0)
76  offset = 0;
77  else if (algorithm == 1)
78  offset = 20;
79  else {
80  // not supported, produce no correction
81  return e;
82  }
83 
84  //Make No Corrections if brem is invalid!
85  if (brem == 0)
86  return e;
87 
88  float bremLowThr = (params_->params())[2 + offset];
89  float bremHighThr = (params_->params())[3 + offset];
90  if (brem < bremLowThr)
91  brem = bremLowThr;
92  if (brem > bremHighThr)
93  brem = bremHighThr;
94 
95  // Parameters provided in cfg file
96  float p0 = (params_->params())[4 + offset];
97  float p1 = (params_->params())[5 + offset];
98  float p2 = (params_->params())[6 + offset];
99  float p3 = (params_->params())[7 + offset];
100  float p4 = (params_->params())[8 + offset];
101  //
102  float threshold = p4;
103 
104  float y = p0 * threshold * threshold + p1 * threshold + p2;
105  float yprime = 2 * p0 * threshold + p1;
106  float a = p3;
107  float b = yprime - 2 * a * threshold;
108  float c = y - a * threshold * threshold - b * threshold;
109 
110  float fCorr = 1;
111  if (brem < threshold)
112  fCorr = p0 * brem * brem + p1 * brem + p2;
113  else
114  fCorr = a * brem * brem + b * brem + c;
115 
116  //std::cout << "ECEC fBrem " << e/fCorr << std::endl;
117  return e / fCorr;
118 }

References a, qcdUeDQM_cfi::algorithm, b, c, MillePedeFileConverter_cfg::e, hltrates_dqm_sourceclient-live_cfg::offset, p1, p2, p3, p4, EcalFunParams::params(), params_, remoteMonitoring_LED_IterMethod_cfg::threshold, and y.

Referenced by getValue().

◆ fEta()

float EcalClusterEnergyCorrection::fEta ( float  e,
float  eta,
int  algorithm 
) const
private

Definition at line 43 of file EcalClusterEnergyCorrection.cc.

43  {
44  // this correction is setup only for EB
45  if (algorithm != 0)
46  return energy;
47 
48  float ieta = fabs(eta) * (5 / 0.087);
49  float p0 = (params_->params())[0]; // should be 40.2198
50  float p1 = (params_->params())[1]; // should be -3.03103e-6
51 
52  float correctedEnergy = energy;
53  if (ieta < p0)
54  correctedEnergy = energy;
55  else
56  correctedEnergy = energy / (1.0 + p1 * (ieta - p0) * (ieta - p0));
57  //std::cout << "ECEC fEta = " << correctedEnergy << std::endl;
58  return correctedEnergy;
59 }

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

Referenced by getValue().

◆ fEtEta()

float EcalClusterEnergyCorrection::fEtEta ( float  et,
float  eta,
int  algorithm 
) const
private

Definition at line 120 of file EcalClusterEnergyCorrection.cc.

120  {
121  // et -- Et of the SuperCluster (with respect to (0,0,0))
122  // eta -- eta of the SuperCluster
123 
124  //std::cout << "fEtEta, mode = " << algorithm << std::endl;
125  //std::cout << "ECEC: p0 " << (params_->params())[9] << " " << (params_->params())[10] << " " << (params_->params())[11] << " " << (params_->params())[12] << std::endl;
126  //std::cout << "ECEC: p1 " << (params_->params())[13] << " " << (params_->params())[14] << " " << (params_->params())[15] << " " << (params_->params())[16] << std::endl;
127  //std::cout << "ECEC: fcorr " << (params_->params())[17] << " " << (params_->params())[18] << " " << (params_->params())[19] << std::endl;
128 
129  float fCorr = 0.;
130  int offset;
131  if (algorithm == 0)
132  offset = 0;
133  else if (algorithm == 1)
134  offset = 20;
135  else if (algorithm == 10)
136  offset = 28;
137  else if (algorithm == 11)
138  offset = 39;
139  else {
140  // not supported, produce no correction
141  return et;
142  }
143 
144  // Barrel
145  if (algorithm == 0 || algorithm == 10) {
146  float p0 = (params_->params())[9 + offset] +
147  (params_->params())[10 + offset] / (et + (params_->params())[11 + offset]) +
148  (params_->params())[12 + offset] / (et * et);
149  float p1 = (params_->params())[13 + offset] +
150  (params_->params())[14 + offset] / (et + (params_->params())[15 + offset]) +
151  (params_->params())[16 + offset] / (et * et);
152 
153  fCorr = p0 + p1 * atan((params_->params())[17 + offset] * ((params_->params())[18 + offset] - fabs(eta))) +
154  (params_->params())[19 + offset] * fabs(eta);
155 
156  } else if (algorithm == 1 || algorithm == 11) { // Endcap
157  float p0 = (params_->params())[9 + offset] + (params_->params())[10 + offset] / sqrt(et);
158  float p1 = (params_->params())[11 + offset] + (params_->params())[12 + offset] / sqrt(et);
159  float p2 = (params_->params())[13 + offset] + (params_->params())[14 + offset] / sqrt(et);
160  float p3 = (params_->params())[15 + offset] + (params_->params())[16 + offset] / sqrt(et);
161 
162  fCorr = p0 + p1 * fabs(eta) + p2 * eta * eta + p3 / fabs(eta);
163  }
164 
165  // cap the correction at 50%
166  if (fCorr < 0.5)
167  fCorr = 0.5;
168  if (fCorr > 1.5)
169  fCorr = 1.5;
170 
171  //std::cout << "ECEC fEtEta " << et/fCorr << std::endl;
172  return et / fCorr;
173 }

References qcdUeDQM_cfi::algorithm, EgHLTOffHistBins_cfi::et, PVValHelper::eta, hltrates_dqm_sourceclient-live_cfg::offset, p1, p2, p3, EcalFunParams::params(), params_, and mathSSE::sqrt().

Referenced by getValue().

◆ getParameters()

const EcalClusterEnergyCorrectionParameters* EcalClusterEnergyCorrection::getParameters ( ) const
inline

Definition at line 21 of file EcalClusterEnergyCorrection.cc.

21 { return params_; }

References params_.

◆ getValue() [1/2]

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

Implements EcalClusterFunctionBaseClass.

Definition at line 27 of file EcalClusterEnergyCorrection.cc.

27 { return 0.; };

◆ getValue() [2/2]

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

Implements EcalClusterFunctionBaseClass.

Definition at line 175 of file EcalClusterEnergyCorrection.cc.

175  {
176  // mode flags:
177  // hybrid modes: 1 - return f(eta) correction in GeV
178  // 2 - return f(eta) + f(brem) correction
179  // 3 - return f(eta) + f(brem) + f(et, eta) correction
180  // multi5x5: 4 - return f(brem) correction
181  // 5 - return f(brem) + f(et, eta) correction
182 
183  // special cases: mode = 10 -- return f(et, eta) correction with respect to already corrected SC in barrel
184  // mode = 11 -- return f(et, eta) correction with respect to already corrected SC in endcap
185 
186  checkInit();
187 
188  float eta = fabs(superCluster.eta());
189  float brem = superCluster.phiWidth() / superCluster.etaWidth();
190  int algorithm = -1;
191 
192  if (mode <= 3 || mode == 10) {
193  // algorithm: hybrid
194  algorithm = 0;
195 
196  float energy = superCluster.rawEnergy();
197  if (mode == 10) {
198  algorithm = 10;
199  energy = superCluster.energy();
200  }
201  float correctedEnergy = fEta(energy, eta, algorithm);
202 
203  if (mode == 1) {
204  return correctedEnergy - energy;
205 
206  } else {
207  // now apply F(brem)
208  correctedEnergy = fBrem(correctedEnergy, brem, algorithm);
209  if (mode == 2) {
210  return correctedEnergy - energy;
211  }
212 
213  float correctedEt = correctedEnergy / cosh(eta);
214  correctedEt = fEtEta(correctedEt, eta, algorithm);
215  correctedEnergy = correctedEt * cosh(eta);
216  return correctedEnergy - energy;
217  }
218  } else if (mode == 4 || mode == 5 || mode == 11) {
219  algorithm = 1;
220 
221  float energy = superCluster.rawEnergy() + superCluster.preshowerEnergy();
222  if (mode == 11) {
223  algorithm = 11;
224  energy = superCluster.energy();
225  }
226 
227  float correctedEnergy = fBrem(energy, brem, algorithm);
228  if (mode == 4) {
229  return correctedEnergy - energy;
230  }
231 
232  float correctedEt = correctedEnergy / cosh(eta);
233  correctedEt = fEtEta(correctedEt, eta, algorithm);
234  correctedEnergy = correctedEt * cosh(eta);
235  return correctedEnergy - energy;
236 
237  } else {
238  // perform no correction
239  return 0;
240  }
241 }

References qcdUeDQM_cfi::algorithm, checkInit(), HCALHighEnergyHPDFilter_cfi::energy, reco::CaloCluster::energy(), PVValHelper::eta, reco::CaloCluster::eta(), reco::SuperCluster::etaWidth(), fBrem(), fEta(), fEtEta(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, reco::SuperCluster::phiWidth(), reco::SuperCluster::preshowerEnergy(), and reco::SuperCluster::rawEnergy().

◆ init()

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

Implements EcalClusterFunctionBaseClass.

Definition at line 243 of file EcalClusterEnergyCorrection.cc.

243  {
245  params_ = esParams_.product();
246 }

References esParams_, edm::EventSetup::get(), get, and params_.

Member Data Documentation

◆ esParams_

edm::ESHandle<EcalClusterEnergyCorrectionParameters> EcalClusterEnergyCorrection::esParams_
private

Definition at line 37 of file EcalClusterEnergyCorrection.cc.

Referenced by init().

◆ params_

const EcalClusterEnergyCorrectionParameters* EcalClusterEnergyCorrection::params_
private

Definition at line 38 of file EcalClusterEnergyCorrection.cc.

Referenced by checkInit(), fBrem(), fEta(), fEtEta(), getParameters(), and init().

EcalClusterEnergyCorrection::fEtEta
float fEtEta(float et, float eta, int algorithm) const
Definition: EcalClusterEnergyCorrection.cc:120
DDAxes::y
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
EcalClusterEnergyCorrection::fBrem
float fBrem(float e, float eta, int algorithm) const
Definition: EcalClusterEnergyCorrection.cc:61
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
reco::SuperCluster::phiWidth
double phiWidth() const
obtain phi and eta width of the Super Cluster
Definition: SuperCluster.h:66
PVValHelper::eta
Definition: PVValidationHelpers.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
p2
double p2[4]
Definition: TauolaWrapper.h:90
EcalClusterEnergyCorrection::esParams_
edm::ESHandle< EcalClusterEnergyCorrectionParameters > esParams_
Definition: EcalClusterEnergyCorrection.cc:37
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalClusterEnergyCorrection::params_
const EcalClusterEnergyCorrectionParameters * params_
Definition: EcalClusterEnergyCorrection.cc:38
b
double b
Definition: hdecay.h:118
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
a
double a
Definition: hdecay.h:119
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
EcalClusterEnergyCorrection::fEta
float fEta(float e, float eta, int algorithm) const
Definition: EcalClusterEnergyCorrection.cc:43
EcalClusterEnergyCorrection::checkInit
void checkInit() const
Definition: EcalClusterEnergyCorrection.cc:248
qcdUeDQM_cfi.algorithm
algorithm
Definition: qcdUeDQM_cfi.py:32
p4
double p4[4]
Definition: TauolaWrapper.h:92
p1
double p1[4]
Definition: TauolaWrapper.h:89
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
get
#define get
EcalFunParams::params
EcalFunctionParameters & params()
Definition: EcalFunctionParameters.h:13
reco::SuperCluster::preshowerEnergy
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:61
reco::SuperCluster::rawEnergy
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:58
Exception
Definition: hltDiff.cc:245
EcalClusterEnergyCorrectionParametersRcd
Definition: EcalClusterEnergyCorrectionParametersRcd.h:5
reco::SuperCluster::etaWidth
double etaWidth() const
Definition: SuperCluster.h:67
p3
double p3[4]
Definition: TauolaWrapper.h:91
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37