#include <DPGAnalysis/SiStripTools/plugins/SiStripDetWithSomething.cc>
Public Member Functions | |
SiStripDetWithSomething (const edm::ParameterSet &) | |
~SiStripDetWithSomething () | |
Private Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::InputTag | _digicollection |
std::vector< unsigned int > | _wantedmod |
Description: template EDFilter to select events with selected modules with SiStripDigis or SiStripClusters
Implementation:
Definition at line 48 of file SiStripDetWithSomething.cc.
SiStripDetWithSomething< T >::SiStripDetWithSomething | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 77 of file SiStripDetWithSomething.cc.
References SiStripDetWithSomething< T >::_wantedmod, mod(), and python::multivaluedict::sort().
: _digicollection(iConfig.getParameter<edm::InputTag>("collectionName")), _wantedmod(iConfig.getUntrackedParameter<std::vector<unsigned int> >("selectedModules")) { //now do what ever initialization is needed sort(_wantedmod.begin(),_wantedmod.end()); edm::LogInfo("SelectedModules") << "Selected module list"; for(std::vector<unsigned int>::const_iterator mod = _wantedmod.begin();mod!=_wantedmod.end();mod++) { edm::LogVerbatim("SelectedModules") << *mod ; } }
SiStripDetWithSomething< T >::~SiStripDetWithSomething | ( | ) |
Definition at line 95 of file SiStripDetWithSomething.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void SiStripDetWithSomething< T >::beginJob | ( | void | ) | [private, virtual] |
void SiStripDetWithSomething< T >::endJob | ( | void | ) | [private, virtual] |
bool SiStripDetWithSomething< T >::filter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDFilter.
Definition at line 111 of file SiStripDetWithSomething.cc.
References edm::Event::getByLabel(), and mod().
{ using namespace edm; Handle<T> digis; iEvent.getByLabel(_digicollection,digis); for(typename T::const_iterator it = digis->begin();it!=digis->end();it++) { for(std::vector<unsigned int>::const_iterator mod=_wantedmod.begin(); mod!=_wantedmod.end()&&it->detId()>=*mod; mod++) { if(*mod == it->detId()) { edm::LogInfo("ModuleFound") << " module " << *mod << " found with " << it->size() << " digis/clusters"; return true; } } } return false; }
edm::InputTag SiStripDetWithSomething< T >::_digicollection [private] |
Definition at line 60 of file SiStripDetWithSomething.cc.
std::vector<unsigned int> SiStripDetWithSomething< T >::_wantedmod [private] |
Definition at line 61 of file SiStripDetWithSomething.cc.
Referenced by SiStripDetWithSomething< T >::SiStripDetWithSomething().