test
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, edm::ConsumesCollector &&iC)
 
 SingleMultiplicity (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 

Private Attributes

edm::EDGetTokenT< Tm_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 59 of file Multiplicities.h.

Constructor & Destructor Documentation

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

Definition at line 84 of file Multiplicities.h.

84  :
85  // mult(0),
86 #ifndef __GCCXML__
87 m_collection(),
88 #endif
89  m_modthr(-1), m_useQuality(false), m_qualityLabel(),
90  m_mult(0)
91 { }
std::string m_qualityLabel
edm::EDGetTokenT< T > m_collection
template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 95 of file Multiplicities.h.

95  :
96  // mult(0),
97 m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))),
98  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
99  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
100  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
101  m_mult(0)
102 { }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string m_qualityLabel
edm::EDGetTokenT< T > m_collection
long double T
template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)

Definition at line 104 of file Multiplicities.h.

104  :
105  // mult(0),
106 m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))),
107  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
108  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
109  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
110  m_mult(0)
111 { }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string m_qualityLabel
edm::EDGetTokenT< T > m_collection
long double T

Member Function Documentation

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

Definition at line 117 of file Multiplicities.h.

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

117  {
118 
119  m_mult = 0;
120  // mult = 0;
121 
122  edm::ESHandle<SiStripQuality> qualityHandle;
123  if( m_useQuality) {
124  iSetup.get<SiStripQualityRcd>().get(m_qualityLabel,qualityHandle);
125  }
126 
127  edm::Handle<T> digis;
128  iEvent.getByToken(m_collection,digis);
129 
130 
131  for(typename T::const_iterator it = digis->begin();it!=digis->end();it++) {
132 
133  if(!m_useQuality || !qualityHandle->IsModuleBad(it->detId()) ) {
134  if(m_modthr < 0 || int(it->size()) < m_modthr ) {
135  m_mult += it->size();
136  // mult += it->size();
137  }
138  }
139  }
140 }
std::string m_qualityLabel
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< T > m_collection
const T & get() const
Definition: EventSetup.h:55
template<class T >
int SingleMultiplicity< T >::mult ( ) const

Definition at line 145 of file Multiplicities.h.

145 { return m_mult; }

Member Data Documentation

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

Definition at line 75 of file Multiplicities.h.

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

Definition at line 77 of file Multiplicities.h.

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

Definition at line 80 of file Multiplicities.h.

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

Definition at line 79 of file Multiplicities.h.

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

Definition at line 78 of file Multiplicities.h.