9#ifndef POSTRAWCOPPERFORMAT_V2_H
10#define POSTRAWCOPPERFORMAT_V2_H
18#include <rawdata/dataobjects/RawCOPPERFormat_v2.h>
19#include <rawdata/CRCCalculator.h>
142 unsigned int prev_eve32,
unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no) OVERRIDE_CPP17;
155 unsigned int prev_evenum,
unsigned int* cur_evenum,
156 unsigned int prev_copper_ctr,
unsigned int* cur_copper_ctr,
157 unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no) OVERRIDE_CPP17;
172 int* detector_buf_1st,
int nwords_1st,
173 int* detector_buf_2nd,
int nwords_2nd,
174 int* detector_buf_3rd,
int nwords_3rd,
175 int* detector_buf_4th,
int nwords_4th,
184 SIZE_COPPER_DRIVER_HEADER = 0,
185 SIZE_COPPER_DRIVER_TRAILER = 0
190 SIZE_COPPER_HEADER = 0
195 SIZE_COPPER_TRAILER = 0
200 POS_B2LHSLB_MAGIC = 0,
201 SIZE_B2LHSLB_HEADER = 1
208 SIZE_B2LFEE_HEADER = 1
213 POS_B2LFEE_ERRCNT_CRC16 = 0,
214 SIZE_B2LFEE_TRAILER = 1
221 SIZE_B2LHSLB_TRAILER = 0
240#ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
241 CheckB2LFEEHeaderVersion(n);
252#ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
253 CheckB2LFEEHeaderVersion(n);
264#ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
265 CheckB2LFEEHeaderVersion(n);
276#ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
277 CheckB2LFEEHeaderVersion(n);
300 -
tmp_trailer.RAWTRAILER_NWORDS - SIZE_COPPER_DRIVER_TRAILER;
308 sprintf(err_buf,
"[FATAL] This data format does not have COPPER counter.(block %d) Exiting...\n %s %s %d\n",
309 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
310 printf(
"%s", err_buf);
311 std::string err_str = err_buf;
throw (err_str);
318 sprintf(err_buf,
"[FATAL] This function is not supported. (block %d) Exiting...\n %s %s %d\n",
319 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
320 printf(
"%s", err_buf);
321 std::string err_str = err_buf;
throw (err_str);
328 sprintf(err_buf,
"[FATAL] This function is not supported. (block %d) Exiting...\n %s %s %d\n",
329 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
330 printf(
"%s", err_buf);
331 std::string err_str = err_buf;
throw (err_str);
342 return (
unsigned int)(
m_buffer[ pos_nwords ]);
348 return (
unsigned int)(
m_buffer[ pos_nwords ]);
355 return (
unsigned int)(
m_buffer[ pos_nwords ]);
361 if (fin_nwords > 0) {
363 - ((SIZE_B2LFEE_TRAILER - POS_B2LFEE_ERRCNT_CRC16) + SIZE_B2LHSLB_TRAILER) ;
364 return (
int)(*buf & 0xffff);
The Raw COPPER class ver.2 This class stores data received by COPPER via belle2link Data from all det...
int CheckB2LHSLBMagicWords(int *finesse_buf, int finesse_nwords)
check magic words
int CheckCRC16(int n, int finesse_num)
check magic words
int * PackDetectorBuf(int *packed_buf_nwords, 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) OVERRIDE_CPP17
Pack data (format ver. = -1 -> Select the latest format version)
void CheckUtimeCtimeTRGType(int n) OVERRIDE_CPP17
check data contents
unsigned int FillTopBlockRawHeader(unsigned int m_node_id, unsigned int prev_eve32, unsigned int prev_exprunsubrun_no, unsigned int *cur_exprunsubrun_no) OVERRIDE_CPP17
should be called by DeSerializerCOPPER.cc and fill contents in RawHeader
virtual unsigned int GetB2LFEE32bitEventNumber(int n) OVERRIDE_CPP17
get b2l block from "FEE b2link header"
PostRawCOPPERFormat_v2()
Default constructor.
virtual ~PostRawCOPPERFormat_v2()
Constructor using existing pointer to raw data buffer.
int GetDetectorNwords(int n, int finesse_num) OVERRIDE_CPP17
get Detector buffer length
bool CheckCOPPERMagic(int n) OVERRIDE_CPP17
Check if COPPER Magic words are correct.
unsigned int CalcDriverChkSum(int n) OVERRIDE_CPP17
calc COPPER driver's checksum value
int GetFINESSENwords(int n, int finesse) OVERRIDE_CPP17
get data size of FINESSE buffer
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) OVERRIDE_CPP17
check data contents
struct to contain header information used by RawCOPPERFormat::Packer()
int Get3rdFINESSENwords(int n) OVERRIDE_CPP17
get data size of FINESSE slot C buffer
unsigned int GetDriverChkSum(int n) OVERRIDE_CPP17
read COPPER driver's checksum value
int GetOffset1stFINESSE(int n) OVERRIDE_CPP17
get # of offset words for FINESSE slot A buffer position
unsigned int GetCOPPERCounter(int n) OVERRIDE_CPP17
get posistion of COPPER block in unit of word
unsigned int GetMagicFPGATrailer(int n) OVERRIDE_CPP17
get magic word of COPPER FPGA trailer
int Get1stFINESSENwords(int n) OVERRIDE_CPP17
get data size of FINESSE slot A buffer
unsigned int GetMagicDriverTrailer(int n) OVERRIDE_CPP17
get magic word of COPPER driver trailer
int * Get2ndDetectorBuffer(int n) OVERRIDE_CPP17
get Detector Buffer of slot B
virtual int GetOffset2ndFINESSE(int n)
get # of offset words for FINESSE slot B buffer position
int GetTrlNwords()
Set magic word.
unsigned int GetMagicFPGAHeader(int n) OVERRIDE_CPP17
get magic word of COPPER FPGA header
int GetEventCRC16Value(int n, int finesse_num) OVERRIDE_CPP17
Get CRC16 value for an event.
unsigned int GetTrailerChksum(int n) OVERRIDE_CPP17
Get checksum in RawTrailer.
int * Get4thDetectorBuffer(int n) OVERRIDE_CPP17
get Detector Buffer of slot D
int Get4thFINESSENwords(int n) OVERRIDE_CPP17
get data size of FINESSE slot D buffer
virtual int GetOffset4thFINESSE(int n)
get # of offset words for FINESSE slot D buffer position
virtual int GetOffset3rdFINESSE(int n)
get # of offset words for FINESSE slot C buffer position
virtual int * GetExpRunSubrunBuf(int n) OVERRIDE_CPP17
get b2l block from "FEE b2link header"
int * Get3rdDetectorBuffer(int n) OVERRIDE_CPP17
get Detector Buffer of slot C
unsigned int GetMagicDriverHeader(int n) OVERRIDE_CPP17
get magic word of COPPER driver header
int * Get1stDetectorBuffer(int n) OVERRIDE_CPP17
get Detector buffer of slot A
int Get2ndFINESSENwords(int n) OVERRIDE_CPP17
get data size of FINESSE slot B buffer
Abstract base class for different kinds of events.