58 virtual void endJob()
override ;
90 produces<std::map<unsigned int,int> >();
94 std::vector<edm::ParameterSet> wantedsubds(iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"wantedSubDets"));
96 for(std::vector<edm::ParameterSet>::iterator ps=wantedsubds.begin();ps!=wantedsubds.end();++ps) {
97 m_subdets[ps->getParameter<
unsigned int>(
"detSelection")] = ps->getParameter<
std::string>(
"detLabel");
98 m_subdetsels[ps->getParameter<
unsigned int>(
"detSelection")] =
99 DetIdSelector(ps->getUntrackedParameter<std::vector<std::string> >(
"selection",std::vector<std::string>()));
123 LogDebug(
"Multiplicity") <<
" Ready to loop";
127 std::unique_ptr<std::map<unsigned int,int> > mults(
new std::map<unsigned int,int> );
133 for(std::map<unsigned int,std::string>::const_iterator sdet=
m_subdets.begin();sdet!=
m_subdets.end();++sdet) { (*mults)[sdet->first]=0; }
136 for(
typename T::const_iterator det = digis->begin();det!=digis->end();++det) {
141 DetId detid(det->detId());
142 unsigned int subdet = detid.
subdetId();
147 for(std::map<unsigned int,DetIdSelector>::const_iterator detsel=
m_subdetsels.begin();detsel!=
m_subdetsels.end();++detsel) {
150 if(detsel->second.isValid() && detsel->second.isSelected(detid)) (*mults)[detsel->first] +=
multiplicity(det);
157 for(std::map<unsigned int,int>::const_iterator it=mults->begin();it!=mults->end();++it) {
158 LogDebug(
"Multiplicity") <<
" Found " << it->second <<
" digis/clusters in " << it->first <<
" " <<
m_subdets[it->first];
218 mult += clus->amplitudes().size();
236 mult += clus->size();
T getParameter(std::string const &) const
MultiplicityProducer< edm::DetSetVector< SiStripDigi > > SiStripDigiMultiplicityProducer
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
int detSetMultiplicity(typename T::const_iterator det) const
data_type const * const_iterator
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< T > m_collectionToken
MultiplicityProducer(const edm::ParameterSet &)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual void produce(edm::Event &, const edm::EventSetup &) override
MultiplicityProducer< edmNew::DetSetVector< SiStripCluster > > SiStripClusterMultiplicityProducer
std::map< unsigned int, DetIdSelector > m_subdetsels
int multiplicity(typename T::const_iterator det) const
virtual void beginJob() override
std::map< unsigned int, std::string > m_subdets
virtual void endJob() override
const_iterator begin(bool update=false) const
MultiplicityProducer< edmNew::DetSetVector< SiPixelCluster > > SiPixelClusterMultiplicityProducer