#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 EpCombinationTool * | epCombinationTool_ |
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_ |
Definition at line 41 of file ElectronEnergyCalibrator.h.
|
strong |
Enumerator | |
---|---|
DATA | |
MC |
Definition at line 27 of file ElectronEnergyCalibrator.h.
|
inline |
Definition at line 44 of file ElectronEnergyCalibrator.h.
References csvReporter::delimiter, metsig::electron, allElectronIsolations_cfi::elements, init, CastorDbASCIIIO::splitString(), str, and AlCaHLTBitMon_QueryRunRegistry::string.
|
inline |
Definition at line 32 of file ElectronEnergyCalibrator.h.
References electrons_cff::correctionFile, and AlCaHLTBitMon_QueryRunRegistry::string.
ElectronEnergyCalibrator::ElectronEnergyCalibrator | ( | const EpCombinationTool & | combinator, |
const std::string & | correctionFile | ||
) |
Definition at line 12 of file ElectronEnergyCalibrator.cc.
|
inline |
|
private |
Definition at line 181 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(), and setMinEt().
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 28 of file ElectronEnergyCalibrator.cc.
References calibrate(), and gauss().
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 38 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(), stringResolutionProvider_cfi::et, 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().
void ElectronEnergyCalibrator::calibrate | ( | SimpleElectron & | electron, |
edm::StreamID const & | streamID | ||
) |
Definition at line 164 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_, electrons_cff::r9, Scenarios_cff::scale, SimpleElectron::setNewEnergy(), SimpleElectron::setNewEnergyError(), mathSSE::sqrt(), synchronization_, updateEnergyErrors_, and verbose_.
Referenced by calibrate(), initPrivateRng(), CalibratedElectronProducerT< T >::produce(), and setMinEt().
void ElectronEnergyCalibrator::correctLinearity | ( | SimpleElectron & | electron | ) |
Definition at line 451 of file ElectronEnergyCalibrator.cc.
References applyLinearityCorrection_, linearityCorrectionValues::corrCat0, linearityCorrectionValues::corrCat1, linearityCorrectionValues::corrCat2, linearityCorrectionValues::corrCat3, linearityCorrectionValues::corrCat4, linearityCorrectionValues::corrCat5, gather_cfg::cout, PVValHelper::eta, JetChargeProducer_cfi::exp, SimpleElectron::getCombinedMomentum(), SimpleElectron::getElClass(), SimpleElectron::getEta(), mps_fire::i, SimpleElectron::isEB(), isMC_, linCorrValArray, nLinCorrValRaw, AlCaHLTBitMon_ParallelJobs::p, EnergyCorrector::pt, AlignmentTrackSelector_cfi::ptMax, ALCARECOTkAlBeamHalo_cff::ptMin, SimpleElectron::setCombinedMomentum(), funct::sin(), theta(), and verbose_.
|
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 203 of file ElectronEnergyCalibrator.cc.
References Exception, edm::RandomNumberGenerator::getEngine(), edm::Service< T >::isAvailable(), and rng_.
Referenced by calibrate(), and setMinEt().
|
private |
Definition at line 23 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, csvReporter::delimiter, 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_.
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 22 of file ElectronEnergyCalibrator.cc.
References calibrate(), and rng_.
Referenced by CalibratedElectronProducerT< T >::CalibratedElectronProducerT(), and ~ElectronEnergyCalibrator().
|
private |
Definition at line 171 of file ElectronEnergyCalibrator.cc.
References reco::GsfElectron::ecalEnergy(), reco::GsfElectron::ecalEnergyError(), reco::GsfElectron::setCorrectedEcalEnergy(), and reco::GsfElectron::setCorrectedEcalEnergyError().
Referenced by calCombinedMom(), setEnergyAndSystVarations(), and setMinEt().
|
private |
Definition at line 97 of file ElectronEnergyCalibrator.cc.
References calCombinedMom(), reco::GsfElectron::Corrections::combinedP4Error, 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(), and setMinEt().
|
inline |
Definition at line 41 of file ElectronEnergyCalibrator.h.
References calCombinedMom(), calibrate(), stringResolutionProvider_cfi::et, gauss(), minEt_, convertSQLiteXML::runNumber, Scenarios_cff::scale, setEcalEnergy(), setEnergyAndSystVarations(), and heppy_batch::val.
Referenced by CalibratedElectronProducerT< T >::CalibratedElectronProducerT().
|
private |
Definition at line 142 of file ElectronEnergyCalibrator.cc.
Referenced by init().
|
private |
Definition at line 155 of file ElectronEnergyCalibrator.cc.
References heppy_batch::val.
Referenced by init().
|
private |
Definition at line 86 of file ElectronEnergyCalibrator.h.
Referenced by correctLinearity(), and init().
|
private |
Definition at line 71 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 85 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 93 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), and init().
|
private |
Definition at line 94 of file ElectronEnergyCalibrator.h.
|
private |
Definition at line 84 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
staticprivate |
Definition at line 77 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
staticprivate |
Definition at line 78 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 72 of file ElectronEnergyCalibrator.h.
Referenced by calCombinedMom().
|
private |
Definition at line 88 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), correctLinearity(), and init().
|
private |
Definition at line 95 of file ElectronEnergyCalibrator.h.
Referenced by correctLinearity(), and init().
|
private |
Definition at line 87 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 74 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), and setMinEt().
|
private |
Definition at line 96 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), and init().
|
private |
Definition at line 79 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 80 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 96 of file ElectronEnergyCalibrator.h.
Referenced by correctLinearity(), and init().
|
private |
Definition at line 82 of file ElectronEnergyCalibrator.h.
Referenced by init().
|
private |
Definition at line 83 of file ElectronEnergyCalibrator.h.
Referenced by init().
|
private |
Definition at line 73 of file ElectronEnergyCalibrator.h.
Referenced by gauss(), and initPrivateRng().
|
private |
Definition at line 91 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 89 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 90 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), correctLinearity(), and init().