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 incrementRoc (int rD, 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
 
std::vector< int > const & readRocCounts () const
 
std::vector< int > const & readRocID () const
 
void reset ()
 

Private Attributes

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

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 47 of file PixelClusterCounts.h.

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

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

47  {
48  std::vector<int> const& countsInEvent = pccInEvent.counts();
49  std::vector<int> const& rocCountsInEvent = pccInEvent.countsRoc();
50  std::vector<int> const& modIDInEvent = pccInEvent.modID();
51  std::vector<int> const& rocIDInEvent = pccInEvent.rocID();
52  int bxIDInEvent = pccInEvent.bxID();
53 
54  for (unsigned int i = 0; i < modIDInEvent.size(); i++) {
55  increment(modIDInEvent[i], bxIDInEvent, countsInEvent.at(i));
56  }
57  for (unsigned int i = 0; i < rocIDInEvent.size(); i++) {
58  incrementRoc(rocIDInEvent[i], rocCountsInEvent.at(i));
59  }
60  }
void incrementRoc(int rD, int count)
void increment(int mD, unsigned int bxID, int count)

◆ eventCounter()

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

Definition at line 45 of file PixelClusterCounts.h.

References m_events.

45 { 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_2024v13_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

◆ incrementRoc()

void reco::PixelClusterCounts::incrementRoc ( int  rD,
int  count 
)
inline

Definition at line 34 of file PixelClusterCounts.h.

References submitPVResolutionJobs::count, HLT_2024v13_cff::distance, spr::find(), m_countsRoc, and m_RocID.

Referenced by add(), and merge().

34  {
35  size_t rocIndex = std::distance(m_RocID.begin(), std::find(m_RocID.begin(), m_RocID.end(), rD));
36 
37  if (rocIndex == m_RocID.size()) {
38  m_RocID.push_back(rD);
39  m_countsRoc.push_back(0);
40  }
41 
42  m_countsRoc.at(rocIndex) += count;
43  }
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_RocID
std::vector< int > m_countsRoc

◆ merge()

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

Definition at line 62 of file PixelClusterCounts.h.

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

Referenced by AlcaPCCIntegrator::streamEndLuminosityBlockSummary().

62  {
63  std::vector<int> const& counts = pcc.readCounts();
64  std::vector<int> const& countsRoc = pcc.readRocCounts();
65  std::vector<int> const& modIDs = pcc.readModID();
66  std::vector<int> const& rocIDs = pcc.readRocID();
67  std::vector<int> const& events = pcc.readEvents();
68 
69  for (unsigned int i = 0; i < modIDs.size(); i++) {
70  for (unsigned int bxID = 0; bxID < LumiConstants::numBX; ++bxID) {
71  increment(modIDs[i], bxID + 1, counts.at(i * LumiConstants::numBX + bxID));
72  }
73  }
74  for (unsigned int i = 0; i < rocIDs.size(); i++) {
75  incrementRoc(rocIDs[i], countsRoc.at(i));
76  }
77  for (unsigned int i = 0; i < LumiConstants::numBX; ++i) {
78  m_events[i] += events[i];
79  }
80  }
static const unsigned int numBX
Definition: LumiConstants.h:8
void incrementRoc(int rD, int count)
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 91 of file PixelClusterCounts.h.

References m_counts.

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

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

◆ readEvents()

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

Definition at line 93 of file PixelClusterCounts.h.

References m_events.

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

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

◆ readModID()

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

Definition at line 94 of file PixelClusterCounts.h.

References m_ModID.

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

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

◆ readRocCounts()

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

Definition at line 92 of file PixelClusterCounts.h.

References m_countsRoc.

Referenced by merge().

92 { return (m_countsRoc); }
std::vector< int > m_countsRoc

◆ readRocID()

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

Definition at line 95 of file PixelClusterCounts.h.

References m_RocID.

Referenced by merge().

95 { return (m_RocID); }
std::vector< int > m_RocID

◆ reset()

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

Definition at line 82 of file PixelClusterCounts.h.

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

82  {
83  m_counts.clear();
84  m_countsRoc.clear();
85  m_ModID.clear();
86  m_RocID.clear();
87  m_events.clear();
88  m_events.resize(LumiConstants::numBX, 0);
89  }
static const unsigned int numBX
Definition: LumiConstants.h:8
std::vector< int > m_RocID
std::vector< int > m_events
std::vector< int > m_counts
std::vector< int > m_countsRoc
std::vector< int > m_ModID

Member Data Documentation

◆ m_counts

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

Definition at line 98 of file PixelClusterCounts.h.

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

◆ m_countsRoc

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

Definition at line 99 of file PixelClusterCounts.h.

Referenced by incrementRoc(), readRocCounts(), and reset().

◆ m_events

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

Definition at line 100 of file PixelClusterCounts.h.

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

◆ m_ModID

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

Definition at line 101 of file PixelClusterCounts.h.

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

◆ m_RocID

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

Definition at line 102 of file PixelClusterCounts.h.

Referenced by incrementRoc(), readRocID(), and reset().