#include <PhysicsTools/PatAlgos/plugins/PATTriggerMatchEmbedder.cc>
Public Member Functions | |
PATTriggerMatchEmbedder (const edm::ParameterSet &iConfig) | |
~PATTriggerMatchEmbedder () | |
Private Member Functions | |
virtual void | produce (edm::Event &iEvent, const edm::EventSetup &iSetup) |
Private Attributes | |
std::vector< edm::InputTag > | matches_ |
edm::InputTag | src_ |
Definition at line 41 of file PATTriggerMatchEmbedder.cc.
PATTriggerMatchEmbedder::PATTriggerMatchEmbedder | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 71 of file PATTriggerMatchEmbedder.cc.
: src_( iConfig.getParameter< edm::InputTag >( "src" ) ), matches_( iConfig.getParameter< std::vector< edm::InputTag > >( "matches" ) ) { produces< std::vector< PATObjectType > >(); }
pat::PATTriggerMatchEmbedder< PATObjectType >::~PATTriggerMatchEmbedder | ( | ) | [inline] |
Definition at line 49 of file PATTriggerMatchEmbedder.cc.
{};
void PATTriggerMatchEmbedder::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 79 of file PATTriggerMatchEmbedder.cc.
References edm::Event::getByLabel(), getHLTprescales::index, edm::HandleBase::isValid(), match(), convertSQLitetoXML_cfg::output, and edm::Event::put().
{ std::auto_ptr< std::vector< PATObjectType > > output( new std::vector< PATObjectType >() ); edm::Handle< edm::View< PATObjectType > > candidates; iEvent.getByLabel( src_, candidates ); if ( ! candidates.isValid() ) { edm::LogError( "missingInputSource" ) << "Input source with InputTag " << src_.encode() << " not in event."; return; } for ( typename edm::View< PATObjectType >::const_iterator iCand = candidates->begin(); iCand != candidates->end(); ++iCand ) { const unsigned index( iCand - candidates->begin() ); PATObjectType cand( candidates->at( index ) ); std::set< TriggerObjectStandAloneRef > cachedRefs; for ( size_t iMatch = 0; iMatch < matches_.size(); ++iMatch ) { edm::Handle< TriggerObjectStandAloneMatch > match; iEvent.getByLabel( matches_.at( iMatch ), match ); if ( ! match.isValid() ) { edm::LogError( "missingInputMatch" ) << "Input match with InputTag " << matches_.at( iMatch ).encode() << " not in event."; continue; } const TriggerObjectStandAloneRef trigRef( ( *match )[ candidates->refAt( index ) ] ); if ( trigRef.isNonnull() && trigRef.isAvailable() ) { if ( cachedRefs.insert( trigRef ).second ) { // protection from multiple entries of the same trigger objects cand.addTriggerObjectMatch( *trigRef ); } } } output->push_back( cand ); } iEvent.put( output ); }
std::vector< edm::InputTag > pat::PATTriggerMatchEmbedder< PATObjectType >::matches_ [private] |
Definition at line 44 of file PATTriggerMatchEmbedder.cc.
edm::InputTag pat::PATTriggerMatchEmbedder< PATObjectType >::src_ [private] |
Definition at line 43 of file PATTriggerMatchEmbedder.cc.