CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

LargeEvents< T > Class Template Reference

#include <DPGAnalysis/SiStripTools/LargeEvents.cc>

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

List of all members.

Public Member Functions

 LargeEvents (const edm::ParameterSet &)
 ~LargeEvents ()

Private Member Functions

virtual void beginJob ()
virtual void endJob ()
virtual bool filter (edm::Event &, const edm::EventSetup &)

Private Attributes

int _absthr
edm::InputTag _collection
int _modthr
edm::ESHandle< SiStripQuality_qualityHandle
std::string _qualityLabel
edm::ESWatcher< SiStripQualityRcd_qualityWatcher
bool _useQuality

Detailed Description

template<class T>
class LargeEvents< T >

Description: templated EDFilter to select events with large number of SiStripDigi or SiStripCluster

Implementation: <Notes on="" implementation>="">

Definition at line 54 of file LargeEvents.cc.


Constructor & Destructor Documentation

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

Definition at line 88 of file LargeEvents.cc.

                                                         :
  _collection(iConfig.getParameter<edm::InputTag>("collectionName")),
  _absthr(iConfig.getUntrackedParameter<int>("absoluteThreshold")),
  _modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
  _useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
  _qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel",""))
{
   //now do what ever initialization is needed


}
template<class T >
LargeEvents< T >::~LargeEvents ( )

Definition at line 101 of file LargeEvents.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 LargeEvents< T >::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 153 of file LargeEvents.cc.

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

Reimplemented from edm::EDFilter.

Definition at line 160 of file LargeEvents.cc.

                       {
}
template<class T >
bool LargeEvents< T >::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDFilter.

Definition at line 117 of file LargeEvents.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), and LogDebug.

{
   using namespace edm;

   if( _useQuality) {
     if(_qualityWatcher.check(iSetup)) {
       iSetup.get<SiStripQualityRcd>().get(_qualityLabel,_qualityHandle);
       LogDebug("SiStripQualityUpdated") << "SiStripQuality has changed and it will be updated";
     }
   }

   Handle<T> digis;
   iEvent.getByLabel(_collection,digis);


   int ndigitot = 0;
   for(typename T::const_iterator it = digis->begin();it!=digis->end();it++) {

     if(!_useQuality || !_qualityHandle->IsModuleBad(it->detId()) ) {
       if(_modthr < 0 || int(it->size()) < _modthr ) {
         ndigitot += it->size();
       }
     }
   }

   if(ndigitot > _absthr) {
     LogDebug("LargeEventSelected") << "event with " << ndigitot << " digi/cluster selected";
     return true;
   }

   return false;
}

Member Data Documentation

template<class T >
int LargeEvents< T >::_absthr [private]

Definition at line 67 of file LargeEvents.cc.

template<class T >
edm::InputTag LargeEvents< T >::_collection [private]

Definition at line 66 of file LargeEvents.cc.

template<class T >
int LargeEvents< T >::_modthr [private]

Definition at line 68 of file LargeEvents.cc.

template<class T >
edm::ESHandle<SiStripQuality> LargeEvents< T >::_qualityHandle [private]

Definition at line 71 of file LargeEvents.cc.

template<class T >
std::string LargeEvents< T >::_qualityLabel [private]

Definition at line 70 of file LargeEvents.cc.

template<class T >
edm::ESWatcher<SiStripQualityRcd> LargeEvents< T >::_qualityWatcher [private]

Definition at line 72 of file LargeEvents.cc.

template<class T >
bool LargeEvents< T >::_useQuality [private]

Definition at line 69 of file LargeEvents.cc.