Belle II Software development
|
The Raw FTSW class. More...
#include <RawFTSW.h>
Public Types | |
enum | { POS_NODE_FORMAT_ID = 6 , FTSW_FORMAT_MASK = 0x000000FF , FORMAT_ID_VER_0TO2 = 0x54544420 , FORMAT_ID_VER_0TO3 = 0x54544431 , POS_HEADER_SIZE = 1 , VER_0_HEADER_SIZE = 0 , VER_1_HEADER_SIZE = 0 , VER_2_HEADER_SIZE = 8 , VER_3_HEADER_SIZE = 8 } |
Public Member Functions | |
RawFTSW () | |
Default constructor. | |
virtual | ~RawFTSW () |
Constructor using existing pointer to raw data buffer. | |
void | SetBuffer (int *bufin, int nwords, int delete_flag, int num_events, int num_nodes) OVERRIDE_CPP17 |
set buffer ( delete_flag : m_buffer is freeed( = 0 )/ not freeed( = 1 ) in Destructer ) | |
void | SetVersion () |
read data, detect and set the version number of the data format | |
void | CheckVersionSetBuffer () |
Check the version number of data format. | |
int | GetNwordsHeader (int n) |
Get # of words of header. | |
unsigned int | GetFTSWNodeID (int n) |
Get Node # ( should be "TTD " ) | |
unsigned int | GetEveNo (int n) |
Get event #. | |
unsigned int | GetTTCtimeTRGType (int n) |
Get a word containing ctime and trigger type info. | |
unsigned int | GetTTUtime (int n) |
get unixtime of the trigger | |
int | GetTTCtime (int n) |
Get ctime of the trigger. | |
int | GetTRGType (int n) |
Get trgtype. | |
void | GetTTTimeVal (int n, struct timeval *tv) |
Get timeval from ctime and utime. | |
void | GetPCTimeVal (int n, struct timeval *tv) |
Get timeval obtained from gettimeval() | |
unsigned int | GetMagicTrailer (int n) |
Get magic number for data corruption check. | |
void | CheckData (int n, unsigned int prev_evenum, unsigned int *cur_evenum, unsigned int prev_exprunsubrun_no, unsigned int *cur_exprunsubrun_no) |
check the data contents | |
unsigned int | GetExpRunSubrun (int n) |
Exp# (10bit) run# (14bit) restart # (8bit) | |
int | GetRunNo (int n) |
Get run #. | |
int | GetSubRunNo (int n) |
Get subrun #. | |
int | GetRunNoSubRunNo (int n) |
get a word cotaining run # and subrun # | |
int | GetExpNo (int n) |
Get Exp #. | |
int | Get15bitTLUTag (int n) |
DESY test only. | |
int | GetIsHER (int n) |
HER injection = 1 or LER injection = 0. | |
unsigned int | GetTimeSinceLastInjection (int n) |
Get time since the last injection. | |
unsigned int | GetTimeSincePrevTrigger (int n) |
Get time since the previous trigger. | |
unsigned int | GetBunchNumber (int n) |
Get a bunch number. | |
unsigned int | GetFrameCount (int n) |
Get a frame count. | |
virtual int | TotalBufNwords () |
Get total length of m_buffer. | |
virtual int | GetBufferPos (int n) |
get position of data block in word | |
virtual int * | GetBuffer (int n) |
get nth buffer pointer | |
virtual int * | GetWholeBuffer () |
get pointer to buffer(m_buffer) | |
virtual int | GetNumEntries () |
get # of data blocks = (# of nodes)*(# of events) | |
virtual int | GetNumNodes () |
get # of data sources(e.g. # of COPPER boards) in m_buffer | |
virtual int | GetNumEvents () |
get # of events in m_buffer | |
virtual int | GetPreAllocFlag () |
get malloc_flag | |
virtual int | GetBlockNwords (int n) |
get size of a data block | |
virtual int | CheckFTSWID (int n) |
get FTSW ID to check whether this data block is FTSW data or not | |
virtual int | CheckTLUID (int n) |
get FTSW ID to check whether this data block is FTSW data or not | |
virtual void | CopyBlock (int n, int *buf_to) |
Copy one datablock to buffer. | |
virtual void | PrintData (int *buf, int nwords) |
print data | |
Public Attributes | |
RawFTSWFormat * | m_access {} |
class to access | |
int | m_version = -1 |
do not record | |
RawDataBlockFormat * | m_access_dblk |
class to access | |
Protected Member Functions | |
ClassDefOverride (RawFTSW, 2) | |
do not record | |
ClassDef (RawDataBlock, 3) | |
not record | |
Protected Attributes | |
int | m_nwords |
do not record | |
int | m_num_nodes |
number of nodes in this object | |
int | m_num_events |
number of events in this object | |
int * | m_buffer |
Buffer. | |
int | m_use_prealloc_buf |
flag for deleting m_buffer in destructer( 0:delete, 1: not delete) When using pre-allocated buffer, the buffer should be reused and not deleted in the destructer | |
The Raw FTSW class.
This class stores the RAW data containing FTSW data(event #, trg time ).
anonymous enum |
Enumerator | |
---|---|
POS_NODE_FORMAT_ID | Added to distinguish different version. ver.0 : early DESY-beam-test version( Node ID 0x545444** is at 5th word (0,1,2,..5) : Please ask Nakao-san about his e-mail ( [daq-experts:8055] FEE data header and FTSW data format) ver.1 : late DESY-beam-test version( Node ID 0x545444** was moved to 6th word (0,1,2,..5) : header size is ? words ( I need to ask Nakao-san because it will be used for distinguish between 0,1, and 2 ver 2 : phase II ? version : header size is 8 words : Format is written by Nakao-san in ver.26(as of 2019.3.1 ) of https://xwiki.desy.de/xwiki/rest/p/a2bb3/#HInformationsentfromTTDtodatastream 0x545452?? up to ver.2 this number is more or less same. So, it cannot be used to distinguish different version numbers |
VER_0_HEADER_SIZE | The same number of this information must appear in RawFTSWFormat*.h. Information should be placed in one place but I need to put this number in RawFTSW.h because it is used to distinguish different version numbers. |
VER_1_HEADER_SIZE | Unpacker for ver.0(early DESY version) is not available. |
Definition at line 207 of file RawFTSW.h.
RawFTSW | ( | ) |
Default constructor.
Definition at line 13 of file RawFTSW.cc.
|
virtual |
Constructor using existing pointer to raw data buffer.
Destructor
Definition at line 19 of file RawFTSW.cc.
|
inline |
check the data contents
Definition at line 121 of file RawFTSW.h.
|
inlinevirtualinherited |
get FTSW ID to check whether this data block is FTSW data or not
Definition at line 101 of file RawDataBlock.h.
|
inlinevirtualinherited |
get FTSW ID to check whether this data block is FTSW data or not
Definition at line 108 of file RawDataBlock.h.
|
protectedinherited |
not record
To drive from TObject
|
protected |
do not record
To derive from TObject ver.2 Remove m_FTSW_header and introduce a new data format on Nov. 20, 2013 ver.3 Add m_access on Mar. 7 2016 but Classded stays 2 for some(?) reason ver.4 Add m_version on Feb. 18 2019 for the new format version defined by Nakao-san Reason to stay at 2 is that the persistent content did not change If necessary: be aware that we have to change this in online and offline at the same time!
|
inlinevirtualinherited |
Copy one datablock to buffer.
Definition at line 115 of file RawDataBlock.h.
|
inline |
DESY test only.
Definition at line 166 of file RawFTSW.h.
|
inlinevirtualinherited |
get size of a data block
Definition at line 94 of file RawDataBlock.h.
|
inlinevirtualinherited |
get nth buffer pointer
Definition at line 53 of file RawDataBlock.h.
|
inlinevirtualinherited |
get position of data block in word
Reimplemented in RawCOPPER.
Definition at line 46 of file RawDataBlock.h.
|
inline |
Get a bunch number.
Definition at line 194 of file RawFTSW.h.
|
inline |
|
inline |
|
inline |
Exp# (10bit) run# (14bit) restart # (8bit)
Definition at line 130 of file RawFTSW.h.
|
inline |
Get a frame count.
Definition at line 201 of file RawFTSW.h.
|
inline |
Get Node # ( should be "TTD " )
Definition at line 58 of file RawFTSW.h.
|
inline |
HER injection = 1 or LER injection = 0.
Definition at line 173 of file RawFTSW.h.
|
inline |
Get magic number for data corruption check.
Definition at line 114 of file RawFTSW.h.
|
inlinevirtualinherited |
get # of data blocks = (# of nodes)*(# of events)
Definition at line 67 of file RawDataBlock.h.
|
inlinevirtualinherited |
get # of events in m_buffer
Definition at line 81 of file RawDataBlock.h.
|
inlinevirtualinherited |
get # of data sources(e.g. # of COPPER boards) in m_buffer
Definition at line 74 of file RawDataBlock.h.
|
inline |
Get # of words of header.
|
inline |
Get timeval obtained from gettimeval()
Definition at line 107 of file RawFTSW.h.
|
inlinevirtualinherited |
get malloc_flag
Definition at line 88 of file RawDataBlock.h.
|
inline |
|
inline |
get a word cotaining run # and subrun #
Definition at line 152 of file RawFTSW.h.
|
inline |
|
inline |
Get time since the last injection.
Definition at line 180 of file RawFTSW.h.
|
inline |
Get time since the previous trigger.
Definition at line 187 of file RawFTSW.h.
|
inline |
|
inline |
Get ctime of the trigger.
|
inline |
Get a word containing ctime and trigger type info.
Definition at line 72 of file RawFTSW.h.
|
inline |
Get timeval from ctime and utime.
Definition at line 100 of file RawFTSW.h.
|
inline |
get unixtime of the trigger
Definition at line 79 of file RawFTSW.h.
|
inlinevirtualinherited |
get pointer to buffer(m_buffer)
Definition at line 60 of file RawDataBlock.h.
|
inlinevirtualinherited |
print data
Definition at line 122 of file RawDataBlock.h.
|
virtual |
set buffer ( delete_flag : m_buffer is freeed( = 0 )/ not freeed( = 1 ) in Destructer )
Reimplemented from RawDataBlock.
Definition at line 107 of file RawFTSW.cc.
void SetVersion | ( | ) |
read data, detect and set the version number of the data format
Definition at line 25 of file RawFTSW.cc.
|
inlinevirtualinherited |
Get total length of m_buffer.
Definition at line 39 of file RawDataBlock.h.
RawFTSWFormat* m_access {} |
|
inherited |
class to access
Definition at line 141 of file RawDataBlock.h.
|
protectedinherited |
Definition at line 154 of file RawDataBlock.h.
|
protectedinherited |
number of events in this object
Definition at line 151 of file RawDataBlock.h.
|
protectedinherited |
number of nodes in this object
Definition at line 148 of file RawDataBlock.h.
|
protectedinherited |
|
protectedinherited |
flag for deleting m_buffer in destructer( 0:delete, 1: not delete) When using pre-allocated buffer, the buffer should be reused and not deleted in the destructer
Definition at line 158 of file RawDataBlock.h.