#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 39 of file ElectronEnergyCalibrator.h.
|
strong |
Enumerator | |
---|---|
DATA | |
MC |
Definition at line 26 of file ElectronEnergyCalibrator.h.
|
inline |
Definition at line 41 of file ElectronEnergyCalibrator.h.
References init().
|
inline |
Definition at line 31 of file ElectronEnergyCalibrator.h.
ElectronEnergyCalibrator::ElectronEnergyCalibrator | ( | const EpCombinationTool & | combinator, |
const std::string & | correctionFile | ||
) |
Definition at line 12 of file ElectronEnergyCalibrator.cc.
|
inline |
Definition at line 33 of file ElectronEnergyCalibrator.h.
|
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(), pfClustersFromCombinedCaloHF_cfi::scale, reco::GsfElectron::setCorrectedEcalEnergy(), reco::GsfElectron::setCorrectedEcalEnergyError(), setEcalEnergy(), and reco::GsfElectron::trackMomentumError().
Referenced by setEnergyAndSystVarations().
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(), QIE11Task_cfi::eventType, gauss(), FastTrackerRecHitMaskProducer_cfi::recHits, and convertSQLiteXML::runNumber.
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(), reco::LeafCandidate::energy(), EgHLTOffHistBins_cfi::et, QIE11Task_cfi::eventType, 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_, FastTrackerRecHitMaskProducer_cfi::recHits, convertSQLiteXML::runNumber, EnergyScaleCorrection::ScaleCorrection::scale(), setEnergyAndSystVarations(), EnergyScaleCorrection::SmearCorrection::sigma(), and reco::GsfElectron::superCluster().
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_, HPSPFTauProducerPuppi_cfi::electron, PVValHelper::eta, Exception, edm::RandomNumberGenerator::getEngine(), mps_fire::i, edm::Service< T >::isAvailable(), electrons_cff::isEB, isMC_, lumiRatio_, nCorrValRaw, newEnergy_, newEnergyError_, electrons_cff::r9, pfClustersFromCombinedCaloHF_cfi::scale, mathSSE::sqrt(), synchronization_, updateEnergyErrors_, and verbose_.
Referenced by calibrate().
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, HPSPFTauProducerPuppi_cfi::electron, PVValHelper::eta, JetChargeProducer_cfi::exp, mps_fire::i, electrons_cff::isEB, isMC_, linCorrValArray, nLinCorrValRaw, AlCaHLTBitMon_ParallelJobs::p, DiDispStaMuonMonitor_cfi::pt, AlignmentTrackSelector_cfi::ptMax, ptMin, 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 190 of file ElectronEnergyCalibrator.cc.
References Exception, edm::RandomNumberGenerator::getEngine(), edm::Service< T >::isAvailable(), and rng_.
Referenced by calibrate().
|
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, makeHLTPrescaleTable::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_.
Referenced by ElectronEnergyCalibrator().
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_.
|
private |
Definition at line 163 of file ElectronEnergyCalibrator.cc.
References reco::GsfElectron::ecalEnergy(), reco::GsfElectron::ecalEnergyError(), Matriplex::hypot(), pfClustersFromCombinedCaloHF_cfi::scale, reco::GsfElectron::setCorrectedEcalEnergy(), and reco::GsfElectron::setCorrectedEcalEnergyError().
Referenced by calCombinedMom(), and setEnergyAndSystVarations().
|
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(), EgHLTOffHistBins_cfi::et, 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(), pfClustersFromCombinedCaloHF_cfi::scale, EnergyScaleCorrection::ScaleCorrection::scaleErr(), EnergyScaleCorrection::ScaleCorrection::scaleErrGain(), EnergyScaleCorrection::ScaleCorrection::scaleErrStat(), EnergyScaleCorrection::ScaleCorrection::scaleErrSyst(), setEcalEnergy(), EnergyScaleCorrection::SmearCorrection::sigma(), and reco::GsfElectron::trackMomentumError().
Referenced by calibrate().
|
inline |
|
private |
Definition at line 124 of file ElectronEnergyCalibrator.cc.
References makeHLTPrescaleTable::delimiter, and bookConverter::elements.
Referenced by init().
|
private |
Definition at line 137 of file ElectronEnergyCalibrator.cc.
References str, and heppy_batch::val.
Referenced by init().
|
private |
Definition at line 79 of file ElectronEnergyCalibrator.h.
Referenced by correctLinearity(), and init().
|
private |
Definition at line 74 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 78 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 86 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), and init().
|
private |
Definition at line 87 of file ElectronEnergyCalibrator.h.
|
private |
Definition at line 77 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
staticprivate |
Definition at line 80 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
staticprivate |
Definition at line 81 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 75 of file ElectronEnergyCalibrator.h.
Referenced by calCombinedMom().
|
private |
Definition at line 81 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), correctLinearity(), and init().
|
private |
Definition at line 88 of file ElectronEnergyCalibrator.h.
Referenced by correctLinearity(), and init().
|
private |
Definition at line 80 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 77 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), and setMinEt().
|
private |
Definition at line 89 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), and init().
|
private |
Definition at line 72 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 73 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 89 of file ElectronEnergyCalibrator.h.
Referenced by correctLinearity(), and init().
|
private |
Definition at line 75 of file ElectronEnergyCalibrator.h.
Referenced by init().
|
private |
Definition at line 76 of file ElectronEnergyCalibrator.h.
Referenced by init().
|
private |
Definition at line 76 of file ElectronEnergyCalibrator.h.
Referenced by gauss(), and initPrivateRng().
|
private |
Definition at line 84 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 82 of file ElectronEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 83 of file ElectronEnergyCalibrator.h.
Referenced by calibrate(), correctLinearity(), and init().