CMS 3D CMS Logo

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

#include <ElectronEnergyCalibrator.h>

Public Types

enum  EventType { EventType::DATA, EventType::MC }
 

Public Member Functions

std::array< float,
EGEnergySysIndex::kNrSysErrs
calibrate (reco::GsfElectron &ele, const unsigned int runNumber, const EcalRecHitCollection *recHits, edm::StreamID const &id, const EventType eventType) const
 
std::array< float,
EGEnergySysIndex::kNrSysErrs
calibrate (reco::GsfElectron &ele, const unsigned int runNumber, const EcalRecHitCollection *recHits, const float smearNrSigma, const EventType eventType) const
 
void calibrate (SimpleElectron &electron, edm::StreamID const &)
 
void correctLinearity (SimpleElectron &electron)
 
 ElectronEnergyCalibrator ()
 
 ElectronEnergyCalibrator (const EpCombinationTool &combinator, const std::string &correctionFile)
 
 ElectronEnergyCalibrator (const std::string pathData, const std::string pathLinData, const std::string dataset, int correctionsType, bool applyLinearityCorrection, double lumiRatio, bool isMC, bool updateEnergyErrors, bool verbose, bool synchronization)
 
void initPrivateRng (TRandom *rnd)
 
void setMinEt (float val)
 
 ~ElectronEnergyCalibrator ()
 

Private Member Functions

std::pair< float, float > calCombinedMom (reco::GsfElectron &ele, const float scale, const float smear) const
 
double gauss (edm::StreamID const &id) const
 
void init ()
 
void setEcalEnergy (reco::GsfElectron &ele, const float scale, const float smear) const
 
void setEnergyAndSystVarations (const float scale, const float smearNrSigma, const float et, const EnergyScaleCorrection::ScaleCorrection &scaleCorr, const EnergyScaleCorrection::SmearCorrection &smearCorr, reco::GsfElectron &ele, std::array< float, EGEnergySysIndex::kNrSysErrs > &energyData) const
 
void splitString (const std::string &fullstr, std::vector< std::string > &elements, const std::string &delimiter)
 
double stringToDouble (const std::string &str)
 

Private Attributes

bool applyLinearityCorrection_
 
EnergyScaleCorrection correctionRetriever_
 
int correctionsType_
 
correctionValues corrValArray [100]
 
correctionValues corrValMC
 
std::string dataset_
 
const EpCombinationToolepCombinationTool_
 
bool isMC_
 
linearityCorrectionValues linCorrValArray [100]
 
double lumiRatio_
 
float minEt_
 
int nCorrValRaw
 
double newEnergy_
 
double newEnergyError_
 
int nLinCorrValRaw
 
std::string pathData_
 
std::string pathLinData_
 
TRandom * rng_
 
bool synchronization_
 
bool updateEnergyErrors_
 
bool verbose_
 

Static Private Attributes

static const
EnergyScaleCorrection::ScaleCorrection 
defaultScaleCorr_
 
static const
EnergyScaleCorrection::SmearCorrection 
defaultSmearCorr_
 

Detailed Description

Definition at line 39 of file ElectronEnergyCalibrator.h.

Member Enumeration Documentation

Enumerator
DATA 
MC 

Definition at line 26 of file ElectronEnergyCalibrator.h.

26  {
27  DATA,
28  MC,
29  };

Constructor & Destructor Documentation

ElectronEnergyCalibrator::ElectronEnergyCalibrator ( const std::string  pathData,
const std::string  pathLinData,
const std::string  dataset,
int  correctionsType,
bool  applyLinearityCorrection,
double  lumiRatio,
bool  isMC,
bool  updateEnergyErrors,
bool  verbose,
bool  synchronization 
)
inline

Definition at line 41 of file ElectronEnergyCalibrator.h.

References init().

51  : pathData_(pathData),
52  pathLinData_(pathLinData),
54  correctionsType_(correctionsType),
55  applyLinearityCorrection_(applyLinearityCorrection),
56  lumiRatio_(lumiRatio),
57  isMC_(isMC),
58  updateEnergyErrors_(updateEnergyErrors),
60  synchronization_(synchronization) {
61  init();
62  }
static constexpr int verbose
ElectronEnergyCalibrator::ElectronEnergyCalibrator ( )
inline

Definition at line 31 of file ElectronEnergyCalibrator.h.

31 {}
ElectronEnergyCalibrator::ElectronEnergyCalibrator ( const EpCombinationTool combinator,
const std::string &  correctionFile 
)

Definition at line 12 of file ElectronEnergyCalibrator.cc.

ElectronEnergyCalibrator::~ElectronEnergyCalibrator ( )
inline

Definition at line 33 of file ElectronEnergyCalibrator.h.

33 {}

Member Function Documentation

std::pair< float, float > ElectronEnergyCalibrator::calCombinedMom ( reco::GsfElectron ele,
const float  scale,
const float  smear 
) const
private

Definition at line 170 of file ElectronEnergyCalibrator.cc.

References EpCombinationTool::combine(), reco::GsfElectron::correctMomentum(), reco::GsfElectron::ecalEnergy(), reco::GsfElectron::ecalEnergyError(), epCombinationTool_, reco::GsfElectron::p4(), reco::GsfElectron::P4_COMBINATION, reco::GsfElectron::p4Error(), reco::GsfElectron::setCorrectedEcalEnergy(), reco::GsfElectron::setCorrectedEcalEnergyError(), setEcalEnergy(), and reco::GsfElectron::trackMomentumError().

Referenced by setEnergyAndSystVarations().

