CMS 3D CMS Logo

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 () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 44 of file MultiplicityCorrelator.cc.

Constructor & Destructor Documentation

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

Definition at line 78 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.

79  : m_mchms(),
82  m_xLabels(),
83  m_yLabels(),
84  m_xSelections(),
85  m_ySelections() {
86  //now do what ever initialization is needed
87 
88  std::vector<edm::ParameterSet> correlationConfigs =
89  iConfig.getParameter<std::vector<edm::ParameterSet> >("correlationConfigurations");
90 
91  for (std::vector<edm::ParameterSet>::const_iterator ps = correlationConfigs.begin(); ps != correlationConfigs.end();
92  ++ps) {
93  m_xMultiplicityMapTokens.push_back(
94  consumes<std::map<unsigned int, int> >(ps->getParameter<edm::InputTag>("xMultiplicityMap")));
95  m_yMultiplicityMapTokens.push_back(
96  consumes<std::map<unsigned int, int> >(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 
103  }
104 }
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 ( )
override

Definition at line 106 of file MultiplicityCorrelator.cc.

References mps_fire::i, and m_mchms.

106  {
107  for (unsigned int i = 0; i < m_mchms.size(); ++i) {
108  delete m_mchms[i];
109  }
110 }
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms

Member Function Documentation

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

Definition at line 117 of file MultiplicityCorrelator.cc.

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

117  {
118  using namespace edm;
119 
120  for (unsigned int i = 0; i < m_mchms.size(); ++i) {
122  iEvent.getByToken(m_xMultiplicityMapTokens[i], xMults);
124  iEvent.getByToken(m_yMultiplicityMapTokens[i], yMults);
125 
126  // check if the selection exists
127 
128  std::map<unsigned int, int>::const_iterator xmult = xMults->find(m_xSelections[i]);
129  std::map<unsigned int, int>::const_iterator ymult = yMults->find(m_ySelections[i]);
130 
131  if (xmult != xMults->end() && ymult != yMults->end()) {
132  m_mchms[i]->fill(iEvent, xmult->second, ymult->second);
133 
134  } else {
135  edm::LogWarning("DetSelectionNotFound")
136  << " DetSelection " << m_xSelections[i] << " " << m_ySelections[i] << " not found";
137  }
138  }
139 }
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > m_yMultiplicityMapTokens
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< unsigned int > m_ySelections
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms
HLT enums.
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 142 of file MultiplicityCorrelator.cc.

142 {}
void MultiplicityCorrelator::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 144 of file MultiplicityCorrelator.cc.

References mps_fire::i, and m_mchms.

144  {
145  for (unsigned int i = 0; i < m_mchms.size(); ++i) {
146  m_mchms[i]->beginRun(iRun);
147  }
148 }
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms
void MultiplicityCorrelator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 150 of file MultiplicityCorrelator.cc.

References DEFINE_FWK_MODULE.

150 {}

Member Data Documentation

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

Definition at line 61 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

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

Definition at line 59 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

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

Definition at line 63 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

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

Definition at line 62 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

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

Definition at line 60 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

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

Definition at line 64 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().