CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Private Attributes

EcalDataFrame Class Reference

#include <EcalDataFrame.h>

Inheritance diagram for EcalDataFrame:
EBDataFrame EEDataFrame

List of all members.

Public Member Functions

 EcalDataFrame ()
 EcalDataFrame (edm::DataFrame const &iframe)
edm::DataFrame const & frame () const
edm::DataFrameframe ()
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 const int MAXSAMPLES = 10

Private Attributes

edm::DataFrame m_data

Detailed Description

Id:
EcalDataFrame.h,v 1.9 2012/01/27 15:04:40 franzoni Exp

Definition at line 17 of file EcalDataFrame.h.


Constructor & Destructor Documentation

EcalDataFrame::EcalDataFrame ( ) [inline]

Definition at line 19 of file EcalDataFrame.h.

{}
EcalDataFrame::EcalDataFrame ( edm::DataFrame const &  iframe) [inline]

Definition at line 21 of file EcalDataFrame.h.

: m_data(iframe){} 
virtual EcalDataFrame::~EcalDataFrame ( ) [inline, virtual]

Definition at line 23 of file EcalDataFrame.h.

{} 

Member Function Documentation

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

Definition at line 51 of file EcalDataFrame.h.

References m_data.

Referenced by edm::DataMixingEMDigiWorker::putEM(), and EcalTBReadout::readOut().

{ return m_data;}
edm::DataFrame& EcalDataFrame::frame ( ) [inline]

Definition at line 52 of file EcalDataFrame.h.

References m_data.

{ return m_data;}
bool EcalDataFrame::hasSwitchToGain1 ( ) const

Definition at line 27 of file EcalDataFrame.cc.

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

{
  for(unsigned int u=0; u<m_data.size(); u++) 
    {
      if ( ( static_cast<EcalMGPASample>(m_data[u]) ).gainId() == EcalMgpaBitwiseGain1 ) return true;
    }
  return false;
}
bool EcalDataFrame::hasSwitchToGain6 ( ) const

Definition at line 17 of file EcalDataFrame.cc.

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

{
  for(unsigned int u=0; u<m_data.size(); u++) 
    {
      if ( ( static_cast<EcalMGPASample>(m_data[u]) ).gainId() == EcalMgpaBitwiseGain6 ) return true;
    }
  return false;
}
DetId EcalDataFrame::id ( void  ) const [inline]

Reimplemented in EBDataFrame, and EEDataFrame.

Definition at line 25 of file EcalDataFrame.h.

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

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

{ return m_data.id();}
bool EcalDataFrame::isSaturated ( ) const [inline]

Definition at line 39 of file EcalDataFrame.h.

References lastUnsaturatedSample().

{ return ( lastUnsaturatedSample() != -1 ); }
int EcalDataFrame::lastUnsaturatedSample ( ) const

Definition at line 3 of file EcalDataFrame.cc.

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

Referenced by isSaturated().

{
        int cnt = 0;
        for ( size_t i = 3; i < m_data.size(); ++i ) {
                cnt = 0;
                for ( size_t j = i; j < (i + 5) && j < m_data.size(); ++j ) {
                        if ( ((EcalMGPASample)m_data[j]).gainId() == EcalMgpaBitwiseGain0 ) ++cnt;
                }
                if ( cnt == 5 ) return i-1; // the last unsaturated sample
        }
        return -1; // no saturation found
}
EcalMGPASample EcalDataFrame::operator[] ( int  i) const [inline]

Definition at line 29 of file EcalDataFrame.h.

References i, and m_data.

{ return m_data[i];}
EcalMGPASample EcalDataFrame::sample ( int  i) const [inline]
void EcalDataFrame::setSample ( int  i,
EcalMGPASample  sam 
) [inline]
void EcalDataFrame::setSize ( int  ) [inline]

Definition at line 42 of file EcalDataFrame.h.

Referenced by EcalCoder::analogToDigital().

{}
int EcalDataFrame::size ( void  ) const [inline]

Member Data Documentation

const int EcalDataFrame::MAXSAMPLES = 10 [static]