Belle II Software development
RawTLU Class Reference

The Raw TLU class Class for data from DAQ PC for TLU(Trigger Logic Unit) It is supposed to be used only in the DESY beam test. More...

#include <RawTLU.h>

Inheritance diagram for RawTLU:
RawDataBlock

Public Member Functions

 RawTLU ()
 Default constructor.
 
virtual ~RawTLU ()
 Destructor.
 
int GetNwordsHeader (int n)
 Get the size of the header.
 
unsigned int GetNodeID (int n)
 Get Node ID.
 
unsigned int GetEveNo (int n)
 Get Event #.
 
unsigned int GetMagicTrailer (int n)
 Get Magic Trailer #.
 
int GetRunNo (int n)
 Get Run #.
 
unsigned int GetTLUEventTag (int n)
 Get TLU event tag.
 
void CheckData (int n, unsigned int prev_evenum, unsigned int *cur_evenum)
 check data contents
 
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 )
 
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

RawTLUFormatm_access
 class to access
 
RawDataBlockFormatm_access_dblk
 class to access
 

Protected Member Functions

 ClassDef (RawTLU, 1)
 do not record
 
 ClassDef (RawDataBlock, 3)
 not record
 

Protected Attributes

int m_nwords
 do not record
 
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 TLU class Class for data from DAQ PC for TLU(Trigger Logic Unit) It is supposed to be used only in the DESY beam test.

Definition at line 27 of file RawTLU.h.

Constructor & Destructor Documentation

◆ RawTLU()

RawTLU ( )

Default constructor.

Definition at line 13 of file RawTLU.cc.

14{
16}
The Raw TLU class Class for data from DAQ PC for TLU(Trigger Logic Unit) It is supposed to be used on...
Definition: RawTLUFormat.h:25
RawTLUFormat * m_access
class to access
Definition: RawTLU.h:88

◆ ~RawTLU()

~RawTLU ( )
virtual

Destructor.

Definition at line 18 of file RawTLU.cc.

19{
20 if (m_access != NULL) delete m_access;
21 m_access = NULL;
22}

Member Function Documentation

◆ CheckData()

void CheckData ( int  n,
unsigned int  prev_evenum,
unsigned int *  cur_evenum 
)
inline

check data contents

Definition at line 81 of file RawTLU.h.

82 {
84 return m_access->CheckData(n, prev_evenum, cur_evenum);
85 }
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 )
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
void CheckData(int n, unsigned int prev_evenum, unsigned int *cur_evenum)
check data contents
Definition: RawTLUFormat.cc:60

◆ CheckFTSWID()

virtual int CheckFTSWID ( int  n)
inlinevirtualinherited

get FTSW ID to check whether this data block is FTSW data or not

Definition at line 101 of file RawDataBlock.h.

102 {
104 return m_access_dblk->CheckFTSWID(n);
105 }
virtual int CheckFTSWID(int n)
get FTSW ID to check whether this data block is FTSW data or not
RawDataBlockFormat * m_access_dblk
class to access
Definition: RawDataBlock.h:141

◆ CheckTLUID()

virtual int CheckTLUID ( int  n)
inlinevirtualinherited

get FTSW ID to check whether this data block is FTSW data or not

Definition at line 108 of file RawDataBlock.h.

109 {
111 return m_access_dblk->CheckTLUID(n);
112 }
virtual int CheckTLUID(int n)
get FTSW ID to check whether this data block is FTSW data or not

◆ ClassDef() [1/2]

ClassDef ( RawDataBlock  ,
 
)
protectedinherited

not record

To drive from TObject

◆ ClassDef() [2/2]

ClassDef ( RawTLU  ,
 
)
protected

do not record

To derive from TObject

◆ CopyBlock()

virtual void CopyBlock ( int  n,
int *  buf_to 
)
inlinevirtualinherited

Copy one datablock to buffer.

Definition at line 115 of file RawDataBlock.h.

