Belle II Software  release-08-01-10
RawFTSW Class Reference

The Raw FTSW class. More...

#include <RawFTSW.h>

Inheritance diagram for RawFTSW:
Collaboration diagram for RawFTSW:

Public Types

enum  {
  POS_NODE_FORMAT_ID = 6 ,
  FTSW_FORMAT_MASK = 0x000000FF ,
  FORMAT_ID_VER_0TO2 = 0x54544420 ,
  FORMAT_ID_VER_0TO3 = 0x54544431 ,
  POS_HEADER_SIZE = 1 ,
  VER_0_HEADER_SIZE = 0 ,
  VER_1_HEADER_SIZE = 0 ,
  VER_2_HEADER_SIZE = 8 ,
  VER_3_HEADER_SIZE = 8
}
 

Public Member Functions

 RawFTSW ()
 Default constructor.
 
virtual ~RawFTSW ()
 Constructor using existing pointer to raw data buffer. More...
 
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 )
 
void SetVersion ()
 read data, detect and set the version number of the data format
 
void CheckVersionSetBuffer ()
 Check the version number of data format.
 
int GetNwordsHeader (int n)
 Get # of words of header.
 
unsigned int GetFTSWNodeID (int n)
 Get Node # ( should be "TTD " )
 
unsigned int GetEveNo (int n)
 Get event #.
 
unsigned int GetTTCtimeTRGType (int n)
 Get a word containing ctime and trigger type info.
 
unsigned int GetTTUtime (int n)
 get unixtime of the trigger
 
int GetTTCtime (int n)
 Get ctime of the trigger.
 
int GetTRGType (int n)
 Get trgtype.
 
void GetTTTimeVal (int n, struct timeval *tv)
 Get timeval from ctime and utime.
 
void GetPCTimeVal (int n, struct timeval *tv)
 Get timeval obtained from gettimeval()
 
unsigned int GetMagicTrailer (int n)
 Get magic number for data corruption check.
 
void CheckData (int n, unsigned int prev_evenum, unsigned int *cur_evenum, unsigned int prev_exprunsubrun_no, unsigned int *cur_exprunsubrun_no)
 check the data contents
 
unsigned int GetExpRunSubrun (int n)
 Exp# (10bit) run# (14bit) restart # (8bit)
 
int GetRunNo (int n)
 Get run #.
 
int GetSubRunNo (int n)
 Get subrun #.
 
int GetRunNoSubRunNo (int n)
 get a word cotaining run # and subrun #
 
int GetExpNo (int n)
 Get Exp #.
 
int Get15bitTLUTag (int n)
 DESY test only.
 
int GetIsHER (int n)
 HER injection = 1 or LER injection = 0.
 
unsigned int GetTimeSinceLastInjection (int n)
 Get time since the last injection.
 
unsigned int GetTimeSincePrevTrigger (int n)
 Get time since the previous trigger.
 
unsigned int GetBunchNumber (int n)
 Get a bunch number.
 
unsigned int GetFrameCount (int n)
 Get a frame count.
 
virtual int TotalBufNwords ()
 Get total length of m_buffer.
 
virtual int GetBufferPos (int n)
 get position of data block in word
 
virtual int * GetBuffer (int n)
 get nth buffer pointer
 
virtual int * GetWholeBuffer ()
 get pointer to buffer(m_buffer)
 
virtual int GetNumEntries ()
 get # of data blocks = (# of nodes)*(# of events)
 
virtual int GetNumNodes ()
 get # of data sources(e.g. # of COPPER boards) in m_buffer
 
virtual int GetNumEvents ()
 get # of events in m_buffer
 
virtual int GetPreAllocFlag ()
 get malloc_flag
 
virtual int GetBlockNwords (int n)
 get size of a data block
 
virtual int CheckFTSWID (int n)
 get FTSW ID to check whether this data block is FTSW data or not
 
virtual int CheckTLUID (int n)
 get FTSW ID to check whether this data block is FTSW data or not
 
virtual void CopyBlock (int n, int *buf_to)
 Copy one datablock to buffer.
 
virtual void PrintData (int *buf, int nwords)
 print data
 

Public Attributes

RawFTSWFormatm_access {}
 class to access
 
int m_version = -1
 do not record More...
 
RawDataBlockFormatm_access_dblk
 class to access
 

Protected Member Functions

 ClassDefOverride (RawFTSW, 2)
 do not record More...
 
 ClassDef (RawDataBlock, 3)
 not record More...
 

