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],
168 POS_B2LHSLB_MAGIC = 0,
169 SIZE_B2LHSLB_HEADER = 1
176 SIZE_B2LFEE_HEADER = 1
181 POS_B2LFEE_ERRCNT_CRC16 = 0,
182 SIZE_B2LFEE_TRAILER = 1
189 POS_B2LHSLB_TRL_MAGIC = 0,
190 SIZE_B2LHSLB_TRAILER = 1
215 -
tmp_trailer.RAWTRAILER_NWORDS - SIZE_COPPER_DRIVER_TRAILER;
223 sprintf(err_buf,
"[FATAL] This data format does not have COPPER counter.(block %d) Exiting...\n %s %s %d\n",
224 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
225 printf(
"%s", err_buf);
226 std::string err_str = err_buf;
throw (err_str);
233 sprintf(err_buf,
"[FATAL] This function is not supported. (block %d) Exiting...\n %s %s %d\n",
234 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
235 printf(
"%s", err_buf);
236 std::string err_str = err_buf;
throw (err_str);
243 sprintf(err_buf,
"[FATAL] This function is not supported. (block %d) Exiting...\n %s %s %d\n",
244 n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
245 printf(
"%s", err_buf);
246 std::string err_str = err_buf;
throw (err_str);
257 return (
unsigned int)(
m_buffer[ pos_nwords ]);
263 return (
unsigned int)(
m_buffer[ pos_nwords ]);
270 return (
unsigned int)(
m_buffer[ pos_nwords ]);
276 if (fin_nwords > 0) {
278 - ((SIZE_B2LFEE_TRAILER - POS_B2LFEE_ERRCNT_CRC16) + SIZE_B2LHSLB_TRAILER) ;
279 return (
int)(*buf & 0xffff);
287 return (
GetFINESSEBuffer(n, finesse_num) + SIZE_B2LHSLB_HEADER + SIZE_B2LFEE_HEADER);
298 - (
static_cast<int>(SIZE_B2LHSLB_HEADER) + SIZE_B2LHSLB_TRAILER + SIZE_B2LFEE_HEADER + SIZE_B2LFEE_TRAILER);
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
Abstract base class for different kinds of events.