CMS 3D CMS Logo

PixelClusterCounts.h
Go to the documentation of this file.
1 #ifndef DataFormats_Luminosity_PixelClusterCounts_h
2 #define DataFormats_Luminosity_PixelClusterCounts_h
3 
11 #include <algorithm>
12 #include <string>
13 #include <sstream>
14 #include <iostream>
15 #include <vector>
16 
18 
20 
21 
22 namespace reco {
24 
25  public:
27 
28  void increment(int mD,unsigned int bxID,int count){
29  size_t modIndex = std::distance(m_ModID.begin(), std::find(m_ModID.begin(), m_ModID.end(), mD));
30  if (modIndex == m_ModID.size()){
31  m_ModID.push_back(mD);
32  m_counts.resize(m_counts.size()+LumiConstants::numBX, 0);
33  }
34  m_counts.at(LumiConstants::numBX*modIndex+bxID-1) += count;
35  }
36 
37  void eventCounter(unsigned int bxID){
38  m_events.at(bxID-1)++;
39  }
40 
41  std::vector<int> const & readCounts() const {
42  return(m_counts);
43  }
44  std::vector<int> const & readEvents() const {
45  return(m_events);
46  }
47  std::vector<int> const & readModID() const {
48  return(m_ModID);
49  }
50 
51  private:
52  std::vector<int> m_counts;
53  std::vector<int> m_events;
54  std::vector<int> m_ModID;
55 
56 
57 };
58 
59 }
60 #endif
static const unsigned int numBX
Definition: LumiConstants.h:9
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< int > m_events
std::vector< int > const & readCounts() const
std::vector< int > const & readModID() const
void increment(int mD, unsigned int bxID, int count)
fixed size matrix
std::vector< int > m_counts
void eventCounter(unsigned int bxID)
std::vector< int > m_ModID
std::vector< int > const & readEvents() const