CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
QIE10DataFrame::Sample Class Reference

#include <QIE10DataFrame.h>

Public Types

typedef uint32_t wide_type
 

Public Member Functions

int adc () const
 
int capid () const
 
int le_tdc () const
 
bool ok () const
 
edm::DataFrame::data_type raw (edm::DataFrame::size_type i) const
 
 Sample (const edm::DataFrame &frame, edm::DataFrame::size_type i)
 
 Sample (const edm::DataFrame::data_type &word1, const edm::DataFrame::data_type &word2)
 
 Sample (const wide_type wide)
 
bool soi () const
 
int te_tdc () const
 
QIE10DataFrame::Sample::wide_type wideRaw () const
 

Static Public Attributes

static const int MASK_ADC = 0xFF
 
static const int MASK_CAPID = 0x3
 
static const int MASK_LE_TDC = 0x3F
 
static const int MASK_OK = 0x1000
 
static const int MASK_SOI = 0x2000
 
static const int MASK_TE_TDC = 0x1F
 
static const int OFFSET_CAPID = 12
 
static const int OFFSET_TE_TDC = 6
 

Private Attributes

edm::DataFrame::data_type word1_
 
edm::DataFrame::data_type word2_
 

Detailed Description

Definition at line 21 of file QIE10DataFrame.h.

Member Typedef Documentation

Definition at line 23 of file QIE10DataFrame.h.

Constructor & Destructor Documentation

QIE10DataFrame::Sample::Sample ( const edm::DataFrame frame,
edm::DataFrame::size_type  i 
)
inline

Definition at line 25 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::operator[]().

25 : word1_(frame[i]), word2_(frame[i+1]) { }
edm::DataFrame::data_type word1_
edm::DataFrame::data_type word2_
QIE10DataFrame::Sample::Sample ( const edm::DataFrame::data_type word1,
const edm::DataFrame::data_type word2 
)
inline

Definition at line 26 of file QIE10DataFrame.h.

26 : word1_(word1), word2_(word2) {}
edm::DataFrame::data_type word1_
edm::DataFrame::data_type word2_
QIE10DataFrame::Sample::Sample ( const wide_type  wide)
inlineexplicit

Definition at line 27 of file QIE10DataFrame.h.

References word1_, and word2_.

28  : word1_{0}, word2_{0} {
29  static_assert(sizeof(wide) == 2*sizeof(word1_),
30  "The wide input type must be able to contain two words");
31  const edm::DataFrame::data_type* ptr =
32  reinterpret_cast<const edm::DataFrame::data_type*>(&wide);
33  word1_ = ptr[0];
34  word2_ = ptr[1];
35  }
unsigned short data_type
Definition: DataFrame.h:20
edm::DataFrame::data_type word1_
edm::DataFrame::data_type word2_

Member Function Documentation

int QIE10DataFrame::Sample::adc ( ) const
inline

Definition at line 46 of file QIE10DataFrame.h.

References MASK_ADC, and word1_.

Referenced by QIE10DataFrame::copyContent(), and operator<<().

46 { return word1_&MASK_ADC; }
static const int MASK_ADC
edm::DataFrame::data_type word1_
int QIE10DataFrame::Sample::capid ( ) const
inline

Definition at line 51 of file QIE10DataFrame.h.

References MASK_CAPID, and word2_.

Referenced by QIE10DataFrame::copyContent(), operator<<(), and HFPreRecAlgo::reconstruct().

51 { return (word2_>>OFFSET_CAPID)&MASK_CAPID; }
static const int MASK_CAPID
edm::DataFrame::data_type word2_
static const int OFFSET_CAPID
int QIE10DataFrame::Sample::le_tdc ( ) const
inline

Definition at line 47 of file QIE10DataFrame.h.

References MASK_LE_TDC, and word2_.

Referenced by QIE10DataFrame::copyContent(), operator<<(), and HFPreRecAlgo::reconstruct().

47 { return word2_&MASK_LE_TDC; }
static const int MASK_LE_TDC
edm::DataFrame::data_type word2_
bool QIE10DataFrame::Sample::ok ( ) const
inline

Definition at line 49 of file QIE10DataFrame.h.

