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
#ifndef SimplePhoton_STANDALONE
#include "EgammaAnalysis/ElectronTools/interface/SimplePhoton.h"

SimplePhoton::SimplePhoton(const reco::Photon &in, unsigned int runNumber, bool isMC)
    : run_(runNumber),
      eClass_(-1),
      r9_(in.full5x5_r9()),
      scEnergy_(in.superCluster()->rawEnergy() + (in.isEB() ? 0 : in.superCluster()->preshowerEnergy())),
      scEnergyError_(-999.),  // FIXME???
      regEnergy_(in.getCorrectedEnergy(reco::Photon::P4type::regression2)),
      regEnergyError_(in.getCorrectedEnergyError(reco::Photon::P4type::regression2)),
      eta_(in.superCluster()->eta()),
      isEB_(in.isEB()),
      isMC_(isMC),
      newEnergy_(regEnergy_),
      newEnergyError_(regEnergyError_),
      scale_(1.0),
      smearing_(0.0) {}

void SimplePhoton::writeTo(reco::Photon &out) const {
  out.setCorrectedEnergy(reco::Photon::P4type::regression2, getNewEnergy(), getNewEnergyError(), true);
}
#endif