CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
17  public:
19 
21  {
22  rawChannelHits_.reserve(channels);
23  for (unsigned int i=0;i<channels;i++)
24  rawChannelHits_[i]=0;
25  }
26 
28  unsigned int channels() const { return rawChannelHits_.size(); }
29  const std::vector<bool>& hits() const { return rawChannelHits_; }
30 
31  unsigned int numberOfFiredHits() const
32  {
33  int numberOfHits=0;
34  for (unsigned int i=0;i<rawChannelHits_.size();i++)
35  if (rawChannelHits_[i])
36  numberOfHits++;
37  return numberOfHits;
38  }
39 
40  bool operator[](unsigned int i) const { return rawChannelHits_[i]; }
41  bool isChannelFired(unsigned int i) const { return rawChannelHits_[i]; }
42 
44  void setChannels(unsigned int size)
45  {
46  rawChannelHits_.resize(size);
47  };
48 
49  void addHit(unsigned int i)
50  {
51  if (rawChannelHits_.size() < i+1 )
52  rawChannelHits_.resize(i+1);
53  rawChannelHits_[i]=true;
54  };
55 
56  void setHit(unsigned int i,bool status)
57  {
58  if (rawChannelHits_.size() < i+1 )
59  rawChannelHits_.resize(i+1);
61  };
62 
63 
64  private:
65  std::vector<bool> rawChannelHits_;
66 
67 };
68 
69 std::ostream& operator<<(std::ostream&, const EcalTBHodoscopePlaneRawHits&);
70 
71 #endif
int i
Definition: DBlmapReader.cc:9
void setHit(unsigned int i, bool status)
unsigned int channels() const
Get Methods.
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
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
tuple status
Definition: ntuplemaker.py:245
tuple size
Write out results.