CMS 3D CMS Logo

PixelClusterCountsInEvent.h
Go to the documentation of this file.
1 #ifndef DataFormats_Luminosity_PixelClusterCountsInEvent_h
2 #define DataFormats_Luminosity_PixelClusterCountsInEvent_h
3 
11 #include <algorithm>
12 #include <vector>
13 
14 namespace reco {
16  public:
18 
19  void increment(int mD, int count) {
20  size_t modIndex = std::distance(m_ModID.begin(), std::find(m_ModID.begin(), m_ModID.end(), mD));
21  if (modIndex == m_ModID.size()) {
22  m_ModID.push_back(mD);
23  m_counts.push_back(0);
24  }
25  m_counts[modIndex] += count;
26  }
27 
28  void incrementRoc(int rD, int count) {
29  size_t rocIndex = std::distance(m_RocID.begin(), std::find(m_RocID.begin(), m_RocID.end(), rD));
30  if (rocIndex == m_RocID.size()) {
31  m_RocID.push_back(rD);
32  m_countsRoc.push_back(0);
33  }
34  m_countsRoc[rocIndex] += count;
35  }
36 
37  void setbxID(unsigned int inputbxID) { m_bxID = inputbxID; }
38 
39  std::vector<int> const& counts() const { return (m_counts); }
40 
41  std::vector<int> const& countsRoc() const { return (m_countsRoc); }
42 
43  std::vector<int> const& modID() const { return (m_ModID); }
44 
45  std::vector<int> const& rocID() const { return (m_RocID); }
46 
47  unsigned int const& bxID() const { return m_bxID; }
48 
49  private:
50  std::vector<int> m_counts;
51  std::vector<int> m_countsRoc;
52  std::vector<int> m_ModID;
53  std::vector<int> m_RocID;
54  unsigned int m_bxID;
55  };
56 
57 } // namespace reco
58 #endif
std::vector< int > const & rocID() const
unsigned int const & bxID() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< int > const & modID() const
fixed size matrix
void setbxID(unsigned int inputbxID)
std::vector< int > const & countsRoc() const
std::vector< int > const & counts() const