#include <MCTruthCompositeMatcher.h>
Public Member Functions | |
MCTruthCompositeMatcher (const edm::ParameterSet &) | |
~MCTruthCompositeMatcher () | |
Private Types | |
typedef CandMatcher< C1, C2 > ::map_type | map_type |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
std::vector< edm::InputTag > | matchMaps_ |
edm::InputTag | src_ |
Definition at line 13 of file MCTruthCompositeMatcher.h.
typedef CandMatcher<C1, C2>::map_type MCTruthCompositeMatcher< C1, C2 >::map_type [private] |
Definition at line 18 of file MCTruthCompositeMatcher.h.
MCTruthCompositeMatcher< C1, C2 >::MCTruthCompositeMatcher | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 29 of file MCTruthCompositeMatcher.h.
: src_( cfg.template getParameter<edm::InputTag>( "src" ) ), matchMaps_( cfg.template getParameter<std::vector<edm::InputTag> >( "matchMaps" ) ) { produces<map_type>(); }
MCTruthCompositeMatcher< C1, C2 >::~MCTruthCompositeMatcher | ( | ) |
Definition at line 36 of file MCTruthCompositeMatcher.h.
{ }
void MCTruthCompositeMatcher< C1, C2 >::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | |||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 40 of file MCTruthCompositeMatcher.h.
References edm::Event::getByLabel(), i, match(), and edm::Event::put().
{ typedef typename CandMatcher<C1, C2>::reference_type reference_type; Handle<C1> cands; evt.getByLabel(src_, cands); size_t nMaps = matchMaps_.size(); std::vector<const map_type *> maps; maps.reserve( nMaps ); for( size_t i = 0; i != nMaps; ++ i ) { Handle<map_type> matchMap; evt.getByLabel( matchMaps_[i], matchMap ); maps.push_back( & * matchMap ); } MCCandMatcher<C1, C2> match( maps ); auto_ptr<map_type> matchMap( new map_type ); for( size_t i = 0; i != cands->size(); ++ i ) { const typename C1::value_type & cand = ( * cands )[ i ]; reference_type mc(match( cand )); if ( mc.isNonnull() ) { matchMap->insert( reference_type( cands, i ), mc ); } } evt.put( matchMap ); }
std::vector<edm::InputTag> MCTruthCompositeMatcher< C1, C2 >::matchMaps_ [private] |
Definition at line 20 of file MCTruthCompositeMatcher.h.
edm::InputTag MCTruthCompositeMatcher< C1, C2 >::src_ [private] |
Definition at line 19 of file MCTruthCompositeMatcher.h.