CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 31 of file DTROChainCoding.h.

Constructor & Destructor Documentation

DTROChainCoding::DTROChainCoding ( )
inline

Constructors.

Definition at line 37 of file DTROChainCoding.h.

37 : code(0) {}
DTROChainCoding::DTROChainCoding ( const int &  ddu,
const int &  ros,
const int &  rob,
const int &  tdc,
const int &  channel 
)
inline

Definition at line 39 of file DTROChainCoding.h.

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

40  {
41  code =
42  ddu << DDU_SHIFT |
43  ros << ROS_SHIFT |
44  rob << ROB_SHIFT |
45  tdc << TDC_SHIFT |
46  channel << CHANNEL_SHIFT;
47  }
static const int ROB_SHIFT
static const int ROS_SHIFT
static const int DDU_SHIFT
static const int CHANNEL_SHIFT
static const int TDC_SHIFT
DTROChainCoding::DTROChainCoding ( uint32_t  code_)
inline

Definition at line 49 of file DTROChainCoding.h.

49 : code(code_) {}
virtual DTROChainCoding::~DTROChainCoding ( )
inlinevirtual

Destructor.

Definition at line 52 of file DTROChainCoding.h.

52 {}

Member Function Documentation

int DTROChainCoding::getChannel ( ) const
inline

Definition at line 94 of file DTROChainCoding.h.

References CHANNEL_MASK, CHANNEL_SHIFT, and code.

94 { return (code >> CHANNEL_SHIFT) & CHANNEL_MASK; }
static const int CHANNEL_MASK
static const int CHANNEL_SHIFT
int DTROChainCoding::getChannelID ( ) const
inline

Definition at line 95 of file DTROChainCoding.h.

References CHANNEL_SHIFT, and code.

95 { return (code >> CHANNEL_SHIFT) ; }
static const int CHANNEL_SHIFT
uint32_t DTROChainCoding::getCode ( ) const
inline

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

Definition at line 85 of file DTROChainCoding.h.

References code.

Referenced by DTROS25Unpacker::interpretRawData().

85 { return code; }
int DTROChainCoding::getDDU ( ) const
inline

Definition at line 86 of file DTROChainCoding.h.

References code, DDU_MASK, and DDU_SHIFT.

86 { return (code >> DDU_SHIFT) & DDU_MASK; }
static const int DDU_MASK
static const int DDU_SHIFT
int DTROChainCoding::getDDUID ( ) const
inline

Definition at line 87 of file DTROChainCoding.h.

References code, and DDU_SHIFT.

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

87 { return (code >> DDU_SHIFT) ; }
static const int DDU_SHIFT
int DTROChainCoding::getROB ( ) const
inline

Definition at line 90 of file DTROChainCoding.h.

References code, ROB_MASK, and ROB_SHIFT.

Referenced by DTDataIntegrityTask::processROS25().

90 { return (code >> ROB_SHIFT) & ROB_MASK; }
static const int ROB_MASK
static const int ROB_SHIFT
int DTROChainCoding::getROBID ( ) const
inline

Definition at line 91 of file DTROChainCoding.h.

References code, and ROB_SHIFT.

91 { return (code >> ROB_SHIFT) ; }
static const int ROB_SHIFT
int DTROChainCoding::getROS ( ) const
inline

Definition at line 88 of file DTROChainCoding.h.

References code, ROS_MASK, and ROS_SHIFT.

Referenced by DTDataIntegrityTask::processROS25().

88 { return (code >> ROS_SHIFT) & ROS_MASK; }
static const int ROS_MASK
static const int ROS_SHIFT
int DTROChainCoding::getROSID ( ) const
inline

Definition at line 89 of file DTROChainCoding.h.

References code, and ROS_SHIFT.

Referenced by DTDataIntegrityTask::processROS25().

89 { return (code >> ROS_SHIFT) ; }
static const int ROS_SHIFT
int DTROChainCoding::getSC ( ) const
inline

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

Definition at line 98 of file DTROChainCoding.h.

References code, ROS_MASK, and ROS_SHIFT.

98 { return (code >> ROS_SHIFT) & ROS_MASK; }
static const int ROS_MASK
static const int ROS_SHIFT
int DTROChainCoding::getSCID ( ) const
inline

Definition at line 99 of file DTROChainCoding.h.

References code, and ROS_SHIFT.

Referenced by DTDataIntegrityTask::processROS25().

99 { return (code >> ROS_SHIFT) ; }
static const int ROS_SHIFT
int DTROChainCoding::getTDC ( ) const
inline

Definition at line 92 of file DTROChainCoding.h.

References code, TDC_MASK, and TDC_SHIFT.

92 { return (code >> TDC_SHIFT) & TDC_MASK; }
static const int TDC_MASK
static const int TDC_SHIFT
int DTROChainCoding::getTDCID ( ) const
inline

Definition at line 93 of file DTROChainCoding.h.

