CMS 3D CMS Logo

RequireModule Class Reference

Inheritance diagram for RequireModule:

edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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


Detailed Description

Definition at line 12 of file RequireModule.cc.


Constructor & Destructor Documentation

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]

Definition at line 30 of file RequireModule.cc.

00031 {
00032 }


Member Function Documentation

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 }


Member Data Documentation

edm::InputTag RequireModule::m_requirement [private]

Definition at line 21 of file RequireModule.cc.

Referenced by filter().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:30:44 2009 for CMSSW by  doxygen 1.5.4