#include <IPTCorrector.h>
Public Member Functions | |
IPTCorrector (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &evt, const edm::EventSetup &es) |
~IPTCorrector () | |
Private Attributes | |
double | assocCone_ |
edm::InputTag | corSource_ |
edm::InputTag | uncorSource_ |
Definition at line 22 of file IPTCorrector.h.
IPTCorrector::IPTCorrector | ( | const edm::ParameterSet & | ps | ) |
Definition at line 22 of file IPTCorrector.cc.
References assocCone_, corSource_, edm::ParameterSet::getParameter(), and uncorSource_.
{ corSource_=config.getParameter<edm::InputTag>("corTracksLabel"); uncorSource_=config.getParameter<edm::InputTag>("filterLabel"); assocCone_=config.getParameter<double>("associationCone"); // Register the product produces< reco::IsolatedPixelTrackCandidateCollection >(); }
IPTCorrector::~IPTCorrector | ( | ) |
Definition at line 33 of file IPTCorrector.cc.
{}
void IPTCorrector::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 36 of file IPTCorrector.cc.
References assocCone_, corSource_, deltaR(), edm::Event::getByLabel(), L1TEmulatorMonitor_cff::p, edm::Event::put(), trigger::TriggerTrack, and uncorSource_.
{ reco::IsolatedPixelTrackCandidateCollection * trackCollection=new reco::IsolatedPixelTrackCandidateCollection; edm::Handle<reco::TrackCollection> corTracks; theEvent.getByLabel(corSource_,corTracks); edm::Handle<trigger::TriggerFilterObjectWithRefs> fiCand; theEvent.getByLabel(uncorSource_,fiCand); std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs; fiCand->getObjects(trigger::TriggerTrack, isoPixTrackRefs); int nCand=isoPixTrackRefs.size(); //loop over input ipt for (int p=0; p<nCand; p++) { double iptEta=isoPixTrackRefs[p]->track()->eta(); double iptPhi=isoPixTrackRefs[p]->track()->phi(); int ntrk=0; double minDR=100; reco::TrackCollection::const_iterator citSel; for (reco::TrackCollection::const_iterator cit=corTracks->begin(); cit!=corTracks->end(); cit++) { double dR=deltaR(cit->eta(), cit->phi(), iptEta, iptPhi); if (dR<minDR&&dR<assocCone_) { minDR=dR; ntrk++; citSel=cit; } } if (ntrk>0) { reco::IsolatedPixelTrackCandidate newCandidate(reco::TrackRef(corTracks,citSel-corTracks->begin()), isoPixTrackRefs[p]->l1tau(),isoPixTrackRefs[p]->maxPtPxl(), isoPixTrackRefs[p]->sumPtPxl()); trackCollection->push_back(newCandidate); } } // put the product in the event std::auto_ptr< reco::IsolatedPixelTrackCandidateCollection > outCollection(trackCollection); theEvent.put(outCollection); }
double IPTCorrector::assocCone_ [private] |
Definition at line 35 of file IPTCorrector.h.
Referenced by IPTCorrector(), and produce().
edm::InputTag IPTCorrector::corSource_ [private] |
Definition at line 33 of file IPTCorrector.h.
Referenced by IPTCorrector(), and produce().
edm::InputTag IPTCorrector::uncorSource_ [private] |
Definition at line 34 of file IPTCorrector.h.
Referenced by IPTCorrector(), and produce().