Belle II Software
release-06-01-15
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
z
Typedefs
a
b
c
d
e
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
dump_header.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 <stdio.h>
10
#include <unistd.h>
11
12
using namespace
std;
13
14
enum
{
15
POS_NWORDS = 0,
16
POS_HDR_NWORDS = 1,
17
POS_NUM_EVE_NUM_NODES = 2,
18
POS_EXP_RUN_NUM = 3,
19
POS_EVE_NUM = 4,
20
POS_NODE_ID = 5
21
};
22
23
enum
{
24
EXP_MASK = 0xFFC00000,
25
EXP_SHIFT = 22,
26
RUNNO_MASK = 0x003FFF00,
27
RUNNO_SHIFT = 8,
28
SUBRUNNO_MASK = 0x000000FF
29
};
30
31
32
33
int
main
(
int
argc,
char
** argv)
34
{
35
unsigned
int
buf[400000];
36
int
infn = fileno(stdin);
37
printf(
"infn = %d\n"
, infn);
38
39
int
nrec = 0;
40
for
(;;) {
41
int
is = read(infn, &buf[0], 4);
42
// printf ( "buf[0] = %d\n", buf[0] );
43
if
(is <= 0)
break
;
44
is = read(infn, &buf[1], (buf[0] - 1) * 4);
45
// printf ( "nw = %d, 1st = %d, 2nd = %d, 3rd = %d\n",
46
// buf[0], buf[1], buf[2], buf[3] );
47
// printf ( "exprunnum = %8.8x, evtnum = %8.8x\n", buf[POS_EXP_RUN_NUM],
48
// buf[POS_EVE_NUM] );
49
int
exp = (buf[ POS_EXP_RUN_NUM ] & EXP_MASK) >> EXP_SHIFT;
50
int
run = (buf[ POS_EXP_RUN_NUM ] & RUNNO_MASK) >> RUNNO_SHIFT;
51
int
evt = buf[ POS_EVE_NUM ];
52
53
printf(
"Nrec:%d ; Nw:%d ; Exp:%d, Run:%d, Evt:%d\n"
,
54
nrec, buf[0], exp, run, evt);
55
nrec++;
56
}
57
58
}
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:75
daq
rawdata
tools
dump_header.cc
Generated on Fri Dec 8 2023 04:16:05 for Belle II Software by
1.9.1