1 #ifndef HADAQ_TDCITERATOR_H
2 #define HADAQ_TDCITERATOR_H
4 #include "hadaq/definess.h"
6 #include "hadaq/TdcMessage.h"
19 enum { DummyEpoch = 0xffffffff };
49 void assign(uint32_t* buf,
unsigned len,
bool swapped =
true)
77 if (!
fBuf)
return false;
80 fMsg.
assign((((uint8_t *)
fBuf)[0] << 24) | (((uint8_t *)
fBuf)[1] << 16) | (((uint8_t *)
fBuf)[2] << 8) | (((uint8_t *)
fBuf)[3]));
95 if (!
fBuf)
return false;
98 fMsg.
assign((((uint8_t *)
fBuf)[0] << 24) | (((uint8_t *)
fBuf)[1] << 16) | (((uint8_t *)
fBuf)[2] << 8) | (((uint8_t *)
fBuf)[3]));
113 if (
fBuf==0)
return false;
115 msg.
assign((((uint8_t *)
fBuf)[0] << 24) | (((uint8_t *)
fBuf)[1] << 16) | (((uint8_t *)
fBuf)[2] << 8) | (((uint8_t *)
fBuf)[3]));
157 if (
msg().isHitMsg() ||
msg().isEpochMsg())
LocalStampConverter class should perform conversion of time stamps to time in seconds.
Definition: TimeStamp.h:35
void SetTimeSystem(unsigned wrapbits, double coef)
Set major timing parameters - wrap value and coefficient.
Definition: TimeStamp.h:70
void MoveRef(LocalStamp_t newref)
Move reference to the new position.
Definition: TimeStamp.h:113
double ToSeconds(LocalStamp_t stamp) const
Method convert time stamp to seconds, taking into account probable wrap relative to fRef value.
Definition: TimeStamp.h:98
TDC iterator.
Definition: TdcIterator.h:16
void assign(uint32_t *buf, unsigned len, bool swapped=true)
assign buffer
Definition: TdcIterator.h:49
hadaq::TdcMessage fMsg
! current message
Definition: TdcIterator.h:26
unsigned fBuflen
! length of raw data
Definition: TdcIterator.h:23
void setCurEpoch(uint32_t val)
Set value of current epoch.
Definition: TdcIterator.h:148
bool next4()
next TDC v4 message
Definition: TdcIterator.h:93
bool isCurEpoch() const
Returns true, if current epoch was assigned.
Definition: TdcIterator.h:142
uint64_t getMsgStamp() const
Returns 39-bit value, which combines epoch and coarse counter.
Definition: TdcIterator.h:123
TdcIterator(unsigned epochbitlen=28)
constructor
Definition: TdcIterator.h:34
void printmsg()
print current message
Definition: TdcIterator.h:154
base::LocalStampConverter fConv
! use to covert time stamps in seconds
Definition: TdcIterator.h:29
uint32_t fCurEpoch
! current epoch
Definition: TdcIterator.h:27
double getMsgTimeCoarse() const
get coarse time for the current message
Definition: TdcIterator.h:127
void setRefEpoch(uint32_t epoch)
One should call method to set current reference epoch.
Definition: TdcIterator.h:69
double getMsgTimeFine() const
return fine time value for current message
Definition: TdcIterator.h:131
void printall4()
print all v4 messages
Definition: TdcIterator.h:163
uint32_t * fBuf
! pointer on raw data
Definition: TdcIterator.h:21
void clearCurEpoch()
Clear current epoch value.
Definition: TdcIterator.h:145
bool fSwapped
! true if raw data are swapped
Definition: TdcIterator.h:24
void assign(hadaqs::RawSubevent *subev, unsigned indx, unsigned datalen)
assign data from sub event
Definition: TdcIterator.h:62
bool lookForwardMsg(TdcMessage &msg)
try to check forward message - without shifting iterator
Definition: TdcIterator.h:111
uint32_t getCurEpoch() const
Return value of current epoch.
Definition: TdcIterator.h:151
hadaq::TdcMessage & msg()
get current message
Definition: TdcIterator.h:139
uint32_t * fLastBuf
! pointer on last extracted message
Definition: TdcIterator.h:22
bool next()
next TDC message
Definition: TdcIterator.h:75
TDC message.
Definition: TdcMessage.h:70
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
static double CoarseUnit()
default coarse unit for 200 MHz
Definition: TdcMessage.h:280
bool isEpochMsg() const
is epoch message
Definition: TdcMessage.h:107
static double SimpleFineCalibr(unsigned fine)
get simple linear calibration for fine counter
Definition: TdcMessage.h:286
uint32_t getEpochValue() const
Return Epoch for epoch marker, 28 bit.
Definition: TdcMessage.h:120
bool isHitMsg() const
is any of hit message
Definition: TdcMessage.h:104
void print(double tm=-1.)
print message
Definition: TdcMessage.cxx:22
void assign(uint32_t d)
assign raw data to message
Definition: TdcMessage.h:86
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
bool isHit1Msg() const
is repaired 0x3fff message
Definition: TdcMessage.h:100
bool isEPOC() const
is v4 EPOC message
Definition: TdcMessage.h:191
bool isHit0Msg() const
is original hit message
Definition: TdcMessage.h:98
bool isHit2Msg() const
is hit message with replaced (calibrated) fine counter
Definition: TdcMessage.h:102
bool IsSwapped() const
msb of decode word is always non zero...?
Definition: definess.h:138
Raw hades subevent.
Definition: definess.h:408
uint32_t * GetDataPtr(unsigned indx) const
Return pointer on data by index - user should care itself about swapping.
Definition: definess.h:437