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
 
edm::ESGetToken< SiStripQuality, SiStripQualityRcdm_qualityToken
 
bool m_useQuality
 

Detailed Description

template<class T>
class SingleMultiplicity< T >

Definition at line 47 of file Multiplicities.h.

Constructor & Destructor Documentation

◆ SingleMultiplicity() [1/3]

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

◆ SingleMultiplicity() [2/3]

template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 69 of file Multiplicities.h.

70  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
71  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
74  edm::ESInputTag{"", iConfig.getUntrackedParameter<std::string>("qualityLabel", "")})}
75  : decltype(m_qualityToken){}),
76  m_mult(0),
77  m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_qualityToken
edm::EDGetTokenT< T > m_collection
T getUntrackedParameter(std::string const &, T const &) const
long double T

◆ SingleMultiplicity() [3/3]

template<class T >
SingleMultiplicity< T >::SingleMultiplicity ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)

Definition at line 79 of file Multiplicities.h.

80  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
81  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
84  edm::ESInputTag(iConfig.getUntrackedParameter<std::string>("qualityLabel", "")))}
85  : decltype(m_qualityToken){}),
86  m_mult(0),
87  m_collection(iC.consumes<T>(iConfig.getParameter<edm::InputTag>("collectionName"))) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_qualityToken
edm::EDGetTokenT< T > m_collection
T getUntrackedParameter(std::string const &, T const &) const
long double T

Member Function Documentation

◆ getEvent()

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

Definition at line 90 of file Multiplicities.h.

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
edm::EDGetTokenT< T > m_collection
int iEvent
Definition: GenABIO.cc:224
bool getData(T &iHolder) const
Definition: EventSetup.h:122
string quality

◆ mult()

template<class T >
int SingleMultiplicity< T >::mult ( ) const

Definition at line 112 of file Multiplicities.h.

112  {
113  return m_mult;
114 }

Member Data Documentation

◆ m_collection

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

Definition at line 62 of file Multiplicities.h.

◆ m_modthr

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

Definition at line 58 of file Multiplicities.h.

◆ m_mult

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

Definition at line 61 of file Multiplicities.h.

◆ m_qualityToken

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

Definition at line 60 of file Multiplicities.h.

◆ m_useQuality

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

Definition at line 59 of file Multiplicities.h.