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
reco::PixelClusterCountsInEvent
Definition: PixelClusterCountsInEvent.h:15
reco::PixelClusterCountsInEvent::increment
void increment(int mD, int count)
Definition: PixelClusterCountsInEvent.h:19
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
reco::PixelClusterCountsInEvent::m_counts
std::vector< int > m_counts
Definition: PixelClusterCountsInEvent.h:37
reco::PixelClusterCountsInEvent::PixelClusterCountsInEvent
PixelClusterCountsInEvent()
Definition: PixelClusterCountsInEvent.h:17
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
reco::PixelClusterCountsInEvent::m_bxID
unsigned int m_bxID
Definition: PixelClusterCountsInEvent.h:39
reco::PixelClusterCountsInEvent::counts
std::vector< int > const & counts() const
Definition: PixelClusterCountsInEvent.h:30
reco::PixelClusterCountsInEvent::modID
std::vector< int > const & modID() const
Definition: PixelClusterCountsInEvent.h:32
reco::PixelClusterCountsInEvent::bxID
unsigned int const & bxID() const
Definition: PixelClusterCountsInEvent.h:34
reco::PixelClusterCountsInEvent::setbxID
void setbxID(unsigned int inputbxID)
Definition: PixelClusterCountsInEvent.h:28
reco::PixelClusterCountsInEvent::m_ModID
std::vector< int > m_ModID
Definition: PixelClusterCountsInEvent.h:38
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7799