172  {
173  const float oldEcalEnergy = ele.ecalEnergy();
174  const float oldEcalEnergyErr = ele.ecalEnergyError();
175 
176  const auto oldP4 = ele.p4();
177  const float oldP4Err = ele.p4Error(reco::GsfElectron::P4_COMBINATION);
178  const float oldTrkMomErr = ele.trackMomentumError();
179 
180  setEcalEnergy(ele, scale, smear);
181  const auto& combinedMomentum = epCombinationTool_->combine(ele, oldEcalEnergyErr * scale);
182 
183  ele.setCorrectedEcalEnergy(oldEcalEnergy);
184  ele.setCorrectedEcalEnergyError(oldEcalEnergyErr);
185  ele.correctMomentum(oldP4, oldTrkMomErr, oldP4Err);
186 
187  return combinedMomentum;
188 }
float trackMomentumError() const
Definition: GsfElectron.h:884
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:217
void setEcalEnergy(reco::GsfElectron &ele, const float scale, const float smear) const
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
Definition: GsfElectron.h:905
void combine(SimpleElectron &mySimpleElectron) const
float p4Error(P4Kind kind) const
Definition: GsfElectron.cc:230
void setCorrectedEcalEnergyError(float newEnergyError)
Definition: GsfElectron.cc:170
float ecalEnergyError() const
Definition: GsfElectron.h:897
float ecalEnergy() const
Definition: GsfElectron.h:896
const EpCombinationTool * epCombinationTool_
void setCorrectedEcalEnergy(float newEnergy)
Definition: GsfElectron.cc:174
std::array< float, EGEnergySysIndex::kNrSysErrs > ElectronEnergyCalibrator::calibrate ( reco::GsfElectron ele,
const unsigned int  runNumber,
const EcalRecHitCollection recHits,
edm::StreamID const &  id,
const EventType  eventType 
) const

Correct this electron. StreamID is needed when used with CMSSW Random Number Generator

Definition at line 18 of file ElectronEnergyCalibrator.cc.

References calibrate(), and gauss().

23  {
24  return calibrate(ele, runNumber, recHits, gauss(id), eventType);
25 }
void calibrate(SimpleElectron &electron, edm::StreamID const &)
double gauss(edm::StreamID const &id) const
std::array< float, EGEnergySysIndex::kNrSysErrs > ElectronEnergyCalibrator::calibrate ( reco::GsfElectron ele,
const unsigned int  runNumber,
const EcalRecHitCollection recHits,
const float  smearNrSigma,
const EventType  eventType 
) const

Definition at line 27 of file ElectronEnergyCalibrator.cc.

References funct::abs(), reco::GsfElectron::Corrections::combinedP4Error, correctionRetriever_, reco::GsfElectron::corrections(), DATA, defaultScaleCorr_, defaultSmearCorr_, reco::GsfElectron::ecalEnergy(), reco::GsfElectron::ecalEnergyError(), edm::SortedCollection< T, SORT >::end(), reco::LeafCandidate::energy(), edm::SortedCollection< T, SORT >::find(), reco::GsfElectron::full5x5_r9(), EnergyScaleCorrection::getScaleCorr(), EnergyScaleCorrection::getSmearCorr(), edm::isNotFinite(), EGEnergySysIndex::kEcalErrPostCorr, EGEnergySysIndex::kEcalErrPreCorr, EGEnergySysIndex::kEcalPostCorr, EGEnergySysIndex::kEcalPreCorr, EGEnergySysIndex::kEcalTrkErrPostCorr, EGEnergySysIndex::kEcalTrkErrPreCorr, EGEnergySysIndex::kEcalTrkPostCorr, EGEnergySysIndex::kEcalTrkPreCorr, EcalRecHit::kHasSwitchToGain1, EcalRecHit::kHasSwitchToGain6, EGEnergySysIndex::kScaleValue, EGEnergySysIndex::kSmearNrSigma, EGEnergySysIndex::kSmearValue, MC, minEt_, EnergyScaleCorrection::ScaleCorrection::scale(), setEnergyAndSystVarations(), EnergyScaleCorrection::SmearCorrection::sigma(), and reco::GsfElectron::superCluster().

32  {
33  const float scEtaAbs = std::abs(ele.superCluster()->eta());
34  const float et = ele.ecalEnergy() / cosh(scEtaAbs);
35 
36  if (et < minEt_ || edm::isNotFinite(et)) {
37  std::array<float, EGEnergySysIndex::kNrSysErrs> retVal;
38  retVal.fill(ele.energy());
39  retVal[EGEnergySysIndex::kScaleValue] = 1.0;
40  retVal[EGEnergySysIndex::kSmearValue] = 0.0;
41  retVal[EGEnergySysIndex::kSmearNrSigma] = smearNrSigma;
50  return retVal;
51  }
52 
53  const DetId seedDetId = ele.superCluster()->seed()->seed();
54  EcalRecHitCollection::const_iterator seedRecHit = recHits->find(seedDetId);
55  unsigned int gainSeedSC = 12;
56  if (seedRecHit != recHits->end()) {
57  if (seedRecHit->checkFlag(EcalRecHit::kHasSwitchToGain6))
58  gainSeedSC = 6;
59  if (seedRecHit->checkFlag(EcalRecHit::kHasSwitchToGain1))
60  gainSeedSC = 1;
61  }
62 
64  correctionRetriever_.getScaleCorr(runNumber, et, scEtaAbs, ele.full5x5_r9(), gainSeedSC);
66  correctionRetriever_.getSmearCorr(runNumber, et, scEtaAbs, ele.full5x5_r9(), gainSeedSC);
67  if (scaleCorr == nullptr)
68  scaleCorr = &defaultScaleCorr_;
69  if (smearCorr == nullptr)
70  smearCorr = &defaultSmearCorr_;
71 
72  std::array<float, EGEnergySysIndex::kNrSysErrs> uncertainties{};
73 
74  uncertainties[EGEnergySysIndex::kScaleValue] = scaleCorr->scale();
75  uncertainties[EGEnergySysIndex::kSmearValue] =
76  smearCorr->sigma(et); //even though we use scale = 1.0, we still store the value returned for MC
77  uncertainties[EGEnergySysIndex::kSmearNrSigma] = smearNrSigma;
78  //MC central values are not scaled (scale = 1.0), data is not smeared (smearNrSigma = 0)
79  //the smearing (or resolution extra parameter as it might better be called)
80  //still has a second order effect on data as it enters the E/p combination as an adjustment
81  //to the estimate of the resolution contained in caloEnergyError
82  //MC gets all the scale systematics
83  if (eventType == EventType::DATA) {
84  setEnergyAndSystVarations(scaleCorr->scale(), 0., et, *scaleCorr, *smearCorr, ele, uncertainties);
85  } else if (eventType == EventType::MC) {
86  setEnergyAndSystVarations(1.0, smearNrSigma, et, *scaleCorr, *smearCorr, ele, uncertainties);
87  }
88 
89  return uncertainties;
90 }
const Corrections & corrections() const
Definition: GsfElectron.h:889
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
EnergyScaleCorrection correctionRetriever_
std::vector< EcalRecHit >::const_iterator const_iterator
const ScaleCorrection * getScaleCorr(unsigned int runnr, double et, double eta, double r9, unsigned int gainSeed) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const SmearCorrection * getSmearCorr(unsigned int runnr, double et, double eta, double r9, unsigned int gainSeed) const
float ecalEnergyError() const
Definition: GsfElectron.h:897
float sigma(const float et, const float nrSigmaRho=0., const float nrSigmaPhi=0.) const
const_iterator end() const
Definition: DetId.h:17
float ecalEnergy() const
Definition: GsfElectron.h:896
static const EnergyScaleCorrection::SmearCorrection defaultSmearCorr_
float full5x5_r9() const
Definition: GsfElectron.h:476
void setEnergyAndSystVarations(const float scale, const float smearNrSigma, const float et, const EnergyScaleCorrection::ScaleCorrection &scaleCorr, const EnergyScaleCorrection::SmearCorrection &smearCorr, reco::GsfElectron &ele, std::array< float, EGEnergySysIndex::kNrSysErrs > &energyData) const
static const EnergyScaleCorrection::ScaleCorrection defaultScaleCorr_
iterator find(key_type k)
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
double energy() const final
energy
void ElectronEnergyCalibrator::calibrate ( SimpleElectron electron,
edm::StreamID const &  streamID 
)

