CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
reco::PixelClusterCounts Class Reference

#include <PixelClusterCounts.h>

Public Member Functions

void add (reco::PixelClusterCountsInEvent const &pccInEvent)
 
void eventCounter (unsigned int bxID)
 
void increment (int mD, unsigned int bxID, int count)
 
void merge (reco::PixelClusterCounts const &pcc)
 
 PixelClusterCounts ()
 
std::vector< int > const & readCounts () const
 
std::vector< int > const & readEvents () const
 
std::vector< int > const & readModID () const
 
void reset ()
 

Private Attributes

std::vector< int > m_counts
 
std::vector< int > m_events
 
std::vector< int > m_ModID
 

Detailed Description

Reconstructed PixelClusterCounts object that will contain the moduleID, BX, and counts.

Authors
: Sam Higginbotham shigg.nosp@m.inb@.nosp@m.cern..nosp@m.ch and Chris Palmer capal.nosp@m.mer@.nosp@m.cern..nosp@m.ch

Definition at line 21 of file PixelClusterCounts.h.

Constructor & Destructor Documentation

◆ PixelClusterCounts()

reco::PixelClusterCounts::PixelClusterCounts ( )
inline

Definition at line 23 of file PixelClusterCounts.h.

static const unsigned int numBX
Definition: LumiConstants.h:8
std::vector< int > m_events

Member Function Documentation

◆ add()

void reco::PixelClusterCounts::add ( reco::PixelClusterCountsInEvent const &  pccInEvent)
inline

Definition at line 36 of file PixelClusterCounts.h.

References reco::PixelClusterCountsInEvent::bxID(), reco::PixelClusterCountsInEvent::counts(), mps_fire::i, increment(), and reco::PixelClusterCountsInEvent::modID().

Referenced by counter.Counter::register(), SequenceTypes._TaskBase::remove(), and SequenceTypes._TaskBase::replace().

36  {
37  std::vector<int> const& countsInEvent = pccInEvent.counts();
38  std::vector<int> const& modIDInEvent = pccInEvent.modID();
39  int bxIDInEvent = pccInEvent.bxID();
40  for (unsigned int i = 0; i < modIDInEvent.size(); i++) {
41  increment(modIDInEvent[i], bxIDInEvent, countsInEvent.at(i));
42  }
43  }
void increment(int mD, unsigned int bxID, int count)

◆ eventCounter()

void reco::PixelClusterCounts::eventCounter ( unsigned int  bxID)
inline

Definition at line 34 of file PixelClusterCounts.h.

References m_events.

34 { m_events.at(bxID - 1)++; }
std::vector< int > m_events

◆ increment()

void reco::PixelClusterCounts::increment ( int  mD,
unsigned int  bxID,
int  count 
)
inline

Definition at line 25 of file PixelClusterCounts.h.

References submitPVResolutionJobs::count, HLT_2022v12_cff::distance, spr::find(), m_counts, m_ModID, and LumiConstants::numBX.

Referenced by add(), and merge().

25  {
26  size_t modIndex = std::distance(m_ModID.begin(), std::find(m_ModID.begin(), m_ModID.end(), mD));
27  if (modIndex == m_ModID.size()) {
28  m_ModID.push_back(mD);
29  m_counts.resize(m_counts.size() + LumiConstants::numBX, 0);
30  }
31  m_counts.at(LumiConstants::numBX * modIndex + bxID - 1) += count;
32  }
static const unsigned int numBX
Definition: LumiConstants.h:8
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< int > m_counts
std::vector< int > m_ModID

◆ merge()

void reco::PixelClusterCounts::merge ( reco::PixelClusterCounts const &  pcc)
inline

Definition at line 45 of file PixelClusterCounts.h.

References dqmiodumpmetadata::counts, events, mps_fire::i, increment(), m_events, LumiConstants::numBX, readCounts(), readEvents(), and readModID().

Referenced by AlcaPCCIntegrator::streamEndLuminosityBlockSummary().

45  {
46  std::vector<int> const& counts = pcc.readCounts();
47  std::vector<int> const& modIDs = pcc.readModID();
48  std::vector<int> const& events = pcc.readEvents();
49  for (unsigned int i = 0; i < modIDs.size(); i++) {
50  for (unsigned int bxID = 0; bxID < LumiConstants::numBX; ++bxID) {
51  increment(modIDs[i], bxID + 1, counts.at(i * LumiConstants::numBX + bxID));
52  }
53  }
54  for (unsigned int i = 0; i < LumiConstants::numBX; ++i) {
55  m_events[i] += events[i];
56  }
57  }
static const unsigned int numBX
Definition: LumiConstants.h:8
std::vector< int > m_events
void increment(int mD, unsigned int bxID, int count)
int events

◆ readCounts()

std::vector<int> const& reco::PixelClusterCounts::readCounts ( ) const
inline

Definition at line 66 of file PixelClusterCounts.h.

References m_counts.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce(), and merge().

66 { return (m_counts); }
std::vector< int > m_counts

◆ readEvents()

std::vector<int> const& reco::PixelClusterCounts::readEvents ( ) const
inline

Definition at line 67 of file PixelClusterCounts.h.

References m_events.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce(), and merge().

67 { return (m_events); }
std::vector< int > m_events

◆ readModID()

std::vector<int> const& reco::PixelClusterCounts::readModID ( ) const
inline

Definition at line 68 of file PixelClusterCounts.h.

References m_ModID.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce(), and merge().

68 { return (m_ModID); }
std::vector< int > m_ModID

◆ reset()

void reco::PixelClusterCounts::reset ( void  )
inline

Definition at line 59 of file PixelClusterCounts.h.

References m_counts, m_events, m_ModID, and LumiConstants::numBX.

59  {
60  m_counts.clear();
61  m_ModID.clear();
62  m_events.clear();
63  m_events.resize(LumiConstants::numBX, 0);
64  }
static const unsigned int numBX
Definition: LumiConstants.h:8
std::vector< int > m_events
std::vector< int > m_counts
std::vector< int > m_ModID

Member Data Documentation

◆ m_counts

std::vector<int> reco::PixelClusterCounts::m_counts
private

Definition at line 71 of file PixelClusterCounts.h.

Referenced by increment(), readCounts(), and reset().

◆ m_events

std::vector<int> reco::PixelClusterCounts::m_events
private

Definition at line 72 of file PixelClusterCounts.h.

Referenced by eventCounter(), merge(), readEvents(), and reset().

◆ m_ModID

std::vector<int> reco::PixelClusterCounts::m_ModID
private

Definition at line 73 of file PixelClusterCounts.h.

Referenced by increment(), readModID(), and reset().