#include <dRxyCalculator.h>
Public Member Functions | |
dRxyCalculator (const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::InputTag trackLabel) | |
double | getDRxy (const reco::Photon cluster, double x, double y) |
Private Member Functions | |
double | calcDphi (double phi1_, double phi2_) |
double | dRDistance (double eta1, double phi1, double eta2, double phi2) |
Private Attributes | |
edm::Handle < reco::TrackCollection > | recCollection |
Definition at line 26 of file dRxyCalculator.h.
dRxyCalculator::dRxyCalculator | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup, | ||
edm::InputTag | trackLabel | ||
) |
Definition at line 13 of file dRxyCalculator.cc.
References edm::Event::getByLabel().
{ // Get reconstructed tracks iEvent.getByLabel(trackLabel, recCollection); // !! }
double dRxyCalculator::calcDphi | ( | double | phi1_, |
double | phi2_ | ||
) | [inline, private] |
double dRxyCalculator::dRDistance | ( | double | eta1, |
double | phi1, | ||
double | eta2, | ||
double | phi2 | ||
) | [inline, private] |
Definition at line 33 of file dRxyCalculator.h.
References calcDphi(), and mathSSE::sqrt().
double dRxyCalculator::getDRxy | ( | const reco::Photon | cluster, |
double | x, | ||
double | y | ||
) |
Definition at line 20 of file dRxyCalculator.cc.
References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, reco::LeafCandidate::eta(), reco::LeafCandidate::phi(), L1Trigger_dataformats::reco, python::multivaluedict::sort(), and detailsBasic3DVector::y.
Referenced by HiEgammaIsolationProducer::produce().
{ using namespace edm; using namespace reco; double eta1 = p.eta(); double phi1 = p.phi(); std::vector<double> Rxy; for(reco::TrackCollection::const_iterator recTrack = recCollection->begin(); recTrack!= recCollection->end(); recTrack++) { double pt = recTrack->pt(); double eta2 = recTrack->eta(); double phi2 = recTrack->phi(); if(pt < x * 0.4) continue; double dR = dRDistance(eta1,phi1,eta2,phi2); if(Rxy.size() < y+1) { Rxy.push_back(dR); sort(Rxy.begin(), Rxy.end()); continue; } if(dR < Rxy[Rxy.size()-1]) { Rxy[Rxy.size()-1] = dR; sort(Rxy.begin(), Rxy.end()); } } double rxy = 4; if (Rxy.size()<y) rxy=4; else rxy = Rxy[(int)y-1]; Rxy.clear(); return rxy; }
Definition at line 56 of file dRxyCalculator.h.