58 virtual void endJob()
override ;
85 m_collectionToken(consumes<
T>(iConfig.getParameter<edm::InputTag>(
"clusterdigiCollection"))),
86 m_clustersize(iConfig.getUntrackedParameter<bool>(
"withClusterSize",
false)),
87 m_subdets(),m_subdetsels()
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::auto_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) {
139 if(m_subdets.find(0)!=m_subdets.end()) (*mults)[0]+= multiplicity(det);
142 unsigned int subdet =
detid.subdetId();
145 if(m_subdets.find(subdet)!=m_subdets.end() && !m_subdetsels[subdet].isValid() ) (*mults)[subdet] += multiplicity(det);
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];
187 mult = detSetMultiplicity(det);
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
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
edm::EDGetTokenT< T > m_collectionToken
MultiplicityProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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
volatile std::atomic< bool > shutdown_flag false
virtual void endJob() override
const_iterator begin(bool update=false) const
MultiplicityProducer< edmNew::DetSetVector< SiPixelCluster > > SiPixelClusterMultiplicityProducer