CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DPGAnalysis/SiStripTools/src/Multiplicities.cc

Go to the documentation of this file.
00001 #include "DPGAnalysis/SiStripTools/interface/Multiplicities.h"
00002 #include "DataFormats/TrackerCommon/interface/ClusterSummary.h"
00003 
00004 ClusterSummarySingleMultiplicity::ClusterSummarySingleMultiplicity():
00005   m_collection(),m_subdetenum(0),m_subdetvar(), m_clustsummvar(), m_mult(0) { }
00006 
00007 ClusterSummarySingleMultiplicity::ClusterSummarySingleMultiplicity(const edm::ParameterSet& iConfig):
00008   m_collection(iConfig.getParameter<edm::InputTag>("clusterSummaryCollection")),
00009   m_subdetenum(iConfig.getParameter<int>("subDetEnum")),
00010   m_subdetvar(iConfig.getParameter<std::string>("subDetVariable")),
00011   m_clustsummvar(),
00012   m_mult(0)
00013 { 
00014 
00015   m_clustsummvar.push_back("cHits");
00016   m_clustsummvar.push_back("cSize");
00017   m_clustsummvar.push_back("cCharge");
00018   m_clustsummvar.push_back("pHits");
00019   m_clustsummvar.push_back("pSize");
00020   m_clustsummvar.push_back("pCharge");
00021 
00022 }
00023 
00024 void ClusterSummarySingleMultiplicity::getEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
00025 
00026   m_mult = 0;
00027 
00028   edm::Handle<ClusterSummary> clustsumm;
00029   iEvent.getByLabel(m_collection,clustsumm);
00030 
00031   clustsumm->SetUserContent(m_clustsummvar);
00032 
00033   m_mult = int(clustsumm->GetGenericVariable(m_subdetvar,m_subdetenum));
00034 
00035 }
00036 
00037 int ClusterSummarySingleMultiplicity::mult() const { return m_mult; }
00038