Belle II Software
release-06-02-00
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
tmemtest.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/rfarm/manager/SharedMem.h"
10
11
#include "TH1F.h"
12
#include "TMemFile.h"
13
#include "TObject.h"
14
15
using namespace
Belle2
;
16
using namespace
std;
17
18
int
main
(
int
argc,
char
** argv)
19
{
20
SharedMem
* shm =
new
SharedMem
(
"testhisto"
, 2000000);
21
// TMemFile* file = new TMemFile ( "TestHisto", (char*)shm->ptr(), 2000000, "RECREATE", "", 0 );
22
TMemFile* file =
new
TMemFile(
"TestHisto"
,
"RECREATE"
);
23
int
cpysize = file->CopyTo(shm->ptr(), 500000);
24
25
// TMapFile* file = TMapFile::Create("TestHisto", "RECREATE", 2000000);
26
// TFile* file = new TFile ( "testhist.root", "RECREATE" );
27
TH1F* h1 =
new
TH1F(
"testhisto"
,
"testhisto"
, 100, 0.0, 100.0);
28
file->Write(0, TObject::kOverwrite);
29
30
// file->Add(h1);
31
h1->Fill(5.0, 5.0);
32
// cpysize = file->CopyTo( shm->ptr(), 500000 );
33
// for (int i=0; i<10; i++ ) {
34
for
(
int
i = 0; i < 100; i++) {
35
h1->Fill((
float
)i, (
float
)i);
36
sleep(1);
37
// file->Update();
38
// cpysize = file->CopyTo( shm.ptr(), 2000000 );
39
file->Write(0, TObject::kOverwrite);
40
shm->lock();
41
cpysize = file->CopyTo(shm->ptr(), 500000);
42
shm->unlock();
43
printf(
"Objects copied : cpysize = %d\n"
, cpysize);
44
}
45
// h1->Reset();
46
// }
47
cpysize = file->CopyTo(shm->ptr(), 500000);
48
file->ls();
49
file->Print();
50
file->Write();
51
file->Close();
52
}
Belle2::SharedMem
Definition:
SharedMem.h:20
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:17
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:75
daq
dqm
tools
tmemtest.cc
Generated on Thu Dec 28 2023 02:21:34 for Belle II Software by
1.9.1