Protected Attributes

int m_nwords
 do not record More...
 
int m_num_nodes
 number of nodes in this object
 
int m_num_events
 number of events in this object
 
int * m_buffer
 Buffer.
 
int m_use_prealloc_buf
 flag for deleting m_buffer in destructer( 0:delete, 1: not delete) When using pre-allocated buffer, the buffer should be reused and not deleted in the destructer
 

Detailed Description

The Raw FTSW class.

This class stores the RAW data containing FTSW data(event #, trg time ).

Definition at line 30 of file RawFTSW.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
POS_NODE_FORMAT_ID 

Added to distinguish different version.

ver.0 : early DESY-beam-test version( Node ID 0x545444** is at 5th word (0,1,2,..5) : Please ask Nakao-san about his e-mail ( [daq-experts:8055] FEE data header and FTSW data format) ver.1 : late DESY-beam-test version( Node ID 0x545444** was moved to 6th word (0,1,2,..5) : header size is ? words ( I need to ask Nakao-san because it will be used for distinguish between 0,1, and 2 ver 2 : phase II ? version : header size is 8 words : Format is written by Nakao-san in ver.26(as of 2019.3.1 ) of https://confluence.desy.de/pages/viewpage.action?spaceKey=BI&title=DAQ+TimingDistribution#DAQTimingDistribution-InformationsentfromTTDtodatastream 0x545452?? up to ver.2 this number is more or less same. So, it cannot be used to distinguish different version numbers

VER_0_HEADER_SIZE 

The same number of this information must appear in RawFTSWFormat*.h. Information should be placed in one place but I need to put this number in RawFTSW.h because it is used to distinguish different version numbers.

VER_1_HEADER_SIZE 

Unpacker for ver.0(early DESY version) is not available.

Definition at line 207 of file RawFTSW.h.

207  {
217  POS_NODE_FORMAT_ID = 6, // Position of format ID in header
218  FTSW_FORMAT_MASK = 0x000000FF,
219 
220  FORMAT_ID_VER_0TO2 = 0x54544420,
221  FORMAT_ID_VER_0TO3 = 0x54544431,
222 
223  POS_HEADER_SIZE = 1,
224  // header size is used to distinguish different version number for ver. 0, 1, and 2
225  VER_0_HEADER_SIZE = 0,
226  VER_1_HEADER_SIZE = 0, // ! Unpacker for ver.1(late DESY version) is available but it is unlikely for a user to read this ver. Until there is a request to read ver.1, it is closed.
227  VER_2_HEADER_SIZE = 8,
228  VER_3_HEADER_SIZE = 8
229  };
@ POS_NODE_FORMAT_ID
Added to distinguish different version.
Definition: RawFTSW.h:217
@ VER_1_HEADER_SIZE
Unpacker for ver.0(early DESY version) is not available.
Definition: RawFTSW.h:226
@ VER_0_HEADER_SIZE
The same number of this information must appear in RawFTSWFormat*.h. Information should be placed in ...
Definition: RawFTSW.h:225

Constructor & Destructor Documentation

◆ ~RawFTSW()

~RawFTSW ( )
virtual

Constructor using existing pointer to raw data buffer.

Destructor

Definition at line 19 of file RawFTSW.cc.

20 {
21  if (m_access != NULL) delete m_access;
22  m_access = NULL;
23 }
RawFTSWFormat * m_access
class to access
Definition: RawFTSW.h:232

Member Function Documentation

◆ ClassDef()

ClassDef ( RawDataBlock  ,
 
)
protectedinherited

not record

To drive from TObject

◆ ClassDefOverride()

ClassDefOverride ( RawFTSW  ,
 
)
protected

do not record

To derive from TObject ver.2 Remove m_FTSW_header and introduce a new data format on Nov. 20, 2013 ver.3 Add m_access on Mar. 7 2016 but Classded stays 2 for some(?) reason ver.4 Add m_version on Feb. 18 2019 for the new format version defined by Nakao-san Reason to stay at 2 is that the persistent content did not change If necessary: be aware that we have to change this in online and offline at the same time!

Member Data Documentation

◆ m_nwords

int m_nwords
protectedinherited

do not record

number of words of buffer

Definition at line 145 of file RawDataBlock.h.

◆ m_version

int m_version = -1

do not record

Version of the format

Definition at line 235 of file RawFTSW.h.


The documentation for this class was generated from the following files: