Belle II Software
prerelease-10-00-00a
RawTrailer_latest.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 RAWTRAILER_LATEST_H
10
#define RAWTRAILER_LATEST_H
11
12
#include <stdio.h>
13
14
#include <rawdata/switch_basf2_standalone.h>
15
16
//#define TRAILER_SIZE 16
17
/* #define POS_CHKSUM 0 */
18
/* #define POS_TERM_WORD 1 */
19
/* #define RAWCOPPER_TRAILER_SIZE 2 */
20
/* #define MAGIC_WORD_TERM_TRAILER 0x7fff0006 */
21
22
namespace
Belle2
{
27
33
// class RawTrailer_latest : public TObject {
34
class
RawTrailer_latest
{
35
public
:
37
RawTrailer_latest
();
38
40
~RawTrailer_latest
();
41
43
void
CheckBuffer
();
44
45
int
*
GetBuffer
();
46
47
void
SetBuffer
(
int
* bufin);
48
49
void
Initialize
();
50
51
void
SetChksum
(
int
chksum);
52
53
void
SetMagicWord
();
54
55
int
GetTrlNwords
();
56
57
unsigned
int
GetChksum
();
58
59
int
GetMagicWord
();
60
61
enum
{
62
RAWTRAILER_NWORDS = 4
63
};
64
65
enum
{
66
MAGIC_WORD_TERM_TRAILER = 0x7fff0006
67
};
68
69
enum
{
70
POS_ERROR_BIT_CH1 = 0,
71
POS_ERROR_CH2 = 1,
72
POS_CHKSUM = 2,
73
POS_TERM_WORD = 3
74
};
75
76
private
:
78
int
*
m_buffer
;
79
81
// ver.2 Do not record m_buffer pointer. (Dec.19, 2014)
82
// ClassDef(RawTrailer_latest, 1);
83
};
84
85
86
inline
void
RawTrailer_latest::CheckBuffer
()
87
{
88
if
(
m_buffer
== NULL) {
89
B2FATAL(
"m_buffer is NULL. Exiting..."
);
90
}
91
}
92
93
inline
int
*
RawTrailer_latest::GetBuffer
()
94
{
95
return
m_buffer
;
96
}
97
98
inline
void
RawTrailer_latest::SetBuffer
(
int
* bufin)
99
{
100
m_buffer
= bufin;
101
}
102
103
inline
void
RawTrailer_latest::Initialize
()
104
{
105
SetMagicWord
();
106
}
107
108
inline
void
RawTrailer_latest::SetChksum
(
int
chksum)
109
{
110
CheckBuffer
();
111
m_buffer
[ POS_CHKSUM ] = chksum;
112
}
113
114
inline
void
RawTrailer_latest::SetMagicWord
()
115
{
116
CheckBuffer
();
117
m_buffer
[ POS_TERM_WORD ] = MAGIC_WORD_TERM_TRAILER;
118
}
119
120
inline
int
RawTrailer_latest::GetMagicWord
()
121
{
122
CheckBuffer
();
123
return
m_buffer
[ POS_TERM_WORD ];
124
}
125
126
inline
unsigned
int
RawTrailer_latest::GetChksum
()
127
{
128
CheckBuffer
();
129
return
(
unsigned
int
)(
m_buffer
[ POS_CHKSUM ]);
130
}
131
132
inline
int
RawTrailer_latest::GetTrlNwords
()
133
{
134
return
RAWTRAILER_NWORDS;
135
}
136
137
138
139
141
}
142
143
#endif
Belle2::RawTrailer_latest::~RawTrailer_latest
~RawTrailer_latest()
Destructor.
Definition
RawTrailer_latest.cc:20
Belle2::RawTrailer_latest::m_buffer
int * m_buffer
do not record buffer ( RawCOPPER includes buffer of RawHeader and RawTrailer_latest )
Definition
RawTrailer_latest.h:78
Belle2::RawTrailer_latest::RawTrailer_latest
RawTrailer_latest()
Default constructor.
Definition
RawTrailer_latest.cc:15
Belle2::RawTrailer_latest::CheckBuffer
void CheckBuffer()
set buffer
Definition
RawTrailer_latest.h:86
Belle2::RawTrailer_latest::GetTrlNwords
int GetTrlNwords()
Set magic word.
Definition
RawTrailer_latest.h:132
Belle2::RawTrailer_latest::GetMagicWord
int GetMagicWord()
initialize header
Definition
RawTrailer_latest.h:120
Belle2::RawTrailer_latest::GetChksum
unsigned int GetChksum()
Set # of trailer words.
Definition
RawTrailer_latest.h:126
Belle2::RawTrailer_latest::SetMagicWord
void SetMagicWord()
initialize header
Definition
RawTrailer_latest.h:114
Belle2::RawTrailer_latest::SetBuffer
void SetBuffer(int *bufin)
return buffer
Definition
RawTrailer_latest.h:98
Belle2::RawTrailer_latest::SetChksum
void SetChksum(int chksum)
set buffer
Definition
RawTrailer_latest.h:108
Belle2::RawTrailer_latest::Initialize
void Initialize()
set buffer
Definition
RawTrailer_latest.h:103
Belle2::RawTrailer_latest::GetBuffer
int * GetBuffer()
set buffer
Definition
RawTrailer_latest.h:93
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
rawdata
dataobjects
include
RawTrailer_latest.h
Generated on Wed Jul 2 2025 03:32:02 for Belle II Software by
1.13.2