EcalIsolationCorrector

RunRange

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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
//
// to use this code outside of CMSSW
// set this definition
//

//#define STANDALONE_ECALCORR
#ifndef STANDALONE_ECALCORR
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
#include "DataFormats/EgammaCandidates/interface/Photon.h"
#include "DataFormats/PatCandidates/interface/Electron.h"
#include "DataFormats/PatCandidates/interface/Photon.h"
#endif

#include <string>
#include <iostream>

class EcalIsolationCorrector {
public:
  enum RunRange { RunAB, RunC, RunD };

  EcalIsolationCorrector(bool forElectrons);
  ~EcalIsolationCorrector() {}

#ifndef STANDALONE_ECALCORR
  // Global correction for ABCD together
  float correctForNoise(
      reco::GsfElectron e, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForNoise(reco::GsfElectron e, int runNumber, bool isData = false);
  float correctForNoise(reco::GsfElectron e, std::string runName, bool isData = false);

  // Global correction for ABCD together
  float correctForHLTDefinition(
      reco::GsfElectron e, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForHLTDefinition(reco::GsfElectron e, int runNumber, bool isData = false);
  float correctForHLTDefinition(reco::GsfElectron e, std::string runName, bool isData = false);

  // Global correction for ABCD together
  float correctForNoise(
      reco::Photon p, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForNoise(reco::Photon p, int runNumber, bool isData = false);
  float correctForNoise(reco::Photon p, std::string runName, bool isData = false);

  // Global correction for ABCD together
  float correctForHLTDefinition(
      reco::Photon p, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForHLTDefinition(reco::Photon p, int runNumber, bool isData = false);
  float correctForHLTDefinition(reco::Photon p, std::string runName, bool isData = false);

  // Global correction for ABCD together
  float correctForNoise(
      pat::Electron e, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForNoise(pat::Electron e, int runNumber, bool isData = false);
  float correctForNoise(pat::Electron e, std::string runName, bool isData = false);

  // Global correction for ABCD together
  float correctForHLTDefinition(
      pat::Electron e, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForHLTDefinition(pat::Electron e, int runNumber, bool isData = false);
  float correctForHLTDefinition(pat::Electron e, std::string runName, bool isData = false);

  // Global correction for ABCD together
  float correctForNoise(pat::Photon p, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForNoise(pat::Photon p, int runNumber, bool isData = false);
  float correctForNoise(pat::Photon p, std::string runName, bool isData = false);

  // Global correction for ABCD together
  float correctForHLTDefinition(
      pat::Photon p, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForHLTDefinition(pat::Photon p, int runNumber, bool isData = false);
  float correctForHLTDefinition(pat::Photon p, std::string runName, bool isData = false);
#else
  // Global correction for ABCD together
  float correctForNoise(
      float unCorrIso, bool isBarrel, bool isData = false, float intL_AB = 5.5, float intL_C = 6.7, float intL_D = 7.3);
  // Run dependent correction
  float correctForNoise(float unCorrIso, bool isBarrel, int runNumber, bool isData = false);
  float correctForNoise(float unCorrIso, bool isBarrel, std::string runName, bool isData = false);

  // Global correction for ABCD together
  float correctForHLTDefinition(float unCorrIso,
                                bool isBarrrel,
                                bool isData = false,
                                float intL_AB = 5.5,
                                float intL_C = 6.7,
                                float intL_D = 7.3);
  // Run dependent correction
  float correctForHLTDefinition(float unCorrIso, bool isBarrel, int runNumber, bool isData = false);
  float correctForHLTDefinition(float unCorrIso, bool isBarrel, std::string runName, bool isData = false);
#endif

protected:
  RunRange checkRunRange(int runNumber);
  float correctForNoise(float iso, bool isBarrel, RunRange runRange, bool isData);
  float correctForHLTDefinition(float iso, bool isBarrel, RunRange runRange);

private:
  bool isElectron_;
};