test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes
EnergyScaleCorrection_class Class Reference

Read and get energy scale and smearings from .dat files. More...

#include <Calibration/ZFitter/src/EnergyScaleCorrection_class.cc>

Public Member Functions

 EnergyScaleCorrection_class (std::string correctionFileName, unsigned int genSeed=0)
 
 EnergyScaleCorrection_class ()
 
float getSmearingRho (int runNumber, bool isEBEle, float R9Ele, float etaSCEle, float EtEle) const
 public for sigmaE estimate More...
 
float getSmearingSigma (int runNumber, bool isEBEle, float R9Ele, float etaSCEle, float EtEle, paramSmear_t par, float nSigma=0.) const
 
float getSmearingSigma (int runNumber, bool isEBEle, float R9Ele, float etaSCEle, float EtEle, float nSigma_rho, float nSigma_phi) const
 
float ScaleCorrection (unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
 method to get energy scale corrections More...
 
float ScaleCorrectionUncertainty (unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
 method to get scale correction uncertainties: it's stat+syst in eta x R9 categories More...
 
void SetSmearingType (fileFormat_t value)
 
 ~EnergyScaleCorrection_class (void)
 dummy constructor needed in ElectronEnergyCalibratorRun2 More...
 

Public Attributes

bool doScale
 
bool doSmearings
 

Private Types

enum  fileFormat_t { UNKNOWN =0, GLOBE, ECALELF_TOY, ECALELF }
 
enum  paramSmear_t { kNone = 0, kRho, kPhi, kNParamSmear }
 

Private Member Functions

void AddScale (TString category_, int runMin_, int runMax_, double deltaP_, double err_deltaP_, double err_syst_deltaP)
 
void AddSmearing (TString category_, int runMin_, int runMax_, double rho, double err_rho, double phi, double err_phi, double Emean, double err_Emean)
 
correctionValue_class getScaleCorrection (unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
 returns the correction value class More...
 
float getScaleOffset (unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
 
float getScaleStatUncertainty (unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
 
float getScaleSystUncertainty (unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
 
void ReadFromFile (TString filename)
 category "runNumber" runMin runMax deltaP err_deltaP_per_bin err_deltaP_stat err_deltaP_syst More...
 
void ReadSmearingFromFile (TString filename)
 File structure: category constTerm alpha;. More...
 

Private Attributes

correction_map_t scales
 
correction_map_t scales_not_defined
 
correction_map_t smearings
 
correction_map_t smearings_not_defined
 
fileFormat_t smearingType_
 

Detailed Description

Read and get energy scale and smearings from .dat files.

Author
Shervin Nourbakhsh

Definition at line 131 of file EnergyScaleCorrection_class.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

EnergyScaleCorrection_class::EnergyScaleCorrection_class ( std::string  correctionFileName,
unsigned int  genSeed = 0 
)

Definition at line 18 of file EnergyScaleCorrection_class.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, cmsRelvalreport::exit, lut2db_cfg::filename, ReadFromFile(), ReadSmearingFromFile(), scales, smearings, and AlCaHLTBitMon_QueryRunRegistry::string.

18  :
19  doScale(false), doSmearings(false),
21 {
22 
23  if(correctionFileName.size() > 0) {
24  std::string filename = correctionFileName+"_scales.dat";
25  ReadFromFile(filename);
26  if(scales.empty()) {
27  std::cerr << "[ERROR] scale correction map empty" << std::endl;
28  exit(1);
29  }
30  }
31 
32  if(correctionFileName.size() > 0) {
33  std::string filename = correctionFileName+"_smearings.dat";
34  ReadSmearingFromFile(filename);
35  if(smearings.empty()) {
36  std::cerr << "[ERROR] scale correction map empty" << std::endl;
37  exit(1);
38  }
39  }
40 
41  return;
42 }
void ReadFromFile(TString filename)
category &quot;runNumber&quot; runMin runMax deltaP err_deltaP_per_bin err_deltaP_stat err_deltaP_syst ...
void ReadSmearingFromFile(TString filename)
File structure: category constTerm alpha;.
tuple filename
Definition: lut2db_cfg.py:20
EnergyScaleCorrection_class::EnergyScaleCorrection_class ( )
inline

Definition at line 153 of file EnergyScaleCorrection_class.h.

153 {};
EnergyScaleCorrection_class::~EnergyScaleCorrection_class ( void  )

dummy constructor needed in ElectronEnergyCalibratorRun2

Definition at line 44 of file EnergyScaleCorrection_class.cc.

45 {
46  return;
47 }

Member Function Documentation

void EnergyScaleCorrection_class::AddScale ( TString  category_,
int  runMin_,
int  runMax_,
double  deltaP_,
double  err_deltaP_,
double  err_syst_deltaP 
)
private

Definition at line 185 of file EnergyScaleCorrection_class.cc.

References eostools::cat(), ecal_dqm_sourceclient-live_cfg::cerr, corr, gather_cfg::cout, cmsRelvalreport::exit, correctionCategory_class::runmax, correctionCategory_class::runmin, correctionValue_class::scale, correctionValue_class::scale_err, correctionValue_class::scale_err_syst, and scales.

Referenced by ReadFromFile().

186 {
187 
188  correctionCategory_class cat(category_); // build the category from the string
189  cat.runmin = runMin_;
190  cat.runmax = runMax_;
191 
192  // the following check is not needed, can be removed
193  if(scales.count(cat) != 0) {
194  std::cerr << "[ERROR] Category already defined!" << std::endl;
195  std::cerr << " Adding category: " << cat << std::endl;
196  std::cerr << " Defined category: " << scales[cat] << std::endl;
197  exit(1);
198  }
199 
200  correctionValue_class corr; // define the correction values
201  corr.scale = deltaP_;
202  corr.scale_err = err_deltaP_;
203  corr.scale_err_syst = err_syst_deltaP;
204  scales[cat] = corr;
205 
206 #ifdef PEDANTIC_OUTPUT
207  std::cout << "[INFO:scale correction] " << cat << corr << std::endl;
208 #endif
209  return;
210 }
def cat
Definition: eostools.py:400
JetCorrectorParameters corr
Definition: classes.h:5
tuple cout
Definition: gather_cfg.py:145
void EnergyScaleCorrection_class::AddSmearing ( TString  category_,
int  runMin_,
int  runMax_,
double  rho,
double  err_rho,
double  phi,
double  err_phi,
double  Emean,
double  err_Emean 
)
private

Definition at line 213 of file EnergyScaleCorrection_class.cc.

References eostools::cat(), ecal_dqm_sourceclient-live_cfg::cerr, corr, gather_cfg::cout, correctionValue_class::Emean, correctionValue_class::Emean_err, cmsRelvalreport::exit, phi, correctionValue_class::phi, correctionValue_class::phi_err, rho, correctionValue_class::rho, correctionValue_class::rho_err, correctionCategory_class::runmax, correctionCategory_class::runmin, and smearings.

Referenced by ReadSmearingFromFile().

216 {
217 
218  correctionCategory_class cat(category_);
219  cat.runmin = (runMin_ < 0) ? 0 : runMin_;
220  cat.runmax = runMax_;
221 
222  if(smearings.count(cat) != 0) {
223  std::cerr << "[ERROR] Smearing category already defined!" << std::endl;
224  std::cerr << " Adding category: " << cat << std::endl;
225  std::cerr << " Defined category: " << smearings[cat] << std::endl;
226  exit(1);
227  }
228 
230  corr.rho = rho;
231  corr.rho_err = err_rho;
232  corr.phi = phi;
233  corr.phi_err = err_phi;
234  corr.Emean = Emean;
235  corr.Emean_err = err_Emean;
236  smearings[cat] = corr;
237 
238 #ifdef PEDANTIC_OUTPUT
239 #ifndef CMSSW
240  std::cout << "[INFO:smearings] " << cat << corr << std::endl;
241 #else
242  edm::LogInfo("[INFO:smearings] ") << cat << corr;
243 #endif
244 #endif
245 
246  return;
247 }
def cat
Definition: eostools.py:400
JetCorrectorParameters corr
Definition: classes.h:5
tuple cout
Definition: gather_cfg.py:145
correctionValue_class EnergyScaleCorrection_class::getScaleCorrection ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const
private

returns the correction value class

Definition at line 85 of file EnergyScaleCorrection_class.cc.

References python.rootplot.argparse::category, gather_cfg::cout, and scales.

Referenced by getScaleStatUncertainty(), and getScaleSystUncertainty().

86 {
87  // buld the category based on the values of the object
88  correctionCategory_class category(runNumber, etaSCEle, R9Ele, EtEle);
89  correction_map_t::const_iterator corr_itr = scales.find(category); // find the correction value in the map that associates the category to the correction
90 
91  if(corr_itr == scales.end()) { // if not in the standard classes, add it in the list of not defined classes
92 
93  // this part is commented because it makes the method not constant
94  // if(scales_not_defined.count(category) == 0) {
95  // correctionValue_class corr;
96  // scales_not_defined[category] = corr;
97  // }
98  // corr_itr = scales_not_defined.find(category);
100  std::cout << "[ERROR] Scale category not found: " << std::endl;
101  std::cout << category << std::endl;
102  // exit(1);
103  }
104 
105 #ifdef DEBUG
106  std::cout << "[DEBUG] Checking scale correction for category: " << category << std::endl;
107  std::cout << "[DEBUG] Correction is: " << corr_itr->second
108  << std::endl
109  << " given for category " << corr_itr->first << std::endl;;
110 #endif
111  return corr_itr->second;
112 }
tuple cout
Definition: gather_cfg.py:145
float EnergyScaleCorrection_class::getScaleOffset ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const
private

Definition at line 114 of file EnergyScaleCorrection_class.cc.

References python.rootplot.argparse::category, gather_cfg::cout, and scales.

Referenced by ScaleCorrection().

115 {
116  // buld the category based on the values of the object
117  correctionCategory_class category(runNumber, etaSCEle, R9Ele, EtEle);
118  correction_map_t::const_iterator corr_itr = scales.find(category); // find the correction value in the map that associates the category to the correction
119 
120  if(corr_itr == scales.end()) { // if not in the standard classes, add it in the list of not defined classes
121 
122  // this part is commented because it makes the method not constant
123  // if(scales_not_defined.count(category) == 0) {
124  // correctionValue_class corr;
125  // scales_not_defined[category] = corr;
126  // }
127  // corr_itr = scales_not_defined.find(category);
129  std::cout << "[ERROR] Scale offset category not found: " << std::endl;
130  std::cout << category << std::endl;
131  // exit(1);
132  }
133 
134 #ifdef DEBUG
135  std::cout << "[DEBUG] Checking scale offset correction for category: " << category << std::endl;
136  std::cout << "[DEBUG] Correction is: " << corr_itr->second
137  << std::endl
138  << " given for category " << corr_itr->first << std::endl;;
139 #endif
140 
141  return corr_itr->second.scale;
142 }
tuple cout
Definition: gather_cfg.py:145
float EnergyScaleCorrection_class::getScaleStatUncertainty ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const
private

Definition at line 72 of file EnergyScaleCorrection_class.cc.

References getScaleCorrection(), and correctionValue_class::scale_err.

Referenced by ScaleCorrectionUncertainty().

74 {
75  return getScaleCorrection(runNumber, isEBEle, R9Ele, etaSCEle, EtEle).scale_err;
76 }
correctionValue_class getScaleCorrection(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
returns the correction value class
float EnergyScaleCorrection_class::getScaleSystUncertainty ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const
private

Definition at line 78 of file EnergyScaleCorrection_class.cc.

References getScaleCorrection(), and correctionValue_class::scale_err_syst.

Referenced by ScaleCorrectionUncertainty().

80 {
81  return getScaleCorrection(runNumber, isEBEle, R9Ele, etaSCEle, EtEle).scale_err_syst;
82 }
correctionValue_class getScaleCorrection(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
returns the correction value class
float EnergyScaleCorrection_class::getSmearingRho ( int  runNumber,
bool  isEBEle,
float  R9Ele,
float  etaSCEle,
float  EtEle 
) const

public for sigmaE estimate

Definition at line 387 of file EnergyScaleCorrection_class.cc.

References python.rootplot.argparse::category, smearings, and smearings_not_defined.

388 {
389 
390  correctionCategory_class category(runNumber, etaSCEle, R9Ele, EtEle);
391  correction_map_t::const_iterator corr_itr = smearings.find(category);
392  if(corr_itr == smearings.end()) { // if not in the standard classes, add it in the list of not defined classes
393  // if(smearings_not_defined.count(category) == 0) {
394  // correctionValue_class corr;
395  // smearings_not_defined[category] = corr;
396  // }
397  corr_itr = smearings_not_defined.find(category);
398  }
399 
400  return corr_itr->second.rho;
401 }
float EnergyScaleCorrection_class::getSmearingSigma ( int  runNumber,
bool  isEBEle,
float  R9Ele,
float  etaSCEle,
float  EtEle,
paramSmear_t  par,
float  nSigma = 0. 
) const

Definition at line 346 of file EnergyScaleCorrection_class.cc.

References kPhi, and kRho.

Referenced by PhotonEnergyCalibratorRun2::calibrate(), and ElectronEnergyCalibratorRun2::calibrate().

347 {
348  if (par == kRho) return getSmearingSigma(runNumber, isEBEle, R9Ele, etaSCEle, EtEle, nSigma, 0.);
349  if (par == kPhi) return getSmearingSigma(runNumber, isEBEle, R9Ele, etaSCEle, EtEle, 0., nSigma);
350  return getSmearingSigma(runNumber, isEBEle, R9Ele, etaSCEle, EtEle, 0., 0.);
351 }
float getSmearingSigma(int runNumber, bool isEBEle, float R9Ele, float etaSCEle, float EtEle, paramSmear_t par, float nSigma=0.) const
float EnergyScaleCorrection_class::getSmearingSigma ( int  runNumber,
bool  isEBEle,
float  R9Ele,
float  etaSCEle,
float  EtEle,
float  nSigma_rho,
float  nSigma_phi 
) const

Definition at line 353 of file EnergyScaleCorrection_class.cc.

References alpha, python.rootplot.argparse::category, ecal_dqm_sourceclient-live_cfg::cerr, funct::cos(), gather_cfg::cout, phi, rho, funct::sin(), smearings, smearings_not_defined, and mathSSE::sqrt().

354 {
355 
356  correctionCategory_class category(runNumber, etaSCEle, R9Ele, EtEle);
357  correction_map_t::const_iterator corr_itr = smearings.find(category);
358  if(corr_itr == smearings.end()) { // if not in the standard classes, add it in the list of not defined classes
359  // the following commented part makes the method non const
360  // if(smearings_not_defined.count(category) == 0) {
361  // correctionValue_class corr;
362  // smearings_not_defined[category] = corr;
363  // }
364  corr_itr = smearings_not_defined.find(category);
365  std::cerr << "[WARNING] Smearing category not found: " << std::endl;
366  std::cerr << category << std::endl;
367  // exit(1);
368  }
369 
370 #ifdef DEBUG
371  std::cout << "[DEBUG] Checking smearing correction for category: " << category << std::endl;
372  std::cout << "[DEBUG] Correction is: " << corr_itr->second
373  << std::endl
374  << " given for category " << corr_itr->first;
375 #endif
376 
377  double rho = corr_itr->second.rho + corr_itr->second.rho_err * nSigma_rho;
378  double phi = corr_itr->second.phi + corr_itr->second.phi_err * nSigma_phi;
379 
380  double constTerm = rho * sin(phi);
381  double alpha = rho * corr_itr->second.Emean * cos( phi);
382 
383  return sqrt(constTerm * constTerm + alpha * alpha / EtEle);
384 
385 }
float alpha
Definition: AMPTWrapper.h:95
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
tuple cout
Definition: gather_cfg.py:145
void EnergyScaleCorrection_class::ReadFromFile ( TString  filename)
private

category "runNumber" runMin runMax deltaP err_deltaP_per_bin err_deltaP_stat err_deltaP_syst

Input file structure: category "runNumber" runMin runMax deltaP err_deltaP(stat on single bins) err_deltaP_stat(to be used) err_deltaP_syst(to be used)

Definition at line 150 of file EnergyScaleCorrection_class.cc.

References AddScale(), python.rootplot.argparse::category, ecal_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, cmsRelvalreport::exit, and contentValuesFiles::fullPath.

Referenced by EnergyScaleCorrection_class().

151 {
152 #ifdef PEDANTIC_OUTPUT
153  std::cout << "[STATUS] Reading energy scale correction values from file: " << filename << std::endl;
154 #endif
155  std::cout << "[STATUS] Reading energy scale correction values from file: " << filename << std::endl;
156 
157  //std::ifstream Ccufile(edm::FileInPath(Ccufilename).fullPath().c_str(),std::ios::in);
158  std::ifstream f_in(edm::FileInPath(filename).fullPath().c_str());
159 
160  if(!f_in.good()) {
161  std::cerr << "[ERROR] file " << filename << " not readable" << std::endl;
162  exit(1);
163  return;
164  }
165 
166  int runMin, runMax;
167  TString category, region2;
168  double deltaP, err_deltaP, err_deltaP_stat, err_deltaP_syst;
169 
170 
171  for(f_in >> category; f_in.good(); f_in >> category) {
172  f_in >> region2
173  >> runMin >> runMax
174  >> deltaP >> err_deltaP >> err_deltaP_stat >> err_deltaP_syst;
175 
176  AddScale(category, runMin, runMax, deltaP, err_deltaP_stat, err_deltaP_syst);
177  }
178 
179  f_in.close();
180 
181  return;
182 }
void AddScale(TString category_, int runMin_, int runMax_, double deltaP_, double err_deltaP_, double err_syst_deltaP)
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:145
void EnergyScaleCorrection_class::ReadSmearingFromFile ( TString  filename)
private

File structure: category constTerm alpha;.

File structure: EBlowEtaBad8TeV 0 0.0 1.0 -999. 0.94 -999999 999999 6.73 0. 7.7e-3 6.32e-4 0.00 0.16 EBlowEtaGold8TeV 0 0.0 1.0 0.94 999. -999999 999999 6.60 0. 7.4e-3 6.50e-4 0.00 0.16 EBhighEtaBad8TeV 0 1.0 1.5 -999. 0.94 -999999 999999 6.73 0. 1.26e-2 1.03e-3 0.00 0.07 EBhighEtaGold8TeV 0 1.0 1.5 0.94 999. -999999 999999 6.52 0. 1.12e-2 1.32e-3 0.00 0.22

EElowEtaBad8TeV 0 1.5 2.0 -999. 0.94 -999999 999999 0. 0. 1.98e-2 3.03e-3 0. 0. EElowEtaGold8TeV 0 1.5 2.0 0.94 999. -999999 999999 0. 0. 1.63e-2 1.22e-3 0. 0. EEhighEtaBad8TeV 0 2.0 3.0 -999. 0.94 -999999 999999 0. 0. 1.92e-2 9.22e-4 0. 0. EEhighEtaGold8TeV 0 2.0 3.0 0.94 999. -999999 999999 0. 0. 1.86e-2 7.81e-4 0. 0.

Definition at line 264 of file EnergyScaleCorrection_class.cc.

References AddSmearing(), assert(), python.rootplot.argparse::category, ecal_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, ECALELF, HLT_25ns10e33_v2_cff::etaMax, HLT_25ns10e33_v2_cff::etaMin, cmsRelvalreport::exit, contentValuesFiles::fullPath, GLOBE, M_PI_2, phi, rho, smearingType_, AlCaHLTBitMon_QueryRunRegistry::string, and UNKNOWN.

Referenced by EnergyScaleCorrection_class().

265 {
266 #ifdef PEDANTIC_OUTPUT
267  std::cout << "[STATUS] Reading smearing values from file: " << filename << std::endl;
268 #endif
269  //edm::FileInPath(Ccufilename).fullPath().c_str(),std::ios::in); .fullPath().c_str()
270  std::ifstream f_in(edm::FileInPath(filename).fullPath().c_str());
271  if(!f_in.good()) {
272  std::cerr << "[ERROR] file " << filename << " not readable" << std::endl;
273  exit(1);
274  }
275 
276  int runMin = 0, runMax = 900000;
277  int unused = 0;
278  TString category, region2;
279  //double smearing, err_smearing;
280  double rho, phi, Emean, err_rho, err_phi, err_Emean;
281  double etaMin, etaMax, r9Min, r9Max;
282  std::string phi_string, err_phi_string;
283 
284 
285  while(f_in.peek() != EOF && f_in.good()) {
286  if(f_in.peek() == 10) { // 10 = \n
287  f_in.get();
288  continue;
289  }
290 
291  if(f_in.peek() == 35) { // 35 = #
292  f_in.ignore(1000, 10); // ignore the rest of the line until \n
293  continue;
294  }
295 
296  if(smearingType_ == UNKNOWN) { // trying to guess: not recommended
297  std::cerr << "[ERROR] Not implemented" << std::endl;
298  assert(false);
299 
300  } else if(smearingType_ == GLOBE) {
301  f_in >> category >> unused >> etaMin >> etaMax >> r9Min >> r9Max >> runMin >> runMax >>
302  Emean >> err_Emean >>
303  rho >> err_rho >> phi >> err_phi;
304 
305  AddSmearing(category, runMin, runMax, rho, err_rho, phi, err_phi, Emean, err_Emean);
306 
307  } else if(smearingType_ == ECALELF) {
308  f_in >> category >>
309  Emean >> err_Emean >>
310  rho >> err_rho >> phi_string >> err_phi_string;
311 #ifdef DEBUG
312  std::cout << category
313  //<< "\t" << etaMin << "\t" << etaMax << "\t" << r9Min << "\t" << r9Max << "\t" << runMin << "\t" << runMax
314  << "\tEmean=" << Emean << "\t"
315  << rho << "\t" << err_rho << "\tphi_string="
316  << phi_string << "#\terr_phi_string=" << err_phi_string << std::endl;
317 #endif
318 
319  if(phi_string=="M_PI_2") phi=M_PI_2;
320  else phi = std::stod(phi_string);
321 
322  if(err_phi_string=="M_PI_2") err_phi=M_PI_2;
323  else err_phi = std::stod(err_phi_string);
324 
325 
326  AddSmearing(category, runMin, runMax, rho, err_rho, phi, err_phi, Emean, err_Emean);
327 
328  } else {
329  f_in >> category >> rho >> phi;
330  AddSmearing(category, runMin, runMax, rho, err_rho, phi, err_phi, Emean, err_Emean);
331  }
332 #ifdef DEBUG
333  std::cout << category << "\t" << etaMin << "\t" << etaMax << "\t" << r9Min << "\t" << r9Max << "\t" << runMin << "\t" << runMax << "\tEmean=" << Emean << "\t" << rho << "\t" << phi << std::endl;
334 #endif
335  }
336 
337  f_in.close();
338  // runCorrection_itr=runMin_map.begin();
339 
340 
341  return;
342 }
assert(m_qm.get())
#define M_PI_2
void AddSmearing(TString category_, int runMin_, int runMax_, double rho, double err_rho, double phi, double err_phi, double Emean, double err_Emean)
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:145
float EnergyScaleCorrection_class::ScaleCorrection ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const

method to get energy scale corrections

Definition at line 51 of file EnergyScaleCorrection_class.cc.

References doScale, and getScaleOffset().

Referenced by PhotonEnergyCalibratorRun2::calibrate(), and ElectronEnergyCalibratorRun2::calibrate().

53 {
54  float correction = 1;
55  if(doScale) correction *= getScaleOffset(runNumber, isEBEle, R9Ele, etaSCEle, EtEle);
56 
57  return correction;
58 }
float getScaleOffset(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
float EnergyScaleCorrection_class::ScaleCorrectionUncertainty ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const

method to get scale correction uncertainties: it's stat+syst in eta x R9 categories

Definition at line 62 of file EnergyScaleCorrection_class.cc.

References getScaleStatUncertainty(), getScaleSystUncertainty(), and mathSSE::sqrt().

64 {
65  float statUncert = getScaleStatUncertainty(runNumber, isEBEle, R9Ele, etaSCEle, EtEle);
66  float systUncert = getScaleSystUncertainty(runNumber, isEBEle, R9Ele, etaSCEle, EtEle);
67 
68  return sqrt(statUncert * statUncert + systUncert * systUncert);
69 }
float getScaleSystUncertainty(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
T sqrt(T t)
Definition: SSEVec.h:18
float getScaleStatUncertainty(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
void EnergyScaleCorrection_class::SetSmearingType ( fileFormat_t  value)
inline

Definition at line 192 of file EnergyScaleCorrection_class.h.

References smearingType_, UNKNOWN, and relativeConstraints::value.

193  {
194  if(value >= 0 && value <= 1) {
196  } else {
198  }
199  };

Member Data Documentation

bool EnergyScaleCorrection_class::doScale
bool EnergyScaleCorrection_class::doSmearings
correction_map_t EnergyScaleCorrection_class::scales
private
correction_map_t EnergyScaleCorrection_class::scales_not_defined
private

Definition at line 185 of file EnergyScaleCorrection_class.h.

correction_map_t EnergyScaleCorrection_class::smearings
private
correction_map_t EnergyScaleCorrection_class::smearings_not_defined
private

Definition at line 186 of file EnergyScaleCorrection_class.h.

Referenced by getSmearingRho(), and getSmearingSigma().

fileFormat_t EnergyScaleCorrection_class::smearingType_
private

Definition at line 183 of file EnergyScaleCorrection_class.h.

Referenced by ReadSmearingFromFile(), and SetSmearingType().