Belle II Software  release-05-02-19
RawCOPPER.h
1 //+
2 // File : RawCOPPER.h
3 // Description : Module to handle raw data from COPPER
4 //
5 // Author : Satoru Yamada, IPNS, KEK
6 // Date : 2 - Aug - 2013
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 
41 namespace 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  void SetBuffer(int* bufin, int nwords, int delete_flag, int num_events, int num_nodes) OVERRIDE_CPP17;
68 
70  // POINTER TO "DETECTOR BUFFER"
71  //( after removing "B2link headers" from "FINESSE buffer". THIS IS THE RAW DATA FROM A DETECTOR
74  int GetDetectorNwords(int n, int finesse_num);
75 
77  int Get1stDetectorNwords(int n);
78 
80  int Get2ndDetectorNwords(int n);
81 
83  int Get3rdDetectorNwords(int n);
84 
86  int Get4thDetectorNwords(int n);
87 
89  int* GetDetectorBuffer(int n, int finesse_num);
90 
92  int* Get1stDetectorBuffer(int n);
93 
95  int* Get2ndDetectorBuffer(int n);
96 
98  int* Get3rdDetectorBuffer(int n);
99 
101  int* Get4thDetectorBuffer(int n);
103 
105  virtual int GetBufferPos(int n) OVERRIDE_CPP17;
106 
108  virtual int* GetRawHdrBufPtr(int n);
109 
111  virtual int* GetRawTrlBufPtr(int n);
112 
114  int* GetFINESSEBuffer(int n, int finesse_num);
115 
117  int* Get1stFINESSEBuffer(int n);
118 
120  int* Get2ndFINESSEBuffer(int n);
121 
123  int* Get3rdFINESSEBuffer(int n);
124 
126  int* Get4thFINESSEBuffer(int n);
127 
128 
129  //
130  // Get information from "RawCOPPER header" attached by DAQ software
131  //
132 
134  int GetExpNo(int n);
135 
136  unsigned int GetExpRunSubrun(int n);
137 
138  int GetRunNo(int n);
139 
140  int GetSubRunNo(int n);
141 
142  unsigned int GetEveNo(int n);
143 
144  int GetDataType(int n);
145 
146  int GetTruncMask(int n);
147 
149  unsigned int GetErrorBitFlag(int n);
150 
152  void AddErrorBitFlag(int n, unsigned int error_bit_flag);
153 
154 
156  int GetPacketCRCError(int n);
157 
159  int GetEventCRCError(int n);
160 
162  int GetEventCRC16Value(int n, int finesse_num);
163 
165  unsigned int GetNodeID(int n);
166 
167  //
168  // Get information from 13words "COPPER header" attached by COPPER board
169  //
171  virtual unsigned int GetCOPPERCounter(int n);
172 
174  virtual int GetNumFINESSEBlock(int n);
175 
177  int GetOffsetFINESSE(int n, int finesse);
178 
180  int GetOffset1stFINESSE(int n);
181 
183  int GetOffset2ndFINESSE(int n);
184 
186  int GetOffset3rdFINESSE(int n);
187 
189  int GetOffset4thFINESSE(int n);
190 
192  int GetFINESSENwords(int n, int finesse);
193 
195  int Get1stFINESSENwords(int n);
196 
198  int Get2ndFINESSENwords(int n);
199 
201  int Get3rdFINESSENwords(int n);
202 
204  int Get4thFINESSENwords(int n);
205 
206  //
207  // Get information from "B2link(attached by FEE and HLSB) header"
208  //
210  // virtual int* GetFTSW2Words(int n);
211 
213  virtual int* GetExpRunSubrunBuf(int n);
214 
216  virtual unsigned int GetB2LFEE32bitEventNumber(int n);
217 
218  //
219  // read magic word to check data
220  //
222  unsigned int GetMagicDriverHeader(int n);
223 
225  unsigned int GetMagicFPGAHeader(int n);
226 
228  unsigned int GetMagicFPGATrailer(int n);
229 
231  unsigned int GetMagicDriverTrailer(int n);
232 
234  unsigned int GetTrailerChksum(int n);
235 
237  bool CheckCOPPERMagic(int n);
238 
239 #ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
240  void CheckB2LFEEHeaderVersion(int n);
242 #endif
243 
245  unsigned int GetTTCtimeTRGType(int n);
246 
248  unsigned int GetTTUtime(int n);
249 
251  unsigned int FillTopBlockRawHeader(unsigned int m_node_id,
252  unsigned int prev_eve32, unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no);
253 
255  unsigned int GetDriverChkSum(int n);
256 
258  unsigned int CalcDriverChkSum(int n);
259 
261  unsigned int CalcXORChecksum(int* buf, int nwords);
262 
264  void CheckData(int n,
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);
268 
270  void CheckUtimeCtimeTRGType(int n);
271 
273  int GetTTCtime(int n);
274 
276  int GetTRGType(int n);
277 
279  void GetTTTimeVal(int n, struct timeval* tv);
280 
282  void SetVersion();
283 
285  void SetVersion(std::string class_name);
286 
288  void CheckVersionSetBuffer();
289 
291  void ShowBuffer();
292 
295  void PackDetectorBuf(int* detector_buf_1st, int nwords_1st,
296  int* detector_buf_2nd, int nwords_2nd,
297  int* detector_buf_3rd, int nwords_3rd,
298  int* detector_buf_4th, int nwords_4th,
299  RawCOPPERPackerInfo rawcprpacker_info);
300 
302  void PackDetectorBuf4DummyData(int* detector_buf_1st, int nwords_1st,
303  int* detector_buf_2nd, int nwords_2nd,
304  int* detector_buf_3rd, int nwords_3rd,
305  int* detector_buf_4th, int nwords_4th,
306  RawCOPPERPackerInfo rawcprpacker_info);
307 
309  void PackDetectorBuf(int* const(&detector_buf_ch)[MAX_PCIE40_CH],
310  int const(&nwords_ch)[MAX_PCIE40_CH],
311  RawCOPPERPackerInfo rawcprpacker_info);
312 
314  int GetMaxNumOfCh(int n);
315 
317  void CompareHeaderValue(int n, const unsigned int (&input_val)[MAX_PCIE40_CH] , std::vector<std::vector< unsigned int>>& result);
318 
320  std::string getInfoHTML() const;
321 
322  enum {
323  POS_FORMAT_VERSION = 1,
324  FORMAT_MASK = 0x0000FF00
325  };
326 
329 
331  int m_version;
332 
333  protected :
338 
339  };
340 
341 
342  inline int* RawCOPPER::GetRawHdrBufPtr(int n)
343  {
345  return m_access->GetRawHdrBufPtr(n);
346  }
347 
348  inline int* RawCOPPER::GetRawTrlBufPtr(int n)
349  {
351  return m_access->GetRawTrlBufPtr(n);
352  }
353 
354  inline unsigned int RawCOPPER::GetDriverChkSum(int n)
355  {
357  return m_access->GetDriverChkSum(n);
358  }
359 
360  inline int RawCOPPER::GetExpNo(int n)
361  {
363  return m_access->GetExpNo(n);
364  }
365 
366  inline unsigned int RawCOPPER::GetExpRunSubrun(int n)
367  {
369  return m_access->GetExpRunSubrun(n);
370  }
371 
372  inline int RawCOPPER::GetRunNo(int n)
373  {
375  return m_access->GetRunNo(n);
376  }
377 
378 
379  inline int RawCOPPER::GetSubRunNo(int n)
380  {
382  return m_access->GetSubRunNo(n);
383  }
384 
385  inline unsigned int RawCOPPER::GetEveNo(int n)
386  {
388  return m_access->GetEveNo(n);
389  }
390 
391 
392  inline unsigned int RawCOPPER::GetNodeID(int n)
393  {
395  return m_access->GetNodeID(n);
396  }
397 
398 
399  inline int RawCOPPER::GetDataType(int n)
400  {
402  return m_access->GetDataType(n);
403  }
404 
405  inline int RawCOPPER::GetTruncMask(int n)
406  {
408  return m_access->GetTruncMask(n);
409  }
410 
411  inline unsigned int RawCOPPER::GetErrorBitFlag(int n)
412  {
414  return m_access->GetErrorBitFlag(n);
415  }
416 
417  inline void RawCOPPER::AddErrorBitFlag(int n, unsigned int error_bit_flag)
418  {
420  return m_access->AddErrorBitFlag(n, error_bit_flag);
421  }
422 
424  {
426  return m_access->GetPacketCRCError(n);
427  }
428 
429  inline int RawCOPPER::GetEventCRCError(int n)
430  {
432  return m_access->GetEventCRCError(n);
433  }
434 
435  inline int RawCOPPER::GetEventCRC16Value(int n, int finesse_num)
436  {
438  return m_access->GetEventCRC16Value(n, finesse_num);
439  }
440 
441  inline unsigned int RawCOPPER::GetCOPPERCounter(int n)
442  {
444  return m_access->GetCOPPERCounter(n);
445  }
446 
448  {
450  return m_access->Get1stDetectorNwords(n);
451  }
452 
454  {
456  return m_access->Get2ndDetectorNwords(n);
457  }
458 
460  {
462  return m_access->Get3rdDetectorNwords(n);
463  }
464 
466  {
468  return m_access->Get4thDetectorNwords(n);
469  }
470 
472  {
474  return m_access->Get1stFINESSENwords(n);
475  }
476 
478  {
480  return m_access->Get2ndFINESSENwords(n);
481  }
482 
484  {
486  return m_access->Get3rdFINESSENwords(n);
487  }
488 
490  {
492  return m_access->Get4thFINESSENwords(n);
493  }
494 
496  {
498  return m_access->GetOffset1stFINESSE(n);
499  }
500 
502  {
504  return m_access->GetOffset2ndFINESSE(n);
505  }
506 
508  {
510  return m_access->GetOffset3rdFINESSE(n);
511  }
512 
514  {
516  return m_access->GetOffset4thFINESSE(n);
517  }
518 
520  {
522  return m_access->Get1stFINESSEBuffer(n);
523  }
524 
526  {
528  return m_access->Get2ndFINESSEBuffer(n);
529  }
530 
532  {
534  return m_access->Get3rdFINESSEBuffer(n);
535  }
536 
538  {
540  return m_access->Get4thFINESSEBuffer(n);
541  }
542 
544  {
546  return m_access->Get1stDetectorBuffer(n);
547  }
548 
550  {
552  return m_access->Get2ndDetectorBuffer(n);
553  }
554 
556  {
558  return m_access->Get3rdDetectorBuffer(n);
559  }
560 
562  {
564  return m_access->Get4thDetectorBuffer(n);
565  }
566 
567  inline int* RawCOPPER::GetExpRunSubrunBuf(int n)
568  {
570  return m_access->GetExpRunSubrunBuf(n);
571  }
572 
573  inline unsigned int RawCOPPER::GetMagicDriverHeader(int n)
574  {
576  return m_access->GetMagicDriverHeader(n);
577  }
578 
579  inline unsigned int RawCOPPER::GetMagicFPGAHeader(int n)
580  {
582  return m_access->GetMagicFPGAHeader(n);
583  }
584 
585  inline unsigned int RawCOPPER::GetMagicFPGATrailer(int n)
586  {
588  return m_access->GetMagicFPGATrailer(n);
589  }
590 
591  inline unsigned int RawCOPPER::GetMagicDriverTrailer(int n)
592  {
594  return m_access->GetMagicDriverTrailer(n);
595  }
596 
597  inline unsigned int RawCOPPER::GetTrailerChksum(int n)
598  {
600  return m_access->GetTrailerChksum(n);
601  }
602 
603  inline unsigned int RawCOPPER::GetTTCtimeTRGType(int n)
604  {
606  return m_access->GetTTCtimeTRGType(n);
607  }
608 
609  inline unsigned int RawCOPPER::GetTTUtime(int n)
610  {
612  return m_access->GetTTUtime(n);
613  }
614 
615  inline int RawCOPPER::GetTTCtime(int n)
616  {
618  return m_access->GetTTCtime(n);
619  }
620 
621  inline int RawCOPPER::GetTRGType(int n)
622  {
624  return m_access->GetTRGType(n);
625  }
626 
627  inline void RawCOPPER::GetTTTimeVal(int n, struct timeval* tv)
628  {
630  return m_access->GetTTTimeVal(n, tv);
631  }
632 
633  inline int RawCOPPER::GetBufferPos(int n)
634  {
636  return m_access->GetBufferPos(n);
637  }
638 
639  inline unsigned int RawCOPPER::CalcDriverChkSum(int n)
640  {
642  return m_access->CalcDriverChkSum(n);
643  }
644 
645 
647  {
649  return m_access->GetNumFINESSEBlock(n);
650  }
651 
652  inline int RawCOPPER::GetDetectorNwords(int n, int finesse_num)
653  {
655  return m_access->GetDetectorNwords(n, finesse_num);
656  }
657 
658  inline int RawCOPPER::GetFINESSENwords(int n, int finesse_num)
659  {
661  return m_access->GetFINESSENwords(n, finesse_num);
662  }
663 
664  inline int RawCOPPER::GetOffsetFINESSE(int n, int finesse_num)
665  {
667  return m_access->GetOffsetFINESSE(n, finesse_num);
668  }
669 
670  inline int* RawCOPPER::GetFINESSEBuffer(int n, int finesse_num)
671  {
673  return m_access->GetFINESSEBuffer(n, finesse_num);
674  }
675 
676  inline int* RawCOPPER::GetDetectorBuffer(int n, int finesse_num)
677  {
679  return m_access->GetDetectorBuffer(n, finesse_num);
680  }
681 
682  inline unsigned int RawCOPPER::GetB2LFEE32bitEventNumber(int n)
683  {
686  }
687 
688  inline unsigned int RawCOPPER::CalcXORChecksum(int* buf, int nwords)
689  {
691  return m_access->CalcXORChecksum(buf, nwords);
692  }
693 
694  inline void RawCOPPER::CheckData(int n,
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)
698  {
699 
701  m_access->CheckData(n,
702  prev_evenum, cur_evenum_rawcprhdr,
703  prev_copper_ctr, cur_copper_ctr,
704  prev_exprunsubrun_no, cur_exprunsubrun_no);
705  return;
706  }
707 
708  inline bool RawCOPPER::CheckCOPPERMagic(int n)
709  {
711  return m_access->CheckCOPPERMagic(n);
712  }
713 
715  {
717  return m_access->CheckUtimeCtimeTRGType(n);
718  }
719 
720  inline unsigned int RawCOPPER::FillTopBlockRawHeader(unsigned int m_node_id, unsigned int prev_eve32,
721  unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no)
722  {
724  return m_access->FillTopBlockRawHeader(m_node_id, prev_eve32,
725  prev_exprunsubrun_no, cur_exprunsubrun_no);
726  }
727 
728 #ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
729  inline void RawCOPPER::CheckB2LFEEHeaderVersion(int n)
730  {
732  return m_access->CheckB2LFEEHeaderVersion(n);
733  }
734 #endif
735 
737  {
738  if (((m_buffer[ POS_FORMAT_VERSION ] & FORMAT_MASK) >> 8) != m_version
739  || m_access == NULL) {
740  SetVersion();
741  }
743  }
744 
745  inline int RawCOPPER::GetMaxNumOfCh(int n)
746  {
748  return m_access->GetMaxNumOfCh(n);
749  }
750 
752 }
753 
754 #endif
Belle2::RawCOPPER
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
Definition: RawCOPPER.h:52
Belle2::RawCOPPERFormat::Get1stFINESSENwords
virtual int Get1stFINESSENwords(int n)=0
get data size of FINESSE slot A buffer
Belle2::RawCOPPERFormat::GetSubRunNo
virtual int GetSubRunNo(int n)=0
get run # (14bit)
Belle2::RawCOPPER::GetFINESSEBuffer
int * GetFINESSEBuffer(int n, int finesse_num)
get FINESSE buffer pointer
Definition: RawCOPPER.h:670
Belle2::RawCOPPERPackerInfo
struct to contain header information used by RawCOPPERFormat::Packer()
Definition: RawCOPPERPackerInfo.h:12
Belle2::RawCOPPER::GetOffset3rdFINESSE
int GetOffset3rdFINESSE(int n)
get # of offset words for FINESSE slot C buffer position
Definition: RawCOPPER.h:507
Belle2::RawCOPPERFormat::Get3rdDetectorBuffer
virtual int * Get3rdDetectorBuffer(int n)=0
get Detector Buffer of slot C
Belle2::RawCOPPER::GetTTCtimeTRGType
unsigned int GetTTCtimeTRGType(int n)
Check if COPPER Magic words are correct.
Definition: RawCOPPER.h:603
Belle2::RawCOPPERFormat::FillTopBlockRawHeader
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
Belle2::RawCOPPER::Get2ndDetectorNwords
int Get2ndDetectorNwords(int n)
get Detector buffer length of slot B
Definition: RawCOPPER.h:453
Belle2::RawCOPPER::CheckCOPPERMagic
bool CheckCOPPERMagic(int n)
Check if COPPER Magic words are correct.
Definition: RawCOPPER.h:708
Belle2::RawCOPPERFormat::GetDetectorNwords
virtual int GetDetectorNwords(int n, int finesse_num)=0
set buffer ( delete_flag : m_buffer is freeed( = 0 )/ not freeed( = 1 ) in Destructer )
Belle2::RawCOPPERFormat::CheckUtimeCtimeTRGType
virtual void CheckUtimeCtimeTRGType(int n)=0
check data contents
Belle2::RawDataBlockFormat::SetBuffer
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 )
Definition: RawDataBlockFormat.cc:131
Belle2::RawCOPPER::CalcXORChecksum
unsigned int CalcXORChecksum(int *buf, int nwords)
calc XOR checksum
Definition: RawCOPPER.h:688
Belle2::RawCOPPERFormat::GetNodeID
virtual unsigned int GetNodeID(int n)=0
get node-ID from data
Belle2::RawCOPPER::GetMagicDriverHeader
unsigned int GetMagicDriverHeader(int n)
get magic word of COPPER driver header
Definition: RawCOPPER.h:573
Belle2::RawCOPPERFormat::GetEventCRCError
virtual int GetEventCRCError(int n)
check CRC event Error
Definition: RawCOPPERFormat.cc:134
Belle2::RawDataBlockFormat::GetBufferPos
virtual int GetBufferPos(int n)
get position of data block in word
Definition: RawDataBlockFormat.cc:30
Belle2::RawCOPPERFormat::GetExpRunSubrunBuf
virtual int * GetExpRunSubrunBuf(int n)=0
get b2l block from "FEE b2link header"
Belle2::RawCOPPER::Get2ndFINESSENwords
int Get2ndFINESSENwords(int n)
get data size of FINESSE slot B buffer
Definition: RawCOPPER.h:477
Belle2::RawCOPPERFormat::GetErrorBitFlag
virtual unsigned int GetErrorBitFlag(int n)=0
get contents of header
Belle2::RawCOPPER::GetExpRunSubrun
unsigned int GetExpRunSubrun(int n)
get Experimental # from header
Definition: RawCOPPER.h:366
Belle2::RawCOPPERFormat::GetTTTimeVal
virtual void GetTTTimeVal(int n, struct timeval *tv)=0
Get timeval.
Belle2::RawCOPPER::GetTrailerChksum
unsigned int GetTrailerChksum(int n)
Get checksum in RawTrailer.
Definition: RawCOPPER.h:597
Belle2::RawCOPPER::GetPacketCRCError
int GetPacketCRCError(int n)
check CRC packet Error
Definition: RawCOPPER.h:423
Belle2::RawCOPPER::GetExpRunSubrunBuf
virtual int * GetExpRunSubrunBuf(int n)
get b2l block from "FEE b2link header"
Definition: RawCOPPER.h:567
Belle2::RawCOPPER::m_access
RawCOPPERFormat * m_access
class to access
Definition: RawCOPPER.h:328
Belle2::RawCOPPERFormat::GetFINESSEBuffer
virtual int * GetFINESSEBuffer(int n, int finesse_num)
get FINESSE buffer pointer
Definition: RawCOPPERFormat.cc:65
Belle2::RawCOPPER::GetDetectorBuffer
int * GetDetectorBuffer(int n, int finesse_num)
get Detector buffer
Definition: RawCOPPER.h:676
Belle2::RawCOPPERFormat::GetEventCRC16Value
virtual int GetEventCRC16Value(int n, int finesse_num)
Get Event CRC16 value.
Definition: RawCOPPERFormat.cc:145
Belle2::RawCOPPERFormat::GetTRGType
virtual int GetTRGType(int n)=0
Get trgtype.
Belle2::RawCOPPERFormat::Get2ndDetectorNwords
virtual int Get2ndDetectorNwords(int n)=0
get Detector buffer length of slot B
Belle2::RawCOPPERFormat::GetB2LFEE32bitEventNumber
virtual unsigned int GetB2LFEE32bitEventNumber(int n)=0
get b2l block from "FEE b2link header"
Belle2::RawCOPPER::~RawCOPPER
virtual ~RawCOPPER()
Constructor using existing pointer to raw data buffer.
Definition: RawCOPPER.cc:28
Belle2::RawCOPPER::GetDetectorNwords
int GetDetectorNwords(int n, int finesse_num)
get Detector buffer length
Definition: RawCOPPER.h:652
Belle2::RawCOPPERFormat::GetMagicDriverTrailer
virtual unsigned int GetMagicDriverTrailer(int n)=0
get magic word of COPPER driver trailer
Belle2::RawCOPPER::AddErrorBitFlag
void AddErrorBitFlag(int n, unsigned int error_bit_flag)
Get Detected Error bitflag.
Definition: RawCOPPER.h:417
Belle2::RawDataBlock::m_num_events
int m_num_events
number of events in this object
Definition: RawDataBlock.h:151
Belle2::RawCOPPER::GetDriverChkSum
unsigned int GetDriverChkSum(int n)
read COPPER driver's checksum value
Definition: RawCOPPER.h:354
Belle2::RawCOPPERFormat::Get4thFINESSENwords
virtual int Get4thFINESSENwords(int n)=0
get data size of FINESSE slot D buffer
Belle2::RawCOPPERFormat::GetEveNo
virtual unsigned int GetEveNo(int n)=0
get subrun #(8bit)
Belle2::RawCOPPER::GetOffset2ndFINESSE
int GetOffset2ndFINESSE(int n)
get # of offset words for FINESSE slot B buffer position
Definition: RawCOPPER.h:501
Belle2::RawCOPPERFormat::GetDriverChkSum
virtual unsigned int GetDriverChkSum(int n)=0
read COPPER driver's checksum value
Belle2::RawCOPPERFormat::GetTTCtimeTRGType
virtual unsigned int GetTTCtimeTRGType(int n)=0
Check if COPPER Magic words are correct.
Belle2::RawCOPPER::GetTTTimeVal
void GetTTTimeVal(int n, struct timeval *tv)
Get timeval.
Definition: RawCOPPER.h:627
Belle2::RawCOPPERFormat::CheckCOPPERMagic
virtual bool CheckCOPPERMagic(int n)=0
Check if COPPER Magic words are correct.
Belle2::RawCOPPER::Get4thFINESSEBuffer
int * Get4thFINESSEBuffer(int n)
get FINESSE buffer pointer for slot D
Definition: RawCOPPER.h:537
Belle2::RawCOPPER::CalcDriverChkSum
unsigned int CalcDriverChkSum(int n)
calc COPPER driver's checksum value
Definition: RawCOPPER.h:639
Belle2::RawCOPPER::CheckVersionSetBuffer
void CheckVersionSetBuffer()
Check the version number of data format.
Definition: RawCOPPER.h:736
Belle2::RawCOPPER::GetTTUtime
unsigned int GetTTUtime(int n)
Check if COPPER Magic words are correct.
Definition: RawCOPPER.h:609
Belle2::RawCOPPER::GetTTCtime
int GetTTCtime(int n)
Get ctime.
Definition: RawCOPPER.h:615
Belle2::RawCOPPER::ShowBuffer
void ShowBuffer()
show m_buffer
Definition: RawCOPPER.cc:169
Belle2::RawCOPPER::GetDataType
int GetDataType(int n)
get contents of header
Definition: RawCOPPER.h:399
Belle2::RawCOPPERFormat::Get2ndDetectorBuffer
virtual int * Get2ndDetectorBuffer(int n)=0
get Detector Buffer of slot B
Belle2::RawCOPPERFormat::AddErrorBitFlag
virtual void AddErrorBitFlag(int n, unsigned int error_bit_flag)=0
Add Detected Error bitflag.
Belle2::RawCOPPER::GetMaxNumOfCh
int GetMaxNumOfCh(int n)
Get the max number of channels in a readout board.
Definition: RawCOPPER.h:745
Belle2::RawCOPPER::SetVersion
void SetVersion()
read data, detect and set the version number of the data format
Definition: RawCOPPER.cc:34
Belle2::RawCOPPER::CheckUtimeCtimeTRGType
void CheckUtimeCtimeTRGType(int n)
check data contents
Definition: RawCOPPER.h:714
Belle2::RawCOPPERFormat::CalcXORChecksum
virtual unsigned int CalcXORChecksum(int *buf, int nwords)
calc XOR checksum
Definition: RawCOPPERFormat.cc:24
Belle2::RawCOPPERFormat::Get4thDetectorBuffer
virtual int * Get4thDetectorBuffer(int n)=0
get Detector Buffer of slot D
Belle2::RawCOPPERFormat::GetCOPPERCounter
virtual unsigned int GetCOPPERCounter(int n)=0
get COPPER counter(not event number)
Belle2::RawCOPPER::Get1stFINESSEBuffer
int * Get1stFINESSEBuffer(int n)
get FINESSE buffer pointer for slot A
Definition: RawCOPPER.h:519
Belle2::RawDataBlock::m_num_nodes
int m_num_nodes
number of nodes in this object
Definition: RawDataBlock.h:148
Belle2::RawCOPPER::Get3rdFINESSENwords
int Get3rdFINESSENwords(int n)
get data size of FINESSE slot C buffer
Definition: RawCOPPER.h:483
Belle2::RawCOPPER::GetNumFINESSEBlock
virtual int GetNumFINESSEBlock(int n)
get # of FINNESEs which contains data
Definition: RawCOPPER.h:646
Belle2::RawCOPPER::GetBufferPos
virtual int GetBufferPos(int n) OVERRIDE_CPP17
get posistion of COPPER block in unit of word
Definition: RawCOPPER.h:633
Belle2::RawCOPPER::GetExpNo
int GetExpNo(int n)
get Experimental # from header
Definition: RawCOPPER.h:360
Belle2::RawCOPPER::CheckData
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:694
Belle2::RawCOPPERFormat::Get2ndFINESSENwords
virtual int Get2ndFINESSENwords(int n)=0
get data size of FINESSE slot B buffer
Belle2::RawCOPPER::Get2ndFINESSEBuffer
int * Get2ndFINESSEBuffer(int n)
get FINESSE buffer pointer for slot B
Definition: RawCOPPER.h:525
Belle2::RawCOPPER::m_version
int m_version
do not record
Definition: RawCOPPER.h:331
Belle2::RawCOPPERFormat::GetTrailerChksum
virtual unsigned int GetTrailerChksum(int n)=0
Get checksum in RawTrailer.
Belle2::RawCOPPER::GetRunNo
int GetRunNo(int n)
Exp# (10bit) run# (14bit) restart # (8bit)
Definition: RawCOPPER.h:372
Belle2::RawCOPPER::GetRawTrlBufPtr
virtual int * GetRawTrlBufPtr(int n)
get buffer pointer of rawcopper trailer
Definition: RawCOPPER.h:348
Belle2::RawCOPPER::GetCOPPERCounter
virtual unsigned int GetCOPPERCounter(int n)
get COPPER counter(not event number)
Definition: RawCOPPER.h:441
Belle2::RawCOPPER::Get1stDetectorNwords
int Get1stDetectorNwords(int n)
get Detector buffer length of slot A
Definition: RawCOPPER.h:447
Belle2::RawCOPPER::FillTopBlockRawHeader
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:720
Belle2::RawCOPPER::GetMagicFPGATrailer
unsigned int GetMagicFPGATrailer(int n)
get magic word of COPPER FPGA trailer
Definition: RawCOPPER.h:585
Belle2::RawCOPPER::GetMagicFPGAHeader
unsigned int GetMagicFPGAHeader(int n)
get magic word of COPPER FPGA header
Definition: RawCOPPER.h:579
Belle2::RawCOPPER::GetOffset4thFINESSE
int GetOffset4thFINESSE(int n)
get # of offset words for FINESSE slot D buffer position
Definition: RawCOPPER.h:513
Belle2::RawCOPPER::GetSubRunNo
int GetSubRunNo(int n)
get run # (14bit)
Definition: RawCOPPER.h:379
Belle2::RawCOPPER::Get3rdFINESSEBuffer
int * Get3rdFINESSEBuffer(int n)
get FINESSE buffer pointer for slot C
Definition: RawCOPPER.h:531
Belle2::RawCOPPERFormat::GetDetectorBuffer
virtual int * GetDetectorBuffer(int n, int finesse_num)
get Detector buffer
Definition: RawCOPPERFormat.cc:94
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RawCOPPER::Get4thDetectorBuffer
int * Get4thDetectorBuffer(int n)
get Detector Buffer of slot D
Definition: RawCOPPER.h:561
Belle2::RawCOPPER::GetOffsetFINESSE
int GetOffsetFINESSE(int n, int finesse)
get # of offset words
Definition: RawCOPPER.h:664
Belle2::RawCOPPERFormat::GetExpRunSubrun
virtual unsigned int GetExpRunSubrun(int n)=0
get Experimental # from header
Belle2::RawCOPPER::GetEveNo
unsigned int GetEveNo(int n)
get subrun #(8bit)
Definition: RawCOPPER.h:385
Belle2::RawCOPPERFormat::GetFINESSENwords
virtual int GetFINESSENwords(int n, int finesse)=0
get data size of FINESSE buffer
Belle2::RawCOPPER::PackDetectorBuf4DummyData
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
Belle2::RawCOPPER::GetNodeID
unsigned int GetNodeID(int n)
get node-ID from data
Definition: RawCOPPER.h:392
Belle2::RawCOPPERFormat::GetMagicFPGATrailer
virtual unsigned int GetMagicFPGATrailer(int n)=0
get magic word of COPPER FPGA trailer
Belle2::RawCOPPERFormat::Get3rdDetectorNwords
virtual int Get3rdDetectorNwords(int n)=0
get Detector buffer length of slot C
Belle2::RawCOPPER::GetErrorBitFlag
unsigned int GetErrorBitFlag(int n)
get contents of header
Definition: RawCOPPER.h:411
Belle2::RawCOPPERFormat::Get1stDetectorNwords
virtual int Get1stDetectorNwords(int n)=0
get Detector buffer length of slot A
Belle2::RawCOPPER::SetBuffer
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
Belle2::RawCOPPERFormat::GetRawTrlBufPtr
virtual int * GetRawTrlBufPtr(int n)=0
get buffer pointer of rawcopper trailer
Belle2::RawCOPPER::GetOffset1stFINESSE
int GetOffset1stFINESSE(int n)
get # of offset words for FINESSE slot A buffer position
Definition: RawCOPPER.h:495
Belle2::RawCOPPERFormat::GetRunNo
virtual int GetRunNo(int n)=0
Exp# (10bit) run# (14bit) restart # (8bit)
Belle2::RawCOPPERFormat::GetOffsetFINESSE
virtual int GetOffsetFINESSE(int n, int finesse)
get # of offset words
Definition: RawCOPPERFormat.cc:36
Belle2::RawCOPPERFormat::Get3rdFINESSENwords
virtual int Get3rdFINESSENwords(int n)=0
get data size of FINESSE slot C buffer
Belle2::RawCOPPER::GetMagicDriverTrailer
unsigned int GetMagicDriverTrailer(int n)
get magic word of COPPER driver trailer
Definition: RawCOPPER.h:591
Belle2::RawCOPPERFormat::Get4thDetectorNwords
virtual int Get4thDetectorNwords(int n)=0
get Detector buffer length of slot D
Belle2::RawCOPPER::GetB2LFEE32bitEventNumber
virtual unsigned int GetB2LFEE32bitEventNumber(int n)
get b2l block from "FEE b2link header"
Definition: RawCOPPER.h:682
Belle2::RawCOPPER::Get1stFINESSENwords
int Get1stFINESSENwords(int n)
get data size of FINESSE slot A buffer
Definition: RawCOPPER.h:471
Belle2::RawCOPPERFormat::GetOffset1stFINESSE
virtual int GetOffset1stFINESSE(int n)=0
get # of offset words for FINESSE slot A buffer position
Belle2::RawCOPPER::GetFINESSENwords
int GetFINESSENwords(int n, int finesse)
get data size of FINESSE buffer
Definition: RawCOPPER.h:658
Belle2::RawCOPPER::GetRawHdrBufPtr
virtual int * GetRawHdrBufPtr(int n)
get buffer pointer of rawcopper header(Currently same as GetBufferPos)
Definition: RawCOPPER.h:342
Belle2::RawCOPPERFormat::GetTTUtime
virtual unsigned int GetTTUtime(int n)=0
Check if COPPER Magic words are correct.
Belle2::RawCOPPER::GetTRGType
int GetTRGType(int n)
Get trgtype.
Definition: RawCOPPER.h:621
Belle2::RawCOPPER::PackDetectorBuf
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
Belle2::RawCOPPER::RawCOPPER
RawCOPPER()
Default constructor.
Definition: RawCOPPER.cc:22
Belle2::RawCOPPER::Get1stDetectorBuffer
int * Get1stDetectorBuffer(int n)
get Detector buffer of slot A
Definition: RawCOPPER.h:543
Belle2::RawCOPPERFormat::GetNumFINESSEBlock
virtual int GetNumFINESSEBlock(int n)=0
get # of FINNESEs which contains data
Belle2::RawCOPPERFormat::Get1stDetectorBuffer
virtual int * Get1stDetectorBuffer(int n)=0
get Detector buffer of slot A
Belle2::RawDataBlock::m_nwords
int m_nwords
do not record
Definition: RawDataBlock.h:145
Belle2::RawCOPPER::Get3rdDetectorNwords
int Get3rdDetectorNwords(int n)
get Detector buffer length of slot C
Definition: RawCOPPER.h:459
Belle2::RawCOPPER::GetTruncMask
int GetTruncMask(int n)
get contents of header
Definition: RawCOPPER.h:405
Belle2::RawCOPPERFormat::GetTruncMask
virtual int GetTruncMask(int n)=0
get contents of header
Belle2::RawCOPPERFormat::GetExpNo
virtual int GetExpNo(int n)=0
get Experimental # from header
Belle2::RawCOPPER::ClassDefOverride
ClassDefOverride(RawCOPPER, 3)
do not record
Belle2::RawCOPPER::GetEventCRC16Value
int GetEventCRC16Value(int n, int finesse_num)
Get Event CRC16 value.
Definition: RawCOPPER.h:435
Belle2::RawCOPPER::CompareHeaderValue
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
Belle2::RawCOPPER::Get3rdDetectorBuffer
int * Get3rdDetectorBuffer(int n)
get Detector Buffer of slot C
Definition: RawCOPPER.h:555
Belle2::RawCOPPERFormat::GetDataType
virtual int GetDataType(int n)=0
get contents of header
Belle2::RawCOPPERFormat::GetPacketCRCError
virtual int GetPacketCRCError(int n)
check CRC packet Error
Definition: RawCOPPERFormat.cc:122
Belle2::RawCOPPERFormat::CalcDriverChkSum
virtual unsigned int CalcDriverChkSum(int n)=0
calc COPPER driver's checksum value
Belle2::RawCOPPERFormat
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
Definition: RawCOPPERFormat.h:53
Belle2::RawCOPPER::getInfoHTML
std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
Definition: RawCOPPER.cc:285
Belle2::RawCOPPERFormat::CheckData
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
Belle2::RawDataBlock
The RawDataBlock class Base class for rawdata handling.
Definition: RawDataBlock.h:27
Belle2::RawCOPPER::Get4thFINESSENwords
int Get4thFINESSENwords(int n)
get data size of FINESSE slot D buffer
Definition: RawCOPPER.h:489
Belle2::RawDataBlock::m_buffer
int * m_buffer
Buffer.
Definition: RawDataBlock.h:154
Belle2::RawCOPPERFormat::GetMagicFPGAHeader
virtual unsigned int GetMagicFPGAHeader(int n)=0
get magic word of COPPER FPGA header
Belle2::RawCOPPERFormat::GetMaxNumOfCh
virtual int GetMaxNumOfCh(int n)=0
Get the max number of channels in a readout board.
Belle2::RawCOPPER::GetEventCRCError
int GetEventCRCError(int n)
check CRC event Error
Definition: RawCOPPER.h:429
Belle2::RawCOPPER::Get4thDetectorNwords
int Get4thDetectorNwords(int n)
get Detector buffer length of slot D
Definition: RawCOPPER.h:465
Belle2::RawCOPPER::Get2ndDetectorBuffer
int * Get2ndDetectorBuffer(int n)
get Detector Buffer of slot B
Definition: RawCOPPER.h:549
Belle2::RawCOPPERFormat::GetTTCtime
virtual int GetTTCtime(int n)=0
Get ctime.
Belle2::RawCOPPERFormat::GetMagicDriverHeader
virtual unsigned int GetMagicDriverHeader(int n)=0
get magic word of COPPER driver header