Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef ElectronEnergyCalibratorRun2_h
0002 #define ElectronEnergyCalibratorRun2_h
0003 
0004 #include <TRandom.h>
0005 #include "EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h"
0006 #include "EgammaAnalysis/ElectronTools/interface/SimpleElectron.h"
0007 #include "EgammaAnalysis/ElectronTools/interface/EpCombinationTool.h"
0008 #include "FWCore/Utilities/interface/StreamID.h"
0009 
0010 #include <vector>
0011 
0012 class ElectronEnergyCalibratorRun2 {
0013 public:
0014   // dummy constructor for persistence
0015   ElectronEnergyCalibratorRun2() {}
0016 
0017   // further configuration will be added when we will learn how it will work
0018   ElectronEnergyCalibratorRun2(EpCombinationTool &combinator, bool isMC, bool synchronization, std::string);
0019   ~ElectronEnergyCalibratorRun2();
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(SimpleElectron &electron, 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::GsfElectron &electron,
0032                  unsigned int runNumber,
0033                  edm::StreamID const &id = edm::StreamID::invalidStreamID()) const;
0034 
0035 protected:
0036   // whatever data will be needed
0037   EpCombinationTool *epCombinationTool_;
0038   bool isMC_, synchronization_;
0039   TRandom *rng_;
0040 
0041   /// Return a number distributed as a unit gaussian, drawn from the private RNG if initPrivateRng was called,
0042   /// or from the CMSSW RandomNumberGenerator service
0043   /// If synchronization is set to true, it returns a fixed number (1.0)
0044   double gauss(edm::StreamID const &id) const;
0045   EnergyScaleCorrection_class _correctionRetriever;
0046 };
0047 
0048 #endif