CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalDataFrame.h
Go to the documentation of this file.
1 #ifndef DIGIECAL_ECALDATAFRAME_H
2 #define DIGIECAL_ECALDATAFRAME_H
3 
7 
8 #define EcalMgpaBitwiseGain12 1
9 #define EcalMgpaBitwiseGain6 2
10 #define EcalMgpaBitwiseGain1 3
11 #define EcalMgpaBitwiseGain0 0
12 
18  public:
20  // EcalDataFrame(DetId i) : m_data(i) {}
21  EcalDataFrame(edm::DataFrame const & iframe) : m_data(iframe){}
22 
23  virtual ~EcalDataFrame() {}
24 
25  DetId id() const { return m_data.id();}
26 
27  int size() const { return m_data.size();}
28 
29  EcalMGPASample operator[](int i) const { return m_data[i];}
30  EcalMGPASample sample(int i) const { return m_data[i]; }
31 
32  // get the leading sample (the first non saturated sample)
33  // starting from the fourth sample
34  // (it relies on the fact that the unpaker will discard fixed gain0 DataFrame)
35  // .. sample numbering: [0, 9]
36  // .. return -1 in case of no saturation
37  int lastUnsaturatedSample() const;
38  // just the boolean method
39  bool isSaturated() const { return ( lastUnsaturatedSample() != -1 ); }
40 
41  // FIXME (shall we throw??)
42  void setSize(int){}
43  // void setPresamples(int ps);
44  void setSample(int i, EcalMGPASample sam) { m_data[i]=sam; }
45 
46  bool hasSwitchToGain6() const;
47  bool hasSwitchToGain1() const;
48 
49  static const int MAXSAMPLES = 10;
50 
51  edm::DataFrame const & frame() const { return m_data;}
52  edm::DataFrame & frame() { return m_data;}
53 
54  private:
55 
57 
58 };
59 
60 #endif
int i
Definition: DBlmapReader.cc:9
bool hasSwitchToGain1() const
DetId id() const
Definition: EcalDataFrame.h:25
bool hasSwitchToGain6() const
bool isSaturated() const
Definition: EcalDataFrame.h:39
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:30
EcalMGPASample operator[](int i) const
Definition: EcalDataFrame.h:29
int size() const
Definition: EcalDataFrame.h:27
EcalDataFrame(edm::DataFrame const &iframe)
Definition: EcalDataFrame.h:21
void setSize(int)
Definition: EcalDataFrame.h:42
edm::DataFrame & frame()
Definition: EcalDataFrame.h:52
Definition: DetId.h:20
edm::DataFrame const & frame() const
Definition: EcalDataFrame.h:51
void setSample(int i, EcalMGPASample sam)
Definition: EcalDataFrame.h:44
edm::DataFrame m_data
Definition: EcalDataFrame.h:56
size_type size() const
Definition: DataFrame.h:63
static const int MAXSAMPLES
Definition: EcalDataFrame.h:49
int lastUnsaturatedSample() const
Definition: EcalDataFrame.cc:3
id_type id() const
Definition: DataFrame.h:60
virtual ~EcalDataFrame()
Definition: EcalDataFrame.h:23