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 setbxID(unsigned int inputbxID) { m_bxID = inputbxID; }
29 
30  std::vector<int> const& counts() const { return (m_counts); }
31 
32  std::vector<int> const& modID() const { return (m_ModID); }
33 
34  unsigned int const& bxID() const { return m_bxID; }
35 
36  private:
37  std::vector<int> m_counts;
38  std::vector<int> m_ModID;
39  unsigned int m_bxID;
40  };
41 
42 } // namespace reco
43 #endif
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 & counts() const