Definition at line 145 of file ElectronEnergyCalibrator.cc.

References correctionValues::corrCat0, correctionValues::corrCat1, correctionValues::corrCat2, correctionValues::corrCat3, correctionValues::corrCat4, correctionValues::corrCat5, correctionValues::corrCat6, correctionValues::corrCat7, correctionsType_, corrValArray, gather_cfg::cout, dataset_, PVValHelper::eta, Exception, edm::RandomNumberGenerator::getEngine(), SimpleElectron::getEta(), SimpleElectron::getR9(), SimpleElectron::getRegEnergy(), SimpleElectron::getRegEnergyError(), SimpleElectron::getRunNumber(), SimpleElectron::getSCEnergy(), SimpleElectron::getSCEnergyError(), mps_fire::i, edm::Service< T >::isAvailable(), SimpleElectron::isEB(), isMC_, lumiRatio_, nCorrValRaw, newEnergy_, newEnergyError_, pileupReCalc_HLTpaths::scale, SimpleElectron::setNewEnergy(), SimpleElectron::setNewEnergyError(), mathSSE::sqrt(), synchronization_, updateEnergyErrors_, and verbose_.

Referenced by calibrate().

145  {
146  double scale = 1.0;
147  double dsigMC = 0.;
148  double corrMC = 0.;
149  double run_ = electron.getRunNumber();
150  bool isEB = electron.isEB();
151  double eta = electron.getEta();
152  double r9 = electron.getR9();
153 
154  switch (correctionsType_) {
155  case 1:
156  if (verbose_) {
157  std::cout << "[ElectronEnergyCalibrator] Using regression energy for calibration" << std::endl;
158  }
159  newEnergy_ = electron.getRegEnergy();
160  newEnergyError_ = electron.getRegEnergyError();
161  break;
162  case 2:
163  if (verbose_) {
164  std::cout << "[ElectronEnergyCalibrator] Using scale corrections for new regression" << std::endl;
165  }
166  newEnergy_ = electron.getRegEnergy();
167  newEnergyError_ = electron.getRegEnergyError();
168  break;
169  case 3:
170  if (verbose_) {
171  std::cout << "[ElectronEnergyCalibrator] Using standard ecal energy for calibration" << std::endl;
172  }
173  newEnergy_ = electron.getSCEnergy();
174  newEnergyError_ = electron.getSCEnergyError();
175  break;
176  }
177 
179  if (!rng.isAvailable()) {
180  throw cms::Exception("Configuration")
181  << "XXXXXXX requires the RandomNumberGeneratorService\n"
182  "which is not present in the configuration file. You must add the service\n"
183  "in the configuration file or remove the modules that require it.";
184  }
185 
186  if (!isMC_) {
187  for (int i = 0; i < nCorrValRaw; i++) {
188  if ((run_ >= corrValArray[i].nRunMin) && (run_ <= corrValArray[i].nRunMax)) {
189  if (isEB) {
190  if (fabs(eta) < 1) {
191  if (r9 < 0.94) {
192  scale = corrValArray[i].corrCat0;
193  } else {
194  scale = corrValArray[i].corrCat1;
195  }
196  } else {
197  if (r9 < 0.94) {
198  scale = corrValArray[i].corrCat2;
199  } else {
200  scale = corrValArray[i].corrCat3;
201  }
202  }
203  } else {
204  if (fabs(eta) < 2) {
205  if (r9 < 0.94) {
206  scale = corrValArray[i].corrCat4;
207  } else {
208  scale = corrValArray[i].corrCat5;
209  }
210  } else {
211  if (r9 < 0.94) {
212  scale = corrValArray[i].corrCat6;
213  } else {
214  scale = corrValArray[i].corrCat7;
215  }
216  }
217  }
218  }
219  }
221  }
222 
223  switch (correctionsType_) {
224  case 1:
225  // Implementation of the MC smearing for regression energy type 1
226  if (dataset_ == "Summer12_DR53X_HCP2012" || dataset_ == "Moriond2013") {
227  if (!isMC_) {
228  if (run_ <= 203002) {
229  if (isEB && fabs(eta) < 1 && r9 < 0.94)
230  dsigMC = 0.0103;
231  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
232  dsigMC = 0.0090;
233  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
234  dsigMC = 0.0190;
235  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
236  dsigMC = 0.0156;
237  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
238  dsigMC = 0.0269;
239  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
240  dsigMC = 0.0287;
241  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
242  dsigMC = 0.0364;
243  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
244  dsigMC = 0.0321;
245  } else {
246  if (isEB && fabs(eta) < 1 && r9 < 0.94)
247  dsigMC = 0.0109;
248  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
249  dsigMC = 0.0099;
250  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
251  dsigMC = 0.0182;
252  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
253  dsigMC = 0.0200;
254  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
255  dsigMC = 0.0282;
256  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
257  dsigMC = 0.0309;
258  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
259  dsigMC = 0.0386;
260  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
261  dsigMC = 0.0359;
262  }
263  } else {
264  CLHEP::RandFlat flatRandom(rng->getEngine(streamID));
265  double rn = flatRandom.fire();
266  if (rn > lumiRatio_) {
267  if (isEB && fabs(eta) < 1 && r9 < 0.94)
268  dsigMC = 0.0109;
269  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
270  dsigMC = 0.0099;
271  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
272  dsigMC = 0.0182;
273  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
274  dsigMC = 0.0200;
275  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
276  dsigMC = 0.0282;
277  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
278  dsigMC = 0.0309;
279  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
280  dsigMC = 0.0386;
281  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
282  dsigMC = 0.0359;
283  } else {
284  if (isEB && fabs(eta) < 1 && r9 < 0.94)
285  dsigMC = 0.0103;
286  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
287  dsigMC = 0.0090;
288  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
289  dsigMC = 0.0190;
290  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
291  dsigMC = 0.0156;
292  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
293  dsigMC = 0.0269;
294  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
295  dsigMC = 0.0287;
296  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
297  dsigMC = 0.0364;
298  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
299  dsigMC = 0.0321;
300  }
301  if (lumiRatio_ == 0.0) {
302  if (isEB && fabs(eta) < 1 && r9 < 0.94)
303  dsigMC = 0.0103;
304  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
305  dsigMC = 0.0090;
306  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
307  dsigMC = 0.0190;
308  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
309  dsigMC = 0.0156;
310  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
311  dsigMC = 0.0269;
312  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
313  dsigMC = 0.0287;
314  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
315  dsigMC = 0.0364;
316  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
317  dsigMC = 0.0321;
318  }
319  if (lumiRatio_ == 1.0) {
320  if (isEB && fabs(eta) < 1 && r9 < 0.94)
321  dsigMC = 0.0109;
322  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
323  dsigMC = 0.0099;
324  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
325  dsigMC = 0.0182;
326  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
327  dsigMC = 0.0200;
328  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
329  dsigMC = 0.0282;
330  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
331  dsigMC = 0.0309;
332  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
333  dsigMC = 0.0386;
334  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
335  dsigMC = 0.0359;
336  }
337  }
338  }
339  break;
340 
341  case 2:
342  // Implementation of the MC smearing for regression energy type 2
343  if (dataset_ == "Summer12_LegacyPaper" || dataset_ == "22Jan2013ReReco") {
344  if (isEB && fabs(eta) < 1 && r9 < 0.94)
345  dsigMC = 0.0094;
346  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
347  dsigMC = 0.0092;
348  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
349  dsigMC = 0.0182;
350  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
351  dsigMC = 0.0139;
352  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
353  dsigMC = 0.0220;
354  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
355  dsigMC = 0.0229;
356  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
357  dsigMC = 0.0290;
358  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
359  dsigMC = 0.0234;
360  }
361  break;
362 
363  case 3:
364  // standard SC energy scale corrections implementation
365  if (dataset_ == "Summer11" ||
366  dataset_ == "ReReco") { // values from https://indico.cern.ch/conferenceDisplay.py?confId=146386
367  if (isEB && fabs(eta) < 1 && r9 < 0.94)
368  dsigMC = 0.01;
369  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
370  dsigMC = 0.0099;
371  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
372  dsigMC = 0.0217;
373  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
374  dsigMC = 0.0157;
375  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
376  dsigMC = 0.0326;
377  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
378  dsigMC = 0.0330;
379  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
380  dsigMC = 0.0331;
381  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
382  dsigMC = 0.0378;
383  } else if (dataset_ == "Fall11" ||
384  dataset_ ==
385  "Jan16ReReco") { // values from https://hypernews.cern.ch/HyperNews/CMS/get/higgs2g/634.html, consistant with Jan16ReReco corrections
386  if (isEB && fabs(eta) < 1 && r9 < 0.94)
387  dsigMC = 0.0096;
388  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
389  dsigMC = 0.0074;
390  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
391  dsigMC = 0.0196;
392  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
393  dsigMC = 0.0141;
394  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
395  dsigMC = 0.0279;
396  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
397  dsigMC = 0.0268;
398  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
399  dsigMC = 0.0301;
400  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
401  dsigMC = 0.0293;
402  } else if (dataset_ == "Summer12" ||
403  dataset_ ==
404  "ICHEP2012") { // new values from https://twiki.cern.ch/twiki/pub/CMS/EcalEnergyResolutionWithZee/oriented-ICHEP-scales_resolution.pdf
405  if (isEB && fabs(eta) < 1 && r9 < 0.94)
406  dsigMC = 0.0119;
407  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
408  dsigMC = 0.0107;
409  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
410  dsigMC = 0.0240;
411  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
412  dsigMC = 0.0149;
413  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
414  dsigMC = 0.0330;
415  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
416  dsigMC = 0.0375;
417  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
418  dsigMC = 0.0602;
419  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
420  dsigMC = 0.0607;
421  } else if (dataset_ == "Summer12_DR53X_HCP2012" || dataset_ == "Moriond2013") {
422  if (isEB && fabs(eta) < 1 && r9 < 0.94)
423  dsigMC = 0.0099;
424  if (isEB && fabs(eta) < 1 && r9 >= 0.94)
425  dsigMC = 0.0103;
426  if (isEB && fabs(eta) >= 1 && r9 < 0.94)
427  dsigMC = 0.0219;
428  if (isEB && fabs(eta) >= 1 && r9 >= 0.94)
429  dsigMC = 0.0158;
430  if (!isEB && fabs(eta) < 2 && r9 < 0.94)
431  dsigMC = 0.0222;
432  if (!isEB && fabs(eta) < 2 && r9 >= 0.94)
433  dsigMC = 0.0298;
434  if (!isEB && fabs(eta) >= 2 && r9 < 0.94)
435  dsigMC = 0.0318;
436  if (!isEB && fabs(eta) >= 2 && r9 >= 0.94)
437  dsigMC = 0.0302;
438  }
439  break;
440  }
441 
442  if (isMC_) {
443  CLHEP::RandGaussQ gaussDistribution(rng->getEngine(streamID), 1., dsigMC);
444  corrMC = gaussDistribution.fire();
445  if (verbose_) {
446  std::cout << "[ElectronEnergyCalibrator] unsmeared energy " << newEnergy_ << std::endl;
447  }
448  if (synchronization_) {
449  std::cout << "[ElectronEnergyCalibrator] "
450  << "======================= SYNCRONIZATION MODE! =======================" << std::endl;
451  newEnergy_ = newEnergy_ * (1 + dsigMC);
452  } else {
453  newEnergy_ = newEnergy_ * corrMC;
454  }
455  if (verbose_) {
456  std::cout << "[ElectronEnergyCalibrator] smeared energy " << newEnergy_ << std::endl;
457  }
458  }
459 
460  // correct energy error for MC and for data as error is obtained from (ideal) MC parametrisation
461  if (updateEnergyErrors_) {
463  }
464  if (verbose_) {
465  std::cout << "[ElectronEnergyCalibrator] initial energy " << electron.getRegEnergy() << " recalibrated energy "
466  << newEnergy_ << std::endl;
467  }
468  if (verbose_) {
469  std::cout << "[ElectronEnergyCalibrator] initial energy error " << electron.getRegEnergyError()
470  << " recalibrated energy error " << newEnergyError_ << std::endl;
471  }
472 
473  electron.setNewEnergy(newEnergy_);
475 }
correctionValues corrValArray[100]
double getSCEnergy() const
void setNewEnergyError(double newEnergyError)
double getRegEnergy() const
void setNewEnergy(double newEnergy)
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
unsigned int getRunNumber() const
T sqrt(T t)
Definition: SSEVec.h:19
bool isAvailable() const
Definition: Service.h:40
double getEta() const
float getR9() const
double getRegEnergyError() const
double getSCEnergyError() const
bool isEB() const
tuple cout
Definition: gather_cfg.py:144
void ElectronEnergyCalibrator::correctLinearity ( SimpleElectron electron)

