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
operator<<
std::ostream & operator<<(std::ostream &, const EcalTBHodoscopePlaneRawHits &)
Definition: EcalTBHodoscopePlaneRawHits.cc:3
mps_fire.i
i
Definition: mps_fire.py:428
EcalTBHodoscopePlaneRawHits
Definition: EcalTBHodoscopePlaneRawHits.h:13
EcalTBHodoscopePlaneRawHits::setChannels
void setChannels(unsigned int size)
Set methods.
Definition: EcalTBHodoscopePlaneRawHits.h:39
mps_update.status
status
Definition: mps_update.py:69
EcalTBHodoscopePlaneRawHits::operator[]
bool operator[](unsigned int i) const
Definition: EcalTBHodoscopePlaneRawHits.h:35
EcalTBHodoscopePlaneRawHits::rawChannelHits_
std::vector< bool > rawChannelHits_
Definition: EcalTBHodoscopePlaneRawHits.h:51
EcalTBHodoscopePlaneRawHits::hits
const std::vector< bool > & hits() const
Definition: EcalTBHodoscopePlaneRawHits.h:25
EcalTBHodoscopePlaneRawHits::addHit
void addHit(unsigned int i)
Definition: EcalTBHodoscopePlaneRawHits.h:41
EcalTBHodoscopePlaneRawHits::setHit
void setHit(unsigned int i, bool status)
Definition: EcalTBHodoscopePlaneRawHits.h:47
EcalTBHodoscopePlaneRawHits::numberOfFiredHits
unsigned int numberOfFiredHits() const
Definition: EcalTBHodoscopePlaneRawHits.h:27
EcalTBHodoscopePlaneRawHits::isChannelFired
bool isChannelFired(unsigned int i) const
Definition: EcalTBHodoscopePlaneRawHits.h:36
EcalTBHodoscopePlaneRawHits::channels
unsigned int channels() const
Get Methods.
Definition: EcalTBHodoscopePlaneRawHits.h:24
EcalTBHodoscopePlaneRawHits::EcalTBHodoscopePlaneRawHits
EcalTBHodoscopePlaneRawHits()
Definition: EcalTBHodoscopePlaneRawHits.h:15
EcalTBHodoscopePlaneRawHits::EcalTBHodoscopePlaneRawHits
EcalTBHodoscopePlaneRawHits(unsigned int channels)
Definition: EcalTBHodoscopePlaneRawHits.h:17
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443