ElectronEnergyCalibratorRun2

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#ifndef ElectronEnergyCalibratorRun2_h
#define ElectronEnergyCalibratorRun2_h

#include <TRandom.h>
#include "EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h"
#include "EgammaAnalysis/ElectronTools/interface/SimpleElectron.h"
#include "EgammaAnalysis/ElectronTools/interface/EpCombinationTool.h"
#include "FWCore/Utilities/interface/StreamID.h"

#include <vector>

class ElectronEnergyCalibratorRun2 {
public:
  // dummy constructor for persistence
  ElectronEnergyCalibratorRun2() {}

  // further configuration will be added when we will learn how it will work
  ElectronEnergyCalibratorRun2(EpCombinationTool &combinator, bool isMC, bool synchronization, std::string);
  ~ElectronEnergyCalibratorRun2();

  /// Initialize with a random number generator (if not done, it will use the CMSSW service)
  /// Caller code owns the TRandom.
  void initPrivateRng(TRandom *rnd);

  /// Correct this electron.
  /// StreamID is needed when used with CMSSW Random Number Generator
  void calibrate(SimpleElectron &electron, edm::StreamID const &id = edm::StreamID::invalidStreamID()) const;

  /// Correct this electron.
  /// StreamID is needed when used with CMSSW Random Number Generator
  void calibrate(reco::GsfElectron &electron,
                 unsigned int runNumber,
                 edm::StreamID const &id = edm::StreamID::invalidStreamID()) const;

protected:
  // whatever data will be needed
  EpCombinationTool *epCombinationTool_;
  bool isMC_, synchronization_;
  TRandom *rng_;

  /// Return a number distributed as a unit gaussian, drawn from the private RNG if initPrivateRng was called,
  /// or from the CMSSW RandomNumberGenerator service
  /// If synchronization is set to true, it returns a fixed number (1.0)
  double gauss(edm::StreamID const &id) const;
  EnergyScaleCorrection_class _correctionRetriever;
};

#endif