Definition at line 477 of file ElectronEnergyCalibrator.cc.

References applyLinearityCorrection_, linearityCorrectionValues::corrCat0, linearityCorrectionValues::corrCat1, linearityCorrectionValues::corrCat2, linearityCorrectionValues::corrCat3, linearityCorrectionValues::corrCat4, linearityCorrectionValues::corrCat5, gather_cfg::cout, PVValHelper::eta, funct::exp(), SimpleElectron::getCombinedMomentum(), SimpleElectron::getElClass(), SimpleElectron::getEta(), mps_fire::i, SimpleElectron::isEB(), isMC_, linCorrValArray, nLinCorrValRaw, AlCaHLTBitMon_ParallelJobs::p, DiDispStaMuonMonitor_cfi::pt, HLT_FULL_cff::ptMax, ptMin, SimpleElectron::setCombinedMomentum(), funct::sin(), theta(), and verbose_.

477  {
479  bool isEB = electron.isEB();
480  double eta = electron.getEta();
481  double theta = 2 * atan(exp(-eta));
482  double p = electron.getCombinedMomentum();
483  double pt = p * fabs(sin(theta));
484  int classification = electron.getElClass();
485  double linscale = 0.;
486 
487  for (int i = 0; i < nLinCorrValRaw; i++) {
488  if ((pt >= linCorrValArray[i].ptMin) && (pt <= linCorrValArray[i].ptMax)) {
489  if (isEB) {
490  if (fabs(eta) < 1) {
491  if (classification < 2) {
492  linscale = linCorrValArray[i].corrCat0;
493  } else {
494  linscale = linCorrValArray[i].corrCat3;
495  }
496  } else {
497  if (classification < 2) {
498  linscale = linCorrValArray[i].corrCat1;
499  } else {
500  linscale = linCorrValArray[i].corrCat4;
501  }
502  }
503  } else // !isEB
504  {
505  if (classification < 2) {
506  linscale = linCorrValArray[i].corrCat2;
507  } else {
508  linscale = linCorrValArray[i].corrCat5;
509  }
510  }
511  }
512  }
513  double newP = p / (1. + linscale);
514  if (verbose_) {
515  std::cout << "[ElectronEnergyCalibrator] Applying a linearity correction of " << 1. / (1. + linscale)
516  << " to " << pt << " GeV in pt" << std::endl;
517  }
518  electron.setCombinedMomentum(newP);
519  if (verbose_) {
520  std::cout << "[ElectronEnergyCalibrator] calibrated transverse momentum " << pt
521  << " GeV recalibrated for linearity to momentum " << electron.getCombinedMomentum() * fabs(sin(theta))
522  << " GeV" << std::endl;
523  }
524  }
525 }
int getElClass() const
void setCombinedMomentum(double combinedMomentum)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
constexpr float ptMin
Geom::Theta< T > theta() const
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
double getCombinedMomentum() const
double getEta() const
linearityCorrectionValues linCorrValArray[100]
bool isEB() const
tuple cout
Definition: gather_cfg.py:144
double ElectronEnergyCalibrator::gauss ( edm::StreamID const &  id) const
private

