#include <MatchedProbeMaker.h>
Public Types | |
typedef std::vector< T > | collection |
Public Member Functions | |
MatchedProbeMaker (const edm::ParameterSet &iConfig) | |
~MatchedProbeMaker () | |
Private Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::InputTag | m_candidateSource |
edm::InputTag | m_referenceSource |
edm::InputTag | m_resMatchMapSource |
bool | matched_ |
Definition at line 30 of file MatchedProbeMaker.h.
typedef std::vector< T > MatchedProbeMaker< T >::collection |
Definition at line 33 of file MatchedProbeMaker.h.
MatchedProbeMaker< T >::MatchedProbeMaker | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 54 of file MatchedProbeMaker.h.
: m_candidateSource(iConfig.getUntrackedParameter<edm::InputTag>("CandidateSource")), m_referenceSource(iConfig.getUntrackedParameter<edm::InputTag>("ReferenceSource")), m_resMatchMapSource(iConfig.getUntrackedParameter<edm::InputTag>("ResMatchMapSource",edm::InputTag("Dummy"))), matched_(iConfig.getUntrackedParameter< bool >("Matched",true)) { //register your products produces< edm::RefVector< collection > >(); }
MatchedProbeMaker< T >::~MatchedProbeMaker | ( | ) |
Definition at line 66 of file MatchedProbeMaker.h.
{}
void MatchedProbeMaker< T >::beginJob | ( | void | ) | [private, virtual] |
void MatchedProbeMaker< T >::endJob | ( | void | ) | [private, virtual] |
void MatchedProbeMaker< T >::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 70 of file MatchedProbeMaker.h.
References f, edm::Event::getByLabel(), i, j, LogDebug, muon::overlap(), edm::Event::put(), and dt_dqm_sourceclient_common_cff::reco.
{ LogDebug("MatchedProbeMaker"); using namespace edm; using namespace reco; std::auto_ptr< edm::RefVector< collection > > outputCollection_matched( new edm::RefVector< collection > ); std::auto_ptr< edm::RefVector< collection > > outputCollection_unmatched(new edm::RefVector< collection > ); // Get the candidates from the event edm::Handle< edm::RefVector< collection > > Cands; iEvent.getByLabel(m_candidateSource,Cands); edm::Handle< reco::CandidateView > Refs; iEvent.getByLabel(m_referenceSource,Refs); // Get the resolution matching map from the event edm::Handle<reco::CandViewMatchMap> ResMatchMap; if(iEvent.getByLabel(m_resMatchMapSource,ResMatchMap)){ // Loop over the candidates looking for a match for (unsigned i=0; i<Cands->size(); i++) { const edm::Ref< collection > CandRef = (*Cands)[i]; reco::CandidateBaseRef candBaseRef( CandRef ); // Loop over match map reco::CandViewMatchMap::const_iterator f = ResMatchMap->find( candBaseRef ); if( f!=ResMatchMap->end() ) { outputCollection_matched->push_back(CandRef); } else { outputCollection_unmatched->push_back(CandRef); } } } else { OverlapChecker overlap; // Loop over the candidates looking for a match for (unsigned i=0; i<Cands->size(); i++) { const edm::Ref< collection > CandRef = (*Cands)[i]; //RefToBase<Candidate> CandRef(Cands, i); reco::CandidateBaseRef candBaseRef( CandRef ); bool ppass = false; for (unsigned j=0; j<Refs->size(); j++) { //const edm::Ref< collection > RefRef = (*Refs)[j]; RefToBase<Candidate> RefRef(Refs, j); reco::CandidateBaseRef refBaseRef( RefRef ); if(overlap(*CandRef,*RefRef)) { ppass = true; } } if( ppass ) outputCollection_matched->push_back(CandRef); else outputCollection_unmatched->push_back(CandRef); } } if( matched_ ) iEvent.put( outputCollection_matched ); else iEvent.put( outputCollection_unmatched ); }
edm::InputTag MatchedProbeMaker< T >::m_candidateSource [private] |
Definition at line 45 of file MatchedProbeMaker.h.
edm::InputTag MatchedProbeMaker< T >::m_referenceSource [private] |
Definition at line 46 of file MatchedProbeMaker.h.
edm::InputTag MatchedProbeMaker< T >::m_resMatchMapSource [private] |
Definition at line 47 of file MatchedProbeMaker.h.
bool MatchedProbeMaker< T >::matched_ [private] |
Definition at line 49 of file MatchedProbeMaker.h.