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:
55 };
56 
57 #endif
EcalDataFrame::MAXSAMPLES
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
EcalDataFrame::sample
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
mps_fire.i
i
Definition: mps_fire.py:428
EcalDataFrame::frame
edm::DataFrame const & frame() const
Definition: EcalDataFrame.h:50
EcalDataFrame::hasSwitchToGain6
bool hasSwitchToGain6() const
Definition: EcalDataFrame.cc:17
EcalDataFrame::EcalDataFrame
EcalDataFrame()
Definition: EcalDataFrame.h:18
EcalDataFrame::setSize
void setSize(int)
Definition: EcalDataFrame.h:41
EcalDataFrame
Definition: EcalDataFrame.h:16
EcalDataFrame::operator[]
EcalMGPASample operator[](int i) const
Definition: EcalDataFrame.h:28
EcalDataFrame::~EcalDataFrame
virtual ~EcalDataFrame()
Definition: EcalDataFrame.h:22
DetId
Definition: DetId.h:17
DataFrame.h
EcalDataFrame::id
DetId id() const
Definition: EcalDataFrame.h:24
EcalDataFrame::lastUnsaturatedSample
int lastUnsaturatedSample() const
Definition: EcalDataFrame.cc:3
EcalDataFrame::isSaturated
bool isSaturated() const
Definition: EcalDataFrame.h:38
EcalDataFrame::hasSwitchToGain1
bool hasSwitchToGain1() const
Definition: EcalDataFrame.cc:25
EcalMGPASample.h
EcalMGPASample
Definition: EcalMGPASample.h:22
EcalDataFrame::m_data
edm::DataFrame m_data
Definition: EcalDataFrame.h:54
edm::DataFrame
Definition: DataFrame.h:15
DetId.h
EcalDataFrame::frame
edm::DataFrame & frame()
Definition: EcalDataFrame.h:51
EcalDataFrame::EcalDataFrame
EcalDataFrame(edm::DataFrame const &iframe)
Definition: EcalDataFrame.h:20
EcalDataFrame::size
int size() const
Definition: EcalDataFrame.h:26
edm::DataFrame::size
constexpr size_type size() const
Definition: DataFrame.h:43
EcalDataFrame::setSample
void setSample(int i, EcalMGPASample sam)
Definition: EcalDataFrame.h:43
edm::DataFrame::id
constexpr id_type id() const
Definition: DataFrame.h:41