CMS 3D CMS Logo

EcalTBHodoscopePlaneRawHits.h
Go to the documentation of this file.
1 #ifndef DIGIECAL_ECALTBHODOSCOPEPLANERAWHITS_H
2 #define DIGIECAL_ECALTBHODOSCOPEPLANERAWHITS_H 1
3 
4 #include <ostream>
5 #include <vector>
6 
14 public:
16 
18  rawChannelHits_.reserve(channels);
19  for (unsigned int i = 0; i < channels; i++)
20  rawChannelHits_[i] = false;
21  }
22 
24  unsigned int channels() const { return rawChannelHits_.size(); }
25  const std::vector<bool>& hits() const { return rawChannelHits_; }
26 
27  unsigned int numberOfFiredHits() const {
28  int numberOfHits = 0;
29  for (unsigned int i = 0; i < rawChannelHits_.size(); i++)
30  if (rawChannelHits_[i])
31  numberOfHits++;
32  return numberOfHits;
33  }
34 
35  bool operator[](unsigned int i) const { return rawChannelHits_[i]; }
36  bool isChannelFired(unsigned int i) const { return rawChannelHits_[i]; }
37 
39  void setChannels(unsigned int size) { rawChannelHits_.resize(size); };
40 
41  void addHit(unsigned int i) {
42  if (rawChannelHits_.size() < i + 1)
43  rawChannelHits_.resize(i + 1);
44  rawChannelHits_[i] = true;
45  };
46 
47  void setHit(unsigned int i, bool status) {
48  if (rawChannelHits_.size() < i + 1)
49  rawChannelHits_.resize(i + 1);
51  };
52 
53 private:
54  std::vector<bool> rawChannelHits_;
55 };
56 
57 std::ostream& operator<<(std::ostream&, const EcalTBHodoscopePlaneRawHits&);
58 
59 #endif
size
Write out results.
void setHit(unsigned int i, bool status)
bool isChannelFired(unsigned int i) const
void setChannels(unsigned int size)
Set methods.
unsigned int channels() const
Get Methods.
bool operator[](unsigned int i) const
EcalTBHodoscopePlaneRawHits(unsigned int channels)
const std::vector< bool > & hits() const
std::ostream & operator<<(std::ostream &, const EcalTBHodoscopePlaneRawHits &)