#include <DPGAnalysis/SiStripTools/plugins/FromClusterSummaryMultiplicityProducer.cc>
Public Member Functions | |
FromClusterSummaryMultiplicityProducer (const edm::ParameterSet &) | |
~FromClusterSummaryMultiplicityProducer () | |
Private Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) override |
Private Attributes | |
std::vector< std::string > | m_clustsummvar |
edm::InputTag | m_collection |
std::map< unsigned int, int > | m_subdetenums |
std::map< unsigned int, std::string > | m_subdets |
std::map< unsigned int, std::string > | m_subdetvars |
Description: EDProducer of multiplicity maps Implementation:
Definition at line 41 of file FromClusterSummaryMultiplicityProducer.cc.
FromClusterSummaryMultiplicityProducer::FromClusterSummaryMultiplicityProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 74 of file FromClusterSummaryMultiplicityProducer.cc.
References edm::ParameterSet::getParameter(), m_clustsummvar, m_subdetenums, m_subdets, m_subdetvars, and AlCaHLTBitMon_QueryRunRegistry::string.
: m_collection(iConfig.getParameter<edm::InputTag>("clusterSummaryCollection")), m_subdets(),m_subdetenums(),m_subdetvars(),m_clustsummvar() { m_clustsummvar.push_back("cHits"); m_clustsummvar.push_back("cSize"); m_clustsummvar.push_back("cCharge"); m_clustsummvar.push_back("pHits"); m_clustsummvar.push_back("pSize"); m_clustsummvar.push_back("pCharge"); produces<std::map<unsigned int,int> >(); //now do what ever other initialization is needed std::vector<edm::ParameterSet> wantedsubds(iConfig.getParameter<std::vector<edm::ParameterSet> >("wantedSubDets")); for(std::vector<edm::ParameterSet>::iterator ps=wantedsubds.begin();ps!=wantedsubds.end();++ps) { m_subdets[ps->getParameter<unsigned int>("detSelection")] = ps->getParameter<std::string>("detLabel"); m_subdetenums[ps->getParameter<unsigned int>("detSelection")] = ps->getParameter<int >("subDetEnum"); m_subdetvars[ps->getParameter<unsigned int>("detSelection")] = ps->getParameter<std::string>("subDetVariable"); } }
FromClusterSummaryMultiplicityProducer::~FromClusterSummaryMultiplicityProducer | ( | ) |
Definition at line 99 of file FromClusterSummaryMultiplicityProducer.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void FromClusterSummaryMultiplicityProducer::beginJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 150 of file FromClusterSummaryMultiplicityProducer.cc.
{ }
void FromClusterSummaryMultiplicityProducer::endJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 156 of file FromClusterSummaryMultiplicityProducer.cc.
{ }
void FromClusterSummaryMultiplicityProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [override, private, virtual] |
Implements edm::EDProducer.
Definition at line 114 of file FromClusterSummaryMultiplicityProducer.cc.
References edm::Event::getByLabel(), LogDebug, m_clustsummvar, m_collection, m_subdetenums, m_subdets, m_subdetvars, and edm::Event::put().
{ LogDebug("Multiplicity") << " Ready to go"; using namespace edm; std::auto_ptr<std::map<unsigned int,int> > mults(new std::map<unsigned int,int> ); Handle<ClusterSummary> clustsumm; iEvent.getByLabel(m_collection,clustsumm); clustsumm->SetUserContent(m_clustsummvar); for(std::map<unsigned int,std::string>::const_iterator sdet=m_subdets.begin();sdet!=m_subdets.end();++sdet) { (*mults)[sdet->first]=0; } for(std::map<unsigned int,int>::const_iterator detsel=m_subdetenums.begin();detsel!=m_subdetenums.end();++detsel) { // (*mults)[detsel->first] = int(clustsumm->GetGenericVariable(m_subdetvars[detsel->first])[clustsumm->GetModuleLocation(detsel->second)]); (*mults)[detsel->first] = int(clustsumm->GetGenericVariable(m_subdetvars[detsel->first],detsel->second)); LogDebug("Multiplicity") << "GetModuleLocation result: " << detsel->second << " " << clustsumm->GetModuleLocation(detsel->second); } for(std::map<unsigned int,int>::const_iterator it=mults->begin();it!=mults->end();++it) { LogDebug("Multiplicity") << " Found " << it->second << " digis/clusters in " << it->first << " " << m_subdets[it->first]; } iEvent.put(mults); }
std::vector<std::string> FromClusterSummaryMultiplicityProducer::m_clustsummvar [private] |
Definition at line 58 of file FromClusterSummaryMultiplicityProducer.cc.
Referenced by FromClusterSummaryMultiplicityProducer(), and produce().
Definition at line 54 of file FromClusterSummaryMultiplicityProducer.cc.
Referenced by produce().
std::map<unsigned int, int> FromClusterSummaryMultiplicityProducer::m_subdetenums [private] |
Definition at line 56 of file FromClusterSummaryMultiplicityProducer.cc.
Referenced by FromClusterSummaryMultiplicityProducer(), and produce().
std::map<unsigned int, std::string> FromClusterSummaryMultiplicityProducer::m_subdets [private] |
Definition at line 55 of file FromClusterSummaryMultiplicityProducer.cc.
Referenced by FromClusterSummaryMultiplicityProducer(), and produce().
std::map<unsigned int, std::string> FromClusterSummaryMultiplicityProducer::m_subdetvars [private] |
Definition at line 57 of file FromClusterSummaryMultiplicityProducer.cc.
Referenced by FromClusterSummaryMultiplicityProducer(), and produce().