References code, and TDC_SHIFT.

93 { return (code >> TDC_SHIFT) ; }
static const int TDC_SHIFT
void DTROChainCoding::setChain ( const int &  ddu,
const int &  ros,
const int &  rob,
const int &  tdc,
const int &  channel 
)
inline

Definition at line 56 of file DTROChainCoding.h.

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

57  {
58 
59  code =
60  ddu << DDU_SHIFT |
61  ros << ROS_SHIFT |
62  rob << ROB_SHIFT |
63  tdc << TDC_SHIFT |
64  channel << CHANNEL_SHIFT;
65  }
static const int ROB_SHIFT
static const int ROS_SHIFT
static const int DDU_SHIFT
static const int CHANNEL_SHIFT
static const int TDC_SHIFT
void DTROChainCoding::setChannel ( const int &  ID)
inline

Definition at line 80 of file DTROChainCoding.h.

References CHANNEL_MASK, CHANNEL_SHIFT, and code.

80  {
81  code = ( code & (~(CHANNEL_MASK << CHANNEL_SHIFT)) ) | (ID << CHANNEL_SHIFT);
82  }
uint32_t ID
Definition: Definitions.h:26
static const int CHANNEL_MASK
static const int CHANNEL_SHIFT
void DTROChainCoding::setCode ( const uint32_t &  code_)
inline

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

Definition at line 55 of file DTROChainCoding.h.

References code.

55 {code = code_;}
void DTROChainCoding::setDDU ( const int &  ID)
inline

need to reset the bits before setting

Definition at line 68 of file DTROChainCoding.h.

References code, DDU_MASK, and DDU_SHIFT.

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

68  {
69  code = ( code & (~(DDU_MASK << DDU_SHIFT)) ) | (ID << DDU_SHIFT);
70  }
uint32_t ID
Definition: Definitions.h:26
static const int DDU_MASK
static const int DDU_SHIFT
void DTROChainCoding::setROB ( const int &  ID)
inline

Definition at line 74 of file DTROChainCoding.h.

References code, ROB_MASK, and ROB_SHIFT.

Referenced by DTDataIntegrityTask::processROS25().

74  {
75  code = ( code & (~(ROB_MASK << ROB_SHIFT)) ) | (ID << ROB_SHIFT);
76  }
static const int ROB_MASK
uint32_t ID
Definition: Definitions.h:26
static const int ROB_SHIFT
void DTROChainCoding::setROS ( const int &  ID)
inline

Definition at line 71 of file DTROChainCoding.h.

References code, ROS_MASK, and ROS_SHIFT.

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

71  {
72  code = ( code & (~(ROS_MASK << ROS_SHIFT)) ) | (ID << ROS_SHIFT);
73  }
static const int ROS_MASK
uint32_t ID
Definition: Definitions.h:26
static const int ROS_SHIFT
void DTROChainCoding::setTDC ( const int &  ID)
inline

Definition at line 77 of file DTROChainCoding.h.

References code, TDC_MASK, and TDC_SHIFT.

77  {
78  code = ( code & (~(TDC_MASK << TDC_SHIFT)) ) | (ID << TDC_SHIFT);
79  }
uint32_t ID
Definition: Definitions.h:26
static const int TDC_MASK
static const int TDC_SHIFT

Member Data Documentation

const int DTROChainCoding::CHANNEL_MASK = 0x1F
staticprivate

Definition at line 122 of file DTROChainCoding.h.

Referenced by getChannel(), and setChannel().

const int DTROChainCoding::CHANNEL_SHIFT = 0
staticprivate

Definition at line 121 of file DTROChainCoding.h.

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

uint32_t DTROChainCoding::code
private
const int DTROChainCoding::DDU_MASK = 0x3FF
staticprivate

Definition at line 110 of file DTROChainCoding.h.

Referenced by getDDU(), and setDDU().

const int DTROChainCoding::DDU_SHIFT = 16
staticprivate

Definition at line 109 of file DTROChainCoding.h.

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

const int DTROChainCoding::ROB_MASK = 0x1F
staticprivate

Definition at line 116 of file DTROChainCoding.h.

Referenced by getROB(), and setROB().

const int DTROChainCoding::ROB_SHIFT = 7
staticprivate

Definition at line 115 of file DTROChainCoding.h.

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

const int DTROChainCoding::ROS_MASK = 0xF
staticprivate

Definition at line 113 of file DTROChainCoding.h.

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

const int DTROChainCoding::ROS_SHIFT = 12
staticprivate

Definition at line 112 of file DTROChainCoding.h.

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

const int DTROChainCoding::TDC_MASK = 0x3
staticprivate

Definition at line 119 of file DTROChainCoding.h.

Referenced by getTDC(), and setTDC().

const int DTROChainCoding::TDC_SHIFT = 5
staticprivate

Definition at line 118 of file DTROChainCoding.h.

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