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 {
22  public:
23  enum class EventType{
24  DATA,
25  MC,
26  };
27 
31 
34  void initPrivateRng(TRandom *rnd) ;
35 
36  //set the minimum et to apply the correction to
37  void setMinEt(float val){minEt_=val;}
38 
41  std::array<float,EGEnergySysIndex::kNrSysErrs>
42  calibrate(reco::Photon &photon, const unsigned int runNumber,
43  const EcalRecHitCollection* recHits, edm::StreamID const & id, const EventType eventType) const ;
44 
45  std::array<float,EGEnergySysIndex::kNrSysErrs>
46  calibrate(reco::Photon &photon, const unsigned int runNumber,
47  const EcalRecHitCollection* recHits, const float smearNrSigma,
48  const EventType eventType) const ;
49 
50 private:
51  void setEnergyAndSystVarations(const float scale,const float smearNrSigma,const float et,
54  reco::Photon& photon,
55  std::array<float,EGEnergySysIndex::kNrSysErrs>& energyData)const;
56 
60  double gauss(edm::StreamID const& id) const ;
61 
62  // whatever data will be needed
64  TRandom *rng_; //this is not owned
65  float minEt_;
66 
67  //default values to access if no correction availible
70 
71 };
72 
73 #endif
EnergyScaleCorrection correctionRetriever_
void initPrivateRng(TRandom *rnd)
static const EnergyScaleCorrection::ScaleCorrection defaultScaleCorr_
static const EnergyScaleCorrection::SmearCorrection defaultSmearCorr_
et
define resolution functions of each parameter
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