79 : m_collectionToken(consumes<
T>(iConfig.getParameter<
edm::
InputTag>(
"clusterdigiCollection"))),
80 m_clustersize(iConfig.getUntrackedParameter<
bool>(
"withClusterSize",
false)),
83 produces<std::map<unsigned int, int> >();
87 std::vector<edm::ParameterSet> wantedsubds(iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"wantedSubDets"));
89 for (std::vector<edm::ParameterSet>::iterator ps = wantedsubds.begin(); ps != wantedsubds.end(); ++ps) {
90 m_subdets[ps->getParameter<
unsigned int>(
"detSelection")] = ps->getParameter<
std::string>(
"detLabel");
91 m_subdetsels[ps->getParameter<
unsigned int>(
"detSelection")] =
92 DetIdSelector(ps->getUntrackedParameter<std::vector<std::string> >(
"selection", std::vector<std::string>()));
109 LogDebug(
"Multiplicity") <<
" Ready to loop";
113 std::unique_ptr<std::map<unsigned int, int> > mults(
new std::map<unsigned int, int>);
116 iEvent.getByToken(m_collectionToken, digis);
118 for (std::map<unsigned int, std::string>::const_iterator sdet = m_subdets.begin(); sdet != m_subdets.end(); ++sdet) {
119 (*mults)[sdet->first] = 0;
122 for (
typename T::const_iterator det = digis->begin(); det != digis->end(); ++det) {
124 if (m_subdets.find(0) != m_subdets.end())
125 (*mults)[0] += multiplicity(det);
127 DetId detid(det->detId());
128 unsigned int subdet = detid.
subdetId();
131 if (m_subdets.find(subdet) != m_subdets.end()) {
132 auto detsel = m_subdetsels.find(subdet);
133 if (detsel == m_subdetsels.end()
or !detsel->second.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.find(it->first)->second;
158 mult = detSetMultiplicity(det);
179 mult += clus->amplitudes().size();
191 mult += clus->size();
MultiplicityProducer< edm::DetSetVector< SiStripDigi > > SiStripDigiMultiplicityProducer
T getParameter(std::string const &) const
int detSetMultiplicity(typename T::const_iterator det) const
data_type const * const_iterator
const_iterator end(bool update=false) const
edm::EDGetTokenT< T > m_collectionToken
MultiplicityProducer(const edm::ParameterSet &)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
#define DEFINE_FWK_MODULE(type)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int multiplicity(typename T::const_iterator det) const
~MultiplicityProducer() override
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
MultiplicityProducer< edmNew::DetSetVector< SiStripCluster > > SiStripClusterMultiplicityProducer
const_iterator begin(bool update=false) const
std::map< unsigned int, DetIdSelector > m_subdetsels
std::map< unsigned int, std::string > m_subdets
MultiplicityProducer< edmNew::DetSetVector< SiPixelCluster > > SiPixelClusterMultiplicityProducer