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

Constructor & Destructor Documentation

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

Definition at line 66 of file Multiplicities.h.

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

Definition at line 73 of file Multiplicities.h.

73  :
74  // mult(0),
75  m_collection(iConfig.getParameter<edm::InputTag>("collectionName")),
76  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
77  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
78  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
79  m_mult(0)
80 { }
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 84 of file Multiplicities.h.

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

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

Definition at line 111 of file Multiplicities.h.

111 { return m_mult; }

Member Data Documentation

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

Definition at line 58 of file Multiplicities.h.

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

Definition at line 59 of file Multiplicities.h.

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

Definition at line 62 of file Multiplicities.h.

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

Definition at line 61 of file Multiplicities.h.

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

Definition at line 60 of file Multiplicities.h.