CMS 3D CMS Logo

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

#include <EcalFEMSample.h>

Public Member Functions

int adc () const
 get the ADC sample (12 bits) More...
 
 EcalFEMSample ()
 
 EcalFEMSample (int adc, int gainId)
 
 EcalFEMSample (uint16_t data)
 
int gainId () const
 get the gainId (2 bits) More...
 
uint16_t operator() ()
 for streaming More...
 
uint16_t raw () const
 get the raw word More...
 

Private Attributes

uint16_t theSample
 

Detailed Description

Simple container packer/unpacker for a single sample from the FEM electronics

$Id:

Definition at line 14 of file EcalFEMSample.h.

Constructor & Destructor Documentation

◆ EcalFEMSample() [1/3]

EcalFEMSample::EcalFEMSample ( )
inline

Definition at line 16 of file EcalFEMSample.h.

16 { theSample = 0; }

References theSample.

◆ EcalFEMSample() [2/3]

EcalFEMSample::EcalFEMSample ( uint16_t  data)
inline

Definition at line 17 of file EcalFEMSample.h.

17 { theSample = data; }

References data, and theSample.

◆ EcalFEMSample() [3/3]

EcalFEMSample::EcalFEMSample ( int  adc,
int  gainId 
)

Definition at line 3 of file EcalFEMSample.cc.

3 { theSample = (adc & 0xFFF) | ((gainId & 0x3) << 12); }

References adc(), gainId(), and theSample.

Member Function Documentation

◆ adc()

int EcalFEMSample::adc ( ) const
inline

get the ADC sample (12 bits)

Definition at line 23 of file EcalFEMSample.h.

23 { return theSample & 0xFFF; }

References theSample.

Referenced by EcalFEMSample(), and operator<<().

◆ gainId()

int EcalFEMSample::gainId ( ) const
inline

get the gainId (2 bits)

Definition at line 25 of file EcalFEMSample.h.

25 { return (theSample >> 12) & 0x3; }

References theSample.

Referenced by EcalFEMSample(), and operator<<().

◆ operator()()

uint16_t EcalFEMSample::operator() ( )
inline

for streaming

Definition at line 27 of file EcalFEMSample.h.

27 { return theSample; }

References theSample.

◆ raw()

uint16_t EcalFEMSample::raw ( ) const
inline

get the raw word

Definition at line 21 of file EcalFEMSample.h.

21 { return theSample; }

References theSample.

Member Data Documentation

◆ theSample

uint16_t EcalFEMSample::theSample
private

Definition at line 30 of file EcalFEMSample.h.

Referenced by adc(), EcalFEMSample(), gainId(), operator()(), and raw().

EcalFEMSample::theSample
uint16_t theSample
Definition: EcalFEMSample.h:30
EcalFEMSample::gainId
int gainId() const
get the gainId (2 bits)
Definition: EcalFEMSample.h:25
EcalFEMSample::adc
int adc() const
get the ADC sample (12 bits)
Definition: EcalFEMSample.h:23
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79