1 #ifndef DPGAnalysis_SiStripTools_Multiplicities_H
2 #define DPGAnalysis_SiStripTools_Multiplicities_H
70 : m_modthr(iConfig.getUntrackedParameter<
int>(
"moduleThreshold")),
71 m_useQuality(iConfig.getUntrackedParameter<
bool>(
"useQuality",
false)),
72 m_qualityToken(m_useQuality
75 : decltype(m_qualityToken){}),
77 m_collection(iC.consumes<
T>(iConfig.getParameter<
edm::InputTag>(
"collectionName"))) {}
80 : m_modthr(iConfig.getUntrackedParameter<
int>(
"moduleThreshold")),
81 m_useQuality(iConfig.getUntrackedParameter<
bool>(
"useQuality",
false)),
82 m_qualityToken(m_useQuality
85 : decltype(m_qualityToken){}),
87 m_collection(iC.consumes<
T>(iConfig.getParameter<
edm::InputTag>(
"collectionName"))) {}
99 iEvent.getByToken(m_collection, digis);
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();
116 template <
class T1,
class T2>
132 template <
class T1,
class T2>
135 template <
class T1,
class T2>
137 : m_multiplicity1(iConfig.getParameter<
edm::
ParameterSet>(
"firstMultiplicityConfig"), iC),
138 m_multiplicity2(iConfig.getParameter<
edm::
ParameterSet>(
"secondMultiplicityConfig"), iC) {}
139 template <
class T1,
class T2>
141 : m_multiplicity1(iConfig.getParameter<
edm::
ParameterSet>(
"firstMultiplicityConfig"), iC),
142 m_multiplicity2(iConfig.getParameter<
edm::
ParameterSet>(
"secondMultiplicityConfig"), iC) {}
144 template <
class T1,
class T2>
146 m_multiplicity1.getEvent(
iEvent, iSetup);
147 m_multiplicity2.getEvent(
iEvent, iSetup);
150 template <
class T1,
class T2>
152 return m_multiplicity1.mult();
155 template <
class T1,
class T2>
157 return m_multiplicity2.mult();
169 #endif // DPGAnalysis_SiStripTools_Multiplicities_H