References MASK_OK, and word1_.

Referenced by QIE10DataFrame::copyContent(), HFQIE10Info::isDataframeOK(), operator<<(), and QIE10DataFrame::setSample().

49 { return word1_&MASK_OK; }
static const int MASK_OK
edm::DataFrame::data_type word1_
edm::DataFrame::data_type QIE10DataFrame::Sample::raw ( edm::DataFrame::size_type  i) const
inline

Definition at line 52 of file QIE10DataFrame.h.

References word1_, and word2_.

53  { return (i > WORDS_PER_SAMPLE) ? 0 : ( (i==1) ? word2_ : word1_ ); }
static const int WORDS_PER_SAMPLE
edm::DataFrame::data_type word1_
edm::DataFrame::data_type word2_
bool QIE10DataFrame::Sample::soi ( ) const
inline

Definition at line 50 of file QIE10DataFrame.h.

References MASK_SOI, and word1_.

Referenced by QIE10DataFrame::copyContent(), operator<<(), and QIE10DataFrame::setSample().

50 { return word1_&MASK_SOI; }
static const int MASK_SOI
edm::DataFrame::data_type word1_
int QIE10DataFrame::Sample::te_tdc ( ) const
inline

Definition at line 48 of file QIE10DataFrame.h.

References MASK_TE_TDC, and word2_.

Referenced by QIE10DataFrame::copyContent(), and operator<<().

48 { return (word2_>>OFFSET_TE_TDC)&MASK_TE_TDC; }
static const int OFFSET_TE_TDC
edm::DataFrame::data_type word2_
static const int MASK_TE_TDC
QIE10DataFrame::Sample::wide_type QIE10DataFrame::Sample::wideRaw ( ) const
inline

Definition at line 54 of file QIE10DataFrame.h.

References mps_fire::result, word1_, and word2_.

Referenced by HFPreRecAlgo::reconstruct().

54  {
55  static_assert(sizeof(QIE10DataFrame::Sample::wide_type) == 2*sizeof(word1_),
56  "The wide result type must be able to contain two words");
57  wide_type result = 0;
59  reinterpret_cast<edm::DataFrame::data_type*>(&result);
60  ptr[0] = word1_;
61  ptr[1] = word2_;
62  return result;
63  }
unsigned short data_type
Definition: DataFrame.h:20
edm::DataFrame::data_type word1_
edm::DataFrame::data_type word2_

Member Data Documentation

const int QIE10DataFrame::Sample::MASK_ADC = 0xFF
static

Definition at line 37 of file QIE10DataFrame.h.

Referenced by adc(), and QIE10DataFrame::setSample().

const int QIE10DataFrame::Sample::MASK_CAPID = 0x3
static

Definition at line 43 of file QIE10DataFrame.h.

Referenced by capid(), and QIE10DataFrame::setSample().

const int QIE10DataFrame::Sample::MASK_LE_TDC = 0x3F
static

Definition at line 38 of file QIE10DataFrame.h.

Referenced by le_tdc(), and QIE10DataFrame::setSample().

const int QIE10DataFrame::Sample::MASK_OK = 0x1000
static

Definition at line 42 of file QIE10DataFrame.h.

Referenced by ok(), and QIE10DataFrame::setSample().

const int QIE10DataFrame::Sample::MASK_SOI = 0x2000
static

Definition at line 41 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample(), and soi().

const int QIE10DataFrame::Sample::MASK_TE_TDC = 0x1F
static

Definition at line 39 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample(), and te_tdc().

const int QIE10DataFrame::Sample::OFFSET_CAPID = 12
static

Definition at line 44 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample().

const int QIE10DataFrame::Sample::OFFSET_TE_TDC = 6
static

Definition at line 40 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample().

edm::DataFrame::data_type QIE10DataFrame::Sample::word1_
private

Definition at line 66 of file QIE10DataFrame.h.

Referenced by adc(), ok(), raw(), Sample(), soi(), and wideRaw().

edm::DataFrame::data_type QIE10DataFrame::Sample::word2_
private

Definition at line 67 of file QIE10DataFrame.h.

Referenced by capid(), le_tdc(), raw(), Sample(), te_tdc(), and wideRaw().