81 : m_collectionToken(consumes<
T>(iConfig.getParameter<
edm::
InputTag>(
"clusterdigiCollection"))),
82 m_clustersize(iConfig.getUntrackedParameter<
bool>(
"withClusterSize",
false)),
85 produces<std::map<unsigned int, int> >();
89 std::vector<edm::ParameterSet> wantedsubds(iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"wantedSubDets"));
91 for (std::vector<edm::ParameterSet>::iterator ps = wantedsubds.begin(); ps != wantedsubds.end(); ++ps) {
92 m_subdets[ps->getParameter<
unsigned int>(
"detSelection")] = ps->getParameter<
std::string>(
"detLabel");
93 m_subdetsels[ps->getParameter<
unsigned int>(
"detSelection")] =
94 DetIdSelector(ps->getUntrackedParameter<std::vector<std::string> >(
"selection", std::vector<std::string>()));
111 LogDebug(
"Multiplicity") <<
" Ready to loop";
115 std::unique_ptr<std::map<unsigned int, int> > mults(
new std::map<unsigned int, int>);
118 iEvent.getByToken(m_collectionToken, digis);
120 for (std::map<unsigned int, std::string>::const_iterator sdet = m_subdets.begin(); sdet != m_subdets.end(); ++sdet) {
121 (*mults)[sdet->first] = 0;
124 for (
typename T::const_iterator det = digis->begin(); det != digis->end(); ++det) {
126 if (m_subdets.find(0) != m_subdets.end())
127 (*mults)[0] += multiplicity(det);
129 DetId detid(det->detId());
130 unsigned int subdet = detid.
subdetId();
133 if (m_subdets.find(subdet) != m_subdets.end() && !m_subdetsels[subdet].isValid())
134 (*mults)[subdet] += multiplicity(det);
136 for (std::map<unsigned int, DetIdSelector>::const_iterator detsel = m_subdetsels.begin();
137 detsel != m_subdetsels.end();
140 if (detsel->second.isValid() && detsel->second.isSelected(detid))
141 (*mults)[detsel->first] += multiplicity(det);
145 for (std::map<unsigned int, int>::const_iterator it = mults->begin(); it != mults->end(); ++it) {
146 LogDebug(
"Multiplicity") <<
" Found " << it->second <<
" digis/clusters in " << it->first <<
" "
147 << m_subdets[it->first];
166 mult = detSetMultiplicity(det);
187 mult += clus->amplitudes().size();
199 mult += clus->size();