CMS 3D CMS Logo

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

Constructor & Destructor Documentation

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

Definition at line 83 of file Multiplicities.h.

83  :
84  // mult(0),
85 #ifndef __ROOTCLING__
86 m_collection(),
87 #endif
88  m_modthr(-1), m_useQuality(false), m_qualityLabel(),
89  m_mult(0)
90 { }
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 94 of file Multiplicities.h.

94  :
95  // mult(0),
96 m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))),
97  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
98  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
99  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
100  m_mult(0)
101 { }
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 103 of file Multiplicities.h.

103  :
104  // mult(0),
105 m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))),
106  m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
107  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality",false)),
108  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel","")),
109  m_mult(0)
110 { }
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 116 of file Multiplicities.h.

References edm::EventSetup::get(), edm::Event::getByToken(), SiStripQuality::IsModuleBad(), SingleMultiplicity< T >::m_collection, SingleMultiplicity< T >::m_modthr, SingleMultiplicity< T >::m_mult, SingleMultiplicity< T >::m_qualityLabel, and SingleMultiplicity< T >::m_useQuality.

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

Definition at line 144 of file Multiplicities.h.

References SingleMultiplicity< T >::m_mult.

144 { return m_mult; }

Member Data Documentation

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

Definition at line 74 of file Multiplicities.h.

Referenced by SingleMultiplicity< T >::getEvent().

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

Definition at line 76 of file Multiplicities.h.

Referenced by SingleMultiplicity< T >::getEvent().

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

Definition at line 78 of file Multiplicities.h.

Referenced by SingleMultiplicity< T >::getEvent().

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

Definition at line 77 of file Multiplicities.h.

Referenced by SingleMultiplicity< T >::getEvent().