Public Member Functions | |
void | endJob () |
IsoTracks (const edm::ParameterSet &iConfig) | |
void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
virtual | ~IsoTracks () |
Private Attributes | |
double | coneRadius_ |
edm::InputTag | src_ |
double | threshold_ |
Definition at line 21 of file IsoTracks.cc.
IsoTracks::IsoTracks | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 46 of file IsoTracks.cc.
Referenced by produce().
: src_ (iConfig.getParameter<edm::InputTag>("src")) , coneRadius_(iConfig.getParameter<double>("radius")) , threshold_ (iConfig.getParameter<double>("SumPtFraction")) { produces<std::vector<reco::Track> >(); }
IsoTracks::~IsoTracks | ( | ) | [virtual] |
Definition at line 55 of file IsoTracks.cc.
{}
void IsoTracks::endJob | ( | void | ) | [virtual] |
void IsoTracks::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 62 of file IsoTracks.cc.
References coneRadius_, deltaR(), eta(), edm::Event::getByLabel(), IsoTracks(), phi, edm::Event::put(), src_, and threshold_.
{ std::auto_ptr<std::vector<reco::Track> > IsoTracks(new std::vector<reco::Track >); edm::Handle< std::vector<reco::Track> > dirtyTracks; iEvent.getByLabel(src_,dirtyTracks); if( dirtyTracks->size() == 0 ) { iEvent.put(IsoTracks); return ; } std::vector<reco::Track>::const_iterator dirtyTrackIt ; std::vector<reco::Track>::const_iterator dirtyTrackIt2 ; // typename std::vector<reco::Track>::const_iterator dirtyTrackIt ; // typename std::vector<reco::Track>::const_iterator dirtyTrackIt2 ; double sumPtInCone = 0 ; for ( dirtyTrackIt = dirtyTracks->begin(); dirtyTrackIt != dirtyTracks->end(); ++dirtyTrackIt ) { for ( dirtyTrackIt2 = dirtyTracks->begin(); dirtyTrackIt2 != dirtyTracks->end(); ++dirtyTrackIt2 ) { if ( dirtyTrackIt == dirtyTrackIt2) continue ; if ( deltaR(dirtyTrackIt -> eta() , dirtyTrackIt -> phi() , dirtyTrackIt2 -> eta() , dirtyTrackIt2 -> phi() ) < coneRadius_ ){ sumPtInCone = sumPtInCone + dirtyTrackIt2 -> pt() ; } } if ( sumPtInCone <= threshold_*(dirtyTrackIt->pt()) ){ IsoTracks -> push_back( *dirtyTrackIt ) ; } } iEvent.put(IsoTracks); }
double IsoTracks::coneRadius_ [private] |
Definition at line 35 of file IsoTracks.cc.
Referenced by produce().
edm::InputTag IsoTracks::src_ [private] |
Definition at line 34 of file IsoTracks.cc.
Referenced by produce().
double IsoTracks::threshold_ [private] |
Definition at line 36 of file IsoTracks.cc.
Referenced by produce().