Belle II Software development
RawCOPPER.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#ifndef RAWCOPPER_H
10#define RAWCOPPER_H
11
12// Includes
13#include <stdio.h>
14
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>
26
27//#define USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
28
29
30// Divide ECL and KLM to barrel and endcap categories from Itoh-san's suggestion
31// Updated on May 9, 2014
32
34//
35// The latest DAQformat version number
36#define LATEST_POSTREDUCTION_FORMAT_VER 4 // Since Aug. 18, 2020
37//
39
40
41namespace Belle2 {
52 class RawCOPPER : public RawDataBlock {
53 public:
55 RawCOPPER();
56
58 //RawCOPPER(int* bufin, int nwords);
60 virtual ~RawCOPPER();
61
62 //
63 // Get position of or pointer to data
64 //
65
67 /* cppcheck-suppress missingOverride */
68 void SetBuffer(int* bufin, int nwords, int delete_flag, int num_events, int num_nodes) OVERRIDE_CPP17;
69
71 // POINTER TO "DETECTOR BUFFER"
72 //( after removing "B2link headers" from "FINESSE buffer". THIS IS THE RAW DATA FROM A DETECTOR
75 int GetDetectorNwords(int n, int finesse_num);
76
78 int Get1stDetectorNwords(int n);
79
81 int Get2ndDetectorNwords(int n);
82
84 int Get3rdDetectorNwords(int n);
85
87 int Get4thDetectorNwords(int n);
88
90 int* GetDetectorBuffer(int n, int finesse_num);
91
93 int* Get1stDetectorBuffer(int n);
94
96 int* Get2ndDetectorBuffer(int n);
97
99 int* Get3rdDetectorBuffer(int n);
100
102 int* Get4thDetectorBuffer(int n);
104
106 /* cppcheck-suppress missingOverride */
107 virtual int GetBufferPos(int n) OVERRIDE_CPP17;
108
110 virtual int* GetRawHdrBufPtr(int n);
111
113 virtual int* GetRawTrlBufPtr(int n);
114
116 int* GetFINESSEBuffer(int n, int finesse_num);
117
119 int* Get1stFINESSEBuffer(int n);
120
122 int* Get2ndFINESSEBuffer(int n);
123
125 int* Get3rdFINESSEBuffer(int n);
126
128 int* Get4thFINESSEBuffer(int n);
129
130
131 //
132 // Get information from "RawCOPPER header" attached by DAQ software
133 //
134
136 int GetExpNo(int n);
137
138 unsigned int GetExpRunSubrun(int n);
139
140 int GetRunNo(int n);
141
142 int GetSubRunNo(int n);
143
144 unsigned int GetEveNo(int n);
145
146 int GetDataType(int n);
147
148 int GetTruncMask(int n);
149
151 unsigned int GetErrorBitFlag(int n);
152
154 void AddErrorBitFlag(int n, unsigned int error_bit_flag);
155
156
158 int GetPacketCRCError(int n);
159
161 int GetEventCRCError(int n);
162
164 int GetEventCRC16Value(int n, int finesse_num);
165
167 unsigned int GetNodeID(int n);
168
169 //
170 // Get information from 13words "COPPER header" attached by COPPER board
171 //
173 virtual unsigned int GetCOPPERCounter(int n);
174
176 virtual int GetNumFINESSEBlock(int n);
177
179 int GetOffsetFINESSE(int n, int finesse);
180
182 int GetOffset1stFINESSE(int n);
183
185 int GetOffset2ndFINESSE(int n);
186
188 int GetOffset3rdFINESSE(int n);
189
191 int GetOffset4thFINESSE(int n);
192
194 int GetFINESSENwords(int n, int finesse);
195
197 int Get1stFINESSENwords(int n);
198
200 int Get2ndFINESSENwords(int n);
201
203 int Get3rdFINESSENwords(int n);
204
206 int Get4thFINESSENwords(int n);
207
208 //
209 // Get information from "B2link(attached by FEE and HLSB) header"
210 //
212 // virtual int* GetFTSW2Words(int n);
213
215 virtual int* GetExpRunSubrunBuf(int n);
216
218 virtual unsigned int GetB2LFEE32bitEventNumber(int n);
219
220 //
221 // read magic word to check data
222 //
224 unsigned int GetMagicDriverHeader(int n);
225
227 unsigned int GetMagicFPGAHeader(int n);
228
230 unsigned int GetMagicFPGATrailer(int n);
231
233 unsigned int GetMagicDriverTrailer(int n);
234
236 unsigned int GetTrailerChksum(int n);
237
239 bool CheckCOPPERMagic(int n);
240
241#ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
243 void CheckB2LFEEHeaderVersion(int n);
244#endif
245
247 unsigned int GetTTCtimeTRGType(int n);
248
250 unsigned int GetTTUtime(int n);
251
253 unsigned int FillTopBlockRawHeader(unsigned int m_node_id,
254 unsigned int prev_eve32, unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no);
255
257 unsigned int GetDriverChkSum(int n);
258
260 unsigned int CalcDriverChkSum(int n);
261
263 unsigned int CalcXORChecksum(int* buf, int nwords);
264
266 void CheckData(int n,
267 unsigned int prev_evenum, unsigned int* cur_evenum,
268 unsigned int prev_copper_ctr, unsigned int* cur_copper_ctr,
269 unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no);
270
272 void CheckUtimeCtimeTRGType(int n);
273
275 int GetTTCtime(int n);
276
278 int GetTRGType(int n);
279
281 void GetTTTimeVal(int n, struct timeval* tv);
282
284 void SetVersion();
285
287 void SetVersion(std::string class_name);
288
291
293 void ShowBuffer();
294
297 void PackDetectorBuf(int* detector_buf_1st, int nwords_1st,
298 int* detector_buf_2nd, int nwords_2nd,
299 int* detector_buf_3rd, int nwords_3rd,
300 int* detector_buf_4th, int nwords_4th,
301 RawCOPPERPackerInfo rawcprpacker_info);
302
304 void PackDetectorBuf4DummyData(int* detector_buf_1st, int nwords_1st,
305 int* detector_buf_2nd, int nwords_2nd,
306 int* detector_buf_3rd, int nwords_3rd,
307 int* detector_buf_4th, int nwords_4th,
308 RawCOPPERPackerInfo rawcprpacker_info);
309
311 void PackDetectorBuf(int* const(&detector_buf_ch)[MAX_PCIE40_CH],
312 int const(&nwords_ch)[MAX_PCIE40_CH],
313 RawCOPPERPackerInfo rawcprpacker_info);
314
316 int GetMaxNumOfCh(int n);
317
319 void CompareHeaderValue(int n, const unsigned int (&input_val)[MAX_PCIE40_CH], std::vector<std::vector< unsigned int>>& result);
320
322 bool CheckOnlineRemovedDataBit(int n, int finesse_num);
323
325 std::string getInfoHTML() const;
326
327 enum {
328 POS_FORMAT_VERSION = 1,
329 FORMAT_MASK = 0x0000FF00
330 };
331
334
337
338 protected :
343
344 };
345
346
347 inline int* RawCOPPER::GetRawHdrBufPtr(int n)
348 {
350 return m_access->GetRawHdrBufPtr(n);
351 }
352
353 inline int* RawCOPPER::GetRawTrlBufPtr(int n)
354 {
356 return m_access->GetRawTrlBufPtr(n);
357 }
358
359 inline unsigned int RawCOPPER::GetDriverChkSum(int n)
360 {
362 return m_access->GetDriverChkSum(n);
363 }
364
365 inline int RawCOPPER::GetExpNo(int n)
366 {
368 return m_access->GetExpNo(n);
369 }
370
371 inline unsigned int RawCOPPER::GetExpRunSubrun(int n)
372 {
374 return m_access->GetExpRunSubrun(n);
375 }
376
377 inline int RawCOPPER::GetRunNo(int n)
378 {
380 return m_access->GetRunNo(n);
381 }
382
383
384 inline int RawCOPPER::GetSubRunNo(int n)
385 {
387 return m_access->GetSubRunNo(n);
388 }
389
390 inline unsigned int RawCOPPER::GetEveNo(int n)
391 {
393 return m_access->GetEveNo(n);
394 }
395
396
397 inline unsigned int RawCOPPER::GetNodeID(int n)
398 {
400 return m_access->GetNodeID(n);
401 }
402
403
404 inline int RawCOPPER::GetDataType(int n)
405 {
407 return m_access->GetDataType(n);
408 }
409
410 inline int RawCOPPER::GetTruncMask(int n)
411 {
413 return m_access->GetTruncMask(n);
414 }
415
416 inline unsigned int RawCOPPER::GetErrorBitFlag(int n)
417 {
419 return m_access->GetErrorBitFlag(n);
420 }
421
422 inline void RawCOPPER::AddErrorBitFlag(int n, unsigned int error_bit_flag)
423 {
425 return m_access->AddErrorBitFlag(n, error_bit_flag);
426 }
427
429 {
431 return m_access->GetPacketCRCError(n);
432 }
433
435 {
437 return m_access->GetEventCRCError(n);
438 }
439
440 inline int RawCOPPER::GetEventCRC16Value(int n, int finesse_num)
441 {
443 return m_access->GetEventCRC16Value(n, finesse_num);
444 }
445
446 inline unsigned int RawCOPPER::GetCOPPERCounter(int n)
447 {
449 return m_access->GetCOPPERCounter(n);
450 }
451
453 {
456 }
457
459 {
462 }
463
465 {
468 }
469
471 {
474 }
475
477 {
479 return m_access->Get1stFINESSENwords(n);
480 }
481
483 {
485 return m_access->Get2ndFINESSENwords(n);
486 }
487
489 {
491 return m_access->Get3rdFINESSENwords(n);
492 }
493
495 {
497 return m_access->Get4thFINESSENwords(n);
498 }
499
501 {
503 return m_access->GetOffset1stFINESSE(n);
504 }
505
507 {
509 return m_access->GetOffset2ndFINESSE(n);
510 }
511
513 {
515 return m_access->GetOffset3rdFINESSE(n);
516 }
517
519 {
521 return m_access->GetOffset4thFINESSE(n);
522 }
523
525 {
527 return m_access->Get1stFINESSEBuffer(n);
528 }
529
531 {
533 return m_access->Get2ndFINESSEBuffer(n);
534 }
535
537 {
539 return m_access->Get3rdFINESSEBuffer(n);
540 }
541
543 {
545 return m_access->Get4thFINESSEBuffer(n);
546 }
547
549 {
552 }
553
555 {
558 }
559
561 {
564 }
565
567 {
570 }
571
573 {
575 return m_access->GetExpRunSubrunBuf(n);
576 }
577
578 inline unsigned int RawCOPPER::GetMagicDriverHeader(int n)
579 {
582 }
583
584 inline unsigned int RawCOPPER::GetMagicFPGAHeader(int n)
585 {
587 return m_access->GetMagicFPGAHeader(n);
588 }
589
590 inline unsigned int RawCOPPER::GetMagicFPGATrailer(int n)
591 {
593 return m_access->GetMagicFPGATrailer(n);
594 }
595
596 inline unsigned int RawCOPPER::GetMagicDriverTrailer(int n)
597 {
600 }
601
602 inline unsigned int RawCOPPER::GetTrailerChksum(int n)
603 {
605 return m_access->GetTrailerChksum(n);
606 }
607
608 inline unsigned int RawCOPPER::GetTTCtimeTRGType(int n)
609 {
611 return m_access->GetTTCtimeTRGType(n);
612 }
613
614 inline unsigned int RawCOPPER::GetTTUtime(int n)
615 {
617 return m_access->GetTTUtime(n);
618 }
619
620 inline int RawCOPPER::GetTTCtime(int n)
621 {
623 return m_access->GetTTCtime(n);
624 }
625
626 inline int RawCOPPER::GetTRGType(int n)
627 {
629 return m_access->GetTRGType(n);
630 }
631
632 inline void RawCOPPER::GetTTTimeVal(int n, struct timeval* tv)
633 {
635 return m_access->GetTTTimeVal(n, tv);
636 }
637
638 inline int RawCOPPER::GetBufferPos(int n)
639 {
641 return m_access->GetBufferPos(n);
642 }
643
644 inline unsigned int RawCOPPER::CalcDriverChkSum(int n)
645 {
647 return m_access->CalcDriverChkSum(n);
648 }
649
650
652 {
654 return m_access->GetNumFINESSEBlock(n);
655 }
656
657 inline int RawCOPPER::GetDetectorNwords(int n, int finesse_num)
658 {
660 return m_access->GetDetectorNwords(n, finesse_num);
661 }
662
663 inline int RawCOPPER::GetFINESSENwords(int n, int finesse_num)
664 {
666 return m_access->GetFINESSENwords(n, finesse_num);
667 }
668
669 inline int RawCOPPER::GetOffsetFINESSE(int n, int finesse_num)
670 {
672 return m_access->GetOffsetFINESSE(n, finesse_num);
673 }
674
675 inline int* RawCOPPER::GetFINESSEBuffer(int n, int finesse_num)
676 {
678 return m_access->GetFINESSEBuffer(n, finesse_num);
679 }
680
681 inline int* RawCOPPER::GetDetectorBuffer(int n, int finesse_num)
682 {
684 return m_access->GetDetectorBuffer(n, finesse_num);
685 }
686
687 inline unsigned int RawCOPPER::GetB2LFEE32bitEventNumber(int n)
688 {
691 }
692
693 inline unsigned int RawCOPPER::CalcXORChecksum(int* buf, int nwords)
694 {
696 return m_access->CalcXORChecksum(buf, nwords);
697 }
698
699 inline void RawCOPPER::CheckData(int n,
700 unsigned int prev_evenum, unsigned int* cur_evenum_rawcprhdr,
701 unsigned int prev_copper_ctr, unsigned int* cur_copper_ctr,
702 unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no)
703 {
704
707 prev_evenum, cur_evenum_rawcprhdr,
708 prev_copper_ctr, cur_copper_ctr,
709 prev_exprunsubrun_no, cur_exprunsubrun_no);
710 return;
711 }
712
714 {
716 return m_access->CheckCOPPERMagic(n);
717 }
718
720 {
723 }
724
725 inline unsigned int RawCOPPER::FillTopBlockRawHeader(unsigned int m_node_id, unsigned int prev_eve32,
726 unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no)
727 {
729 return m_access->FillTopBlockRawHeader(m_node_id, prev_eve32,
730 prev_exprunsubrun_no, cur_exprunsubrun_no);
731 }
732
733#ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
734 inline void RawCOPPER::CheckB2LFEEHeaderVersion(int n)
735 {
737 return m_access->CheckB2LFEEHeaderVersion(n);
738 }
739#endif
740
742 {
743 if (((m_buffer[ POS_FORMAT_VERSION ] & FORMAT_MASK) >> 8) != m_version
744 || m_access == NULL) {
745 SetVersion();
746 }
748 }
749
750 inline int RawCOPPER::GetMaxNumOfCh(int n)
751 {
753 return m_access->GetMaxNumOfCh(n);
754 }
755
756 inline bool RawCOPPER::CheckOnlineRemovedDataBit(int n, int finesse_num)
757 {
759 return m_access->CheckOnlineRemovedDataBit(n, finesse_num);
760 }
761
763}
764
765#endif
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
virtual int Get4thFINESSENwords(int n)=0
get data size of FINESSE slot D buffer
virtual int GetDataType(int n)=0
get contents of header
virtual unsigned int FillTopBlockRawHeader(unsigned int m_node_id, unsigned int prev_eve32, unsigned int prev_exprunsubrun_no, unsigned int *cur_exprunsubrun_no)=0
should be called by DeSerializerCOPPER.cc and fill contents in RawHeader
virtual unsigned int GetEveNo(int n)=0
get subrun #(8bit)
virtual void AddErrorBitFlag(int n, unsigned int error_bit_flag)=0
Add Detected Error bitflag.
virtual int GetMaxNumOfCh(int n)=0
Get the max number of channels in a readout board.
virtual int * Get4thDetectorBuffer(int n)=0
get Detector Buffer of slot D
virtual int Get2ndFINESSENwords(int n)=0
get data size of FINESSE slot B buffer
virtual int Get3rdFINESSENwords(int n)=0
get data size of FINESSE slot C buffer
virtual int GetTRGType(int n)=0
Get trgtype.
virtual int GetExpNo(int n)=0
get Experimental # from header
virtual unsigned int GetNodeID(int n)=0
get node-ID from data
virtual int GetTruncMask(int n)=0
get contents of header
virtual unsigned int GetTrailerChksum(int n)=0
Get checksum in RawTrailer.
virtual int GetFINESSENwords(int n, int finesse)=0
get data size of FINESSE buffer
virtual int Get1stDetectorNwords(int n)=0
get Detector buffer length of slot A
virtual unsigned int GetMagicDriverTrailer(int n)=0
get magic word of COPPER driver trailer
virtual int Get2ndDetectorNwords(int n)=0
get Detector buffer length of slot B
virtual int GetOffsetFINESSE(int n, int finesse)
get # of offset words
virtual unsigned int CalcXORChecksum(int *buf, int nwords)
calc XOR checksum
virtual int * Get2ndDetectorBuffer(int n)=0
get Detector Buffer of slot B
virtual int Get4thDetectorNwords(int n)=0
get Detector buffer length of slot D
virtual bool CheckOnlineRemovedDataBit(int n, int finesse_num)
Check if COPPER Magic words are correct.
virtual int * GetRawTrlBufPtr(int n)=0
get buffer pointer of rawcopper trailer
virtual bool CheckCOPPERMagic(int n)=0
Check if COPPER Magic words are correct.
virtual unsigned int GetB2LFEE32bitEventNumber(int n)=0
get b2l block from "FEE b2link header"
virtual int GetOffset1stFINESSE(int n)=0
get # of offset words for FINESSE slot A buffer position
virtual unsigned int GetExpRunSubrun(int n)=0
get Experimental # from header
virtual int * GetDetectorBuffer(int n, int finesse_num)
get Detector buffer
virtual unsigned int CalcDriverChkSum(int n)=0
calc COPPER driver's checksum value
virtual unsigned int GetMagicFPGAHeader(int n)=0
get magic word of COPPER FPGA header
virtual int GetTTCtime(int n)=0
Get ctime.
virtual unsigned int GetMagicDriverHeader(int n)=0
get magic word of COPPER driver header
virtual int GetNumFINESSEBlock(int n)=0
get # of FINNESEs which contains data
virtual 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)=0
check data contents
virtual unsigned int GetTTUtime(int n)=0
Check if COPPER Magic words are correct.
virtual unsigned int GetMagicFPGATrailer(int n)=0
get magic word of COPPER FPGA trailer
virtual int GetEventCRC16Value(int n, int finesse_num)
Get Event CRC16 value.
virtual unsigned int GetDriverChkSum(int n)=0
read COPPER driver's checksum value
virtual void GetTTTimeVal(int n, struct timeval *tv)=0
Get timeval.
virtual unsigned int GetErrorBitFlag(int n)=0
get contents of header
virtual unsigned int GetCOPPERCounter(int n)=0
get COPPER counter(not event number)
virtual int * GetFINESSEBuffer(int n, int finesse_num)
get FINESSE buffer pointer
virtual int * Get3rdDetectorBuffer(int n)=0
get Detector Buffer of slot C
virtual unsigned int GetTTCtimeTRGType(int n)=0
Check if COPPER Magic words are correct.
virtual int GetSubRunNo(int n)=0
get run # (14bit)
virtual int * Get1stDetectorBuffer(int n)=0
get Detector buffer of slot A
virtual void CheckUtimeCtimeTRGType(int n)=0
check data contents
virtual int GetEventCRCError(int n)
check CRC event Error
virtual int Get3rdDetectorNwords(int n)=0
get Detector buffer length of slot C
virtual int GetPacketCRCError(int n)
check CRC packet Error
virtual int * GetExpRunSubrunBuf(int n)=0
get b2l block from "FEE b2link header"
virtual int GetDetectorNwords(int n, int finesse_num)=0
set buffer ( delete_flag : m_buffer is freeed( = 0 )/ not freeed( = 1 ) in Destructer )
virtual int GetRunNo(int n)=0
Exp# (10bit) run# (14bit) restart # (8bit)
virtual int Get1stFINESSENwords(int n)=0
get data size of FINESSE slot A buffer
struct to contain header information used by RawCOPPERFormat::Packer()
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
Definition: RawCOPPER.h:52
void SetVersion()
read data, detect and set the version number of the data format
Definition: RawCOPPER.cc:34
RawCOPPERFormat * m_access
class to access
Definition: RawCOPPER.h:333
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.
Definition: RawCOPPER.cc:313
void ShowBuffer()
show m_buffer
Definition: RawCOPPER.cc:169
ClassDefOverride(RawCOPPER, 3)
do not record
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.
Definition: RawCOPPER.cc:183
virtual ~RawCOPPER()
Constructor using existing pointer to raw data buffer.
Definition: RawCOPPER.cc:28
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)
Definition: RawCOPPER.cc:251
int m_version
do not record
Definition: RawCOPPER.h:336
RawCOPPER()
Default constructor.
Definition: RawCOPPER.cc:22
std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
Definition: RawCOPPER.cc:285
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 )
Definition: RawCOPPER.cc:141
virtual int GetBufferPos(int n)
get position of data block in word
virtual void SetBuffer(int *bufin, int nwords, int delete_flag, int num_events, int num_nodes)
set buffer ( delete_flag : m_buffer is freeed( = 0 )/ not freeed( = 1 ) in Destructer )
The RawDataBlock class Base class for rawdata handling.
Definition: RawDataBlock.h:27
int m_num_events
number of events in this object
Definition: RawDataBlock.h:151
int m_num_nodes
number of nodes in this object
Definition: RawDataBlock.h:148
int * m_buffer
Buffer.
Definition: RawDataBlock.h:154
int m_nwords
do not record
Definition: RawDataBlock.h:145
unsigned int GetTTCtimeTRGType(int n)
Check if COPPER Magic words are correct.
Definition: RawCOPPER.h:608
virtual unsigned int GetB2LFEE32bitEventNumber(int n)
get b2l block from "FEE b2link header"
Definition: RawCOPPER.h:687
unsigned int GetTrailerChksum(int n)
Get checksum in RawTrailer.
Definition: RawCOPPER.h:602
unsigned int GetMagicDriverHeader(int n)
get magic word of COPPER driver header
Definition: RawCOPPER.h:578
int GetExpNo(int n)
get Experimental # from header
Definition: RawCOPPER.h:365
unsigned int GetExpRunSubrun(int n)
get Experimental # from header
Definition: RawCOPPER.h:371
int * Get2ndDetectorBuffer(int n)
get Detector Buffer of slot B
Definition: RawCOPPER.h:554
unsigned int GetEveNo(int n)
get subrun #(8bit)
Definition: RawCOPPER.h:390
unsigned int GetMagicDriverTrailer(int n)
get magic word of COPPER driver trailer
Definition: RawCOPPER.h:596
virtual int * GetRawHdrBufPtr(int n)
get buffer pointer of rawcopper header(Currently same as GetBufferPos)
Definition: RawCOPPER.h:347
bool CheckCOPPERMagic(int n)
Check if COPPER Magic words are correct.
Definition: RawCOPPER.h:713
unsigned int GetTTUtime(int n)
Check if COPPER Magic words are correct.
Definition: RawCOPPER.h:614
int * Get3rdFINESSEBuffer(int n)
get FINESSE buffer pointer for slot C
Definition: RawCOPPER.h:536
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
Definition: RawCOPPER.h:699
void CheckVersionSetBuffer()
Check the version number of data format.
Definition: RawCOPPER.h:741
int * Get3rdDetectorBuffer(int n)
get Detector Buffer of slot C
Definition: RawCOPPER.h:560
int GetOffsetFINESSE(int n, int finesse)
get # of offset words
Definition: RawCOPPER.h:669
int GetSubRunNo(int n)
get run # (14bit)
Definition: RawCOPPER.h:384
int GetOffset2ndFINESSE(int n)
get # of offset words for FINESSE slot B buffer position
Definition: RawCOPPER.h:506
virtual int GetBufferPos(int n) OVERRIDE_CPP17
get posistion of COPPER block in unit of word
Definition: RawCOPPER.h:638
unsigned int CalcXORChecksum(int *buf, int nwords)
calc XOR checksum
Definition: RawCOPPER.h:693
bool CheckOnlineRemovedDataBit(int n, int finesse_num)
check if this channel's data has been removed on a readout PC for CDC online "masking"
Definition: RawCOPPER.h:756
unsigned int GetMagicFPGATrailer(int n)
get magic word of COPPER FPGA trailer
Definition: RawCOPPER.h:590
virtual unsigned int GetCOPPERCounter(int n)
get COPPER counter(not event number)
Definition: RawCOPPER.h:446
int GetDetectorNwords(int n, int finesse_num)
get Detector buffer length
Definition: RawCOPPER.h:657
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
Definition: RawCOPPER.h:725
virtual int * GetRawTrlBufPtr(int n)
get buffer pointer of rawcopper trailer
Definition: RawCOPPER.h:353
int Get4thDetectorNwords(int n)
get Detector buffer length of slot D
Definition: RawCOPPER.h:470
int * GetDetectorBuffer(int n, int finesse_num)
get Detector buffer
Definition: RawCOPPER.h:681
unsigned int GetMagicFPGAHeader(int n)
get magic word of COPPER FPGA header
Definition: RawCOPPER.h:584
int GetEventCRC16Value(int n, int finesse_num)
Get Event CRC16 value.
Definition: RawCOPPER.h:440
int * Get2ndFINESSEBuffer(int n)
get FINESSE buffer pointer for slot B
Definition: RawCOPPER.h:530
int Get1stDetectorNwords(int n)
get Detector buffer length of slot A
Definition: RawCOPPER.h:452
int GetOffset1stFINESSE(int n)
get # of offset words for FINESSE slot A buffer position
Definition: RawCOPPER.h:500
int GetDataType(int n)
get contents of header
Definition: RawCOPPER.h:404
int GetOffset4thFINESSE(int n)
get # of offset words for FINESSE slot D buffer position
Definition: RawCOPPER.h:518
int GetTruncMask(int n)
get contents of header
Definition: RawCOPPER.h:410
int GetFINESSENwords(int n, int finesse)
get data size of FINESSE buffer
Definition: RawCOPPER.h:663
int Get2ndDetectorNwords(int n)
get Detector buffer length of slot B
Definition: RawCOPPER.h:458
int GetOffset3rdFINESSE(int n)
get # of offset words for FINESSE slot C buffer position
Definition: RawCOPPER.h:512
void AddErrorBitFlag(int n, unsigned int error_bit_flag)
Get Detected Error bitflag.
Definition: RawCOPPER.h:422
unsigned int CalcDriverChkSum(int n)
calc COPPER driver's checksum value
Definition: RawCOPPER.h:644
int Get1stFINESSENwords(int n)
get data size of FINESSE slot A buffer
Definition: RawCOPPER.h:476
virtual int GetNumFINESSEBlock(int n)
get # of FINNESEs which contains data
Definition: RawCOPPER.h:651
int Get4thFINESSENwords(int n)
get data size of FINESSE slot D buffer
Definition: RawCOPPER.h:494
void CheckUtimeCtimeTRGType(int n)
check data contents
Definition: RawCOPPER.h:719
virtual int * GetExpRunSubrunBuf(int n)
get b2l block from "FEE b2link header"
Definition: RawCOPPER.h:572
int * Get1stDetectorBuffer(int n)
get Detector buffer of slot A
Definition: RawCOPPER.h:548
void GetTTTimeVal(int n, struct timeval *tv)
Get timeval.
Definition: RawCOPPER.h:632
int * GetFINESSEBuffer(int n, int finesse_num)
get FINESSE buffer pointer
Definition: RawCOPPER.h:675
int GetTTCtime(int n)
Get ctime.
Definition: RawCOPPER.h:620
int Get3rdFINESSENwords(int n)
get data size of FINESSE slot C buffer
Definition: RawCOPPER.h:488
int GetEventCRCError(int n)
check CRC event Error
Definition: RawCOPPER.h:434
int GetPacketCRCError(int n)
check CRC packet Error
Definition: RawCOPPER.h:428
int * Get4thFINESSEBuffer(int n)
get FINESSE buffer pointer for slot D
Definition: RawCOPPER.h:542
int Get2ndFINESSENwords(int n)
get data size of FINESSE slot B buffer
Definition: RawCOPPER.h:482
int * Get4thDetectorBuffer(int n)
get Detector Buffer of slot D
Definition: RawCOPPER.h:566
unsigned int GetNodeID(int n)
get node-ID from data
Definition: RawCOPPER.h:397
int GetTRGType(int n)
Get trgtype.
Definition: RawCOPPER.h:626
int Get3rdDetectorNwords(int n)
get Detector buffer length of slot C
Definition: RawCOPPER.h:464
int * Get1stFINESSEBuffer(int n)
get FINESSE buffer pointer for slot A
Definition: RawCOPPER.h:524
unsigned int GetDriverChkSum(int n)
read COPPER driver's checksum value
Definition: RawCOPPER.h:359
unsigned int GetErrorBitFlag(int n)
get contents of header
Definition: RawCOPPER.h:416
int GetRunNo(int n)
Exp# (10bit) run# (14bit) restart # (8bit)
Definition: RawCOPPER.h:377
int GetMaxNumOfCh(int n)
Get the max number of channels in a readout board.
Definition: RawCOPPER.h:750
Abstract base class for different kinds of events.