9#ifndef POSTRAWCOPPERFORMAT_LATEST_H
10#define POSTRAWCOPPERFORMAT_LATEST_H
18#include <rawdata/dataobjects/RawCOPPERFormat_latest.h>
19#include <rawdata/CRCCalculator.h>
119 unsigned int prev_eve32,
unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no) OVERRIDE_CPP17;
132 unsigned int prev_evenum,
unsigned int* cur_evenum,
133 unsigned int prev_copper_ctr,
unsigned int* cur_copper_ctr,
134 unsigned int prev_exprunsubrun_no,
unsigned int* cur_exprunsubrun_no) OVERRIDE_CPP17;
149 int* detector_buf_1st,
int nwords_1st,
150 int* detector_buf_2nd,
int nwords_2nd,
151 int* detector_buf_3rd,
int nwords_3rd,
152 int* detector_buf_4th,
int nwords_4th,
158 int*
const(&detector_buf_ch)[MAX_PCIE40_CH],
159 int const(&nwords_ch)[MAX_PCIE40_CH],
173 POS_B2LHSLB_MAGIC = 0,
174 SIZE_B2LHSLB_HEADER = 1
181 SIZE_B2LFEE_HEADER = 1
186 POS_B2LFEE_ERRCNT_CRC16 = 0,
187 SIZE_B2LFEE_TRAILER = 1
194 POS_B2LHSLB_TRL_MAGIC = 0,
195 SIZE_B2LHSLB_TRAILER = 1
220 -
tmp_trailer.RAWTRAILER_NWORDS - SIZE_COPPER_DRIVER_TRAILER;
228 sprintf(err_buf,
"[FATAL] This data format does not have COPPER counter.(block %d) Exiting...\n %s %s %d\n",
229 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
230 printf(
"%s", err_buf);
231 std::string err_str = err_buf;
throw (err_str);
238 sprintf(err_buf,
"[FATAL] This function is not supported. (block %d) Exiting...\n %s %s %d\n",
239 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
240 printf(
"%s", err_buf);
241 std::string err_str = err_buf;
throw (err_str);
248 sprintf(err_buf,
"[FATAL] This function is not supported. (block %d) Exiting...\n %s %s %d\n",
249 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
250 printf(
"%s", err_buf);
251 std::string err_str = err_buf;
throw (err_str);
262 return (
unsigned int)(
m_buffer[ pos_nwords ]);
268 return (
unsigned int)(
m_buffer[ pos_nwords ]);
275 return (
unsigned int)(
m_buffer[ pos_nwords ]);
281 if (fin_nwords > 0) {
283 - ((SIZE_B2LFEE_TRAILER - POS_B2LFEE_ERRCNT_CRC16) + SIZE_B2LHSLB_TRAILER) ;
284 return (
int)(*buf & 0xffff);
292 return (
GetFINESSEBuffer(n, finesse_num) + SIZE_B2LHSLB_HEADER + SIZE_B2LFEE_HEADER);
303 - (
static_cast<int>(SIZE_B2LHSLB_HEADER) + SIZE_B2LHSLB_TRAILER + SIZE_B2LFEE_HEADER + SIZE_B2LFEE_TRAILER);
312 + (
GetFINESSENwords(n, finesse_num) - SIZE_B2LHSLB_TRAILER + POS_B2LHSLB_MAGIC);
313 if (*buf & (1 << ONLINE_REMOVED_DATA)) {
return true; }
The Raw COPPER class ver.
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_latest()
Default constructor.
virtual ~PostRawCOPPERFormat_latest()
Constructor using existing pointer to raw data buffer.
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
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()
unsigned int GetDriverChkSum(int n) OVERRIDE_CPP17
read COPPER driver's checksum value
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
unsigned int GetMagicDriverTrailer(int n) OVERRIDE_CPP17
get magic word of COPPER driver trailer
int GetTrlNwords()
Set magic word.
int * GetDetectorBuffer(int n, int finesse_num) OVERRIDE_CPP17
Get a pointer to detector buffer.
unsigned int GetMagicFPGAHeader(int n) OVERRIDE_CPP17
get magic word of COPPER FPGA header
int * GetFINESSEBuffer(int n, int finesse_num) OVERRIDE_CPP17
Get a pointer to a FINESSE buffer.
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.
virtual int * GetExpRunSubrunBuf(int n) OVERRIDE_CPP17
get b2l block from "FEE b2link header"
int GetDetectorNwords(int n, int finesse_num) OVERRIDE_CPP17
get Detector buffer length
int GetFINESSENwords(int n, int finesse_num) OVERRIDE_CPP17
Get the size of a finesse buffer.
unsigned int GetMagicDriverHeader(int n) OVERRIDE_CPP17
get magic word of COPPER driver header
bool CheckOnlineRemovedDataBit(int n, int finesse_num) OVERRIDE_CPP17
check if this channel's data has been removed on a readout PC for CDC online "masking" True : data co...
Abstract base class for different kinds of events.