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

Constructor & Destructor Documentation

◆ SingleMultiplicity() [1/3]

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

Definition at line 77 of file Multiplicities.h.

78  : m_modthr(-1),
79  m_useQuality(false),
81  m_mult(0)
82 #ifndef __ROOTCLING__
83  ,
84  m_collection()
85 #endif
86 {
87 }

◆ SingleMultiplicity() [2/3]

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

Definition at line 91 of file Multiplicities.h.

92  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
93  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
94  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel", "")),
95  m_mult(0),
96  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 98 of file Multiplicities.h.

99  : m_modthr(iConfig.getUntrackedParameter<int>("moduleThreshold")),
100  m_useQuality(iConfig.getUntrackedParameter<bool>("useQuality", false)),
101  m_qualityLabel(iConfig.getUntrackedParameter<std::string>("qualityLabel", "")),
102  m_mult(0),
103  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 108 of file Multiplicities.h.

108  {
109  m_mult = 0;
110 
111  edm::ESHandle<SiStripQuality> qualityHandle;
112  if (m_useQuality) {
113  iSetup.get<SiStripQualityRcd>().get(m_qualityLabel, qualityHandle);
114  }
115 
116  edm::Handle<T> digis;
117  iEvent.getByToken(m_collection, digis);
118 
119  for (typename T::const_iterator it = digis->begin(); it != digis->end(); it++) {
120  if (!m_useQuality || !qualityHandle->IsModuleBad(it->detId())) {
121  if (m_modthr < 0 || int(it->size()) < m_modthr) {
122  m_mult += it->size();
123  // mult += it->size();
124  }
125  }
126  }
127 }

◆ mult()

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

Definition at line 131 of file Multiplicities.h.

131  {
132  return m_mult;
133 }

Member Data Documentation

◆ m_collection

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

Definition at line 72 of file Multiplicities.h.

◆ m_modthr

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

Definition at line 67 of file Multiplicities.h.

◆ m_mult

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

Definition at line 70 of file Multiplicities.h.

◆ m_qualityLabel

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

Definition at line 69 of file Multiplicities.h.

◆ m_useQuality

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

Definition at line 68 of file Multiplicities.h.

SiStripQuality::IsModuleBad
bool IsModuleBad(const uint32_t &detid) const
Definition: SiStripQuality.cc:604
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SiStripQualityRcd
Definition: SiStripDependentRecords.h:56
edm::ESHandle< SiStripQuality >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
SingleMultiplicity::m_modthr
int m_modthr
Definition: Multiplicities.h:67
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:72
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SingleMultiplicity::m_mult
int m_mult
Definition: Multiplicities.h:70
SingleMultiplicity::m_useQuality
bool m_useQuality
Definition: Multiplicities.h:68
T
long double T
Definition: Basic3DVectorLD.h:48
SingleMultiplicity::m_qualityLabel
std::string m_qualityLabel
Definition: Multiplicities.h:69
edm::InputTag
Definition: InputTag.h:15