116 {
118 return m_access_dblk->CopyBlock(n, buf_to);
119 }
virtual void CopyBlock(int n, int *buf_to)
Copy one datablock to buffer.

◆ GetBlockNwords()

virtual int GetBlockNwords ( int  n)
inlinevirtualinherited

get size of a data block

Definition at line 94 of file RawDataBlock.h.

95 {
98 }
virtual int GetBlockNwords(int n)
get size of a data block

◆ GetBuffer()

virtual int * GetBuffer ( int  n)
inlinevirtualinherited

get nth buffer pointer

Definition at line 53 of file RawDataBlock.h.

54 {
56 return m_access_dblk->GetBuffer(n);
57 }
virtual int * GetBuffer(int n)
get nth buffer pointer

◆ GetBufferPos()

virtual int GetBufferPos ( int  n)
inlinevirtualinherited

get position of data block in word

Reimplemented in RawCOPPER.

Definition at line 46 of file RawDataBlock.h.

47 {
49 return m_access_dblk->GetBufferPos(n);
50 }
virtual int GetBufferPos(int n)
get position of data block in word

◆ GetEveNo()

unsigned int GetEveNo ( int  n)
inline

Get Event #.

Definition at line 53 of file RawTLU.h.

54 {
56 return m_access->GetEveNo(n);
57 }
unsigned int GetEveNo(int n)
Get Event #.
Definition: RawTLUFormat.cc:37

◆ GetMagicTrailer()

unsigned int GetMagicTrailer ( int  n)
inline

Get Magic Trailer #.

Definition at line 60 of file RawTLU.h.

61 {
63 return m_access->GetMagicTrailer(n);
64 }
unsigned int GetMagicTrailer(int n)
Get Magic Trailer #.
Definition: RawTLUFormat.cc:49

◆ GetNodeID()

unsigned int GetNodeID ( int  n)
inline

Get Node ID.

Definition at line 46 of file RawTLU.h.

47 {
49 return m_access->GetNodeID(n);
50 }
unsigned int GetNodeID(int n)
Get Node ID.
Definition: RawTLUFormat.cc:32

◆ GetNumEntries()

virtual int GetNumEntries ( )
inlinevirtualinherited

get # of data blocks = (# of nodes)*(# of events)

Definition at line 67 of file RawDataBlock.h.

68 {
71 }
virtual int GetNumEntries()
get # of data blocks = (# of nodes)*(# of events)

◆ GetNumEvents()

virtual int GetNumEvents ( )
inlinevirtualinherited

get # of events in m_buffer

Definition at line 81 of file RawDataBlock.h.

82 {
85 }
virtual int GetNumEvents()
get # of events in m_buffer

◆ GetNumNodes()

virtual int GetNumNodes ( )
inlinevirtualinherited

get # of data sources(e.g. # of COPPER boards) in m_buffer

Definition at line 74 of file RawDataBlock.h.

75 {
77 return m_access_dblk->GetNumNodes();
78 }
virtual int GetNumNodes()
get # of data sources(e.g. # of COPPER boards) in m_buffer

◆ GetNwordsHeader()

int GetNwordsHeader ( int  n)
inline

Get the size of the header.

Definition at line 39 of file RawTLU.h.

40 {
42 return m_access->GetNwordsHeader(n);
43 }
int GetNwordsHeader(int n)
Get the size of the header.
Definition: RawTLUFormat.cc:26

◆ GetPreAllocFlag()

virtual int GetPreAllocFlag ( )
inlinevirtualinherited

get malloc_flag

Definition at line 88 of file RawDataBlock.h.

89 {
90 return m_use_prealloc_buf;
91 }
int m_use_prealloc_buf
flag for deleting m_buffer in destructer( 0:delete, 1: not delete) When using pre-allocated buffer,...
Definition: RawDataBlock.h:158

◆ GetRunNo()

int GetRunNo ( int  n)
inline

