CMS 3D CMS Logo

EcalTBTDCRawInfo.h
Go to the documentation of this file.
1 #ifndef ECALTBTDCRAWINFO_H
2 #define ECALTBTDCRAWINFO_H 1
3 
4 #include <ostream>
5 #include <vector>
7 
14 public:
16 
17  EcalTBTDCRawInfo(unsigned int channels) { data_.reserve(channels); };
18 
20  unsigned int size() const { return data_.size(); }
21  unsigned int channels() const { return data_.size(); }
22  const EcalTBTDCSample& operator[](unsigned int i) const { return data_[i]; }
23  const EcalTBTDCSample& sample(unsigned int i) const { return data_[i]; }
24 
26  void setSize(unsigned int size) {
27  // data_.reserve(size);
28  data_.resize(size);
29  };
30 
31  void setSample(unsigned int i, const EcalTBTDCSample& sam) {
32  if (data_.size() < i + 1)
33  // data_.reserve(i);
34  data_.resize(i + 1);
35  data_[i] = sam;
36  };
37 
38 private:
39  std::vector<EcalTBTDCSample> data_;
40 };
41 
42 std::ostream& operator<<(std::ostream& s, const EcalTBTDCRawInfo& digi);
43 
44 #endif
const EcalTBTDCSample & operator[](unsigned int i) const
EcalTBTDCRawInfo(unsigned int channels)
unsigned int size() const
Get methods.
const EcalTBTDCSample & sample(unsigned int i) const
std::vector< EcalTBTDCSample > data_
std::ostream & operator<<(std::ostream &s, const EcalTBTDCRawInfo &digi)
void setSample(unsigned int i, const EcalTBTDCSample &sam)
unsigned int channels() const
void setSize(unsigned int size)
Set methods.