CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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
 
edm::ESGetToken
< SiStripQuality,
SiStripQualityRcd
m_qualityToken
 
bool m_useQuality
 

Detailed Description

template<class T>
class SingleMultiplicity< T >

Definition at line 47 of file Multiplicities.h.

Constructor & Destructor Documentation

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

Definition at line 66 of file Multiplicities.h.

66 : m_modthr(-1), m_useQuality(false), m_mult(0), m_collection() {}
edm::EDGetTokenT< T > m_collection
template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 69 of file Multiplicities.h.

References edm::ParameterSet::getUntrackedParameter(), AlCaHarvesting_cff::SiStripQuality, and AlCaHLTBitMon_QueryRunRegistry::string.

70  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
71  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
74  edm::ESInputTag{"", iConfig.getUntrackedParameter<std::string>("qualityLabel", "")})}
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_qualityToken
template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)

Member Function Documentation

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

Definition at line 90 of file Multiplicities.h.

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

90  {
91  m_mult = 0;
92 
93  const SiStripQuality* quality = nullptr;
94  if (m_useQuality) {
95  quality = &iSetup.getData(m_qualityToken);
96  }
97 
98  edm::Handle<T> digis;
99  iEvent.getByToken(m_collection, digis);
100 
101  for (typename T::const_iterator it = digis->begin(); it != digis->end(); it++) {
102  if (!m_useQuality || !quality->IsModuleBad(it->detId())) {
103  if (m_modthr < 0 || int(it->size()) < m_modthr) {
104  m_mult += it->size();
105  // mult += it->size();
106  }
107  }
108  }
109 }
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_qualityToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
uint32_t const *__restrict__ Quality * quality
edm::EDGetTokenT< T > m_collection
bool getData(T &iHolder) const
Definition: EventSetup.h:128
bool IsModuleBad(const uint32_t &detid) const
template<class T >
int SingleMultiplicity< T >::mult ( ) const

Definition at line 112 of file Multiplicities.h.

References SingleMultiplicity< T >::m_mult.

112  {
113  return m_mult;
114 }

Member Data Documentation

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

Definition at line 62 of file Multiplicities.h.

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

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

Definition at line 58 of file Multiplicities.h.

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

template<class T>
int SingleMultiplicity< T >::m_mult
private
template<class T>
edm::ESGetToken<SiStripQuality, SiStripQualityRcd> SingleMultiplicity< T >::m_qualityToken
private

Definition at line 60 of file Multiplicities.h.

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

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

Definition at line 59 of file Multiplicities.h.

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