CMS 3D CMS Logo

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

FIXEME: More...

#include <DTROChainCoding.h>

Public Member Functions

 DTROChainCoding ()
 Constructors. More...
 
 DTROChainCoding (const int &ddu, const int &ros, const int &rob, const int &tdc, const int &channel)
 
 DTROChainCoding (uint32_t code_)
 
int getChannel () const
 
int getChannelID () const
 
uint32_t getCode () const
 Getters ///////////////////////. More...
 
int getDDU () const
 
int getDDUID () const
 
int getROB () const
 
int getROBID () const
 
int getROS () const
 
int getROSID () const
 
int getSC () const
 SC getters: same as ROS getters (SC data goes in the corresponding ROS) More...
 
int getSCID () const
 
int getTDC () const
 
int getTDCID () const
 
void setChain (const int &ddu, const int &ros, const int &rob, const int &tdc, const int &channel)
 
void setChannel (const int &ID)
 
void setCode (const uint32_t &code_)
 Setters ///////////////////////. More...
 
void setDDU (const int &ID)
 need to reset the bits before setting More...
 
void setROB (const int &ID)
 
void setROS (const int &ID)
 
void setTDC (const int &ID)
 
virtual ~DTROChainCoding ()
 Destructor. More...
 

Private Attributes

uint32_t code
 

Static Private Attributes

static const int CHANNEL_MASK = 0x1F
 
static const int CHANNEL_SHIFT = 0
 
static const int DDU_MASK = 0x3FF
 
static const int DDU_SHIFT = 16
 
static const int ROB_MASK = 0x1F
 
static const int ROB_SHIFT = 7
 
static const int ROS_MASK = 0xF
 
static const int ROS_SHIFT = 12
 
static const int TDC_MASK = 0x3
 
static const int TDC_SHIFT = 5
 

Detailed Description

FIXEME:

A class for handling the DT Read-out chain.

Author
M. Zanetti - INFN Padova

Definition at line 28 of file DTROChainCoding.h.

Constructor & Destructor Documentation

◆ DTROChainCoding() [1/3]

DTROChainCoding::DTROChainCoding ( )
inline

Constructors.

Definition at line 32 of file DTROChainCoding.h.

32 : code(0) {}

◆ DTROChainCoding() [2/3]

DTROChainCoding::DTROChainCoding ( const int &  ddu,
const int &  ros,
const int &  rob,
const int &  tdc,
const int &  channel 
)
inline

Definition at line 34 of file DTROChainCoding.h.

34  {
35  code = ddu << DDU_SHIFT | ros << ROS_SHIFT | rob << ROB_SHIFT | tdc << TDC_SHIFT | channel << CHANNEL_SHIFT;
36  }

References CHANNEL_SHIFT, code, DDU_SHIFT, ROB_SHIFT, ROS_SHIFT, and TDC_SHIFT.

◆ DTROChainCoding() [3/3]

DTROChainCoding::DTROChainCoding ( uint32_t  code_)
inline

Definition at line 38 of file DTROChainCoding.h.

38 : code(code_) {}

◆ ~DTROChainCoding()

virtual DTROChainCoding::~DTROChainCoding ( )
inlinevirtual

Destructor.

Definition at line 41 of file DTROChainCoding.h.

41 {}

Member Function Documentation

◆ getChannel()

int DTROChainCoding::getChannel ( ) const
inline

Definition at line 66 of file DTROChainCoding.h.

66 { return (code >> CHANNEL_SHIFT) & CHANNEL_MASK; }

References CHANNEL_MASK, CHANNEL_SHIFT, and code.

◆ getChannelID()

int DTROChainCoding::getChannelID ( ) const
inline

Definition at line 67 of file DTROChainCoding.h.

67 { return (code >> CHANNEL_SHIFT); }

References CHANNEL_SHIFT, and code.

◆ getCode()

uint32_t DTROChainCoding::getCode ( ) const
inline

Getters ///////////////////////.

Definition at line 57 of file DTROChainCoding.h.

57 { return code; }

References code.

Referenced by DTROS25Unpacker::interpretRawData(), and DTuROSRawToDigi::process().

◆ getDDU()

int DTROChainCoding::getDDU ( ) const
inline

Definition at line 58 of file DTROChainCoding.h.

58 { return (code >> DDU_SHIFT) & DDU_MASK; }

References code, DDU_MASK, and DDU_SHIFT.

◆ getDDUID()

int DTROChainCoding::getDDUID ( ) const
inline

Definition at line 59 of file DTROChainCoding.h.

