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 
45 
46  private:
47  std::vector<int> m_counts;
48  std::vector<int> m_events;
49  std::vector<int> m_ModID;
50 
51 
52 };
53 
54 }
55 #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
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