Return a number distributed as a unit gaussian, drawn from the private RNG if initPrivateRng was called, or from the CMSSW RandomNumberGenerator service If synchronization is set to true, it returns a fixed number (1.0)

Definition at line 190 of file ElectronEnergyCalibrator.cc.

References Exception, edm::RandomNumberGenerator::getEngine(), edm::Service< T >::isAvailable(), and rng_.

Referenced by calibrate().

190  {
191  if (rng_) {
192  return rng_->Gaus();
193  } else {
195  if (!rng.isAvailable()) {
196  throw cms::Exception("Configuration")
197  << "XXXXXXX requires the RandomNumberGeneratorService\n"
198  "which is not present in the configuration file. You must add the service\n"
199  "in the configuration file or remove the modules that require it.";
200  }
201  CLHEP::RandGaussQ gaussDistribution(rng->getEngine(id), 0.0, 1.0);
202  return gaussDistribution.fire();
203  }
204 }
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
bool isAvailable() const
Definition: Service.h:40
void ElectronEnergyCalibrator::init ( void  )
private

Definition at line 22 of file ElectronEnergyCalibrator.cc.

References applyLinearityCorrection_, correctionValues::corrCat0, linearityCorrectionValues::corrCat0, correctionValues::corrCat1, linearityCorrectionValues::corrCat1, correctionValues::corrCat2, linearityCorrectionValues::corrCat2, correctionValues::corrCat3, linearityCorrectionValues::corrCat3, correctionValues::corrCat4, linearityCorrectionValues::corrCat4, correctionValues::corrCat5, linearityCorrectionValues::corrCat5, correctionValues::corrCat6, correctionValues::corrCat7, corrValArray, gather_cfg::cout, Exception, groupFilesInBlocks::fin, isMC_, linCorrValArray, nCorrValRaw, nLinCorrValRaw, correctionValues::nRunMax, correctionValues::nRunMin, pathData_, pathLinData_, linearityCorrectionValues::ptMax, linearityCorrectionValues::ptMin, alignCSCRings::s, splitString(), AlCaHLTBitMon_QueryRunRegistry::string, stringToDouble(), and verbose_.

