Belle II Software
release-08-00-10
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
x
z
Typedefs
a
b
c
d
e
g
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
e
f
g
n
p
s
v
z
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
Typedefs
Macros
readraw.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 <stdlib.h>
11
#include <unistd.h>
12
#include <fcntl.h>
13
14
using namespace
std;
15
16
#define MAXBUF 4096000
17
18
int
main
(
int
argc,
char
** argv)
19
{
20
if
(argc < 2) {
21
perror(
"#argc"
);
22
return
1;
23
}
24
25
int
fd = open(argv[1], O_RDONLY);
26
if
(fd < 0) {
27
perror(
"fopen"
);
28
exit(-1);
29
}
30
char
* buf =
new
char
[MAXBUF];
31
32
int
nrec = 0;
33
for
(;;) {
34
int
sizebuf;
35
int
sstat = read(fd, &sizebuf,
sizeof
(
int
));
36
if
(sstat <= 0)
break
;
37
int
stat = read(fd, buf, (sizebuf - 1) * 4);
38
if
(stat <= 0)
break
;
39
printf(
"record %d: size = %d\n"
, nrec, sizebuf);
40
nrec++;
41
}
42
43
close(fd);
44
}
45
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:91
daq
rfarm
event
tools
readraw.cc
Generated on Fri Aug 9 2024 00:50:16 for Belle II Software by
1.9.1