CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MultiplicityCorrelator Class Reference

#include <DPGAnalysis/SiStripTools/src/MultiplicityCorrelator.cc>

Inheritance diagram for MultiplicityCorrelator:
edm::EDAnalyzer

Public Member Functions

 MultiplicityCorrelator (const edm::ParameterSet &)
 
 ~MultiplicityCorrelator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 

Private Attributes

std::vector
< MultiplicityCorrelatorHistogramMaker * > 
m_mchms
 
std::vector< std::string > m_xLabels
 
std::vector< edm::InputTagm_xMultiplicityMaps
 
std::vector< unsigned int > m_xSelections
 
std::vector< std::string > m_yLabels
 
std::vector< edm::InputTagm_yMultiplicityMaps
 
std::vector< unsigned int > m_ySelections
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 45 of file MultiplicityCorrelator.cc.

Constructor & Destructor Documentation

MultiplicityCorrelator::MultiplicityCorrelator ( const edm::ParameterSet iConfig)
explicit

Definition at line 83 of file MultiplicityCorrelator.cc.

References edm::ParameterSet::getParameter(), m_mchms, m_xLabels, m_xMultiplicityMaps, m_xSelections, m_yLabels, m_yMultiplicityMaps, and m_ySelections.

83  :
84  m_mchms(),
87 {
88  //now do what ever initialization is needed
89 
90  std::vector<edm::ParameterSet> correlationConfigs =
91  iConfig.getParameter<std::vector<edm::ParameterSet> >("correlationConfigurations");
92 
93  for(std::vector<edm::ParameterSet>::const_iterator ps=correlationConfigs.begin();ps!=correlationConfigs.end();++ps) {
94 
95  m_xMultiplicityMaps.push_back(ps->getParameter<edm::InputTag>("xMultiplicityMap"));
96  m_yMultiplicityMaps.push_back(ps->getParameter<edm::InputTag>("yMultiplicityMap"));
97  m_xLabels.push_back(ps->getParameter<std::string>("xDetLabel"));
98  m_yLabels.push_back(ps->getParameter<std::string>("yDetLabel"));
99  m_xSelections.push_back(ps->getParameter<unsigned int>("xDetSelection"));
100  m_ySelections.push_back(ps->getParameter<unsigned int>("yDetSelection"));
101 
102  m_mchms.push_back(new MultiplicityCorrelatorHistogramMaker(*ps));
103 
104  }
105 
106 }
T getParameter(std::string const &) const
std::vector< unsigned int > m_ySelections
std::vector< std::string > m_yLabels
std::vector< edm::InputTag > m_xMultiplicityMaps
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms
std::vector< std::string > m_xLabels
std::vector< unsigned int > m_xSelections
std::vector< edm::InputTag > m_yMultiplicityMaps
MultiplicityCorrelator::~MultiplicityCorrelator ( )

Definition at line 109 of file MultiplicityCorrelator.cc.

References i, and m_mchms.

110 {
111 
112  for(unsigned int i=0;i<m_mchms.size();++i) {
113  delete m_mchms[i];
114  }
115 
116 }
int i
Definition: DBlmapReader.cc:9
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms

Member Function Documentation

void MultiplicityCorrelator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 125 of file MultiplicityCorrelator.cc.

References edm::Event::getByLabel(), i, m_mchms, m_xMultiplicityMaps, m_xSelections, m_yMultiplicityMaps, and m_ySelections.

126 {
127  using namespace edm;
128 
129  for(unsigned int i=0;i<m_mchms.size();++i) {
131  iEvent.getByLabel(m_xMultiplicityMaps[i],xMults);
133  iEvent.getByLabel(m_yMultiplicityMaps[i],yMults);
134 
135  // check if the selection exists
136 
137  std::map<unsigned int, int>::const_iterator xmult = xMults->find(m_xSelections[i]);
138  std::map<unsigned int, int>::const_iterator ymult = yMults->find(m_ySelections[i]);
139 
140  if(xmult!=xMults->end() && ymult!=yMults->end()) {
141 
142 
143  m_mchms[i]->fill(iEvent,xmult->second,ymult->second);
144 
145  }
146  else {
147  edm::LogWarning("DetSelectionNotFound") << " DetSelection "
148  << m_xSelections[i] << " "
149  << m_ySelections[i] << " not found";
150  }
151  }
152 
153 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned int > m_ySelections
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< edm::InputTag > m_xMultiplicityMaps
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms
std::vector< unsigned int > m_xSelections
std::vector< edm::InputTag > m_yMultiplicityMaps
void MultiplicityCorrelator::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 158 of file MultiplicityCorrelator.cc.

159 {
160 
161 }
void MultiplicityCorrelator::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 164 of file MultiplicityCorrelator.cc.

References i, and m_mchms.

164  {
165 
166  for(unsigned int i=0;i<m_mchms.size();++i) {
167  m_mchms[i]->beginRun(iRun);
168  }
169 }
int i
Definition: DBlmapReader.cc:9
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms
void MultiplicityCorrelator::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 176 of file MultiplicityCorrelator.cc.

176  {
177 }
void MultiplicityCorrelator::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 172 of file MultiplicityCorrelator.cc.

172  {
173 }

Member Data Documentation

std::vector<MultiplicityCorrelatorHistogramMaker*> MultiplicityCorrelator::m_mchms
private
std::vector<std::string> MultiplicityCorrelator::m_xLabels
private

Definition at line 64 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

std::vector<edm::InputTag> MultiplicityCorrelator::m_xMultiplicityMaps
private

Definition at line 62 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

std::vector<unsigned int> MultiplicityCorrelator::m_xSelections
private

Definition at line 66 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

std::vector<std::string> MultiplicityCorrelator::m_yLabels
private

Definition at line 65 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

std::vector<edm::InputTag> MultiplicityCorrelator::m_yMultiplicityMaps
private

Definition at line 63 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

std::vector<unsigned int> MultiplicityCorrelator::m_ySelections
private

Definition at line 67 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().