Referenced by ElectronEnergyCalibrator().

22  {
23  if (!isMC_) // DATA
24  {
25  if (verbose_) {
26  std::cout << "[ElectronEnergyCalibrator] Initialization in DATA mode" << std::endl;
27  }
28 
29  std::ifstream fin(pathData_.c_str());
30 
31  if (!fin) {
32  throw cms::Exception("Configuration") << "[ElectronEnergyCalibrator] Cannot open the file " << pathData_
33  << "\n It is not found, missed or corrupted";
34  } else {
35  if (verbose_) {
36  std::cout << "[ElectronEnergyCalibrator] File " << pathData_ << " succesfully opened" << std::endl;
37  }
38 
39  std::string s;
40  std::vector<std::string> selements;
41  std::string delimiter = ",";
42  nCorrValRaw = 0;
43 
44  while (!fin.eof()) {
45  getline(fin, s);
46  if (!s.empty()) {
47  splitString(s, selements, delimiter);
58 
59  nCorrValRaw++;
60 
61  selements.clear();
62  }
63  }
64 
65  fin.close();
66 
67  if (verbose_) {
68  std::cout << "[ElectronEnergyCalibrator] File closed" << std::endl;
69  }
70  }
71  // linearity corrections data
73  std::ifstream finlin(pathLinData_.c_str());
74 
75  if (!finlin) {
76  throw cms::Exception("Configuration") << "[ElectronEnergyCalibrator] Cannot open the file " << pathLinData_
77  << "\n It is not found, missed or corrupted";
78  } else {
79  if (verbose_) {
80  std::cout << "[ElectronEnergyCalibrator] File with Linearity Corrections " << pathLinData_
81  << " succesfully opened" << std::endl;
82  }
83 
84  std::string s;
85  std::vector<std::string> selements;
86  std::string delimiter = ",";
87  nLinCorrValRaw = 0;
88 
89  while (!finlin.eof()) {
90  getline(finlin, s);
91  if (!s.empty()) {
92  splitString(s, selements, delimiter);
93 
102 
103  nLinCorrValRaw++;
104 
105  selements.clear();
106  }
107  }
108 
109  finlin.close();
110 
111  if (verbose_) {
112  std::cout << "[ElectronEnergyCalibrator] File closed" << std::endl;
113  }
114  }
115  }
116  } else // MC
117  {
118  if (verbose_) {
119  std::cout << "[ElectronEnergyCalibrator] Initialization in MC mode" << std::endl;
120  }
121  }
122 }
correctionValues corrValArray[100]
double stringToDouble(const std::string &str)
linearityCorrectionValues linCorrValArray[100]
void splitString(const std::string &fullstr, std::vector< std::string > &elements, const std::string &delimiter)
tuple cout
Definition: gather_cfg.py:144
void ElectronEnergyCalibrator::initPrivateRng ( TRandom *  rnd)

Initialize with a random number generator (if not done, it will use the CMSSW service) Caller code owns the TRandom.

Definition at line 16 of file ElectronEnergyCalibrator.cc.

References rng_.

16 { rng_ = rnd; }
void ElectronEnergyCalibrator::setEcalEnergy ( reco::GsfElectron ele,
const float  scale,
const float  smear 
) const
private

Definition at line 163 of file ElectronEnergyCalibrator.cc.

References reco::GsfElectron::ecalEnergy(), reco::GsfElectron::ecalEnergyError(), reco::GsfElectron::setCorrectedEcalEnergy(), and reco::GsfElectron::setCorrectedEcalEnergyError().

Referenced by calCombinedMom(), and setEnergyAndSystVarations().

163  {
164  const float oldEcalEnergy = ele.ecalEnergy();
165  const float oldEcalEnergyErr = ele.ecalEnergyError();
166  ele.setCorrectedEcalEnergy(oldEcalEnergy * scale);
167  ele.setCorrectedEcalEnergyError(std::hypot(oldEcalEnergyErr * scale, oldEcalEnergy * smear * scale));
168 }
void setCorrectedEcalEnergyError(float newEnergyError)
Definition: GsfElectron.cc:170
float ecalEnergyError() const
Definition: GsfElectron.h:897
float ecalEnergy() const
Definition: GsfElectron.h:896
void setCorrectedEcalEnergy(float newEnergy)
Definition: GsfElectron.cc:174
void ElectronEnergyCalibrator::setEnergyAndSystVarations ( const float  scale,
const float  smearNrSigma,
const float  et,
const EnergyScaleCorrection::ScaleCorrection scaleCorr,
const EnergyScaleCorrection::SmearCorrection smearCorr,
reco::GsfElectron ele,
std::array< float, EGEnergySysIndex::kNrSysErrs > &  energyData 
) const
private

