Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:38:12

0001 #ifndef ECALTBTDCRAWINFO_H
0002 #define ECALTBTDCRAWINFO_H 1
0003 
0004 #include <ostream>
0005 #include <vector>
0006 #include "TBDataFormats/EcalTBObjects/interface/EcalTBTDCSample.h"
0007 
0008 /** \class EcalTBTDCRawInfo

0009 

0010 $Id: EcalTBTDCRawInfo.h,v 1.2 2006/04/21 09:30:56 meridian Exp $

0011 */
0012 
0013 class EcalTBTDCRawInfo {
0014 public:
0015   EcalTBTDCRawInfo() : data_(0) {}
0016 
0017   EcalTBTDCRawInfo(unsigned int channels) { data_.reserve(channels); }
0018 
0019   /// Get methods

0020   unsigned int size() const { return data_.size(); }
0021   unsigned int channels() const { return data_.size(); }
0022   const EcalTBTDCSample& operator[](unsigned int i) const { return data_[i]; }
0023   const EcalTBTDCSample& sample(unsigned int i) const { return data_[i]; }
0024 
0025   /// Set methods

0026   void setSize(unsigned int size) {
0027     // data_.reserve(size);

0028     data_.resize(size);
0029   };
0030 
0031   void setSample(unsigned int i, const EcalTBTDCSample& sam) {
0032     if (data_.size() < i + 1)
0033       // data_.reserve(i);

0034       data_.resize(i + 1);
0035     data_[i] = sam;
0036   };
0037 
0038 private:
0039   std::vector<EcalTBTDCSample> data_;
0040 };
0041 
0042 std::ostream& operator<<(std::ostream& s, const EcalTBTDCRawInfo& digi);
0043 
0044 #endif