Calculates a lepton's calorimetric isolation energy. More...
#include <PhysicsTools/PatUtils/interface/CaloIsolationEnergy.h>
Public Member Functions | |
float | calculate (const Electron &anElectron, const std::vector< CaloTower > &theTowers, float isoConeElectron=0.3) const |
calculate the CalIsoE from the lepton object | |
float | calculate (const Muon &aMuon, const std::vector< CaloTower > &theTowers, float isoConeMuon=0.3) const |
CaloIsolationEnergy () | |
constructor | |
virtual | ~CaloIsolationEnergy () |
destructor | |
Private Member Functions | |
float | calculate (const reco::Track &track, const float leptonEnergy, const std::vector< CaloTower > &theTowers, float isoCone) const |
calculate the CalIsoE from the lepton's track |
Calculates a lepton's calorimetric isolation energy.
CaloIsolationEnergy calculates a calorimetric isolation energy in a half-cone (dependent on the lepton's charge) around the lepton's impact position on the ECAL surface, as defined in CMS Note 2006/024
Definition at line 33 of file CaloIsolationEnergy.h.
CaloIsolationEnergy::CaloIsolationEnergy | ( | ) |
CaloIsolationEnergy::~CaloIsolationEnergy | ( | ) | [virtual] |
float CaloIsolationEnergy::calculate | ( | const Electron & | anElectron, |
const std::vector< CaloTower > & | theTowers, | ||
float | isoConeElectron = 0.3 |
||
) | const |
calculate the CalIsoE from the lepton object
Definition at line 26 of file CaloIsolationEnergy.cc.
References reco::GsfElectron::caloEnergy(), reco::LeafCandidate::energy(), and pat::Electron::gsfTrack().
Referenced by calculate().
{ float isoE = this->calculate(*theElectron.gsfTrack(), theElectron.energy(), theTowers, isoConeElectron); return isoE - theElectron.caloEnergy(); }
float CaloIsolationEnergy::calculate | ( | const reco::Track & | track, |
const float | leptonEnergy, | ||
const std::vector< CaloTower > & | theTowers, | ||
float | isoCone | ||
) | const [private] |
calculate the CalIsoE from the lepton's track
Definition at line 36 of file CaloIsolationEnergy.cc.
References dPhi(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, reco::TrackBase::eta(), M_PI, reco::TrackBase::phi(), funct::pow(), and mathSSE::sqrt().
{ float isoELepton = 0; // calculate iso energy //const CaloTower * closestTower = 0; float closestDR = 10000; for (std::vector<CaloTower>::const_iterator itTower = theTowers.begin(); itTower != theTowers.end(); itTower++) { // calculate dPhi with correct sign float dPhi = theTrack.phi() - itTower->phi(); if (dPhi > M_PI) dPhi = -2*M_PI + dPhi; if (dPhi < -M_PI) dPhi = 2*M_PI + dPhi; // calculate dR float dR = sqrt(std::pow(theTrack.eta()-itTower->eta(), 2) + std::pow(dPhi, 2)); // calculate energy in cone around direction at vertex of the track if (dR < isoCone) { isoELepton += itTower->energy(); if (dR < closestDR) { closestDR = dR; //closestTower = &(*itTower); } } } // subtract track deposits from total energy in cone // if (closestTower) isoELepton -= closestTower->energy(); // return the iso energy return isoELepton; }
float CaloIsolationEnergy::calculate | ( | const Muon & | aMuon, |
const std::vector< CaloTower > & | theTowers, | ||
float | isoConeMuon = 0.3 |
||
) | const |
Definition at line 30 of file CaloIsolationEnergy.cc.
References calculate(), reco::LeafCandidate::energy(), and pat::Muon::track().
{ return this->calculate(*theMuon.track(), theMuon.energy(), theTowers, isoConeMuon); }