CMS 3D CMS Logo

EcalDataFrame.cc
Go to the documentation of this file.
2 
4 {
5  int cnt = 0;
6  for ( size_t i = 3; i < m_data.size(); ++i ) {
7  cnt = 0;
8  for ( size_t j = i; j < (i + 5) && j < m_data.size(); ++j ) {
9  if ( ((EcalMGPASample)m_data[j]).gainId() == EcalMgpaBitwiseGain0 ) ++cnt;
10  }
11  if ( cnt == 5 ) return i-1; // the last unsaturated sample
12  }
13  return -1; // no saturation found
14 }
15 
16 
18 {
19  for(unsigned int u=0; u<m_data.size(); u++)
20  {
21  if ( ( static_cast<EcalMGPASample>(m_data[u]) ).gainId() == EcalMgpaBitwiseGain6 ) return true;
22  }
23  return false;
24 }
25 
26 
28 {
29  for(unsigned int u=0; u<m_data.size(); u++)
30  {
31  if ( ( static_cast<EcalMGPASample>(m_data[u]) ).gainId() == EcalMgpaBitwiseGain1 ) return true;
32  }
33  return false;
34 }
bool hasSwitchToGain1() const
bool hasSwitchToGain6() const
#define EcalMgpaBitwiseGain1
Definition: EcalDataFrame.h:10
#define EcalMgpaBitwiseGain6
Definition: EcalDataFrame.h:9
edm::DataFrame m_data
Definition: EcalDataFrame.h:55
size_type size() const
Definition: DataFrame.h:64
#define EcalMgpaBitwiseGain0
Definition: EcalDataFrame.h:11
int lastUnsaturatedSample() const
Definition: EcalDataFrame.cc:3