CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SiStripDetWithSomething< T > Class Template Reference

#include <DPGAnalysis/SiStripTools/plugins/SiStripDetWithSomething.cc>

Inheritance diagram for SiStripDetWithSomething< T >:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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

Detailed Description

template<class T>
class SiStripDetWithSomething< T >

Description: template EDFilter to select events with selected modules with SiStripDigis or SiStripClusters

Implementation:

Definition at line 48 of file SiStripDetWithSomething.cc.


Constructor & Destructor Documentation

template<class T >
SiStripDetWithSomething< T >::SiStripDetWithSomething ( const edm::ParameterSet iConfig) [explicit]

Definition at line 77 of file SiStripDetWithSomething.cc.

References SiStripDetWithSomething< T >::_wantedmod, text2workspace::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 ;
  }

}
template<class T >
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.)

}

Member Function Documentation

template<class T >
void SiStripDetWithSomething< T >::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 137 of file SiStripDetWithSomething.cc.

{
}
template<class T >
void SiStripDetWithSomething< T >::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 144 of file SiStripDetWithSomething.cc.

                                   {
}
template<class T >
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 text2workspace::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;
}

Member Data Documentation

template<class T >
edm::InputTag SiStripDetWithSomething< T >::_digicollection [private]

Definition at line 60 of file SiStripDetWithSomething.cc.

template<class T >
std::vector<unsigned int> SiStripDetWithSomething< T >::_wantedmod [private]