CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SingleMultiplicity< T > Class Template Reference

#include <Multiplicities.h>

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 48 of file Multiplicities.h.

Constructor & Destructor Documentation

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

Definition at line 69 of file Multiplicities.h.

69  :
70  // mult(0),
72  m_mult(0)
73 { }
std::string m_qualityLabel
edm::InputTag m_collection
template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( const edm::ParameterSet iConfig)

Definition at line 76 of file Multiplicities.h.

76  :
77  // mult(0),
78  m_collection(iConfig.getParameter<edm::InputTag>("collectionName")),
79  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
80  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
81  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
82  m_mult(0)
83 { }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string m_qualityLabel
edm::InputTag m_collection

Member Function Documentation

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

Definition at line 88 of file Multiplicities.h.

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

88  {
89 
90  m_mult = 0;
91  // mult = 0;
92 
93  edm::ESHandle<SiStripQuality> qualityHandle;
94  if( m_useQuality) {
95  iSetup.get<SiStripQualityRcd>().get(m_qualityLabel,qualityHandle);
96  }
97 
98  edm::Handle<T> digis;
99  iEvent.getByLabel(m_collection,digis);
100 
101 
102  for(typename T::const_iterator it = digis->begin();it!=digis->end();it++) {
103 
104  if(!m_useQuality || !qualityHandle->IsModuleBad(it->detId()) ) {
105  if(m_modthr < 0 || int(it->size()) < m_modthr ) {
106  m_mult += it->size();
107  // mult += it->size();
108  }
109  }
110  }
111 }
std::string m_qualityLabel
edm::InputTag m_collection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
const T & get() const
Definition: EventSetup.h:55
template<class T >
int SingleMultiplicity< T >::mult ( ) const

Definition at line 116 of file Multiplicities.h.

116 { return m_mult; }

Member Data Documentation

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

Definition at line 61 of file Multiplicities.h.

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

Definition at line 62 of file Multiplicities.h.

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

Definition at line 65 of file Multiplicities.h.

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

Definition at line 64 of file Multiplicities.h.

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

Definition at line 63 of file Multiplicities.h.