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 (wide_type wide)
 
bool soi () const
 
int te_tdc () const
 
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[](), and Sample().

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.

References Sample().

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

Definition at line 34 of file QIE10DataFrame.cc.

34  {
35  static_assert(sizeof(wide) == 2*sizeof(word1_),
36  "The wide input type must be able to contain two words");
37  const edm::DataFrame::data_type* ptr =
38  reinterpret_cast<const edm::DataFrame::data_type*>(&wide);
39  word1_ = ptr[0];
40  word2_ = ptr[1];
41 }
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 38 of file QIE10DataFrame.h.

References MASK_ADC, and word1_.

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

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

Definition at line 43 of file QIE10DataFrame.h.

References MASK_CAPID, and word2_.

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

43 { 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 39 of file QIE10DataFrame.h.

References MASK_LE_TDC, and word2_.

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

39 { 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 41 of file QIE10DataFrame.h.

References MASK_OK, and word1_.

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

41 { 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 44 of file QIE10DataFrame.h.

References wideRaw(), word1_, and word2_.

45  { 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 42 of file QIE10DataFrame.h.

References MASK_SOI, and word1_.

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

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

Definition at line 40 of file QIE10DataFrame.h.

References MASK_TE_TDC, and word2_.

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

40 { 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

Definition at line 43 of file QIE10DataFrame.cc.

References mps_fire::result.

Referenced by raw(), and HFPreRecAlgo::reconstruct().

43  {
44  static_assert(sizeof(QIE10DataFrame::Sample::wide_type) == 2*sizeof(word1_),
45  "The wide result type must be able to contain two words");
46  wide_type result = 0;
48  reinterpret_cast<edm::DataFrame::data_type*>(&result);
49  ptr[0] = word1_;
50  ptr[1] = word2_;
51  return result;
52 }
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 29 of file QIE10DataFrame.h.

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

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

Definition at line 35 of file QIE10DataFrame.h.

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

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

Definition at line 30 of file QIE10DataFrame.h.

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

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

Definition at line 34 of file QIE10DataFrame.h.

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

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

Definition at line 33 of file QIE10DataFrame.h.

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

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

Definition at line 31 of file QIE10DataFrame.h.

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

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

Definition at line 36 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample().

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

Definition at line 32 of file QIE10DataFrame.h.

Referenced by QIE10DataFrame::setSample().

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

Definition at line 49 of file QIE10DataFrame.h.

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

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

Definition at line 50 of file QIE10DataFrame.h.

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