File indexing completed on 2024-04-06 12:04:04
0001 #ifndef DIGIECAL_ECALDATAFRAME_H
0002 #define DIGIECAL_ECALDATAFRAME_H
0003
0004 #include "DataFormats/EcalDigi/interface/EcalMGPASample.h"
0005 #include "DataFormats/DetId/interface/DetId.h"
0006 #include "DataFormats/Common/interface/DataFrame.h"
0007
0008 #define EcalMgpaBitwiseGain12 1
0009 #define EcalMgpaBitwiseGain6 2
0010 #define EcalMgpaBitwiseGain1 3
0011 #define EcalMgpaBitwiseGain0 0
0012
0013
0014
0015
0016 class EcalDataFrame {
0017 public:
0018 EcalDataFrame() {}
0019
0020 EcalDataFrame(edm::DataFrame const& iframe) : m_data(iframe) {}
0021
0022 virtual ~EcalDataFrame() {}
0023
0024 DetId id() const { return m_data.id(); }
0025
0026 int size() const { return m_data.size(); }
0027
0028 EcalMGPASample operator[](int i) const { return m_data[i]; }
0029 EcalMGPASample sample(int i) const { return m_data[i]; }
0030
0031
0032
0033
0034
0035
0036 int lastUnsaturatedSample() const;
0037
0038 bool isSaturated() const { return (lastUnsaturatedSample() != -1); }
0039
0040
0041 void setSize(int) {}
0042
0043 void setSample(int i, EcalMGPASample sam) { m_data[i] = sam; }
0044
0045 bool hasSwitchToGain6() const;
0046 bool hasSwitchToGain1() const;
0047
0048 static constexpr int MAXSAMPLES = 10;
0049
0050 edm::DataFrame const& frame() const { return m_data; }
0051 edm::DataFrame& frame() { return m_data; }
0052
0053 private:
0054 edm::DataFrame m_data;
0055 };
0056
0057 #endif