1 #ifndef DTRawToDigi_DTDDUWords_h
2 #define DTRawToDigi_DTDDUWords_h
10 #define WORDCONTROLMASK 0xE0000000
11 #define WORDCONTROLSHIFT 29
12 #define WORDTYPEMASK 0x1F000000
13 #define WORDTYPESHIFT 24
16 #define ERRORMASK 0x8000
19 #define DEBUG_TYPE_MASK 0xE00000
20 #define DEBUG_TYPE_SHIFT 21
21 #define DEBUG_MESSAGE_MASK 0x7FFF
22 #define CEROS_ID_CEROS_STATUS_MASK 0x1F0000
23 #define CEROS_ID_CEROS_STATUS_SHIFT 16
24 #define EV_ID_CEROS_STATUS_MASK 0xFC0
25 #define EV_ID_CEROS_STATUS_SHIFT 6
26 #define DONTREAD_CEROS_STATUS_MASK 0x3F
27 #define CEROS_ID_ROS_STATUS_MASK 0x3F
30 #define TTC_EVENT_COUNTER_MASK 0xFFFFFF
32 #define TFF_MASK 0x800000
34 #define TPX_MASK 0x400000
36 #define L1A_FIFO_OCC_MASK 0x3F0000
37 #define L1A_FIFO_OCC_SHIFT 16
38 #define EVENT_WORD_COUNT_MASK 0xFFFF
40 #define ERROR_TYPE_MASK 0xE00000
41 #define ERROR_TYPE_SHIFT 21
42 #define ERROR_ROB_ID_MASK 0x1F0000
43 #define ERROR_ROB_ID_SHIFT 16
44 #define ERROR_CEROS_ID_MASK 0x3F
46 #define ROB_ID_MASK 0x1F000000
47 #define EVENT_ID_MASK 0xFFF000
48 #define EVENT_ID_SHIFT 12
49 #define BUNCH_ID_MASK 0xFFF
50 #define WORD_COUNT_MASK 0xFFF
52 #define PC_MASK 0x8000000
54 #define PAF_MASK 0x4000000
56 #define TDC_ID_MASK 0x3000000
57 #define TDC_ID_SHIFT 24
59 #define TDC_CHANNEL_MASK 0xF80000
60 #define TDC_CHANNEL_SHIFT 19
61 #define TDC_TIME_MASK 0x7FFFC // First two bits are excluded
62 #define TDC_TIME_SHIFT 2
64 #define TDC_ERROR_MASK 0x7FFF
66 #define SCFO_MASK 0xFF
68 #define TRIGGER_WORD_COUNT_MASK 0xFFFF
70 #define TRIGGER_DATA_MASK 0xFFFF
73 #define SC_LAT_SHIFT 8
74 #define SC_LAT_MASK 0x7F
76 #define SC_NW_MASK 0xFF
78 #define SC_TRIGGERDLY_MASK 0x7
79 #define SC_TRIGGERDLY_SHIFT 12
80 #define SC_BXC_MASK 0xFFF
84 #include <boost/cstdint.hpp>
229 static void set(uint32_t &word,
230 int ttc_event_counter) {
278 static void set(uint32_t &word,
282 int event_word_count) {
328 static void set(uint32_t &word,
378 static void set(uint32_t &word,
388 static void set(uint32_t &word,
436 static void set(uint32_t &word,
484 static void set(uint32_t &word,
536 static void set(uint32_t &word,
592 static void set(uint32_t &word,
648 static void set(uint32_t &word,
704 static void set(uint32_t &word,
754 static void set(uint32_t &word,
796 static void set(uint32_t &word,
846 static void set(uint32_t &word,
979 static void set(uint32_t &word,
1024 static void set(uint32_t &word,
DTROSWordType(const uint32_t index)
Constructor.
int trackQuality(int first) const
int EventWordCount() const
DTLocalTriggerDataWord()
Constructor.
int opticalFiberSignalLost() const
virtual ~DTTDCErrorWord()
Destructor.
int tlkPropagationError() const
DTLocalTriggerDataWord(const uint32_t index)
#define EV_ID_CEROS_STATUS_SHIFT
virtual ~DTROSTrailerWord()
Destructor.
DTDDUFirstStatusWord(const DTDDUFirstStatusWord &obj)
DTLocalTriggerTrailerWord(const uint32_t index)
DTDDUSecondStatusWord()
Constructor.
DTDDUSecondStatusWord(const DTDDUSecondStatusWord &obj)
int outputFifoFull() const
int hasTrigger(int first) const
DTROSErrorWord(const uint32_t index)
#define SC_TRIGGERDLY_MASK
int l1AFifoOccupancy() const
#define L1A_FIFO_OCC_MASK
DTROSDebugWord(const uint32_t index)
static const uint32_t trailerControlWord
DTTDCErrorWord()
Constructor.
int eventTrailerLost() const
int getBits(int first) const
static void set(uint32_t &word, int rob_id, int event_id, int word_count)
#define ERROR_CEROS_ID_MASK
DTROBTrailerWord()
Constructor.
virtual ~DTROBTrailerWord()
Destructor.
DTTDCTrailerWord(const DTTDCTrailerWord &obj)
static void set(uint32_t &word, int word_count)
static const uint32_t tdcHeaderControlWord
#define TRIGGER_DATA_MASK
#define SC_TRIGGERDLY_SHIFT
DTDDUFirstStatusWord(const unsigned char index)
#define TTC_EVENT_COUNTER_MASK
int cerosIdRosStatus() const
DTTDCMeasurementWord()
Constructor.
virtual ~DTLocalTriggerDataWord()
Destructor.
static void set(uint32_t &word, int pc, int paf, int hu, int tdc_id, int event_id, int word_count)
int warningROSPAF() const
static const uint32_t errorControlWord
DTTDCMeasurementWord(const DTTDCMeasurementWord &obj)
DTROBTrailerWord(const uint32_t index)
static void set(uint32_t &word, int debug_type, int ceros_id)
virtual ~DTTDCTrailerWord()
Destructor.
#define TRIGGER_WORD_COUNT_MASK
#define CEROS_ID_ROS_STATUS_MASK
static const uint32_t tdcTrailerControlWord
static void set(uint32_t &word, int pc, int paf, int hu, int tdc_id, int tdc_error)
static const uint32_t scTypeWord
DTLocalTriggerDataWord(const DTLocalTriggerDataWord &obj)
DTROSWordType(const DTROSWordType &obj)
DTROBTrailerWord(const DTROBTrailerWord &obj)
virtual ~DTTDCMeasurementWord()
Destructor.
virtual ~DTDDUFirstStatusWord()
Destructor.
static void set(uint32_t &word, int error_type, int rob_id)
DTTDCTrailerWord()
Constructor.
#define DEBUG_MESSAGE_MASK
#define CEROS_ID_CEROS_STATUS_SHIFT
DTROSDebugWord(const DTROSDebugWord &obj)
#define ERROR_ROB_ID_MASK
int tdcID() const
<== OBSOLETE!!
DTTDCErrorWord(const uint32_t index)
DTROSTrailerWord(const uint32_t index)
int inputFifoAlmostFull() const
int inputFifoFull() const
#define EVENT_WORD_COUNT_MASK
DTROSDebugWord()
Constructor.
int tlkSignalLost() const
enum wordTypes type()
DDU word type getter.
virtual ~DTDDUSecondStatusWord()
Destructor.
#define DONTREAD_CEROS_STATUS_MASK
DTROSTrailerWord(const DTROSTrailerWord &obj)
static const uint32_t tdcDataControlWord
wordTypes
List of DT DDU Word Types.
static const uint32_t rosTypeWord
Word Type bits definitions.
int tdcID() const
<== OBSOLETE!!
DTTDCTrailerWord(const uint32_t index)
static void set(uint32_t &word, int pc, int paf, int hu, int tdc_id, int tdc_channel, int tdc_time)
static void set(uint32_t &word, int sc_data)
#define CEROS_ID_CEROS_STATUS_MASK
static const uint32_t debugControlWord
DTTDCErrorWord(const DTTDCErrorWord &obj)
#define EV_ID_CEROS_STATUS_MASK
int tlkPatternError() const
int outputFifoAlmostFull() const
DTROSErrorWord()
Constructor.
static void set(uint32_t &word, int tff, int tpx, int l1a_fifo_occ, int event_word_count)
int tdcID() const
<== OBSOLETE!!
#define TDC_CHANNEL_SHIFT
static const uint32_t headerControlWord
Control bits definitions.
DTLocalTriggerTrailerWord(const DTLocalTriggerTrailerWord &obj)
static void set(uint32_t &word, int debug_type)
virtual ~DTROSWordType()
Destructor.
virtual ~DTROSErrorWord()
Destructor.
int fifoAlmostFull() const
DTROSTrailerWord()
Constructor.
int channelEnabled() const
int outOfSynchROSError() const
DTROSErrorWord(const DTROSErrorWord &obj)
DTTDCMeasurementWord(const uint32_t index)
DTLocalTriggerTrailerWord()
Constructor.
DTDDUSecondStatusWord(const uint32_t index)
int cerosIdCerosStatus() const
#define ERROR_ROB_ID_SHIFT
virtual ~DTLocalTriggerTrailerWord()
Destructor.
DTDDUFirstStatusWord()
Constructor.
virtual ~DTROSDebugWord()
Destructor.
#define L1A_FIFO_OCC_SHIFT