CMS 3D CMS Logo

PhotonEnergyCalibrator.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_EgammaTools_PhotonEnergyCalibrator_h
2 #define RecoEgamma_EgammaTools_PhotonEnergyCalibrator_h
3 
4 //author: Alan Smithee
5 //description:
6 // this class allows the residual scale and smearing to be applied to photons
7 // returns a vector of calibrated energies and correction data, indexed by EGEnergySysIndex
8 // a port of EgammaAnalysis/ElectronTools/ElectronEnergyCalibratorRun2
9 
15 
16 #include <TRandom.h>
17 
18 #include <vector>
19 
21 public:
22  enum class EventType {
23  DATA,
24  MC,
25  };
26 
30 
33  void initPrivateRng(TRandom* rnd);
34 
35  //set the minimum et to apply the correction to
36  void setMinEt(float val) { minEt_ = val; }
37 
40  std::array<float, EGEnergySysIndex::kNrSysErrs> calibrate(reco::Photon& photon,
41  const unsigned int runNumber,
43  edm::StreamID const& id,
44  const EventType eventType) const;
45 
46  std::array<float, EGEnergySysIndex::kNrSysErrs> calibrate(reco::Photon& photon,
47  const unsigned int runNumber,
49  const float smearNrSigma,
50  const EventType eventType) const;
51 
52 private:
53  void setEnergyAndSystVarations(const float scale,
54  const float smearNrSigma,
55  const float et,
59  std::array<float, EGEnergySysIndex::kNrSysErrs>& energyData) const;
60 
64  double gauss(edm::StreamID const& id) const;
65 
66  // whatever data will be needed
68  TRandom* rng_; //this is not owned
69  float minEt_;
70 
71  //default values to access if no correction availible
74 };
75 
76 #endif
edm::StreamID
Definition: StreamID.h:30
PhotonEnergyCalibrator::setMinEt
void setMinEt(float val)
Definition: PhotonEnergyCalibrator.h:36
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
EGEnergySysIndex.h
PhotonEnergyCalibrator::EventType
EventType
Definition: PhotonEnergyCalibrator.h:22
PhotonEnergyCalibrator::minEt_
float minEt_
Definition: PhotonEnergyCalibrator.h:69
PhotonEnergyCalibrator::setEnergyAndSystVarations
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
Definition: PhotonEnergyCalibrator.cc:89
PhotonEnergyCalibrator::correctionRetriever_
EnergyScaleCorrection correctionRetriever_
Definition: PhotonEnergyCalibrator.h:67
PhotonEnergyCalibrator
Definition: PhotonEnergyCalibrator.h:20
HLT_FULL_cff.scale
scale
Definition: HLT_FULL_cff.py:6634
EnergyScaleCorrection::SmearCorrection
Definition: EnergyScaleCorrection.h:58
edm::SortedCollection< EcalRecHit >
EnergyScaleCorrection
Definition: EnergyScaleCorrection.h:18
PhotonEnergyCalibrator::initPrivateRng
void initPrivateRng(TRandom *rnd)
Definition: PhotonEnergyCalibrator.cc:15
EcalRecHitCollections.h
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
Photon.h
calibratedElectronsRun2_cfi.correctionFile
correctionFile
Definition: calibratedElectronsRun2_cfi.py:21
PhotonEnergyCalibrator::EventType::MC
EnergyScaleCorrection.h
PhotonEnergyCalibrator::PhotonEnergyCalibrator
PhotonEnergyCalibrator()
Definition: PhotonEnergyCalibrator.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
PhotonEnergyCalibrator::defaultScaleCorr_
static const EnergyScaleCorrection::ScaleCorrection defaultScaleCorr_
Definition: PhotonEnergyCalibrator.h:72
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
PhotonEnergyCalibrator::rng_
TRandom * rng_
Definition: PhotonEnergyCalibrator.h:68
hcalcalib_dqm_sourceclient-live_cfg.eventType
eventType
Definition: hcalcalib_dqm_sourceclient-live_cfg.py:205
PhotonEnergyCalibrator::defaultSmearCorr_
static const EnergyScaleCorrection::SmearCorrection defaultSmearCorr_
Definition: PhotonEnergyCalibrator.h:73
PhotonEnergyCalibrator::calibrate
std::array< float, EGEnergySysIndex::kNrSysErrs > calibrate(reco::Photon &photon, const unsigned int runNumber, const EcalRecHitCollection *recHits, edm::StreamID const &id, const EventType eventType) const
Definition: PhotonEnergyCalibrator.cc:17
reco::Photon
Definition: Photon.h:21
heppy_batch.val
val
Definition: heppy_batch.py:351
PhotonEnergyCalibrator::EventType::DATA
PhotonEnergyCalibrator::gauss
double gauss(edm::StreamID const &id) const
Definition: PhotonEnergyCalibrator.cc:144
EnergyScaleCorrection::ScaleCorrection
Definition: EnergyScaleCorrection.h:39
PhotonEnergyCalibrator::~PhotonEnergyCalibrator
~PhotonEnergyCalibrator()
Definition: PhotonEnergyCalibrator.h:29
StreamID.h