CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/TBDataFormats/EcalTBObjects/interface/EcalTBTDCRawInfo.h

Go to the documentation of this file.
00001 #ifndef ECALTBTDCRAWINFO_H
00002 #define ECALTBTDCRAWINFO_H 1
00003 
00004 #include <ostream>
00005 #include <vector>
00006 #include "TBDataFormats/EcalTBObjects/interface/EcalTBTDCSample.h"
00007 
00013 class EcalTBTDCRawInfo {
00014  public:
00015   EcalTBTDCRawInfo() : data_(0) {};
00016 
00017   EcalTBTDCRawInfo(unsigned int channels) 
00018     {
00019       data_.reserve(channels);
00020     }; 
00021 
00023   unsigned int size() const { return data_.size(); }
00024   unsigned int channels() const { return data_.size(); }
00025   const EcalTBTDCSample& operator[](unsigned int i) const { return data_[i]; }
00026   const EcalTBTDCSample& sample(unsigned int i) const { return data_[i]; }
00027     
00029   void setSize(unsigned int size)
00030     {
00031       // data_.reserve(size);
00032       data_.resize(size);
00033     };
00034   
00035   void setSample(unsigned int i, const EcalTBTDCSample& sam) 
00036     {
00037       if (data_.size() < i+1 )
00038         // data_.reserve(i);
00039         data_.resize(i+1);
00040       data_[i]=sam; 
00041     };
00042   
00043  private:
00044 
00045   std::vector<EcalTBTDCSample> data_;
00046 };
00047 
00048 
00049 std::ostream& operator<<(std::ostream& s, const EcalTBTDCRawInfo& digi);
00050 
00051 
00052 
00053 #endif