CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | 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 Types

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

Public Member Functions

 EnergyScaleCorrection_class ()
 
 EnergyScaleCorrection_class (std::string correctionFileName, unsigned int genSeed=0)
 
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, float nSigma_rho, float nSigma_phi) const
 
float getSmearingSigma (int runNumber, bool isEBEle, float R9Ele, float etaSCEle, float EtEle, paramSmear_t par, float nSigma=0.) 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 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 118 of file EnergyScaleCorrection_class.h.

Member Enumeration Documentation

◆ fileFormat_t

Enumerator
UNKNOWN 
GLOBE 
ECALELF_TOY 
ECALELF 

Definition at line 120 of file EnergyScaleCorrection_class.h.

120 { UNKNOWN = 0, GLOBE, ECALELF_TOY, ECALELF };

◆ paramSmear_t

Enumerator
kNone 
kRho 
kPhi 
kNParamSmear 

Definition at line 122 of file EnergyScaleCorrection_class.h.

122 { kNone = 0, kRho, kPhi, kNParamSmear };

Constructor & Destructor Documentation

◆ EnergyScaleCorrection_class() [1/2]

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

Definition at line 19 of file EnergyScaleCorrection_class.cc.

20  : doScale(false), doSmearings(false), smearingType_(ECALELF) {
21  if (!correctionFileName.empty()) {
22  std::string filename = correctionFileName + "_scales.dat";
24  if (scales.empty()) {
25  std::cerr << "[ERROR] scale correction map empty" << std::endl;
26  exit(1);
27  }
28  }
29 
30  if (!correctionFileName.empty()) {
31  std::string filename = correctionFileName + "_smearings.dat";
33  if (smearings.empty()) {
34  std::cerr << "[ERROR] smearing correction map empty" << std::endl;
35  exit(1);
36  }
37  }
38 
39  return;
40 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, beamvalidation::exit(), corrVsCorr::filename, ReadFromFile(), ReadSmearingFromFile(), scales, smearings, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ EnergyScaleCorrection_class() [2/2]

EnergyScaleCorrection_class::EnergyScaleCorrection_class ( )
inline

Definition at line 128 of file EnergyScaleCorrection_class.h.

128 {};

◆ ~EnergyScaleCorrection_class()

EnergyScaleCorrection_class::~EnergyScaleCorrection_class ( void  )

dummy constructor needed in ElectronEnergyCalibratorRun2

Definition at line 42 of file EnergyScaleCorrection_class.cc.

42 { return; }

Member Function Documentation

◆ AddScale()

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

Definition at line 175 of file EnergyScaleCorrection_class.cc.

176  {
177  correctionCategory_class cat(category_); // build the category from the string
178  cat.runmin = runMin_;
179  cat.runmax = runMax_;
180 
181  // the following check is not needed, can be removed
182  if (scales.count(cat) != 0) {
183  std::cerr << "[ERROR] Category already defined!" << std::endl;
184  std::cerr << " Adding category: " << cat << std::endl;
185  std::cerr << " Defined category: " << scales[cat] << std::endl;
186  exit(1);
187  }
188 
189  correctionValue_class corr; // define the correction values
190  corr.scale = deltaP_;
191  corr.scale_err = err_deltaP_;
192  corr.scale_err_syst = err_syst_deltaP;
193  scales[cat] = corr;
194 
195 #ifdef PEDANTIC_OUTPUT
196  std::cout << "[INFO:scale correction] " << cat << corr << std::endl;
197 #endif
198  return;
199 }

References eostools::cat(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, alignCSCRings::corr, gather_cfg::cout, beamvalidation::exit(), and scales.

Referenced by ReadFromFile().

◆ AddSmearing()

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 202 of file EnergyScaleCorrection_class.cc.

210  {
211  correctionCategory_class cat(category_);
212  cat.runmin = (runMin_ < 0) ? 0 : runMin_;
213  cat.runmax = runMax_;
214 
215  if (smearings.count(cat) != 0) {
216  std::cerr << "[ERROR] Smearing category already defined!" << std::endl;
217  std::cerr << " Adding category: " << cat << std::endl;
218  std::cerr << " Defined category: " << smearings[cat] << std::endl;
219  exit(1);
220  }
221 
223  corr.rho = rho;
224  corr.rho_err = err_rho;
225  corr.phi = phi;
226  corr.phi_err = err_phi;
227  corr.Emean = Emean;
228  corr.Emean_err = err_Emean;
229  smearings[cat] = corr;
230 
231 #ifdef PEDANTIC_OUTPUT
232 #ifndef CMSSW
233  std::cout << "[INFO:smearings] " << cat << corr << std::endl;
234 #else
235  edm::LogInfo("[INFO:smearings] ") << cat << corr;
236 #endif
237 #endif
238 
239  return;
240 }

References eostools::cat(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, alignCSCRings::corr, gather_cfg::cout, beamvalidation::exit(), phi, rho, and smearings.

Referenced by ReadSmearingFromFile().

◆ getScaleCorrection()

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 71 of file EnergyScaleCorrection_class.cc.

72  {
73  // buld the category based on the values of the object
74  correctionCategory_class category(runNumber, etaSCEle, R9Ele, EtEle);
75  correction_map_t::const_iterator corr_itr =
76  scales.find(category); // find the correction value in the map that associates the category to the correction
77 
78  if (corr_itr == scales.end()) { // if not in the standard classes, add it in the list of not defined classes
79 
80  // this part is commented because it makes the method not constant
81  // if(scales_not_defined.count(category) == 0) {
82  // correctionValue_class corr;
83  // scales_not_defined[category] = corr;
84  // }
85  // corr_itr = scales_not_defined.find(category);
87  std::cout << "[ERROR] Scale category not found: " << std::endl;
88  std::cout << category << std::endl;
89  std::cout << "Returning uncorrected value." << std::endl;
90  // exit(1);
91  correctionValue_class nocorr;
92  std::cout << nocorr << std::endl;
93  return nocorr;
94  }
95 
96 #ifdef DEBUG
97  std::cout << "[DEBUG] Checking scale correction for category: " << category << std::endl;
98  std::cout << "[DEBUG] Correction is: " << corr_itr->second << std::endl
99  << " given for category " << corr_itr->first << std::endl;
100  ;
101 #endif
102  return corr_itr->second;
103 }

References taus_updatedMVAIds_cff::category, gather_cfg::cout, convertSQLiteXML::runNumber, and scales.

Referenced by getScaleStatUncertainty(), and getScaleSystUncertainty().

◆ getScaleOffset()

float EnergyScaleCorrection_class::getScaleOffset ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const
private

Definition at line 105 of file EnergyScaleCorrection_class.cc.

106  {
107  // buld the category based on the values of the object
108  correctionCategory_class category(runNumber, etaSCEle, R9Ele, EtEle);
109  correction_map_t::const_iterator corr_itr =
110  scales.find(category); // find the correction value in the map that associates the category to the correction
111 
112  if (corr_itr == scales.end()) { // if not in the standard classes, add it in the list of not defined classes
113 
114  // this part is commented because it makes the method not constant
115  // if(scales_not_defined.count(category) == 0) {
116  // correctionValue_class corr;
117  // scales_not_defined[category] = corr;
118  // }
119  // corr_itr = scales_not_defined.find(category);
121  std::cout << "[ERROR] Scale offset category not found: " << std::endl;
122  std::cout << category << std::endl;
123  std::cout << "Returning uncorrected value." << std::endl;
124  // exit(1);
125  correctionValue_class nocorr;
126  return nocorr.scale;
127  }
128 
129 #ifdef DEBUG
130  std::cout << "[DEBUG] Checking scale offset correction for category: " << category << std::endl;
131  std::cout << "[DEBUG] Correction is: " << corr_itr->second << std::endl
132  << " given for category " << corr_itr->first << std::endl;
133  ;
134 #endif
135 
136  return corr_itr->second.scale;
137 }

References taus_updatedMVAIds_cff::category, gather_cfg::cout, convertSQLiteXML::runNumber, correctionValue_class::scale, and scales.

Referenced by ScaleCorrection().

◆ getScaleStatUncertainty()

float EnergyScaleCorrection_class::getScaleStatUncertainty ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const
private

Definition at line 61 of file EnergyScaleCorrection_class.cc.

62  {
63  return getScaleCorrection(runNumber, isEBEle, R9Ele, etaSCEle, EtEle).scale_err;
64 }

References getScaleCorrection(), convertSQLiteXML::runNumber, and correctionValue_class::scale_err.

Referenced by ScaleCorrectionUncertainty().

◆ getScaleSystUncertainty()

float EnergyScaleCorrection_class::getScaleSystUncertainty ( unsigned int  runNumber,
bool  isEBEle,
double  R9Ele,
double  etaSCEle,
double  EtEle 
) const
private

Definition at line 66 of file EnergyScaleCorrection_class.cc.

67  {
68  return getScaleCorrection(runNumber, isEBEle, R9Ele, etaSCEle, EtEle).scale_err_syst;
69 }

References getScaleCorrection(), convertSQLiteXML::runNumber, and correctionValue_class::scale_err_syst.

Referenced by ScaleCorrectionUncertainty().

◆ getSmearingRho()

float EnergyScaleCorrection_class::getSmearingRho ( int  runNumber,
bool  isEBEle,
float  R9Ele,
float  etaSCEle,
float  EtEle 
) const

public for sigmaE estimate

Definition at line 376 of file EnergyScaleCorrection_class.cc.

377  {
378  correctionCategory_class category(runNumber, etaSCEle, R9Ele, EtEle);
379  correction_map_t::const_iterator corr_itr = smearings.find(category);
380  if (corr_itr == smearings.end()) { // if not in the standard classes, add it in the list of not defined classes
381  // if(smearings_not_defined.count(category) == 0) {
382  // correctionValue_class corr;
383  // smearings_not_defined[category] = corr;
384  // }
385  corr_itr = smearings_not_defined.find(category);
386  }
387 
388  return corr_itr->second.rho;
389 }

References taus_updatedMVAIds_cff::category, convertSQLiteXML::runNumber, smearings, and smearings_not_defined.

◆ getSmearingSigma() [1/2]

float EnergyScaleCorrection_class::getSmearingSigma ( int  runNumber,
bool  isEBEle,
float  R9Ele,
float  etaSCEle,
float  EtEle,
float  nSigma_rho,
float  nSigma_phi 
) const

Definition at line 345 of file EnergyScaleCorrection_class.cc.

346  {
347  correctionCategory_class category(runNumber, etaSCEle, R9Ele, EtEle);
348  correction_map_t::const_iterator corr_itr = smearings.find(category);
349  if (corr_itr == smearings.end()) { // if not in the standard classes, add it in the list of not defined classes
350  // the following commented part makes the method non const
351  // if(smearings_not_defined.count(category) == 0) {
352  // correctionValue_class corr;
353  // smearings_not_defined[category] = corr;
354  // }
355  corr_itr = smearings_not_defined.find(category);
356  std::cerr << "[WARNING] Smearing category not found: " << std::endl;
357  std::cerr << category << std::endl;
358  // exit(1);
359  }
360 
361 #ifdef DEBUG
362  std::cout << "[DEBUG] Checking smearing correction for category: " << category << std::endl;
363  std::cout << "[DEBUG] Correction is: " << corr_itr->second << std::endl
364  << " given for category " << corr_itr->first;
365 #endif
366 
367  double rho = corr_itr->second.rho + corr_itr->second.rho_err * nSigma_rho;
368  double phi = corr_itr->second.phi + corr_itr->second.phi_err * nSigma_phi;
369 
370  double constTerm = rho * sin(phi);
371  double alpha = rho * corr_itr->second.Emean * cos(phi);
372 
373  return sqrt(constTerm * constTerm + alpha * alpha / EtEle);
374 }

References alpha, taus_updatedMVAIds_cff::category, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, funct::cos(), gather_cfg::cout, phi, rho, convertSQLiteXML::runNumber, funct::sin(), smearings, smearings_not_defined, and mathSSE::sqrt().

◆ getSmearingSigma() [2/2]

float EnergyScaleCorrection_class::getSmearingSigma ( int  runNumber,
bool  isEBEle,
float  R9Ele,
float  etaSCEle,
float  EtEle,
paramSmear_t  par,
float  nSigma = 0. 
) const

Definition at line 336 of file EnergyScaleCorrection_class.cc.

337  {
338  if (par == kRho)
339  return getSmearingSigma(runNumber, isEBEle, R9Ele, etaSCEle, EtEle, nSigma, 0.);
340  if (par == kPhi)
341  return getSmearingSigma(runNumber, isEBEle, R9Ele, etaSCEle, EtEle, 0., nSigma);
342  return getSmearingSigma(runNumber, isEBEle, R9Ele, etaSCEle, EtEle, 0., 0.);
343 }

References kPhi, kRho, HLTSiStripMonitoring_cff::nSigma, and convertSQLiteXML::runNumber.

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

◆ ReadFromFile()

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 144 of file EnergyScaleCorrection_class.cc.

144  {
145 #ifdef PEDANTIC_OUTPUT
146  std::cout << "[STATUS] Reading energy scale correction values from file: " << filename << std::endl;
147 #endif
148  std::cout << "[STATUS] Reading energy scale correction values from file: " << filename << std::endl;
149 
150  //std::ifstream Ccufile(edm::FileInPath(Ccufilename).fullPath().c_str(),std::ios::in);
151  std::ifstream f_in(edm::FileInPath(filename).fullPath().c_str());
152 
153  if (!f_in.good()) {
154  std::cerr << "[ERROR] file " << filename << " not readable" << std::endl;
155  exit(1);
156  return;
157  }
158 
159  int runMin, runMax;
160  TString category, region2;
161  double deltaP, err_deltaP, err_deltaP_stat, err_deltaP_syst;
162 
163  for (f_in >> category; f_in.good(); f_in >> category) {
164  f_in >> region2 >> runMin >> runMax >> deltaP >> err_deltaP >> err_deltaP_stat >> err_deltaP_syst;
165 
166  AddScale(category, runMin, runMax, deltaP, err_deltaP_stat, err_deltaP_syst);
167  }
168 
169  f_in.close();
170 
171  return;
172 }

References AddScale(), taus_updatedMVAIds_cff::category, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, beamvalidation::exit(), corrVsCorr::filename, contentValuesFiles::fullPath, test_db_connect::runMax, and test_db_connect::runMin.

Referenced by EnergyScaleCorrection_class().

◆ ReadSmearingFromFile()

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 257 of file EnergyScaleCorrection_class.cc.

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

References AddSmearing(), cms::cuda::assert(), taus_updatedMVAIds_cff::category, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ECALELF, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, beamvalidation::exit(), corrVsCorr::filename, contentValuesFiles::fullPath, GLOBE, M_PI_2, phi, cosmicPhotonAnalyzer_cfi::r9Max, photonAnalyzer_cfi::r9Min, rho, test_db_connect::runMax, test_db_connect::runMin, smearingType_, AlCaHLTBitMon_QueryRunRegistry::string, and UNKNOWN.

Referenced by EnergyScaleCorrection_class().

◆ ScaleCorrection()

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 44 of file EnergyScaleCorrection_class.cc.

45  {
46  float correction = 1;
47  if (doScale)
48  correction *= getScaleOffset(runNumber, isEBEle, R9Ele, etaSCEle, EtEle);
49 
50  return correction;
51 }

References pfMETCorrectionType0_cfi::correction, doScale, getScaleOffset(), and convertSQLiteXML::runNumber.

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

◆ ScaleCorrectionUncertainty()

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 53 of file EnergyScaleCorrection_class.cc.

54  {
55  float statUncert = getScaleStatUncertainty(runNumber, isEBEle, R9Ele, etaSCEle, EtEle);
56  float systUncert = getScaleSystUncertainty(runNumber, isEBEle, R9Ele, etaSCEle, EtEle);
57 
58  return sqrt(statUncert * statUncert + systUncert * systUncert);
59 }

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

◆ SetSmearingType()

void EnergyScaleCorrection_class::SetSmearingType ( fileFormat_t  value)
inline

Definition at line 194 of file EnergyScaleCorrection_class.h.

194  {
195  if (value <= 1) {
197  } else {
199  }
200  };

References smearingType_, UNKNOWN, and relativeConstraints::value.

Member Data Documentation

◆ doScale

bool EnergyScaleCorrection_class::doScale

◆ doSmearings

bool EnergyScaleCorrection_class::doSmearings

◆ scales

correction_map_t EnergyScaleCorrection_class::scales
private

◆ scales_not_defined

correction_map_t EnergyScaleCorrection_class::scales_not_defined
private

Definition at line 180 of file EnergyScaleCorrection_class.h.

◆ smearings

correction_map_t EnergyScaleCorrection_class::smearings
private

◆ smearings_not_defined

correction_map_t EnergyScaleCorrection_class::smearings_not_defined
private

Definition at line 181 of file EnergyScaleCorrection_class.h.

Referenced by getSmearingRho(), and getSmearingSigma().

◆ smearingType_

fileFormat_t EnergyScaleCorrection_class::smearingType_
private

Definition at line 178 of file EnergyScaleCorrection_class.h.

Referenced by ReadSmearingFromFile(), and SetSmearingType().

EnergyScaleCorrection_class::getScaleStatUncertainty
float getScaleStatUncertainty(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
Definition: EnergyScaleCorrection_class.cc:61
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:31
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
EnergyScaleCorrection_class::smearingType_
fileFormat_t smearingType_
Definition: EnergyScaleCorrection_class.h:178
correctionValue_class::scale_err
float scale_err
Definition: EnergyScaleCorrection_class.h:33
EnergyScaleCorrection_class::kRho
Definition: EnergyScaleCorrection_class.h:122
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
EnergyScaleCorrection_class::AddScale
void AddScale(TString category_, int runMin_, int runMax_, double deltaP_, double err_deltaP_, double err_syst_deltaP)
Definition: EnergyScaleCorrection_class.cc:175
eostools.cat
def cat(path)
Definition: eostools.py:401
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::cuda::assert
assert(be >=bs)
alpha
float alpha
Definition: AMPTWrapper.h:105
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
correctionValue_class::scale_err_syst
float scale_err_syst
Definition: EnergyScaleCorrection_class.h:33
EnergyScaleCorrection_class::smearings
correction_map_t smearings
Definition: EnergyScaleCorrection_class.h:181
EnergyScaleCorrection_class::ReadSmearingFromFile
void ReadSmearingFromFile(TString filename)
File structure: category constTerm alpha;.
Definition: EnergyScaleCorrection_class.cc:257
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
edm::FileInPath
Definition: FileInPath.h:64
EnergyScaleCorrection_class::getScaleOffset
float getScaleOffset(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
Definition: EnergyScaleCorrection_class.cc:105
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
EnergyScaleCorrection_class::AddSmearing
void AddSmearing(TString category_, int runMin_, int runMax_, double rho, double err_rho, double phi, double err_phi, double Emean, double err_Emean)
Definition: EnergyScaleCorrection_class.cc:202
EnergyScaleCorrection_class::doSmearings
bool doSmearings
Definition: EnergyScaleCorrection_class.h:124
EnergyScaleCorrection_class::getSmearingSigma
float getSmearingSigma(int runNumber, bool isEBEle, float R9Ele, float etaSCEle, float EtEle, paramSmear_t par, float nSigma=0.) const
Definition: EnergyScaleCorrection_class.cc:336
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EnergyScaleCorrection_class::ReadFromFile
void ReadFromFile(TString filename)
category "runNumber" runMin runMax deltaP err_deltaP_per_bin err_deltaP_stat err_deltaP_syst
Definition: EnergyScaleCorrection_class.cc:144
correctionValue_class::scale
float scale
Definition: EnergyScaleCorrection_class.h:33
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
EnergyScaleCorrection_class::doScale
bool doScale
Definition: EnergyScaleCorrection_class.h:124
test_db_connect.runMin
runMin
Definition: test_db_connect.py:7
EnergyScaleCorrection_class::GLOBE
Definition: EnergyScaleCorrection_class.h:120
photonAnalyzer_cfi.r9Min
r9Min
Definition: photonAnalyzer_cfi.py:70
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EnergyScaleCorrection_class::smearings_not_defined
correction_map_t smearings_not_defined
Definition: EnergyScaleCorrection_class.h:181
correctionValue_class
Definition: EnergyScaleCorrection_class.h:30
EnergyScaleCorrection_class::kNone
Definition: EnergyScaleCorrection_class.h:122
pfMETCorrectionType0_cfi.correction
correction
Definition: pfMETCorrectionType0_cfi.py:39
value
Definition: value.py:1
EnergyScaleCorrection_class::getScaleSystUncertainty
float getScaleSystUncertainty(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
Definition: EnergyScaleCorrection_class.cc:66
EnergyScaleCorrection_class::kNParamSmear
Definition: EnergyScaleCorrection_class.h:122
test_db_connect.runMax
runMax
Definition: test_db_connect.py:8
EnergyScaleCorrection_class::scales
correction_map_t scales
Definition: EnergyScaleCorrection_class.h:180
EnergyScaleCorrection_class::ECALELF
Definition: EnergyScaleCorrection_class.h:120
DDAxes::phi
EnergyScaleCorrection_class::getScaleCorrection
correctionValue_class getScaleCorrection(unsigned int runNumber, bool isEBEle, double R9Ele, double etaSCEle, double EtEle) const
returns the correction value class
Definition: EnergyScaleCorrection_class.cc:71
EnergyScaleCorrection_class::UNKNOWN
Definition: EnergyScaleCorrection_class.h:120
relativeConstraints.value
value
Definition: relativeConstraints.py:53
cosmicPhotonAnalyzer_cfi.r9Max
r9Max
Definition: cosmicPhotonAnalyzer_cfi.py:12
correctionCategory_class
Definition: EnergyScaleCorrection_class.h:59
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
M_PI_2
#define M_PI_2
Definition: CSCGattiFunction.cc:6
EnergyScaleCorrection_class::kPhi
Definition: EnergyScaleCorrection_class.h:122
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
EnergyScaleCorrection_class::ECALELF_TOY
Definition: EnergyScaleCorrection_class.h:120
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
HLTSiStripMonitoring_cff.nSigma
nSigma
Definition: HLTSiStripMonitoring_cff.py:151