Belle II Software
development
RawHeader_v0.cc
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
#include <rawdata/dataobjects/RawHeader_v0.h>
10
11
12
13
using namespace
Belle2
;
14
15
//ClassImp(RawHeader_v0);
16
17
RawHeader_v0::RawHeader_v0
()
18
{
19
m_buffer
= NULL;
20
// initialize();
21
// cout << "RawHeader_v0 NULL constructor" << endl;
22
}
23
24
RawHeader_v0::RawHeader_v0
(
int
* buffer)
25
{
26
m_buffer
= buffer;
27
}
28
29
RawHeader_v0::~RawHeader_v0
()
30
{
31
}
32
33
34
int
RawHeader_v0::AddNodeInfo
(
int
node_id)
35
{
36
CheckSetBuffer
();
37
// When the number of total nodes exceeds NUM_MAX_NODES
38
if
(
GetNumNodes
() >= NUM_MAX_NODES) {
39
m_buffer
[ POS_NUM_NODES ]++;
40
return
-1;
41
}
42
43
m_buffer
[ POS_NODES_1 +
m_buffer
[ POS_NUM_NODES ] ] = node_id;
44
m_buffer
[ POS_NUM_NODES ]++;
45
return
0;
46
}
47
48
int
RawHeader_v0::GetNodeInfo
(
int
node_no,
int
* node_id)
49
{
50
CheckGetBuffer
();
51
if
(node_no >=
GetNumNodes
()) {
52
return
-1;
53
}
54
*node_id =
m_buffer
[ POS_NODES_1 + node_no ];
55
56
return
0;
57
}
Belle2::RawHeader_v0::RawHeader_v0
RawHeader_v0()
Default constructor.
Definition:
RawHeader_v0.cc:17
Belle2::RawHeader_v0::AddNodeInfo
int AddNodeInfo(int node_id)
set magic words;
Definition:
RawHeader_v0.cc:34
Belle2::RawHeader_v0::m_buffer
int * m_buffer
do not record buffer ( RawCOPPER includes buffer of RawHeader_v0 and RawTrailer )
Definition:
RawHeader_v0.h:222
Belle2::RawHeader_v0::~RawHeader_v0
~RawHeader_v0()
Destructor.
Definition:
RawHeader_v0.cc:29
Belle2::RawHeader_v0::GetNodeInfo
int GetNodeInfo(int node_no, int *node_id)
get contents of header
Definition:
RawHeader_v0.cc:48
Belle2::RawHeader_v0::CheckSetBuffer
void CheckSetBuffer()
initialize header
Definition:
RawHeader_v0.h:230
Belle2::RawHeader_v0::CheckGetBuffer
void CheckGetBuffer()
check if m_buffer exists
Definition:
RawHeader_v0.h:237
Belle2::RawHeader_v0::GetNumNodes
int GetNumNodes()
get contents of header
Definition:
RawHeader_v0.h:463
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:17
rawdata
dataobjects
src
RawHeader_v0.cc
Generated on Fri Nov 8 2024 02:40:57 for Belle II Software by
1.9.6