Loading [MathJax]/extensions/tex2jax.js
ROOT
6.12/07
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace 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
l
m
n
o
p
q
r
s
u
w
x
+
Enumerations
a
e
f
g
m
p
t
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
w
+
All Classes
Class List
Class Index
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
k
l
m
n
o
p
r
s
t
u
v
w
x
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
w
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Properties
f
+
Related 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
z
+
Files
File List
+
File Members
+
All
1
2
3
4
5
6
7
8
9
_
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
+
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
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
c
e
f
i
l
m
p
r
u
x
+
Enumerator
a
c
d
e
f
g
h
i
k
l
n
o
p
r
s
v
w
+
Macros
1
2
3
4
5
6
7
8
9
_
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
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
tutorials
net
parallelMergeTest.C File Reference
Tutorials
»
Net tutorials
Detailed Description
#include "
TMessage.h
"
#include "
TBenchmark.h
"
#include "
TSocket.h
"
#include "
TH2.h
"
#include "
TTree.h
"
#include "
TFile.h
"
#include "
TRandom.h
"
#include "
TError.h
"
void
parallelMergeTest(
UInt_t
nhist,
UInt_t
ndims = 1,
UInt_t
nbins = 100)
{
gBenchmark
->
Start
(
"parallelMergeTest"
);
TFile
*file =
TFile::Open
(
"mergedClient.root?pmerge=localhost:1095"
,
"RECREATE"
);
Float_t
px, py;
TTree
*tree = 0;
switch
(ndims) {
case
1: {
for
(
UInt_t
h = 0 ; h < nhist; ++
h
) {
new
TH1F
(
TString::Format
(
"hpx%d"
,h),
"This is the px distribution"
,nbins,-4,4);
}
break
;
}
case
2: {
for
(
UInt_t
h = 0 ; h < nhist; ++
h
) {
new
TH2F
(
TString::Format
(
"hpxy%d"
,h),
"py vs px"
,nbins,-4,4,nbins,-4,-4);
}
break
;
}
case
99: {
tree =
new
TTree
(
"tree"
,
"tree"
);
tree->
SetAutoFlush
(4000000);
tree->
Branch
(
"px"
,&px);
tree->
Branch
(
"py"
,&py);
}
}
// Fill histogram randomly
gRandom->SetSeed();
const
int
kUPDATE = 1000000;
for
(
int
i = 0; i < 25000000; ) {
// gRandom->Rannor(px,py);
// if (idx%2 == 0)
// hpx->Fill(px);
// else
// hpx->Fill(px,py);
if
(tree) tree->
Fill
();
++i;
if
(i && (i%kUPDATE) == 0) {
file->
Write
();
}
}
file->
Write
();
delete
file;
gBenchmark
->
Show
(
"parallelMergeTest"
);
}
Author
Definition in file
parallelMergeTest.C
.