Definition at line 92 of file ElectronEnergyCalibrator.cc.

References calCombinedMom(), reco::GsfElectron::Corrections::combinedP4Error, alignCSCRings::corr, reco::GsfElectron::corrections(), reco::GsfElectron::correctMomentum(), reco::GsfElectron::ecalEnergy(), reco::GsfElectron::ecalEnergyError(), reco::LeafCandidate::energy(), EGEnergySysIndex::kEcalErrPostCorr, EGEnergySysIndex::kEcalErrPreCorr, EGEnergySysIndex::kEcalPostCorr, EGEnergySysIndex::kEcalPreCorr, EGEnergySysIndex::kEcalTrkErrPostCorr, EGEnergySysIndex::kEcalTrkErrPreCorr, EGEnergySysIndex::kEcalTrkPostCorr, EGEnergySysIndex::kEcalTrkPreCorr, EnergyScaleCorrection::kErrStatSystGain, EGEnergySysIndex::kScaleDown, EGEnergySysIndex::kScaleGainDown, EGEnergySysIndex::kScaleGainUp, EGEnergySysIndex::kScaleStatDown, EGEnergySysIndex::kScaleStatUp, EGEnergySysIndex::kScaleSystDown, EGEnergySysIndex::kScaleSystUp, EGEnergySysIndex::kScaleUp, EGEnergySysIndex::kSmearDown, EGEnergySysIndex::kSmearPhiDown, EGEnergySysIndex::kSmearPhiUp, EGEnergySysIndex::kSmearRhoDown, EGEnergySysIndex::kSmearRhoUp, EGEnergySysIndex::kSmearUp, reco::GsfElectron::p4(), EnergyScaleCorrection::ScaleCorrection::scaleErr(), EnergyScaleCorrection::ScaleCorrection::scaleErrGain(), EnergyScaleCorrection::ScaleCorrection::scaleErrStat(), EnergyScaleCorrection::ScaleCorrection::scaleErrSyst(), setEcalEnergy(), EnergyScaleCorrection::SmearCorrection::sigma(), and reco::GsfElectron::trackMomentumError().

Referenced by calibrate().

99  {
100  const float smear = smearCorr.sigma(et);
101  const float smearRhoUp = smearCorr.sigma(et, 1, 0);
102  const float smearRhoDn = smearCorr.sigma(et, -1, 0);
103  const float smearPhiUp = smearCorr.sigma(et, 0, 1);
104  const float smearPhiDn = smearCorr.sigma(et, 0, -1);
105  const float smearUp = smearRhoUp;
106  const float smearDn = smearRhoDn;
107 
108  const float corr = scale + smear * smearNrSigma;
109  const float corrRhoUp = scale + smearRhoUp * smearNrSigma;
110  const float corrRhoDn = scale + smearRhoDn * smearNrSigma;
111  const float corrPhiUp = scale + smearPhiUp * smearNrSigma;
112  const float corrPhiDn = scale + smearPhiDn * smearNrSigma;
113  const float corrUp = corrRhoUp;
114  const float corrDn = corrRhoDn;
115 
116  const float corrScaleStatUp = corr + scaleCorr.scaleErrStat();
117  const float corrScaleStatDn = corr - scaleCorr.scaleErrStat();
118  const float corrScaleSystUp = corr + scaleCorr.scaleErrSyst();
119  const float corrScaleSystDn = corr - scaleCorr.scaleErrSyst();
120  const float corrScaleGainUp = corr + scaleCorr.scaleErrGain();
121  const float corrScaleGainDn = corr - scaleCorr.scaleErrGain();
122  const float corrScaleUp = corr + scaleCorr.scaleErr(EnergyScaleCorrection::kErrStatSystGain);
123  const float corrScaleDn = corr - scaleCorr.scaleErr(EnergyScaleCorrection::kErrStatSystGain);
124 
125  const math::XYZTLorentzVector oldP4 = ele.p4();
126  energyData[EGEnergySysIndex::kEcalTrkPreCorr] = ele.energy();
128  energyData[EGEnergySysIndex::kEcalPreCorr] = ele.ecalEnergy();
130 
131  energyData[EGEnergySysIndex::kScaleStatUp] = calCombinedMom(ele, corrScaleStatUp, smear).first;
132  energyData[EGEnergySysIndex::kScaleStatDown] = calCombinedMom(ele, corrScaleStatDn, smear).first;
133  energyData[EGEnergySysIndex::kScaleSystUp] = calCombinedMom(ele, corrScaleSystUp, smear).first;
134  energyData[EGEnergySysIndex::kScaleSystDown] = calCombinedMom(ele, corrScaleSystDn, smear).first;
135  energyData[EGEnergySysIndex::kScaleGainUp] = calCombinedMom(ele, corrScaleGainUp, smear).first;
136  energyData[EGEnergySysIndex::kScaleGainDown] = calCombinedMom(ele, corrScaleGainDn, smear).first;
137 
138  energyData[EGEnergySysIndex::kSmearRhoUp] = calCombinedMom(ele, corrRhoUp, smearRhoUp).first;
139  energyData[EGEnergySysIndex::kSmearRhoDown] = calCombinedMom(ele, corrRhoDn, smearRhoDn).first;
140  energyData[EGEnergySysIndex::kSmearPhiUp] = calCombinedMom(ele, corrPhiUp, smearPhiUp).first;
141  energyData[EGEnergySysIndex::kSmearPhiDown] = calCombinedMom(ele, corrPhiDn, smearPhiDn).first;
142 
143  energyData[EGEnergySysIndex::kScaleUp] = calCombinedMom(ele, corrScaleUp, smear).first;
144  energyData[EGEnergySysIndex::kScaleDown] = calCombinedMom(ele, corrScaleDn, smear).first;
145  energyData[EGEnergySysIndex::kSmearUp] = calCombinedMom(ele, corrUp, smearUp).first;
146  energyData[EGEnergySysIndex::kSmearDown] = calCombinedMom(ele, corrDn, smearDn).first;
147 
148  const std::pair<float, float> combinedMomentum = calCombinedMom(ele, corr, smear);
149  setEcalEnergy(ele, corr, smear);
150  const float energyCorr = combinedMomentum.first / oldP4.t();
151 
152  const math::XYZTLorentzVector newP4(
153  oldP4.x() * energyCorr, oldP4.y() * energyCorr, oldP4.z() * energyCorr, combinedMomentum.first);
154 
155  ele.correctMomentum(newP4, ele.trackMomentumError(), combinedMomentum.second);
156  energyData[EGEnergySysIndex::kEcalTrkPostCorr] = ele.energy();
158 
159  energyData[EGEnergySysIndex::kEcalPostCorr] = ele.ecalEnergy();
161 }
float trackMomentumError() const
Definition: GsfElectron.h:884
const Corrections & corrections() const
Definition: GsfElectron.h:889
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:217
void setEcalEnergy(reco::GsfElectron &ele, const float scale, const float smear) const
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
Definition: GsfElectron.h:905
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
float ecalEnergyError() const
Definition: GsfElectron.h:897
float scaleErr(const std::bitset< kErrNrBits > &uncBitMask) const
float sigma(const float et, const float nrSigmaRho=0., const float nrSigmaPhi=0.) const
float ecalEnergy() const
Definition: GsfElectron.h:896
std::pair< float, float > calCombinedMom(reco::GsfElectron &ele, const float scale, const float smear) const
double energy() const final
energy
void ElectronEnergyCalibrator::setMinEt ( float  val)
inline
void ElectronEnergyCalibrator::splitString ( const std::string &  fullstr,
std::vector< std::string > &  elements,
const std::string &  delimiter 
)
private

