Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:04

0001 #ifndef DIGIECAL_ESDATAFRAME_H
0002 #define DIGIECAL_ESDATAFRAME_H
0003 
0004 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0005 #include "DataFormats/EcalDigi/interface/ESSample.h"
0006 #include "DataFormats/Common/interface/DataFrame.h"
0007 #include <vector>
0008 #include <ostream>
0009 
0010 class ESDataFrame {
0011 public:
0012   typedef ESDetId key_type;  ///< For the sorted collection
0013 
0014   ESDataFrame();
0015   explicit ESDataFrame(const ESDetId& id);
0016 
0017   ESDataFrame(const edm::DataFrame& df);
0018 
0019   const ESDetId& id() const { return id_; }
0020 
0021   int size() const { return size_; }
0022 
0023   const ESSample& operator[](int i) const { return data_[i]; }
0024   const ESSample& sample(int i) const { return data_[i]; }
0025 
0026   void setSize(int size);
0027 
0028   void setSample(int i, const ESSample& sam) { data_[i] = sam; }
0029 
0030   static const int MAXSAMPLES = 3;
0031 
0032 private:
0033   ESDetId id_;
0034   int size_;
0035 
0036   ESSample data_[MAXSAMPLES];
0037 };
0038 
0039 std::ostream& operator<<(std::ostream&, const ESDataFrame&);
0040 
0041 #endif