59 { return (code >> DDU_SHIFT); }

References code, and DDU_SHIFT.

Referenced by DTDataIntegrityROSOffline::processFED(), and DTDataIntegrityROSOffline::processROS25().

◆ getROB()

int DTROChainCoding::getROB ( ) const
inline

Definition at line 62 of file DTROChainCoding.h.

62 { return (code >> ROB_SHIFT) & ROB_MASK; }

References code, ROB_MASK, and ROB_SHIFT.

Referenced by DTDataIntegrityROSOffline::processROS25().

◆ getROBID()

int DTROChainCoding::getROBID ( ) const
inline

Definition at line 63 of file DTROChainCoding.h.

63 { return (code >> ROB_SHIFT); }

References code, and ROB_SHIFT.

◆ getROS()

int DTROChainCoding::getROS ( ) const
inline

Definition at line 60 of file DTROChainCoding.h.

60 { return (code >> ROS_SHIFT) & ROS_MASK; }

References code, ROS_MASK, and ROS_SHIFT.

Referenced by DTDataIntegrityROSOffline::processROS25().

◆ getROSID()

int DTROChainCoding::getROSID ( ) const
inline

Definition at line 61 of file DTROChainCoding.h.

61 { return (code >> ROS_SHIFT); }

References code, and ROS_SHIFT.

Referenced by DTDataIntegrityROSOffline::processROS25().

◆ getSC()

int DTROChainCoding::getSC ( ) const
inline

SC getters: same as ROS getters (SC data goes in the corresponding ROS)

Definition at line 70 of file DTROChainCoding.h.

70 { return (code >> ROS_SHIFT) & ROS_MASK; }

References code, ROS_MASK, and ROS_SHIFT.

◆ getSCID()

int DTROChainCoding::getSCID ( ) const
inline

Definition at line 71 of file DTROChainCoding.h.

71 { return (code >> ROS_SHIFT); }

References code, and ROS_SHIFT.

◆ getTDC()

int DTROChainCoding::getTDC ( ) const
inline

Definition at line 64 of file DTROChainCoding.h.

64 { return (code >> TDC_SHIFT) & TDC_MASK; }

References code, TDC_MASK, and TDC_SHIFT.

◆ getTDCID()

int DTROChainCoding::getTDCID ( ) const
inline

Definition at line 65 of file DTROChainCoding.h.

65 { return (code >> TDC_SHIFT); }

References code, and TDC_SHIFT.

◆ setChain()

void DTROChainCoding::setChain ( const int &  ddu,
const int &  ros,
const int &  rob,
const int &  tdc,
const int &  channel 
)
inline

Definition at line 45 of file DTROChainCoding.h.

45  {
46  code = ddu << DDU_SHIFT | ros << ROS_SHIFT | rob << ROB_SHIFT | tdc << TDC_SHIFT | channel << CHANNEL_SHIFT;
47  }

References CHANNEL_SHIFT, code, DDU_SHIFT, ROB_SHIFT, ROS_SHIFT, and TDC_SHIFT.

◆ setChannel()

void DTROChainCoding::setChannel ( const int &  ID)
inline

Definition at line 54 of file DTROChainCoding.h.

54 { code = (code & (~(CHANNEL_MASK << CHANNEL_SHIFT))) | (ID << CHANNEL_SHIFT); }

References CHANNEL_MASK, CHANNEL_SHIFT, and code.

◆ setCode()

void DTROChainCoding::setCode ( const uint32_t &  code_)
inline

Setters ///////////////////////.

Definition at line 44 of file DTROChainCoding.h.

44 { code = code_; }

References code.

◆ setDDU()

void DTROChainCoding::setDDU ( const int &  ID)
inline

need to reset the bits before setting

Definition at line 50 of file DTROChainCoding.h.

50 { code = (code & (~(DDU_MASK << DDU_SHIFT))) | (ID << DDU_SHIFT); }

References code, DDU_MASK, and DDU_SHIFT.

Referenced by DTDataIntegrityROSOffline::bookHistograms(), DTDataIntegrityROSOffline::processFED(), and DTDataIntegrityROSOffline::processROS25().

◆ setROB()

void DTROChainCoding::setROB ( const int &  ID)
inline

Definition at line 52 of file DTROChainCoding.h.

52 { code = (code & (~(ROB_MASK << ROB_SHIFT))) | (ID << ROB_SHIFT); }

References code, ROB_MASK, and ROB_SHIFT.

Referenced by DTDataIntegrityROSOffline::processROS25().

◆ setROS()

void DTROChainCoding::setROS ( const int &  ID)
inline

