#include <PhotonEnergyCalibrator.h>
Public Types | |
enum | EventType { EventType::DATA, EventType::MC } |
Public Member Functions | |
std::array< float, EGEnergySysIndex::kNrSysErrs > | calibrate (reco::Photon &photon, const unsigned int runNumber, const EcalRecHitCollection *recHits, edm::StreamID const &id, const EventType eventType) const |
std::array< float, EGEnergySysIndex::kNrSysErrs > | calibrate (reco::Photon &photon, const unsigned int runNumber, const EcalRecHitCollection *recHits, const float smearNrSigma, const EventType eventType) const |
void | initPrivateRng (TRandom *rnd) |
PhotonEnergyCalibrator () | |
PhotonEnergyCalibrator (const std::string &correctionFile) | |
void | setMinEt (float val) |
~PhotonEnergyCalibrator () | |
Private Member Functions | |
double | gauss (edm::StreamID const &id) const |
void | setEnergyAndSystVarations (const float scale, const float smearNrSigma, const float et, const EnergyScaleCorrection::ScaleCorrection &scaleCorr, const EnergyScaleCorrection::SmearCorrection &smearCorr, reco::Photon &photon, std::array< float, EGEnergySysIndex::kNrSysErrs > &energyData) const |
Private Attributes | |
EnergyScaleCorrection | correctionRetriever_ |
float | minEt_ |
TRandom * | rng_ |
Static Private Attributes | |
static const EnergyScaleCorrection::ScaleCorrection | defaultScaleCorr_ |
static const EnergyScaleCorrection::SmearCorrection | defaultSmearCorr_ |
Definition at line 20 of file PhotonEnergyCalibrator.h.
|
strong |
Enumerator | |
---|---|
DATA | |
MC |
Definition at line 23 of file PhotonEnergyCalibrator.h.
|
inline |
Definition at line 28 of file PhotonEnergyCalibrator.h.
References electrons_cff::correctionFile, and AlCaHLTBitMon_QueryRunRegistry::string.
PhotonEnergyCalibrator::PhotonEnergyCalibrator | ( | const std::string & | correctionFile | ) |
Definition at line 12 of file PhotonEnergyCalibrator.cc.
|
inline |
std::array< float, EGEnergySysIndex::kNrSysErrs > PhotonEnergyCalibrator::calibrate | ( | reco::Photon & | photon, |
const unsigned int | runNumber, | ||
const EcalRecHitCollection * | recHits, | ||
edm::StreamID const & | id, | ||
const EventType | eventType | ||
) | const |
Correct this photon. StreamID is needed when used with CMSSW Random Number Generator
Definition at line 26 of file PhotonEnergyCalibrator.cc.
References gauss().
Referenced by initPrivateRng(), CalibratedPhotonProducerT< T >::produce(), and setMinEt().
std::array< float, EGEnergySysIndex::kNrSysErrs > PhotonEnergyCalibrator::calibrate | ( | reco::Photon & | photon, |
const unsigned int | runNumber, | ||
const EcalRecHitCollection * | recHits, | ||
const float | smearNrSigma, | ||
const EventType | eventType | ||
) | const |
Definition at line 35 of file PhotonEnergyCalibrator.cc.
References funct::abs(), correctionRetriever_, DATA, defaultScaleCorr_, defaultSmearCorr_, edm::SortedCollection< T, SORT >::end(), stringResolutionProvider_cfi::et, edm::SortedCollection< T, SORT >::find(), reco::Photon::full5x5_r9(), reco::Photon::getCorrectedEnergy(), reco::Photon::getCorrectedEnergyError(), EnergyScaleCorrection::getScaleCorr(), EnergyScaleCorrection::getSmearCorr(), edm::isNotFinite(), EGEnergySysIndex::kEcalErrPostCorr, EGEnergySysIndex::kEcalErrPreCorr, EGEnergySysIndex::kEcalTrkErrPostCorr, EGEnergySysIndex::kEcalTrkErrPreCorr, EGEnergySysIndex::kEcalTrkPostCorr, EGEnergySysIndex::kEcalTrkPreCorr, EcalRecHit::kHasSwitchToGain1, EcalRecHit::kHasSwitchToGain6, EGEnergySysIndex::kScaleValue, EGEnergySysIndex::kSmearNrSigma, EGEnergySysIndex::kSmearValue, MC, minEt_, muons2muons_cfi::photon, EnergyScaleCorrection::ScaleCorrection::scale(), setEnergyAndSystVarations(), EnergyScaleCorrection::SmearCorrection::sigma(), and reco::Photon::superCluster().
|
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 148 of file PhotonEnergyCalibrator.cc.
References Exception, edm::RandomNumberGenerator::getEngine(), edm::Service< T >::isAvailable(), and rng_.
Referenced by calibrate(), and setMinEt().
void PhotonEnergyCalibrator::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 20 of file PhotonEnergyCalibrator.cc.
References calibrate(), and rng_.
Referenced by CalibratedPhotonProducerT< T >::CalibratedPhotonProducerT(), and ~PhotonEnergyCalibrator().
|
private |
Definition at line 93 of file PhotonEnergyCalibrator.cc.
References corr, reco::Photon::getCorrectedEnergy(), reco::Photon::getCorrectedEnergyError(), EGEnergySysIndex::kEcalErrPostCorr, EGEnergySysIndex::kEcalErrPreCorr, EGEnergySysIndex::kEcalPostCorr, EGEnergySysIndex::kEcalPreCorr, 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, EnergyScaleCorrection::ScaleCorrection::scaleErr(), EnergyScaleCorrection::ScaleCorrection::scaleErrGain(), EnergyScaleCorrection::ScaleCorrection::scaleErrStat(), EnergyScaleCorrection::ScaleCorrection::scaleErrSyst(), reco::Photon::setCorrectedEnergy(), and EnergyScaleCorrection::SmearCorrection::sigma().
Referenced by calibrate(), and setMinEt().
|
inline |
Definition at line 37 of file PhotonEnergyCalibrator.h.
References calibrate(), stringResolutionProvider_cfi::et, gauss(), minEt_, muons2muons_cfi::photon, convertSQLiteXML::runNumber, Scenarios_cff::scale, setEnergyAndSystVarations(), and heppy_batch::val.
Referenced by CalibratedPhotonProducerT< T >::CalibratedPhotonProducerT().
|
private |
Definition at line 63 of file PhotonEnergyCalibrator.h.
Referenced by calibrate().
|
staticprivate |
Definition at line 68 of file PhotonEnergyCalibrator.h.
Referenced by calibrate().
|
staticprivate |
Definition at line 69 of file PhotonEnergyCalibrator.h.
Referenced by calibrate().
|
private |
Definition at line 65 of file PhotonEnergyCalibrator.h.
Referenced by calibrate(), and setMinEt().
|
private |
Definition at line 64 of file PhotonEnergyCalibrator.h.
Referenced by gauss(), and initPrivateRng().