CMS 3D CMS Logo

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 
17  public:
19  // EcalDataFrame(DetId i) : m_data(i) {}
20  EcalDataFrame(edm::DataFrame const & iframe) : m_data(iframe){}
21 
22  virtual ~EcalDataFrame() {}
23 
24  DetId id() const { return m_data.id();}
25 
26  int size() const { return m_data.size();}
27 
28  EcalMGPASample operator[](int i) const { return m_data[i];}
29  EcalMGPASample sample(int i) const { return m_data[i]; }
30 
31  // get the leading sample (the first non saturated sample)
32  // starting from the fourth sample
33  // (it relies on the fact that the unpaker will discard fixed gain0 DataFrame)
34  // .. sample numbering: [0, 9]
35  // .. return -1 in case of no saturation
36  int lastUnsaturatedSample() const;
37  // just the boolean method
38  bool isSaturated() const { return ( lastUnsaturatedSample() != -1 ); }
39 
40  // FIXME (shall we throw??)
41  void setSize(int){}
42  // void setPresamples(int ps);
43  void setSample(int i, EcalMGPASample sam) { m_data[i]=sam; }
44 
45  bool hasSwitchToGain6() const;
46  bool hasSwitchToGain1() const;
47 
48  static constexpr int MAXSAMPLES = 10;
49 
50  edm::DataFrame const & frame() const { return m_data;}
51  edm::DataFrame & frame() { return m_data;}
52 
53  private:
54 
56 
57 };
58 
59 #endif
bool hasSwitchToGain1() const
DetId id() const
Definition: EcalDataFrame.h:24
bool hasSwitchToGain6() const
bool isSaturated() const
Definition: EcalDataFrame.h:38
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
EcalMGPASample operator[](int i) const
Definition: EcalDataFrame.h:28
#define constexpr
int size() const
Definition: EcalDataFrame.h:26
EcalDataFrame(edm::DataFrame const &iframe)
Definition: EcalDataFrame.h:20
constexpr id_type id() const
Definition: DataFrame.h:61
void setSize(int)
Definition: EcalDataFrame.h:41
edm::DataFrame & frame()
Definition: EcalDataFrame.h:51
constexpr size_type size() const
Definition: DataFrame.h:64
Definition: DetId.h:18
edm::DataFrame const & frame() const
Definition: EcalDataFrame.h:50
void setSample(int i, EcalMGPASample sam)
Definition: EcalDataFrame.h:43
edm::DataFrame m_data
Definition: EcalDataFrame.h:55
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
int lastUnsaturatedSample() const
Definition: EcalDataFrame.cc:3
virtual ~EcalDataFrame()
Definition: EcalDataFrame.h:22