Get Run #.

Definition at line 67 of file RawTLU.h.

68 {
70 return m_access->GetRunNo(n);
71 }
int GetRunNo(int n)
Get Run #.
Definition: RawTLUFormat.cc:43

◆ GetTLUEventTag()

unsigned int GetTLUEventTag ( int  n)
inline

Get TLU event tag.

Definition at line 74 of file RawTLU.h.

75 {
77 return m_access->GetTLUEventTag(n);
78 }
unsigned int GetTLUEventTag(int n)
Get TLU event tag.
Definition: RawTLUFormat.cc:54

◆ GetWholeBuffer()

virtual int * GetWholeBuffer ( )
inlinevirtualinherited

get pointer to buffer(m_buffer)

Definition at line 60 of file RawDataBlock.h.

61 {
64 }
virtual int * GetWholeBuffer()
get pointer to buffer(m_buffer)

◆ PrintData()

virtual void PrintData ( int *  buf,
int  nwords 
)
inlinevirtualinherited

print data

Definition at line 122 of file RawDataBlock.h.

123 {
125 return m_access_dblk->PrintData(buf, nwords);
126 }
virtual void PrintData(int *buf, int nwords)
print data

◆ SetBuffer()

void SetBuffer ( int *  bufin,
int  nwords,
int  delete_flag,
int  num_events,
int  num_nodes 
)
virtualinherited

set buffer ( delete_flag : m_buffer is freeed( = 0 )/ not freeed( = 1 ) in Destructer )

Reimplemented in RawCOPPER, and RawFTSW.

Definition at line 35 of file RawDataBlock.cc.

36{
37
38 if (bufin == NULL) {
39 char err_buf[500];
40 sprintf(err_buf, "[DEBUG] bufin is NULL. Exting...\n");
41 printf("%s", err_buf); fflush(stdout);
42 B2FATAL(err_buf);
43 }
44
45 if (!m_use_prealloc_buf && m_buffer != NULL) delete[] m_buffer;
46
47 if (delete_flag == 0) {
48 m_use_prealloc_buf = true;
49 } else {
50 m_use_prealloc_buf = false;
51 }
52 // m_nwords = bufin[0];
53 m_nwords = nwords;
54 m_buffer = bufin;
55
56 m_num_nodes = num_nodes;
57 m_num_events = num_events;
58
59 // Set to access class
61
62 // Set length at the first word of the buffer
63 //
64 // Assign header and trailer
65 //
66 // m_header.SetBuffer(&(bufin[ 0 ]));
67 // m_trailer.SetBuffer(&(bufin[ m_nwords - m_trailer.GetTrlNwords() ]));
68
69}

◆ TotalBufNwords()

virtual int TotalBufNwords ( )
inlinevirtualinherited

Get total length of m_buffer.

Definition at line 39 of file RawDataBlock.h.

40 {
43 }
virtual int TotalBufNwords()
Get total length of m_buffer.

Member Data Documentation

◆ m_access

RawTLUFormat* m_access

class to access

Definition at line 88 of file RawTLU.h.

◆ m_access_dblk

RawDataBlockFormat* m_access_dblk
inherited

class to access

Definition at line 141 of file RawDataBlock.h.

◆ m_buffer

int* m_buffer
protectedinherited

Buffer.

Definition at line 154 of file RawDataBlock.h.

◆ m_num_events

int m_num_events
protectedinherited

number of events in this object

Definition at line 151 of file RawDataBlock.h.

◆ m_num_nodes

int m_num_nodes
protectedinherited

number of nodes in this object

Definition at line 148 of file RawDataBlock.h.

◆ m_nwords

int m_nwords
protectedinherited

do not record

number of words of buffer

Definition at line 145 of file RawDataBlock.h.

◆ m_use_prealloc_buf

int m_use_prealloc_buf
protectedinherited

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

Definition at line 158 of file RawDataBlock.h.


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