test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
18  {
19  data_.reserve(channels);
20  };
21 
23  unsigned int size() const { return data_.size(); }
24  unsigned int channels() const { return data_.size(); }
25  const EcalTBTDCSample& operator[](unsigned int i) const { return data_[i]; }
26  const EcalTBTDCSample& sample(unsigned int i) const { return data_[i]; }
27 
29  void setSize(unsigned int size)
30  {
31  // data_.reserve(size);
32  data_.resize(size);
33  };
34 
35  void setSample(unsigned int i, const EcalTBTDCSample& sam)
36  {
37  if (data_.size() < i+1 )
38  // data_.reserve(i);
39  data_.resize(i+1);
40  data_[i]=sam;
41  };
42 
43  private:
44 
45  std::vector<EcalTBTDCSample> data_;
46 };
47 
48 
49 std::ostream& operator<<(std::ostream& s, const EcalTBTDCRawInfo& digi);
50 
51 
52 
53 #endif
int i
Definition: DBlmapReader.cc:9
EcalTBTDCRawInfo(unsigned int channels)
const EcalTBTDCSample & sample(unsigned int i) const
const EcalTBTDCSample & operator[](unsigned int i) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
std::vector< EcalTBTDCSample > data_
unsigned int size() const
Get methods.
unsigned int channels() const
void setSample(unsigned int i, const EcalTBTDCSample &sam)
void setSize(unsigned int size)
Set methods.