Belle II Software  release-05-01-25
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/PreRawCOPPERFormat_v1.h>
22 #include <rawdata/dataobjects/PreRawCOPPERFormat_latest.h>
23 #include <rawdata/RawCOPPERPackerInfo.h>
24 
25 //#define USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
26 
27 
28 // Divide ECL and KLM to barrel and endcap categories from Itoh-san's suggestion
29 // Updated on May 9, 2014
30 
32 //
33 // The latest DAQformat version number
34 #define LATEST_POSTREDUCTION_FORMAT_VER 2 // Since Apr. 21, 2015
35 //
37 
38 
39 namespace Belle2 {
50  class RawCOPPER : public RawDataBlock {
51  public:
53  RawCOPPER();
54 
56  //RawCOPPER(int* bufin, int nwords);
58  virtual ~RawCOPPER();
59 
60  //
61  // Get position of or pointer to data
62  //
63 
65  void SetBuffer(int* bufin, int nwords, int delete_flag, int num_events, int num_nodes) OVERRIDE_CPP17;
66 
68  // POINTER TO "DETECTOR BUFFER"
69  //( after removing "B2link headers" from "FINESSE buffer". THIS IS THE RAW DATA FROM A DETECTOR
72  int GetDetectorNwords(int n, int finesse_num);
73 
75  int Get1stDetectorNwords(int n);
76 
78  int Get2ndDetectorNwords(int n);
79 
81  int Get3rdDetectorNwords(int n);
82 
84  int Get4thDetectorNwords(int n);
85 
87  int* GetDetectorBuffer(int n, int finesse_num);
88 
90  int* Get1stDetectorBuffer(int n);
91 
93  int* Get2ndDetectorBuffer(int n);
94 
96  int* Get3rdDetectorBuffer(int n);
97 
99  int* Get4thDetectorBuffer(int n);
101 
103  virtual int GetBufferPos(int n) OVERRIDE_CPP17;
104 
106  virtual int* GetRawHdrBufPtr(int n);
107 
109  virtual int* GetRawTrlBufPtr(int n);
110 
112  int* GetFINESSEBuffer(int n, int finesse_num);
113 
115  int* Get1stFINESSEBuffer(int n);
116 
118  int* Get2ndFINESSEBuffer(int n);
119 
121  int* Get3rdFINESSEBuffer(int n);
122 
124  int* Get4thFINESSEBuffer(int n);
125 
126 
127  //
128  // Get information from "RawCOPPER header" attached by DAQ software
129  //
130 
132  int GetExpNo(int n);
133 
134  unsigned int GetExpRunSubrun(int n);
135 
136  int GetRunNo(int n);
137 
138  int GetSubRunNo(int n);
139 
140  unsigned int GetEveNo(int n);
141 
142  int GetDataType(int n);
143 
144  int GetTruncMask(int n);
145 
147  unsigned int GetErrorBitFlag(int n);
148 
150  void AddErrorBitFlag(int n, unsigned int error_bit_flag);
151 
152 
154  int GetPacketCRCError(int n);
155 
157  int GetEventCRCError(int n);
158 
160  int GetEventCRC16Value(int n, int finesse_num);
161 
163  unsigned int GetNodeID(int n);
164 
165  //
166  // Get information from 13words "COPPER header" attached by COPPER board
167  //
169  virtual unsigned int GetCOPPERCounter(int n);
170 
172  virtual int GetNumFINESSEBlock(int n);
173 
175  int GetOffsetFINESSE(int n, int finesse);
176 
178  int GetOffset1stFINESSE(int n);
179 
181  int GetOffset2ndFINESSE(int n);
182 
184  int GetOffset3rdFINESSE(int n);
185 
187  int GetOffset4thFINESSE(int n);
188 
190  int GetFINESSENwords(int n, int finesse);
191 
193  int Get1stFINESSENwords(int n);
194 
196  int Get2ndFINESSENwords(int n);
197 
199  int Get3rdFINESSENwords(int n);
200 
202  int Get4thFINESSENwords(int n);
203 
205  unsigned int GetB2LHeaderWord(int n, int finesse_buffer_pos);
206 
207  //
208  // Get information from "B2link(attached by FEE and HLSB) header"
209  //
211  // virtual int* GetFTSW2Words(int n);
212 
214  virtual int* GetExpRunSubrunBuf(int n);
215 
217  virtual unsigned int GetB2LFEE32bitEventNumber(int n);
218 
219  //
220  // read magic word to check data
221  //
223  unsigned int GetMagicDriverHeader(int n);
224 
226  unsigned int GetMagicFPGAHeader(int n);
227 
229  unsigned int GetMagicFPGATrailer(int n);
230 
232  unsigned int GetMagicDriverTrailer(int n);
233 
235  unsigned int GetTrailerChksum(int n);
236 
238  bool CheckCOPPERMagic(int n);
239 
240 #ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
241  void CheckB2LFEEHeaderVersion(int n);
243 #endif
244 
246  unsigned int GetTTCtimeTRGType(int n);
247 
249  unsigned int GetTTUtime(int n);
250 
252  unsigned int FillTopBlockRawHeader(unsigned int m_node_id,
253  unsigned int prev_eve32, unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no);
254 
256  unsigned int GetDriverChkSum(int n);
257 
259  unsigned int CalcDriverChkSum(int n);
260 
262  unsigned int CalcXORChecksum(int* buf, int nwords);
263 
265  void CheckData(int n,
266  unsigned int prev_evenum, unsigned int* cur_evenum,
267  unsigned int prev_copper_ctr, unsigned int* cur_copper_ctr,
268  unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no);
269 
271  void CheckUtimeCtimeTRGType(int n);
272 
274  int GetTTCtime(int n);
275 
277  int GetTRGType(int n);
278 
280  void GetTTTimeVal(int n, struct timeval* tv);
281 
283  void SetVersion();
284 
286  void SetVersion(std::string class_name);
287 
289  void CheckVersionSetBuffer();
290 
292  void ShowBuffer();
293 
296  void PackDetectorBuf(int* detector_buf_1st, int nwords_1st,
297  int* detector_buf_2nd, int nwords_2nd,
298  int* detector_buf_3rd, int nwords_3rd,
299  int* detector_buf_4th, int nwords_4th,
300  RawCOPPERPackerInfo rawcprpacker_info);
301 
303  void PackDetectorBuf4DummyData(int* detector_buf_1st, int nwords_1st,
304  int* detector_buf_2nd, int nwords_2nd,
305  int* detector_buf_3rd, int nwords_3rd,
306  int* detector_buf_4th, int nwords_4th,
307  RawCOPPERPackerInfo rawcprpacker_info);
308 
309 
311  std::string getInfoHTML() const;
312 
313  enum {
314  POS_FORMAT_VERSION = 1,
315  FORMAT_MASK = 0x0000FF00
316  };
317 
320 
322  int m_version;
323 
324  protected :
329 
330  };
331 
332 
333  inline int* RawCOPPER::GetRawHdrBufPtr(int n)
334  {
336  return m_access->GetRawHdrBufPtr(n);
337  }
338 
339  inline int* RawCOPPER::GetRawTrlBufPtr(int n)
340  {
342  return m_access->GetRawTrlBufPtr(n);
343  }
344 
345  inline unsigned int RawCOPPER::GetDriverChkSum(int n)
346  {
348  return m_access->GetDriverChkSum(n);
349  }
350 
351  inline int RawCOPPER::GetExpNo(int n)
352  {
354  return m_access->GetExpNo(n);
355  }
356 
357  inline unsigned int RawCOPPER::GetExpRunSubrun(int n)
358  {
360  return m_access->GetExpRunSubrun(n);
361  }
362 
363  inline int RawCOPPER::GetRunNo(int n)
364  {
366  return m_access->GetRunNo(n);
367  }
368 
369 
370  inline int RawCOPPER::GetSubRunNo(int n)
371  {
373  return m_access->GetSubRunNo(n);
374  }
375 
376  inline unsigned int RawCOPPER::GetEveNo(int n)
377  {
379  return m_access->GetEveNo(n);
380  }
381 
382 
383  inline unsigned int RawCOPPER::GetNodeID(int n)
384  {
386  return m_access->GetNodeID(n);
387  }
388 
389 
390  inline int RawCOPPER::GetDataType(int n)
391  {
393  return m_access->GetDataType(n);
394  }
395 
396  inline int RawCOPPER::GetTruncMask(int n)
397  {
399  return m_access->GetTruncMask(n);
400  }
401 
402  inline unsigned int RawCOPPER::GetErrorBitFlag(int n)
403  {
405  return m_access->GetErrorBitFlag(n);
406  }
407 
408  inline void RawCOPPER::AddErrorBitFlag(int n, unsigned int error_bit_flag)
409  {
411  return m_access->AddErrorBitFlag(n, error_bit_flag);
412  }
413 
415  {
417  return m_access->GetPacketCRCError(n);
418  }
419 
420  inline int RawCOPPER::GetEventCRCError(int n)
421  {
423  return m_access->GetEventCRCError(n);
424  }
425 
426  inline int RawCOPPER::GetEventCRC16Value(int n, int finesse_num)
427  {
429  return m_access->GetEventCRC16Value(n, finesse_num);
430  }
431 
432  inline unsigned int RawCOPPER::GetCOPPERCounter(int n)
433  {
435  return m_access->GetCOPPERCounter(n);
436  }
437 
439  {
441  return m_access->Get1stDetectorNwords(n);
442  }
443 
445  {
447  return m_access->Get2ndDetectorNwords(n);
448  }
449 
451  {
453  return m_access->Get3rdDetectorNwords(n);
454  }
455 
457  {
459  return m_access->Get4thDetectorNwords(n);
460  }
461 
463  {
465  return m_access->Get1stFINESSENwords(n);
466  }
467 
469  {
471  return m_access->Get2ndFINESSENwords(n);
472  }
473 
475  {
477  return m_access->Get3rdFINESSENwords(n);
478  }
479 
481  {
483  return m_access->Get4thFINESSENwords(n);
484  }
485 
487  {
489  return m_access->GetOffset1stFINESSE(n);
490  }
491 
493  {
495  return m_access->GetOffset2ndFINESSE(n);
496  }
497 
499  {
501  return m_access->GetOffset3rdFINESSE(n);
502  }
503 
505  {
507  return m_access->GetOffset4thFINESSE(n);
508  }
509 
511  {
513  return m_access->Get1stFINESSEBuffer(n);
514  }
515 
517  {
519  return m_access->Get2ndFINESSEBuffer(n);
520  }
521 
523  {
525  return m_access->Get3rdFINESSEBuffer(n);
526  }
527 
529  {
531  return m_access->Get4thFINESSEBuffer(n);
532  }
533 
535  {
537  return m_access->Get1stDetectorBuffer(n);
538  }
539 
541  {
543  return m_access->Get2ndDetectorBuffer(n);
544  }
545 
547  {
549  return m_access->Get3rdDetectorBuffer(n);
550  }
551 
553  {
555  return m_access->Get4thDetectorBuffer(n);
556  }
557 
558  inline int* RawCOPPER::GetExpRunSubrunBuf(int n)
559  {
561  return m_access->GetExpRunSubrunBuf(n);
562  }
563 
564  inline unsigned int RawCOPPER::GetMagicDriverHeader(int n)
565  {
567  return m_access->GetMagicDriverHeader(n);
568  }
569 
570  inline unsigned int RawCOPPER::GetMagicFPGAHeader(int n)
571  {
573  return m_access->GetMagicFPGAHeader(n);
574  }
575 
576  inline unsigned int RawCOPPER::GetMagicFPGATrailer(int n)
577  {
579  return m_access->GetMagicFPGATrailer(n);
580  }
581 
582  inline unsigned int RawCOPPER::GetMagicDriverTrailer(int n)
583  {
585  return m_access->GetMagicDriverTrailer(n);
586  }
587 
588  inline unsigned int RawCOPPER::GetTrailerChksum(int n)
589  {
591  return m_access->GetTrailerChksum(n);
592  }
593 
594  inline unsigned int RawCOPPER::GetTTCtimeTRGType(int n)
595  {
597  return m_access->GetTTCtimeTRGType(n);
598  }
599 
600  inline unsigned int RawCOPPER::GetTTUtime(int n)
601  {
603  return m_access->GetTTUtime(n);
604  }
605 
606  inline int RawCOPPER::GetTTCtime(int n)
607  {
609  return m_access->GetTTCtime(n);
610  }
611 
612  inline int RawCOPPER::GetTRGType(int n)
613  {
615  return m_access->GetTRGType(n);
616  }
617 
618  inline void RawCOPPER::GetTTTimeVal(int n, struct timeval* tv)
619  {
621  return m_access->GetTTTimeVal(n, tv);
622  }
623 
624  inline int RawCOPPER::GetBufferPos(int n)
625  {
627  return m_access->GetBufferPos(n);
628  }
629 
630  inline unsigned int RawCOPPER::CalcDriverChkSum(int n)
631  {
633  return m_access->CalcDriverChkSum(n);
634  }
635 
636 
638  {
640  return m_access->GetNumFINESSEBlock(n);
641  }
642 
643  inline int RawCOPPER::GetDetectorNwords(int n, int finesse_num)
644  {
646  return m_access->GetDetectorNwords(n, finesse_num);
647  }
648 
649  inline int RawCOPPER::GetFINESSENwords(int n, int finesse_num)
650  {
652  return m_access->GetFINESSENwords(n, finesse_num);
653  }
654 
655  inline int RawCOPPER::GetOffsetFINESSE(int n, int finesse_num)
656  {
658  return m_access->GetOffsetFINESSE(n, finesse_num);
659  }
660 
661  inline int* RawCOPPER::GetFINESSEBuffer(int n, int finesse_num)
662  {
664  return m_access->GetFINESSEBuffer(n, finesse_num);
665  }
666 
667  inline int* RawCOPPER::GetDetectorBuffer(int n, int finesse_num)
668  {
670  return m_access->GetDetectorBuffer(n, finesse_num);
671  }
672 
673  inline unsigned int RawCOPPER::GetB2LFEE32bitEventNumber(int n)
674  {
677  }
678 
679  inline unsigned int RawCOPPER::CalcXORChecksum(int* buf, int nwords)
680  {
682  return m_access->CalcXORChecksum(buf, nwords);
683  }
684 
685  inline void RawCOPPER::CheckData(int n,
686  unsigned int prev_evenum, unsigned int* cur_evenum_rawcprhdr,
687  unsigned int prev_copper_ctr, unsigned int* cur_copper_ctr,
688  unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no)
689  {
690 
692  m_access->CheckData(n,
693  prev_evenum, cur_evenum_rawcprhdr,
694  prev_copper_ctr, cur_copper_ctr,
695  prev_exprunsubrun_no, cur_exprunsubrun_no);
696  return;
697  }
698 
699  inline bool RawCOPPER::CheckCOPPERMagic(int n)
700  {
702  return m_access->CheckCOPPERMagic(n);
703  }
704 
706  {
708  return m_access->CheckUtimeCtimeTRGType(n);
709  }
710 
711  inline unsigned int RawCOPPER::GetB2LHeaderWord(int n, int finesse_buffer_pos)
712  {
714  return m_access->GetB2LHeaderWord(n, finesse_buffer_pos);
715  }
716 
717  inline unsigned int RawCOPPER::FillTopBlockRawHeader(unsigned int m_node_id, unsigned int prev_eve32,
718  unsigned int prev_exprunsubrun_no, unsigned int* cur_exprunsubrun_no)
719  {
721  return m_access->FillTopBlockRawHeader(m_node_id, prev_eve32,
722  prev_exprunsubrun_no, cur_exprunsubrun_no);
723  }
724 
725 #ifdef USE_B2LFEE_FORMAT_BOTH_VER1_AND_2
726  inline void RawCOPPER::CheckB2LFEEHeaderVersion(int n)
727  {
729  return m_access->CheckB2LFEEHeaderVersion(n);
730  }
731 #endif
732 
734  {
735  if (((m_buffer[ POS_FORMAT_VERSION ] & FORMAT_MASK) >> 8) != m_version
736  || m_access == NULL) {
737  SetVersion();
738  }
740  }
742 }
743 
744 #endif
Belle2::RawCOPPER
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
Definition: RawCOPPER.h:50
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:661
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:498
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:594
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:444
Belle2::RawCOPPER::CheckCOPPERMagic
bool CheckCOPPERMagic(int n)
Check if COPPER Magic words are correct.
Definition: RawCOPPER.h:699
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::RawCOPPER::GetB2LHeaderWord
unsigned int GetB2LHeaderWord(int n, int finesse_buffer_pos)
For copying FTSW word1 (FEE header)
Definition: RawCOPPER.h:711
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:679
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:564
Belle2::RawCOPPERFormat::GetEventCRCError
virtual int GetEventCRCError(int n)
check CRC event Error
Definition: RawCOPPERFormat.cc:174
Belle2::RawCOPPERFormat::GetB2LHeaderWord
virtual unsigned int GetB2LHeaderWord(int n, int finesse_buffer_pos)
For copying FTSW word1 (FEE header)
Definition: RawCOPPERFormat.cc:122
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:468
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:357
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:588
Belle2::RawCOPPER::GetPacketCRCError
int GetPacketCRCError(int n)
check CRC packet Error
Definition: RawCOPPER.h:414
Belle2::RawCOPPER::GetExpRunSubrunBuf
virtual int * GetExpRunSubrunBuf(int n)
get b2l block from "FEE b2link header"
Definition: RawCOPPER.h:558
Belle2::RawCOPPER::m_access
RawCOPPERFormat * m_access
class to access
Definition: RawCOPPER.h:319
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:667
Belle2::RawCOPPERFormat::GetEventCRC16Value
virtual int GetEventCRC16Value(int n, int finesse_num)
Get Event CRC16 value.
Definition: RawCOPPERFormat.cc:185
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:643
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:408
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:345
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:492
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:618
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:528
Belle2::RawCOPPER::CalcDriverChkSum
unsigned int CalcDriverChkSum(int n)
calc COPPER driver's checksum value
Definition: RawCOPPER.h:630
Belle2::RawCOPPER::CheckVersionSetBuffer
void CheckVersionSetBuffer()
Check the version number of data format.
Definition: RawCOPPER.h:733
Belle2::RawCOPPER::GetTTUtime
unsigned int GetTTUtime(int n)
Check if COPPER Magic words are correct.
Definition: RawCOPPER.h:600
Belle2::RawCOPPER::GetTTCtime
int GetTTCtime(int n)
Get ctime.
Definition: RawCOPPER.h:606
Belle2::RawCOPPER::ShowBuffer
void ShowBuffer()
show m_buffer
Definition: RawCOPPER.cc:160
Belle2::RawCOPPER::GetDataType
int GetDataType(int n)
get contents of header
Definition: RawCOPPER.h:390
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::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:705
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:510
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:474
Belle2::RawCOPPER::GetNumFINESSEBlock
virtual int GetNumFINESSEBlock(int n)
get # of FINNESEs which contains data
Definition: RawCOPPER.h:637
Belle2::RawCOPPER::GetBufferPos
virtual int GetBufferPos(int n) OVERRIDE_CPP17
get posistion of COPPER block in unit of word
Definition: RawCOPPER.h:624
Belle2::RawCOPPER::GetExpNo
int GetExpNo(int n)
get Experimental # from header
Definition: RawCOPPER.h:351
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:685
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:516
Belle2::RawCOPPER::m_version
int m_version
do not record
Definition: RawCOPPER.h:322
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:363
Belle2::RawCOPPER::GetRawTrlBufPtr
virtual int * GetRawTrlBufPtr(int n)
get buffer pointer of rawcopper trailer
Definition: RawCOPPER.h:339
Belle2::RawCOPPER::GetCOPPERCounter
virtual unsigned int GetCOPPERCounter(int n)
get COPPER counter(not event number)
Definition: RawCOPPER.h:432
Belle2::RawCOPPER::Get1stDetectorNwords
int Get1stDetectorNwords(int n)
get Detector buffer length of slot A
Definition: RawCOPPER.h:438
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:717
Belle2::RawCOPPER::GetMagicFPGATrailer
unsigned int GetMagicFPGATrailer(int n)
get magic word of COPPER FPGA trailer
Definition: RawCOPPER.h:576
Belle2::RawCOPPER::GetMagicFPGAHeader
unsigned int GetMagicFPGAHeader(int n)
get magic word of COPPER FPGA header
Definition: RawCOPPER.h:570
Belle2::RawCOPPER::GetOffset4thFINESSE
int GetOffset4thFINESSE(int n)
get # of offset words for FINESSE slot D buffer position
Definition: RawCOPPER.h:504
Belle2::RawCOPPER::GetSubRunNo
int GetSubRunNo(int n)
get run # (14bit)
Definition: RawCOPPER.h:370
Belle2::RawCOPPER::Get3rdFINESSEBuffer
int * Get3rdFINESSEBuffer(int n)
get FINESSE buffer pointer for slot C
Definition: RawCOPPER.h:522
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:552
Belle2::RawCOPPER::GetOffsetFINESSE
int GetOffsetFINESSE(int n, int finesse)
get # of offset words
Definition: RawCOPPER.h:655
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:376
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:208
Belle2::RawCOPPER::GetNodeID
unsigned int GetNodeID(int n)
get node-ID from data
Definition: RawCOPPER.h:383
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:402
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:132
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:486
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:582
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:673
Belle2::RawCOPPER::Get1stFINESSENwords
int Get1stFINESSENwords(int n)
get data size of FINESSE slot A buffer
Definition: RawCOPPER.h:462
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:649
Belle2::RawCOPPER::GetRawHdrBufPtr
virtual int * GetRawHdrBufPtr(int n)
get buffer pointer of rawcopper header(Currently same as GetBufferPos)
Definition: RawCOPPER.h:333
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:612
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:174
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:534
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:450
Belle2::RawCOPPER::GetTruncMask
int GetTruncMask(int n)
get contents of header
Definition: RawCOPPER.h:396
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:426
Belle2::RawCOPPER::Get3rdDetectorBuffer
int * Get3rdDetectorBuffer(int n)
get Detector Buffer of slot C
Definition: RawCOPPER.h:546
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:162
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:241
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:480
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::RawCOPPER::GetEventCRCError
int GetEventCRCError(int n)
check CRC event Error
Definition: RawCOPPER.h:420
Belle2::RawCOPPER::Get4thDetectorNwords
int Get4thDetectorNwords(int n)
get Detector buffer length of slot D
Definition: RawCOPPER.h:456
Belle2::RawCOPPER::Get2ndDetectorBuffer
int * Get2ndDetectorBuffer(int n)
get Detector Buffer of slot B
Definition: RawCOPPER.h:540
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