1 #ifndef PhysicsTools_TagAndProbe_MatchedProbeMaker_H
2 #define PhysicsTools_TagAndProbe_MatchedProbeMaker_H
29 template<
typename T >
42 virtual void endJob()
override;
53 template<
typename T >
55 m_candidateSource(iConfig.getUntrackedParameter<edm::
InputTag>(
"CandidateSource")),
56 m_referenceSource(iConfig.getUntrackedParameter<edm::
InputTag>(
"ReferenceSource")),
57 m_resMatchMapSource(iConfig.getUntrackedParameter<edm::
InputTag>(
"ResMatchMapSource",edm::
InputTag(
"Dummy"))),
58 matched_(iConfig.getUntrackedParameter< bool >(
"Matched",
true))
61 produces< edm::RefVector< collection > >();
65 template<
typename T >
69 template<
typename T >
90 if(iEvent.
getByLabel(m_resMatchMapSource,ResMatchMap)){
92 for (
unsigned i=0;
i<Cands->size();
i++) {
98 if( f!=ResMatchMap->end() ) {
99 outputCollection_matched->push_back(CandRef);
101 outputCollection_unmatched->push_back(CandRef);
108 for (
unsigned i=0;
i<Cands->size();
i++) {
115 for (
unsigned j=0;
j<Refs->size();
j++) {
120 if(
overlap(*CandRef,*RefRef)) {
125 if( ppass ) outputCollection_matched->push_back(CandRef);
126 else outputCollection_unmatched->push_back(CandRef);
130 if(matched_) iEvent.
put(
std::move(outputCollection_matched));
136 template<
typename T >
142 template<
typename T >
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
virtual void endJob() override
friend struct const_iterator
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
edm::InputTag m_referenceSource
virtual void beginJob() override
edm::InputTag m_resMatchMapSource
edm::InputTag m_candidateSource
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< T > collection
MatchedProbeMaker(const edm::ParameterSet &iConfig)
virtual void produce(edm::Event &, const edm::EventSetup &) override