CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
EcalDataFrame Class Reference

#include <EcalDataFrame.h>

Inheritance diagram for EcalDataFrame:
EBDataFrame EEDataFrame

Public Member Functions

 EcalDataFrame ()
 
 EcalDataFrame (edm::DataFrame const &iframe)
 
edm::DataFrameframe ()
 
edm::DataFrame const & frame () const
 
bool hasSwitchToGain1 () const
 
bool hasSwitchToGain6 () const
 
DetId id () const
 
bool isSaturated () const
 
int lastUnsaturatedSample () const
 
EcalMGPASample operator[] (int i) const
 
EcalMGPASample sample (int i) const
 
void setSample (int i, EcalMGPASample sam)
 
void setSize (int)
 
int size () const
 
virtual ~EcalDataFrame ()
 

Static Public Attributes

static constexpr int MAXSAMPLES = 10
 

Private Attributes

edm::DataFrame m_data
 

Detailed Description

Definition at line 16 of file EcalDataFrame.h.

Constructor & Destructor Documentation

◆ EcalDataFrame() [1/2]

EcalDataFrame::EcalDataFrame ( )
inline

Definition at line 18 of file EcalDataFrame.h.

18 {}

◆ EcalDataFrame() [2/2]

EcalDataFrame::EcalDataFrame ( edm::DataFrame const &  iframe)
inline

Definition at line 20 of file EcalDataFrame.h.

20 : m_data(iframe) {}

◆ ~EcalDataFrame()

virtual EcalDataFrame::~EcalDataFrame ( )
inlinevirtual

Definition at line 22 of file EcalDataFrame.h.

22 {}

Member Function Documentation

◆ frame() [1/2]

edm::DataFrame& EcalDataFrame::frame ( )
inline

Definition at line 51 of file EcalDataFrame.h.

51 { return m_data; }

References m_data.

◆ frame() [2/2]

edm::DataFrame const& EcalDataFrame::frame ( ) const
inline

◆ hasSwitchToGain1()

bool EcalDataFrame::hasSwitchToGain1 ( ) const

Definition at line 25 of file EcalDataFrame.cc.

25  {
26  for (unsigned int u = 0; u < m_data.size(); u++) {
27  if ((static_cast<EcalMGPASample>(m_data[u])).gainId() == EcalMgpaBitwiseGain1)
28  return true;
29  }
30  return false;
31 }

References EcalMgpaBitwiseGain1, m_data, and edm::DataFrame::size().

Referenced by EcalUncalibRecHitMultiFitAlgo::makeRecHit().

◆ hasSwitchToGain6()

bool EcalDataFrame::hasSwitchToGain6 ( ) const

Definition at line 17 of file EcalDataFrame.cc.

17  {
18  for (unsigned int u = 0; u < m_data.size(); u++) {
19  if ((static_cast<EcalMGPASample>(m_data[u])).gainId() == EcalMgpaBitwiseGain6)
20  return true;
21  }
22  return false;
23 }

References EcalMgpaBitwiseGain6, m_data, and edm::DataFrame::size().

Referenced by EcalUncalibRecHitMultiFitAlgo::makeRecHit().

◆ id()

DetId EcalDataFrame::id ( ) const
inline

Definition at line 24 of file EcalDataFrame.h.

24 { return m_data.id(); }

References edm::DataFrame::id(), and m_data.

Referenced by EEDataFrame::id(), EBDataFrame::id(), and EcalUncalibRecHitMultiFitAlgo::makeRecHit().

◆ isSaturated()

bool EcalDataFrame::isSaturated ( ) const
inline

Definition at line 38 of file EcalDataFrame.h.

38 { return (lastUnsaturatedSample() != -1); }

References lastUnsaturatedSample().

Referenced by EcalUncalibRecHitMultiFitAlgo::makeRecHit().

◆ lastUnsaturatedSample()

int EcalDataFrame::lastUnsaturatedSample ( ) const

Definition at line 3 of file EcalDataFrame.cc.

3  {
4  int cnt = 0;
5  for (size_t i = 3; i < m_data.size(); ++i) {
6  cnt = 0;
7  for (size_t j = i; j < (i + 5) && j < m_data.size(); ++j) {
8  if (((EcalMGPASample)m_data[j]).gainId() == EcalMgpaBitwiseGain0)
9  ++cnt;
10  }
11  if (cnt == 5)
12  return i - 1; // the last unsaturated sample
13  }
14  return -1; // no saturation found
15 }

References EcalMgpaBitwiseGain0, mps_fire::i, dqmiolumiharvest::j, m_data, and edm::DataFrame::size().

Referenced by isSaturated().

◆ operator[]()

EcalMGPASample EcalDataFrame::operator[] ( int  i) const
inline

Definition at line 28 of file EcalDataFrame.h.

28 { return m_data[i]; }

References mps_fire::i, and m_data.

◆ sample()

EcalMGPASample EcalDataFrame::sample ( int  i) const
inline

◆ setSample()

void EcalDataFrame::setSample ( int  i,
EcalMGPASample  sam 
)
inline

◆ setSize()

void EcalDataFrame::setSize ( int  )
inline

Definition at line 41 of file EcalDataFrame.h.

41 {}

◆ size()

int EcalDataFrame::size ( void  ) const
inline

Member Data Documentation

◆ m_data

edm::DataFrame EcalDataFrame::m_data
private

◆ MAXSAMPLES

constexpr int EcalDataFrame::MAXSAMPLES = 10
staticconstexpr
mps_fire.i
i
Definition: mps_fire.py:428
EcalMgpaBitwiseGain1
#define EcalMgpaBitwiseGain1
Definition: EcalDataFrame.h:10
EcalDataFrame::lastUnsaturatedSample
int lastUnsaturatedSample() const
Definition: EcalDataFrame.cc:3
EcalMGPASample
Definition: EcalMGPASample.h:22
EcalDataFrame::m_data
edm::DataFrame m_data
Definition: EcalDataFrame.h:54
EcalMgpaBitwiseGain6
#define EcalMgpaBitwiseGain6
Definition: EcalDataFrame.h:9
edm::DataFrame::size
constexpr size_type size() const
Definition: DataFrame.h:43
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EcalMgpaBitwiseGain0
#define EcalMgpaBitwiseGain0
Definition: EcalDataFrame.h:11
edm::DataFrame::id
constexpr id_type id() const
Definition: DataFrame.h:41