Belle II Software
development
Toggle main menu visibility
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
Enumerator
c
d
f
p
t
v
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
tmemread.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 "daq/dqm/DqmSharedMem.h"
10
11
#include <unistd.h>
12
13
#include "TH1F.h"
14
#include "TMemFile.h"
15
16
using namespace
Belle2
;
17
using namespace
std
;
18
19
int
main(
int
/*argc*/
,
char
**
/*argv*/
)
20
{
21
22
DqmSharedMem
* shm =
new
DqmSharedMem
(
"testhisto"
, 2000000);
23
char
* buf =
new
char
[8000000];
24
25
for
(;;) {
26
shm->lock();
27
memcpy(buf, shm->ptr(), 8000000);
28
shm->unlock();
29
TMemFile* file =
new
TMemFile(
"TestHisto"
, (
char
*)shm->ptr(), 2000000,
"READ"
,
""
, 0);
30
file->ls();
31
file->Print();
32
TH1F* h1 = (TH1F*) file->Get(
"testhisto"
);
33
h1->Print();
34
sleep(1);
35
delete
file;
36
}
37
// file->Write();
38
// file->Close();
39
return
0;
40
}
Belle2::DqmSharedMem
Definition:
DqmSharedMem.h:19
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:17
std
STL namespace.
daq
dqm
tools
tmemread.cc
Generated on Thu Apr 10 2025 02:32:55 for Belle II Software by
1.9.6