Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:16

0001 #ifndef PhotonEnergyCalibratorRun2_h
0002 #define PhotonEnergyCalibratorRun2_h
0003 
0004 #include <TRandom.h>
0005 #include "EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h"
0006 #include "EgammaAnalysis/ElectronTools/interface/SimplePhoton.h"
0007 #include "FWCore/Utilities/interface/StreamID.h"
0008 
0009 #include <vector>
0010 
0011 class PhotonEnergyCalibratorRun2 {
0012 public:
0013   // dummy constructor for persistence
0014   PhotonEnergyCalibratorRun2() {}
0015 
0016   // further configuration will be added when we will learn how it will work
0017   PhotonEnergyCalibratorRun2(bool isMC, bool synchronization, std::string correctionFile);
0018 
0019   ~PhotonEnergyCalibratorRun2();
0020 
0021   /// Initialize with a random number generator (if not done, it will use the CMSSW service)
0022   /// Caller code owns the TRandom.
0023   void initPrivateRng(TRandom *rnd);
0024 
0025   /// Correct this electron.
0026   /// StreamID is needed when used with CMSSW Random Number Generator
0027   void calibrate(SimplePhoton &photon, edm::StreamID const &id = edm::StreamID::invalidStreamID()) const;
0028 
0029   /// Correct this electron.
0030   /// StreamID is needed when used with CMSSW Random Number Generator
0031   void calibrate(reco::Photon &photon,
0032                  unsigned int runNumber,
0033                  edm::StreamID const &id = edm::StreamID::invalidStreamID()) const;
0034 
0035 protected:
0036   // whatever data will be needed
0037   bool isMC_, synchronization_;
0038   TRandom *rng_;
0039   std::vector<double> smearings_;
0040   std::vector<double> scales_;
0041 
0042   /// Return a number distributed as a unit gaussian, drawn from the private RNG if initPrivateRng was called,
0043   /// or from the CMSSW RandomNumberGenerator service
0044   /// If synchronization is set to true, it returns a fixed number (1.0)
0045   double gauss(edm::StreamID const &id) const;
0046   EnergyScaleCorrection_class _correctionRetriever;
0047 };
0048 
0049 #endif