9 #include "CLHEP/Vector/LorentzVector.h" 29 float isoConeElectron)
const {
35 float isoConeMuon)
const {
42 float isoCone)
const {
44 float isoPtLepton = 0;
45 const reco::Track *closestTrackDRPt =
nullptr, *closestTrackDR =
nullptr;
46 float closestDRPt = 10000, closestDR = 10000;
49 CLHEP::HepLorentzVector lepton(theTrack.
px(), theTrack.
py(), theTrack.
pz(), theTrack.
p());
51 CLHEP::HepLorentzVector
track(itTrack->px(), itTrack->py(), itTrack->pz(), itTrack->p());
52 float dR = lepton.deltaR(
track);
54 isoPtLepton +=
track.perp();
57 float pRatio =
track.perp() / lepton.perp();
58 if (dR < closestDRPt && pRatio > 0.5 && pRatio < 1.5) {
60 closestTrackDRPt = &*itTrack;
64 closestTrackDR = &*itTrack;
68 if (closestTrackDRPt) {
69 GlobalVector closestTrackVector(closestTrackDRPt->
px(), closestTrackDRPt->
py(), closestTrackDRPt->
pz());
70 isoPtLepton -= closestTrackVector.
perp();
71 }
else if (closestTrackDR) {
72 GlobalVector closestTrackVector(closestTrackDR->px(), closestTrackDR->py(), closestTrackDR->pz());
73 isoPtLepton -= closestTrackVector.
perp();
double p() const
momentum vector magnitude
TrackerIsolationPt()
constructor
double px() const
x coordinate of momentum vector
reco::TrackRef track() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
virtual ~TrackerIsolationPt()
destructor
const_iterator begin() const
double pz() const
z coordinate of momentum vector
float calculate(const Electron &theElectron, const edm::View< reco::Track > &theTracks, float isoConeElectron=0.3) const
calculate the TrackIsoPt for the lepton object
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const_iterator end() const
reco::GsfTrackRef gsfTrack() const override
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
double py() const
y coordinate of momentum vector