Definition at line 124 of file ElectronEnergyCalibrator.cc.

Referenced by init().

126  {
127  std::string::size_type lastpos = fullstr.find_first_not_of(delimiter, 0);
128  std::string::size_type pos = fullstr.find_first_of(delimiter, lastpos);
129 
130  while ((std::string::npos != pos) || (std::string::npos != lastpos)) {
131  elements.push_back(fullstr.substr(lastpos, pos - lastpos));
132  lastpos = fullstr.find_first_not_of(delimiter, pos);
133  pos = fullstr.find_first_of(delimiter, lastpos);
134  }
135 }
uint16_t size_type
dictionary elements
double ElectronEnergyCalibrator::stringToDouble ( const std::string &  str)
private

Definition at line 137 of file ElectronEnergyCalibrator.cc.

References hgcalPerformanceValidation::val.

Referenced by init().

137  {
138  std::istringstream stm;
139  double val = 0;
140  stm.str(str);
141  stm >> val;
142  return val;
143 }
#define str(s)

Member Data Documentation

bool ElectronEnergyCalibrator::applyLinearityCorrection_
private

Definition at line 79 of file ElectronEnergyCalibrator.h.

Referenced by correctLinearity(), and init().

EnergyScaleCorrection ElectronEnergyCalibrator::correctionRetriever_
private

Definition at line 74 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

int ElectronEnergyCalibrator::correctionsType_
private

Definition at line 78 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

correctionValues ElectronEnergyCalibrator::corrValArray[100]
private

Definition at line 86 of file ElectronEnergyCalibrator.h.

Referenced by calibrate(), and init().

correctionValues ElectronEnergyCalibrator::corrValMC
private

Definition at line 87 of file ElectronEnergyCalibrator.h.

std::string ElectronEnergyCalibrator::dataset_
private

Definition at line 77 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

const EnergyScaleCorrection::ScaleCorrection ElectronEnergyCalibrator::defaultScaleCorr_
staticprivate

Definition at line 80 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

const EnergyScaleCorrection::SmearCorrection ElectronEnergyCalibrator::defaultSmearCorr_
staticprivate

Definition at line 81 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

const EpCombinationTool* ElectronEnergyCalibrator::epCombinationTool_
private

Definition at line 75 of file ElectronEnergyCalibrator.h.

Referenced by calCombinedMom().

bool ElectronEnergyCalibrator::isMC_
private

Definition at line 81 of file ElectronEnergyCalibrator.h.

Referenced by calibrate(), correctLinearity(), and init().

linearityCorrectionValues ElectronEnergyCalibrator::linCorrValArray[100]
private

Definition at line 88 of file ElectronEnergyCalibrator.h.

Referenced by correctLinearity(), and init().

double ElectronEnergyCalibrator::lumiRatio_
private

Definition at line 80 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

float ElectronEnergyCalibrator::minEt_
private

Definition at line 77 of file ElectronEnergyCalibrator.h.

Referenced by calibrate(), and setMinEt().

int ElectronEnergyCalibrator::nCorrValRaw
private

Definition at line 89 of file ElectronEnergyCalibrator.h.

Referenced by calibrate(), and init().

double ElectronEnergyCalibrator::newEnergy_
private

Definition at line 72 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

double ElectronEnergyCalibrator::newEnergyError_
private

Definition at line 73 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

int ElectronEnergyCalibrator::nLinCorrValRaw
private

Definition at line 89 of file ElectronEnergyCalibrator.h.

Referenced by correctLinearity(), and init().

std::string ElectronEnergyCalibrator::pathData_
private

Definition at line 75 of file ElectronEnergyCalibrator.h.

Referenced by init().

std::string ElectronEnergyCalibrator::pathLinData_
private

Definition at line 76 of file ElectronEnergyCalibrator.h.

Referenced by init().

TRandom* ElectronEnergyCalibrator::rng_
private

Definition at line 76 of file ElectronEnergyCalibrator.h.

Referenced by gauss(), and initPrivateRng().

bool ElectronEnergyCalibrator::synchronization_
private

Definition at line 84 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

bool ElectronEnergyCalibrator::updateEnergyErrors_
private

Definition at line 82 of file ElectronEnergyCalibrator.h.

Referenced by calibrate().

bool ElectronEnergyCalibrator::verbose_
private

Definition at line 83 of file ElectronEnergyCalibrator.h.

Referenced by calibrate(), correctLinearity(), and init().