 |
Belle II Software
release-05-02-19
|
15 #include <rawdata/dataobjects/RawDataBlock.h>
16 #include <rawdata/dataobjects/RawDataBlockFormat.h>
17 #include <rawdata/dataobjects/RawCOPPERFormat.h>
18 #include <rawdata/dataobjects/RawCOPPERFormat_latest.h>
19 #include <rawdata/dataobjects/RawCOPPERFormat_v0.h>
20 #include <rawdata/dataobjects/RawCOPPERFormat_v1.h>
21 #include <rawdata/dataobjects/RawCOPPERFormat_v2.h>
22 #include <rawdata/dataobjects/PreRawCOPPERFormat_v1.h>
23 #include <rawdata/dataobjects/PreRawCOPPERFormat_v2.h>
24 #include <rawdata/dataobjects/PreRawCOPPERFormat_latest.h>
25 #include <rawdata/RawCOPPERPackerInfo.h>
36 #define LATEST_POSTREDUCTION_FORMAT_VER 4 // Since Aug. 18, 2020
67 void SetBuffer(
int* bufin,
int nwords,
int delete_flag,
int num_events,
int num_nodes) OVERRIDE_CPP17;
239 #ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
240 void CheckB2LFEEHeaderVersion(
int n);
252 unsigned int prev_eve32,
unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no);
265 unsigned int prev_evenum,
unsigned int* cur_evenum,
266 unsigned int prev_copper_ctr,
unsigned int* cur_copper_ctr,
267 unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no);
296 int* detector_buf_2nd,
int nwords_2nd,
297 int* detector_buf_3rd,
int nwords_3rd,
298 int* detector_buf_4th,
int nwords_4th,
303 int* detector_buf_2nd,
int nwords_2nd,
304 int* detector_buf_3rd,
int nwords_3rd,
305 int* detector_buf_4th,
int nwords_4th,
310 int const(&nwords_ch)[MAX_PCIE40_CH],
317 void CompareHeaderValue(
int n,
const unsigned int (&input_val)[MAX_PCIE40_CH] , std::vector<std::vector< unsigned int>>& result);
323 POS_FORMAT_VERSION = 1,
324 FORMAT_MASK = 0x0000FF00
695 unsigned int prev_evenum,
unsigned int* cur_evenum_rawcprhdr,
696 unsigned int prev_copper_ctr,
unsigned int* cur_copper_ctr,
697 unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no)
702 prev_evenum, cur_evenum_rawcprhdr,
703 prev_copper_ctr, cur_copper_ctr,
704 prev_exprunsubrun_no, cur_exprunsubrun_no);
721 unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no)
725 prev_exprunsubrun_no, cur_exprunsubrun_no);
728 #ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
729 inline void RawCOPPER::CheckB2LFEEHeaderVersion(
int n)
732 return m_access->CheckB2LFEEHeaderVersion(n);
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
int * GetFINESSEBuffer(int n, int finesse_num)
get FINESSE buffer pointer
struct to contain header information used by RawCOPPERFormat::Packer()
int GetOffset3rdFINESSE(int n)
get # of offset words for FINESSE slot C buffer position
unsigned int GetTTCtimeTRGType(int n)
Check if COPPER Magic words are correct.
int Get2ndDetectorNwords(int n)
get Detector buffer length of slot B
bool CheckCOPPERMagic(int n)
Check if COPPER Magic words are correct.
unsigned int CalcXORChecksum(int *buf, int nwords)
calc XOR checksum
unsigned int GetMagicDriverHeader(int n)
get magic word of COPPER driver header
int Get2ndFINESSENwords(int n)
get data size of FINESSE slot B buffer
unsigned int GetExpRunSubrun(int n)
get Experimental # from header
unsigned int GetTrailerChksum(int n)
Get checksum in RawTrailer.
int GetPacketCRCError(int n)
check CRC packet Error
virtual int * GetExpRunSubrunBuf(int n)
get b2l block from "FEE b2link header"
RawCOPPERFormat * m_access
class to access
int * GetDetectorBuffer(int n, int finesse_num)
get Detector buffer
virtual ~RawCOPPER()
Constructor using existing pointer to raw data buffer.
int GetDetectorNwords(int n, int finesse_num)
get Detector buffer length
void AddErrorBitFlag(int n, unsigned int error_bit_flag)
Get Detected Error bitflag.
int m_num_events
number of events in this object
unsigned int GetDriverChkSum(int n)
read COPPER driver's checksum value
int GetOffset2ndFINESSE(int n)
get # of offset words for FINESSE slot B buffer position
void GetTTTimeVal(int n, struct timeval *tv)
Get timeval.
int * Get4thFINESSEBuffer(int n)
get FINESSE buffer pointer for slot D
unsigned int CalcDriverChkSum(int n)
calc COPPER driver's checksum value
void CheckVersionSetBuffer()
Check the version number of data format.
unsigned int GetTTUtime(int n)
Check if COPPER Magic words are correct.
int GetTTCtime(int n)
Get ctime.
void ShowBuffer()
show m_buffer
int GetDataType(int n)
get contents of header
int GetMaxNumOfCh(int n)
Get the max number of channels in a readout board.
void SetVersion()
read data, detect and set the version number of the data format
void CheckUtimeCtimeTRGType(int n)
check data contents
int * Get1stFINESSEBuffer(int n)
get FINESSE buffer pointer for slot A
int m_num_nodes
number of nodes in this object
int Get3rdFINESSENwords(int n)
get data size of FINESSE slot C buffer
virtual int GetNumFINESSEBlock(int n)
get # of FINNESEs which contains data
virtual int GetBufferPos(int n) OVERRIDE_CPP17
get posistion of COPPER block in unit of word
int GetExpNo(int n)
get Experimental # from header
void CheckData(int n, unsigned int prev_evenum, unsigned int *cur_evenum, unsigned int prev_copper_ctr, unsigned int *cur_copper_ctr, unsigned int prev_exprunsubrun_no, unsigned int *cur_exprunsubrun_no)
check data contents
int * Get2ndFINESSEBuffer(int n)
get FINESSE buffer pointer for slot B
int m_version
do not record
int GetRunNo(int n)
Exp# (10bit) run# (14bit) restart # (8bit)
virtual int * GetRawTrlBufPtr(int n)
get buffer pointer of rawcopper trailer
virtual unsigned int GetCOPPERCounter(int n)
get COPPER counter(not event number)
int Get1stDetectorNwords(int n)
get Detector buffer length of slot A
unsigned int FillTopBlockRawHeader(unsigned int m_node_id, unsigned int prev_eve32, unsigned int prev_exprunsubrun_no, unsigned int *cur_exprunsubrun_no)
should be called by DeSerializerCOPPER.cc and fill contents in RawHeader
unsigned int GetMagicFPGATrailer(int n)
get magic word of COPPER FPGA trailer
unsigned int GetMagicFPGAHeader(int n)
get magic word of COPPER FPGA header
int GetOffset4thFINESSE(int n)
get # of offset words for FINESSE slot D buffer position
int GetSubRunNo(int n)
get run # (14bit)
int * Get3rdFINESSEBuffer(int n)
get FINESSE buffer pointer for slot C
Abstract base class for different kinds of events.
int * Get4thDetectorBuffer(int n)
get Detector Buffer of slot D
int GetOffsetFINESSE(int n, int finesse)
get # of offset words
unsigned int GetEveNo(int n)
get subrun #(8bit)
void PackDetectorBuf4DummyData(int *detector_buf_1st, int nwords_1st, int *detector_buf_2nd, int nwords_2nd, int *detector_buf_3rd, int nwords_3rd, int *detector_buf_4th, int nwords_4th, RawCOPPERPackerInfo rawcprpacker_info)
Pack dummy data (format ver. = -1 -> Select the latest format version)
unsigned int GetNodeID(int n)
get node-ID from data
unsigned int GetErrorBitFlag(int n)
get contents of header
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 )
int GetOffset1stFINESSE(int n)
get # of offset words for FINESSE slot A buffer position
unsigned int GetMagicDriverTrailer(int n)
get magic word of COPPER driver trailer
virtual unsigned int GetB2LFEE32bitEventNumber(int n)
get b2l block from "FEE b2link header"
int Get1stFINESSENwords(int n)
get data size of FINESSE slot A buffer
int GetFINESSENwords(int n, int finesse)
get data size of FINESSE buffer
virtual int * GetRawHdrBufPtr(int n)
get buffer pointer of rawcopper header(Currently same as GetBufferPos)
int GetTRGType(int n)
Get trgtype.
void PackDetectorBuf(int *detector_buf_1st, int nwords_1st, int *detector_buf_2nd, int nwords_2nd, int *detector_buf_3rd, int nwords_3rd, int *detector_buf_4th, int nwords_4th, RawCOPPERPackerInfo rawcprpacker_info)
Packer for RawCOPPER class Pack data (format ver.
RawCOPPER()
Default constructor.
int * Get1stDetectorBuffer(int n)
get Detector buffer of slot A
int m_nwords
do not record
int Get3rdDetectorNwords(int n)
get Detector buffer length of slot C
int GetTruncMask(int n)
get contents of header
ClassDefOverride(RawCOPPER, 3)
do not record
int GetEventCRC16Value(int n, int finesse_num)
Get Event CRC16 value.
void CompareHeaderValue(int n, const unsigned int(&input_val)[MAX_PCIE40_CH], std::vector< std::vector< unsigned int >> &result)
Compare value from different channels and make a statistics table.
int * Get3rdDetectorBuffer(int n)
get Detector Buffer of slot C
std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
The RawDataBlock class Base class for rawdata handling.
int Get4thFINESSENwords(int n)
get data size of FINESSE slot D buffer
int GetEventCRCError(int n)
check CRC event Error
int Get4thDetectorNwords(int n)
get Detector buffer length of slot D
int * Get2ndDetectorBuffer(int n)
get Detector Buffer of slot B