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 
5 #include <ostream>
6 #include <vector>
7 #include <boost/cstdint.hpp>
8 
16  public:
18 
20  {
21  rawChannelHits_.reserve(channels);
22  for (unsigned int i=0;i<channels;i++)
23  rawChannelHits_[i]=false;
24  }
25 
27  unsigned int channels() const { return rawChannelHits_.size(); }
28  const std::vector<bool>& hits() const { return rawChannelHits_; }
29 
30  unsigned int numberOfFiredHits() const
31  {
32  int numberOfHits=0;
33  for (unsigned int i=0;i<rawChannelHits_.size();i++)
34  if (rawChannelHits_[i])
35  numberOfHits++;
36  return numberOfHits;
37  }
38 
39  bool operator[](unsigned int i) const { return rawChannelHits_[i]; }
40  bool isChannelFired(unsigned int i) const { return rawChannelHits_[i]; }
41 
43  void setChannels(unsigned int size)
44  {
45  rawChannelHits_.resize(size);
46  };
47 
48  void addHit(unsigned int i)
49  {
50  if (rawChannelHits_.size() < i+1 )
51  rawChannelHits_.resize(i+1);
52  rawChannelHits_[i]=true;
53  };
54 
55  void setHit(unsigned int i,bool status)
56  {
57  if (rawChannelHits_.size() < i+1 )
58  rawChannelHits_.resize(i+1);
60  };
61 
62 
63  private:
64  std::vector<bool> rawChannelHits_;
65 
66 };
67 
68 std::ostream& operator<<(std::ostream&, const EcalTBHodoscopePlaneRawHits&);
69 
70 #endif
size
Write out results.
void setHit(unsigned int i, bool status)
unsigned int channels() const
Get Methods.
void setChannels(unsigned int size)
Set methods.
bool operator[](unsigned int i) const
const std::vector< bool > & hits() const
EcalTBHodoscopePlaneRawHits(unsigned int channels)
bool isChannelFired(unsigned int i) const
std::ostream & operator<<(std::ostream &, const EcalTBHodoscopePlaneRawHits &)