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() {}

◆ 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"))) {}

◆ 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"))) {}

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 }

◆ 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.

edm::ESInputTag
Definition: ESInputTag.h:87
AlCaHarvesting_cff.SiStripQuality
SiStripQuality
Definition: AlCaHarvesting_cff.py:223
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
edm::Handle
Definition: AssociativeIterator.h:50
SiStripQualityRcd
Definition: SiStripDependentRecords.h:55
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
SingleMultiplicity::m_modthr
int m_modthr
Definition: Multiplicities.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
iEvent
int iEvent
Definition: GenABIO.cc:224
SingleMultiplicity::m_collection
edm::EDGetTokenT< T > m_collection
Definition: Multiplicities.h:62
SingleMultiplicity::m_qualityToken
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_qualityToken
Definition: Multiplicities.h:60
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
SingleMultiplicity::m_mult
int m_mult
Definition: Multiplicities.h:61
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
SingleMultiplicity::m_useQuality
bool m_useQuality
Definition: Multiplicities.h:59
T
long double T
Definition: Basic3DVectorLD.h:48
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15
SiStripQuality
Definition: SiStripQuality.h:32