Definition at line 51 of file DTROChainCoding.h.

51 { code = (code & (~(ROS_MASK << ROS_SHIFT))) | (ID << ROS_SHIFT); }

References code, ROS_MASK, and ROS_SHIFT.

Referenced by DTDataIntegrityROSOffline::bookHistograms(), and DTDataIntegrityROSOffline::processROS25().

◆ setTDC()

void DTROChainCoding::setTDC ( const int &  ID)
inline

Definition at line 53 of file DTROChainCoding.h.

53 { code = (code & (~(TDC_MASK << TDC_SHIFT))) | (ID << TDC_SHIFT); }

References code, TDC_MASK, and TDC_SHIFT.

Member Data Documentation

◆ CHANNEL_MASK

const int DTROChainCoding::CHANNEL_MASK = 0x1F
staticprivate

Definition at line 92 of file DTROChainCoding.h.

Referenced by getChannel(), and setChannel().

◆ CHANNEL_SHIFT

const int DTROChainCoding::CHANNEL_SHIFT = 0
staticprivate

Definition at line 91 of file DTROChainCoding.h.

Referenced by DTROChainCoding(), getChannel(), getChannelID(), setChain(), and setChannel().

◆ code

uint32_t DTROChainCoding::code
private

◆ DDU_MASK

const int DTROChainCoding::DDU_MASK = 0x3FF
staticprivate

Definition at line 80 of file DTROChainCoding.h.

Referenced by getDDU(), and setDDU().

◆ DDU_SHIFT

const int DTROChainCoding::DDU_SHIFT = 16
staticprivate

Definition at line 79 of file DTROChainCoding.h.

Referenced by DTROChainCoding(), getDDU(), getDDUID(), setChain(), and setDDU().

◆ ROB_MASK

const int DTROChainCoding::ROB_MASK = 0x1F
staticprivate

Definition at line 86 of file DTROChainCoding.h.

Referenced by getROB(), and setROB().

◆ ROB_SHIFT

const int DTROChainCoding::ROB_SHIFT = 7
staticprivate

Definition at line 85 of file DTROChainCoding.h.

Referenced by DTROChainCoding(), getROB(), getROBID(), setChain(), and setROB().

◆ ROS_MASK

const int DTROChainCoding::ROS_MASK = 0xF
staticprivate

Definition at line 83 of file DTROChainCoding.h.

Referenced by getROS(), getSC(), and setROS().

◆ ROS_SHIFT

const int DTROChainCoding::ROS_SHIFT = 12
staticprivate

Definition at line 82 of file DTROChainCoding.h.

Referenced by DTROChainCoding(), getROS(), getROSID(), getSC(), getSCID(), setChain(), and setROS().

◆ TDC_MASK

const int DTROChainCoding::TDC_MASK = 0x3
staticprivate

Definition at line 89 of file DTROChainCoding.h.

Referenced by getTDC(), and setTDC().

◆ TDC_SHIFT

const int DTROChainCoding::TDC_SHIFT = 5
staticprivate

Definition at line 88 of file DTROChainCoding.h.

Referenced by DTROChainCoding(), getTDC(), getTDCID(), setChain(), and setTDC().

DTROChainCoding::DDU_MASK
static const int DDU_MASK
Definition: DTROChainCoding.h:80
DTROChainCoding::TDC_MASK
static const int TDC_MASK
Definition: DTROChainCoding.h:89
DTROChainCoding::ROB_MASK
static const int ROB_MASK
Definition: DTROChainCoding.h:86
DTROChainCoding::ROS_SHIFT
static const int ROS_SHIFT
Definition: DTROChainCoding.h:82
DTROChainCoding::ROB_SHIFT
static const int ROB_SHIFT
Definition: DTROChainCoding.h:85
DTROChainCoding::code
uint32_t code
Definition: DTROChainCoding.h:74
align::ID
uint32_t ID
Definition: Definitions.h:24
DTROChainCoding::DDU_SHIFT
static const int DDU_SHIFT
Definition: DTROChainCoding.h:79
DTROChainCoding::TDC_SHIFT
static const int TDC_SHIFT
Definition: DTROChainCoding.h:88
DTROChainCoding::CHANNEL_SHIFT
static const int CHANNEL_SHIFT
Definition: DTROChainCoding.h:91
DTROChainCoding::ROS_MASK
static const int ROS_MASK
Definition: DTROChainCoding.h:83
DTROChainCoding::CHANNEL_MASK
static const int CHANNEL_MASK
Definition: DTROChainCoding.h:92