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,
48  const EcalRecHitCollection* recHits,
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,
58  reco::Photon& photon,
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
EnergyScaleCorrection correctionRetriever_
void initPrivateRng(TRandom *rnd)
static const EnergyScaleCorrection::ScaleCorrection defaultScaleCorr_
static const EnergyScaleCorrection::SmearCorrection defaultSmearCorr_
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
std::array< float, EGEnergySysIndex::kNrSysErrs > calibrate(reco::Photon &photon, const unsigned int runNumber, const EcalRecHitCollection *recHits, edm::StreamID const &id, const EventType eventType) const