CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/EcalDigi/interface/EcalDataFrame.h

Go to the documentation of this file.
00001 #ifndef DIGIECAL_ECALDATAFRAME_H
00002 #define DIGIECAL_ECALDATAFRAME_H
00003 
00004 #include "DataFormats/EcalDigi/interface/EcalMGPASample.h"
00005 #include "DataFormats/DetId/interface/DetId.h"
00006 #include "DataFormats/Common/interface/DataFrame.h"
00007 
00008 
00009 
00010 
00015 class EcalDataFrame {
00016  public:
00017   EcalDataFrame() {}
00018   // EcalDataFrame(DetId i) :  m_data(i) {}
00019   EcalDataFrame(edm::DataFrame const & iframe) : m_data(iframe){} 
00020 
00021   virtual ~EcalDataFrame() {} 
00022 
00023   DetId id() const { return m_data.id();}
00024     
00025   int size() const { return m_data.size();}
00026 
00027   EcalMGPASample operator[](int i) const { return m_data[i];}
00028   EcalMGPASample sample(int i) const { return m_data[i]; }
00029 
00030   // get the leading sample (the first non saturated sample)
00031   // starting from the fourth sample
00032   // (it relies on the fact that the unpaker will discard fixed gain0 DataFrame)
00033   // .. sample numbering: [0, 9]
00034   // .. return -1 in case of no saturation
00035   int lastUnsaturatedSample() const;
00036   // just the boolean method
00037   bool isSaturated() const { return ( lastUnsaturatedSample() != -1 ); }
00038     
00039   // FIXME (shall we throw??)
00040   void setSize(int){}
00041   // void setPresamples(int ps);
00042   void setSample(int i, EcalMGPASample sam) { m_data[i]=sam; }
00043 
00044   static const int MAXSAMPLES = 10;
00045 
00046   edm::DataFrame const & frame() const { return m_data;}
00047   edm::DataFrame & frame() { return m_data;}
00048 
00049  private:
00050  
00051   edm::DataFrame m_data;
00052   
00053 };
00054   
00055 #endif