1 #ifndef HADAQ_TDCMESSAGE_H
2 #define HADAQ_TDCMESSAGE_H
12 tdckind_Trailer = 0x00000000,
13 tdckind_Header = 0x20000000,
14 tdckind_Debug = 0x40000000,
15 tdckind_Epoch = 0x60000000,
16 tdckind_Mask = 0xe0000000,
17 tdckind_Hit = 0x80000000,
18 tdckind_Hit1 = 0xa0000000,
19 tdckind_Hit2 = 0xc0000000,
20 tdckind_Calibr = 0xe0000000
25 MaxNumTdcChannels = 65
29 enum TdcNewMessageKinds {
30 newkind_TMDT = 0x80000000,
32 newkind_Mask3 = 0xE0000000,
33 newkind_HDR = 0x20000000,
34 newkind_TRL = 0x00000000,
35 newkind_EPOC = 0x60000000,
37 newkind_Mask4 = 0xF0000000,
38 newkind_TMDS = 0x40000000,
40 newkind_Mask6 = 0xFC000000,
41 newkind_TBD = 0x50000000,
43 newkind_Mask8 = 0xFF000000,
44 newkind_HSTM = 0x54000000,
45 newkind_HSTL = 0x55000000,
46 newkind_HSDA = 0x56000000,
47 newkind_HSDB = 0x57000000,
48 newkind_CTA = 0x58000000,
49 newkind_CTB = 0x59000000,
50 newkind_TEMP = 0x5A000000,
51 newkind_BAD = 0x5B000000,
53 newkind_Mask9 = 0xFF800000,
54 newkind_TTRM = 0x5C000000,
55 newkind_TTRL = 0x5C800000,
56 newkind_TTCM = 0x5D000000,
57 newkind_TTCL = 0x5D800000,
59 newkind_Mask7 = 0xFE000000,
60 newkind_TMDR = 0x5E000000
189 inline bool isHDR()
const {
return (
fData & newkind_Mask3) == newkind_HDR; }
191 inline bool isEPOC()
const {
return (
fData & newkind_Mask3) == newkind_EPOC; }
193 inline bool isTMDR()
const {
return (
fData & newkind_Mask7) == newkind_TMDR; }
195 inline bool isTMDT()
const {
return (
fData & newkind_TMDT) == newkind_TMDT; }
197 inline bool isTMDS()
const {
return (
fData & newkind_Mask4) == newkind_TMDS; }
199 inline bool isTRL()
const {
return (
fData & newkind_Mask3) == newkind_TRL; }
276 void print(
double tm = -1.);
277 void print4(uint32_t &ttype);
TDC message.
Definition: TdcMessage.h:70
uint32_t getHeaderFmt() const
Return data format: 0 - normal, 1 - double edges for each hit.
Definition: TdcMessage.h:172
TdcMessage()
constructor
Definition: TdcMessage.h:80
bool isCalibrMsg() const
is calibration message
Definition: TdcMessage.h:115
bool isTMDR() const
is v4 TMDR message
Definition: TdcMessage.h:193
uint32_t fData
message raw data
Definition: TdcMessage.h:72
uint32_t getHitTmCoarse() const
Returns hit coarse time counter, 11 bit.
Definition: TdcMessage.h:130
uint32_t getEPOC() const
Return Epoch for EPOC marker, 28 bit.
Definition: TdcMessage.h:214
uint32_t getHeaderHwType() const
Return hardware type coded in header message.
Definition: TdcMessage.h:166
uint32_t getHeaderErr() const
Return error bits of header message.
Definition: TdcMessage.h:163
uint32_t getHitChannel() const
Returns hit channel ID.
Definition: TdcMessage.h:127
uint32_t getTRLAMinor() const
TRLA minor.
Definition: TdcMessage.h:250
void setCalibrFine(unsigned n=0, uint32_t v=0)
set calibration for fine counter
Definition: TdcMessage.h:158
static unsigned GetFineMaxValue()
get pre-configured max fine counter
Definition: TdcMessage.h:303
TdcMessage & operator=(const TdcMessage &src)
assign operator for the message
Definition: TdcMessage.h:92
uint32_t getHitTmStamp() const
Returns time stamp, which is simple combination coarse and fine counter.
Definition: TdcMessage.h:138
static unsigned GetFineMinValue()
get pre-configured min fine counter
Definition: TdcMessage.h:301
static double CoarseUnit()
default coarse unit for 200 MHz
Definition: TdcMessage.h:280
bool isTrailerMsg() const
is trailer message
Definition: TdcMessage.h:113
bool isEpochMsg() const
is epoch message
Definition: TdcMessage.h:107
uint32_t getTRLBMaxdc() const
TRLB maxdc.
Definition: TdcMessage.h:260
uint32_t getTMDTChannel() const
TMDT channel.
Definition: TdcMessage.h:222
bool isHitRisingEdge() const
Is rising edge.
Definition: TdcMessage.h:144
bool isTMDT() const
is v4 TMDT message
Definition: TdcMessage.h:195
static double SimpleFineCalibr(unsigned fine)
get simple linear calibration for fine counter
Definition: TdcMessage.h:286
uint32_t getTMDSPattern() const
TMDS pattern.
Definition: TdcMessage.h:242
void setHitTmCoarse(uint32_t coarse)
Set hit coarse time counter, 11 bit.
Definition: TdcMessage.h:132
TdcMessage(uint32_t d)
constructor
Definition: TdcMessage.h:83
uint32_t getTRLASub() const
TRLA sub.
Definition: TdcMessage.h:252
uint32_t getTRLBTptime() const
TRLB tptime.
Definition: TdcMessage.h:262
uint32_t getEpochValue() const
Return Epoch for epoch marker, 28 bit.
Definition: TdcMessage.h:120
uint32_t getHDRTrigger() const
HDR trigger.
Definition: TdcMessage.h:210
bool isHitMsg() const
is any of hit message
Definition: TdcMessage.h:104
uint32_t getDebugKind() const
Return error bits of header message.
Definition: TdcMessage.h:180
void print(double tm=-1.)
print message
Definition: TdcMessage.cxx:22
uint32_t getTRLCCpc() const
TRLC cpc.
Definition: TdcMessage.h:268
uint32_t getTRLCFreq() const
TRLC freq.
Definition: TdcMessage.h:274
uint32_t getTMDRCoarse() const
TMDR coarse.
Definition: TdcMessage.h:232
uint32_t getHitReserved() const
Returns hit reserved value, 2 bits.
Definition: TdcMessage.h:151
uint32_t getTMDSChannel() const
TMDS channel.
Definition: TdcMessage.h:238
bool IsVer4Header() const
is V4 header
Definition: TdcMessage.h:175
uint32_t getTMDTCoarse() const
TMDT coarse.
Definition: TdcMessage.h:224
static unsigned gFineMinValue
default fine min
Definition: TdcMessage.h:74
void assign(uint32_t d)
assign raw data to message
Definition: TdcMessage.h:86
uint32_t getTMDRFine() const
TMDR fine.
Definition: TdcMessage.h:234
uint32_t getHitTmFine() const
Returns hit fine time counter, 10 bit.
Definition: TdcMessage.h:135
void print4(uint32_t &ttype)
print v4 message
Definition: TdcMessage.cxx:62
uint32_t getTMDRMode() const
TMDR mode.
Definition: TdcMessage.h:230
static double CoarseUnit280()
default coarse unit for 280 MHz
Definition: TdcMessage.h:283
void setAsHit2(uint32_t finebin)
set as hit2
Definition: TdcMessage.cxx:9
bool isHit1Msg() const
is repaired 0x3fff message
Definition: TdcMessage.h:100
bool isEPOC() const
is v4 EPOC message
Definition: TdcMessage.h:191
uint32_t getTRLBEflags() const
TRLB eflags.
Definition: TdcMessage.h:258
static unsigned gFineMaxValue
default fine max
Definition: TdcMessage.h:75
bool isHeaderMsg() const
is header message
Definition: TdcMessage.h:111
bool isHitFallingEdge() const
Is falling edge.
Definition: TdcMessage.h:146
bool isHit0Msg() const
is original hit message
Definition: TdcMessage.h:98
static void SetFineLimits(unsigned min, unsigned max)
Method set static limits, which are used for simple interpolation of time for fine counter.
Definition: TdcMessage.h:294
bool isTMDS() const
is v4 TMDS message
Definition: TdcMessage.h:197
bool isTRL() const
is v4 TRL message
Definition: TdcMessage.h:199
bool getEPOCError() const
Is EPOC marker error.
Definition: TdcMessage.h:216
uint32_t getTRLCCcs() const
TRLC ccs.
Definition: TdcMessage.h:270
uint32_t getHeaderRes() const
Return reserved bits of header message.
Definition: TdcMessage.h:169
uint32_t getTRLANumCh() const
TRLA numch.
Definition: TdcMessage.h:254
uint32_t getCalibrFine(unsigned n=0) const
get calibration for fine counter
Definition: TdcMessage.h:156
bool isDebugMsg() const
is debug message
Definition: TdcMessage.h:109
uint32_t getHDRMajor() const
HDR major.
Definition: TdcMessage.h:204
uint32_t getTRLCCcdiv() const
TRLC ccdiv.
Definition: TdcMessage.h:272
uint32_t getHitEdge() const
Returns hit edge 1 - rising, 0 - falling.
Definition: TdcMessage.h:141
uint32_t getData() const
get message raw data
Definition: TdcMessage.h:89
uint32_t getTMDTMode() const
TMDT mode.
Definition: TdcMessage.h:220
bool isHDR() const
is v4 HDR message
Definition: TdcMessage.h:189
uint32_t getKind() const
Returns kind of the message If used for the hit message, four different values can be returned.
Definition: TdcMessage.h:96
uint32_t getTRLAPlatformId() const
TRLA platform id
Definition: TdcMessage.h:246
uint32_t getDebugValue() const
Return reserved bits of header message.
Definition: TdcMessage.h:183
uint32_t getTMDSCoarse() const
TMDS coarse.
Definition: TdcMessage.h:240
uint32_t getTMDTFine() const
TMDT fine.
Definition: TdcMessage.h:226
bool isHit2Msg() const
is hit message with replaced (calibrated) fine counter
Definition: TdcMessage.h:102
uint32_t getHDRMinor() const
HDR minor.
Definition: TdcMessage.h:206
uint32_t getTRLAMajor() const
TRLA major.
Definition: TdcMessage.h:248
uint32_t getHDRTType() const
HDR type.
Definition: TdcMessage.h:208
uint32_t getTRLBFreq() const
TRLB freq.
Definition: TdcMessage.h:264
uint32_t getEpochRes() const
Get reserved bit for epoch, 1 bit.
Definition: TdcMessage.h:122