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::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 MultiplicityCorrelator (const edm::ParameterSet &)
 
 ~MultiplicityCorrelator () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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
 
void endRun (const edm::Run &, const edm::EventSetup &) 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::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

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

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

Definition at line 44 of file MultiplicityCorrelator.cc.

Constructor & Destructor Documentation

◆ MultiplicityCorrelator()

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

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

80  : m_mchms(),
83  m_xLabels(),
84  m_yLabels(),
85  m_xSelections(),
86  m_ySelections() {
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();
93  ++ps) {
94  m_xMultiplicityMapTokens.push_back(
95  consumes<std::map<unsigned int, int> >(ps->getParameter<edm::InputTag>("xMultiplicityMap")));
96  m_yMultiplicityMapTokens.push_back(
97  consumes<std::map<unsigned int, int> >(ps->getParameter<edm::InputTag>("yMultiplicityMap")));
98  m_xLabels.push_back(ps->getParameter<std::string>("xDetLabel"));
99  m_yLabels.push_back(ps->getParameter<std::string>("yDetLabel"));
100  m_xSelections.push_back(ps->getParameter<unsigned int>("xDetSelection"));
101  m_ySelections.push_back(ps->getParameter<unsigned int>("yDetSelection"));
102 
104  }
105 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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::~MultiplicityCorrelator ( )
override

Definition at line 107 of file MultiplicityCorrelator.cc.

References mps_fire::i, and m_mchms.

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 118 of file MultiplicityCorrelator.cc.

References mps_fire::i, iEvent, m_mchms, m_xMultiplicityMapTokens, m_xSelections, m_yMultiplicityMapTokens, and m_ySelections.

118  {
119  using namespace edm;
120 
121  for (unsigned int i = 0; i < m_mchms.size(); ++i) {
123  iEvent.getByToken(m_xMultiplicityMapTokens[i], xMults);
125  iEvent.getByToken(m_yMultiplicityMapTokens[i], yMults);
126 
127  // check if the selection exists
128 
129  std::map<unsigned int, int>::const_iterator xmult = xMults->find(m_xSelections[i]);
130  std::map<unsigned int, int>::const_iterator ymult = yMults->find(m_ySelections[i]);
131 
132  if (xmult != xMults->end() && ymult != yMults->end()) {
133  m_mchms[i]->fill(iEvent, xmult->second, ymult->second);
134 
135  } else {
136  edm::LogWarning("DetSelectionNotFound")
137  << " DetSelection " << m_xSelections[i] << " " << m_ySelections[i] << " not found";
138  }
139  }
140 }
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > m_yMultiplicityMapTokens
std::vector< unsigned int > m_ySelections
int iEvent
Definition: GenABIO.cc:224
std::vector< MultiplicityCorrelatorHistogramMaker * > m_mchms
HLT enums.
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > m_xMultiplicityMapTokens
std::vector< unsigned int > m_xSelections
Log< level::Warning, false > LogWarning

◆ beginJob()

void MultiplicityCorrelator::beginJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 143 of file MultiplicityCorrelator.cc.

143 {}

◆ beginRun()

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

Definition at line 145 of file MultiplicityCorrelator.cc.

References mps_fire::i, and m_mchms.

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

◆ endJob()

void MultiplicityCorrelator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 151 of file MultiplicityCorrelator.cc.

151 {}

◆ endRun()

void MultiplicityCorrelator::endRun ( const edm::Run ,
const edm::EventSetup  
)
inlineoverrideprivate

Definition at line 53 of file MultiplicityCorrelator.cc.

53 {}

Member Data Documentation

◆ m_mchms

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

◆ m_xLabels

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

Definition at line 62 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

◆ m_xMultiplicityMapTokens

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

Definition at line 60 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

◆ m_xSelections

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

Definition at line 64 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

◆ m_yLabels

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

Definition at line 63 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

◆ m_yMultiplicityMapTokens

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

Definition at line 61 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

◆ m_ySelections

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

Definition at line 65 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().