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 edm::EDConsumerBase

Public Member Functions

 MultiplicityCorrelator (const edm::ParameterSet &)
 
 ~MultiplicityCorrelator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

std::vector
< MultiplicityCorrelatorHistogramMaker * > 
m_mchms
 
std::vector< std::string > m_xLabels
 
std::vector< edm::EDGetTokenT
< std::map< unsigned int, int > > > 
m_xMultiplicityMapTokens
 
std::vector< unsigned int > m_xSelections
 
std::vector< std::string > m_yLabels
 
std::vector< edm::EDGetTokenT
< std::map< unsigned int, int > > > 
m_yMultiplicityMapTokens
 
std::vector< unsigned int > m_ySelections
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 82 of file MultiplicityCorrelator.cc.

References edm::EDConsumerBase::consumes(), edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), m_mchms, m_xLabels, m_xMultiplicityMapTokens, m_xSelections, m_yLabels, m_yMultiplicityMapTokens, m_ySelections, and AlCaHLTBitMon_QueryRunRegistry::string.

82  :
83  m_mchms(),
86 {
87  //now do what ever initialization is needed
88 
89  std::vector<edm::ParameterSet> correlationConfigs =
90  iConfig.getParameter<std::vector<edm::ParameterSet> >("correlationConfigurations");
91 
92  for(std::vector<edm::ParameterSet>::const_iterator ps=correlationConfigs.begin();ps!=correlationConfigs.end();++ps) {
93 
94  m_xMultiplicityMapTokens.push_back(consumes<std::map<unsigned int, int> >(ps->getParameter<edm::InputTag>("xMultiplicityMap")));
95  m_yMultiplicityMapTokens.push_back(consumes<std::map<unsigned int, int> >(ps->getParameter<edm::InputTag>("yMultiplicityMap")));
96  m_xLabels.push_back(ps->getParameter<std::string>("xDetLabel"));
97  m_yLabels.push_back(ps->getParameter<std::string>("yDetLabel"));
98  m_xSelections.push_back(ps->getParameter<unsigned int>("xDetSelection"));
99  m_ySelections.push_back(ps->getParameter<unsigned int>("yDetSelection"));
100 
102 
103  }
104 
105 }
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > m_yMultiplicityMapTokens
std::vector< unsigned int > m_ySelections
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::string > m_yLabels
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms
std::vector< std::string > m_xLabels
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > m_xMultiplicityMapTokens
std::vector< unsigned int > m_xSelections
MultiplicityCorrelator::~MultiplicityCorrelator ( )

Definition at line 108 of file MultiplicityCorrelator.cc.

References i, and m_mchms.

109 {
110 
111  for(unsigned int i=0;i<m_mchms.size();++i) {
112  delete m_mchms[i];
113  }
114 
115 }
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 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 124 of file MultiplicityCorrelator.cc.

References edm::Event::getByToken(), i, m_mchms, m_xMultiplicityMapTokens, m_xSelections, m_yMultiplicityMapTokens, and m_ySelections.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 157 of file MultiplicityCorrelator.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 163 of file MultiplicityCorrelator.cc.

References i, and m_mchms.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 171 of file MultiplicityCorrelator.cc.

171  {
172 }

Member Data Documentation

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

Definition at line 63 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

std::vector<edm::EDGetTokenT<std::map<unsigned int, int> > > MultiplicityCorrelator::m_xMultiplicityMapTokens
private

Definition at line 61 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

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

Definition at line 65 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

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

Definition at line 64 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

std::vector<edm::EDGetTokenT<std::map<unsigned int, int> > > MultiplicityCorrelator::m_yMultiplicityMapTokens
private

Definition at line 62 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

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

Definition at line 66 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().