CMS 3D CMS Logo

Public Member Functions | Private Attributes

SingleMultiplicity< T > Class Template Reference

#include <Multiplicities.h>

List of all members.

Public Member Functions

void getEvent (const edm::Event &iEvent, const edm::EventSetup &iSetup)
int mult () const
 SingleMultiplicity ()
 SingleMultiplicity (const edm::ParameterSet &iConfig)

Private Attributes

edm::InputTag m_collection
int m_modthr
int m_mult
std::string m_qualityLabel
bool m_useQuality

Detailed Description

template<class T>
class SingleMultiplicity< T >

Definition at line 24 of file Multiplicities.h.


Constructor & Destructor Documentation

template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( )

Definition at line 45 of file Multiplicities.h.

                                         :
  //  mult(0), 
  m_collection(), m_modthr(-1), m_useQuality(false),  m_qualityLabel(),
  m_mult(0)
{ }
template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( const edm::ParameterSet iConfig)

Definition at line 52 of file Multiplicities.h.

                                                                       :
  //  mult(0),
  m_collection(iConfig.getParameter<edm::InputTag>("collectionName")),
  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
  m_mult(0)
{ }

Member Function Documentation

template<class T >
void SingleMultiplicity< T >::getEvent ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 63 of file Multiplicities.h.

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

                                                                                   {

  m_mult = 0;
  //  mult = 0;

  edm::ESHandle<SiStripQuality> qualityHandle;
   if( m_useQuality) {
     iSetup.get<SiStripQualityRcd>().get(m_qualityLabel,qualityHandle);
   }

   edm::Handle<T> digis;
   iEvent.getByLabel(m_collection,digis);


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

     if(!m_useQuality || !qualityHandle->IsModuleBad(it->detId()) ) {
       if(m_modthr < 0 || int(it->size()) < m_modthr ) {
         m_mult += it->size();
         //      mult += it->size();
       }
     }
   }
}
template<class T >
int SingleMultiplicity< T >::mult ( ) const

Definition at line 90 of file Multiplicities.h.

{ return m_mult; }

Member Data Documentation

template<class T>
edm::InputTag SingleMultiplicity< T >::m_collection [private]

Definition at line 37 of file Multiplicities.h.

template<class T>
int SingleMultiplicity< T >::m_modthr [private]

Definition at line 38 of file Multiplicities.h.

template<class T>
int SingleMultiplicity< T >::m_mult [private]

Definition at line 41 of file Multiplicities.h.

template<class T>
std::string SingleMultiplicity< T >::m_qualityLabel [private]

Definition at line 40 of file Multiplicities.h.

template<class T>
bool SingleMultiplicity< T >::m_useQuality [private]

Definition at line 39 of file Multiplicities.h.