Public Member Functions | |
bool | filter (edm::Event &event, const edm::EventSetup &setup) |
RequireModule (const edm::ParameterSet &config) | |
virtual | ~RequireModule () |
Private Attributes | |
edm::InputTag | m_requirement |
Definition at line 12 of file RequireModule.cc.
RequireModule::RequireModule | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 25 of file RequireModule.cc.
00025 : 00026 m_requirement( config.getParameter<edm::InputTag>("requirement") ) 00027 { 00028 }
RequireModule::~RequireModule | ( | ) | [virtual] |
bool RequireModule::filter | ( | edm::Event & | event, | |
const edm::EventSetup & | setup | |||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 34 of file RequireModule.cc.
References and, edm::Event::get(), i, edm::InputTag::instance(), edm::Handle< T >::isValid(), edm::InputTag::label(), m_requirement, and edm::InputTag::process().
00035 { 00036 bool found = false; 00037 00038 std::vector<const edm::Provenance *> provenances; 00039 event.getAllProvenance(provenances); 00040 00041 edm::ArbitraryHandle handle; 00042 for (unsigned int i = 0; i < provenances.size(); ++i) { 00043 if ((m_requirement.label() == provenances[i]->moduleLabel()) and 00044 (m_requirement.instance() == provenances[i]->productInstanceName()) and 00045 (m_requirement.process() == provenances[i]->processName() or m_requirement.process() == "") and 00046 event.get(provenances[i]->productID(), handle) and 00047 handle.isValid() 00048 ) { 00049 found = true; 00050 break; 00051 } 00052 } 00053 00054 return found; 00055 }
edm::InputTag RequireModule::m_requirement [private] |