ROOT
Version v6.32
master
v6.34
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
▼
Functional Parts
►
Core ROOT classes
►
std Extension classes
►
Parallelized classes
►
The Geometry Package
►
Graphics
►
Event display with ROOT7
►
GUI
►
Web Widgets
►
Web Display
►
Histogram Library
►
Input/Output Library
►
Math
►
N-D parametric functions
►
VecOps
►
Monte Carlo
►
HTTP server
►
PROOF
►
TMVA
►
RooFit
►
Dataframe
►
ROOT7 classes
►
NTuple-related classes
►
Tree Library
►
TreePlayer Library
▼
Tutorials
►
Histograms tutorials
►
Tree tutorials
►
Dataframe tutorials
►
ROOT 7 tutorials
►
FOAM tutorials
►
Containers tutorials
►
Event display tutorials
►
Event display ROOT7 tutorials
►
Geometry tutorials
►
Fast Fourier Transforms tutorials
►
Fit Tutorials
►
RooFit Tutorials
►
Graphs tutorials
►
Graphics tutorials
►
OpenGL tutorials
►
Tutorials specific to Mac/Cocoa
►
GUI tutorials
►
HistFactory Tutorials
►
HTTP tutorials
►
Image tutorials
►
IO tutorials
►
Math tutorials
►
Matrix tutorials
►
Monte Carlo tutorials
►
Multicore tutorials
▼
Net tutorials
authclient.C
authserv.C
fastMergeServer.C
hclient.C
hcons.C
hprod.C
hserv.C
hserv2.C
parallelMergeClient.C
parallelMergeServer.C
parallelMergeTest.C
pclient.C
pserv.C
spy.C
spyserv.C
TestAuth.C
testTUDPSocket.C
treeClient.C
TUriTest.C
►
Physics tutorials
►
PyRoot tutorials
►
Pythia tutorials
►
Quadratic programming package.
►
R tutorials
►
RooStats Tutorials
►
Spectrum tutorials
►
TSPlot tutorials
►
SQL tutorials
►
TMVA tutorials
►
TUnfold tutorials
►
Unuran tutorials
►
VecOps tutorials
►
FITS files interface tutorials
►
XML tutorials
►
Proof tutorials
►
Webgui tutorials
►
Legacy tutorials
demos.C
demoshelp.C
hsimple.C
rootlogoff.C
rootlogon.C
►
R Interface for Statistical Computing
►
Namespaces
►
All Classes
►
Files
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
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 =
nullptr
;
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"
);
}
h
#define h(i)
Definition
RSha256.hxx:106
UInt_t
unsigned int UInt_t
Definition
RtypesCore.h:46
Float_t
float Float_t
Definition
RtypesCore.h:57
TBenchmark.h
gBenchmark
R__EXTERN TBenchmark * gBenchmark
Definition
TBenchmark.h:59
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
TError.h
TFile.h
kUPDATE
@ kUPDATE
Definition
TFitParametersDialog.cxx:46
TH2.h
TMessage.h
TRandom.h
gRandom
R__EXTERN TRandom * gRandom
Definition
TRandom.h:62
TSocket.h
TTree.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TBenchmark::Start
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition
TBenchmark.cxx:172
TBenchmark::Show
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Definition
TBenchmark.cxx:155
TFile
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition
TFile.h:53
TFile::Open
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition
TFile.cxx:4094
TFile::Write
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) override
Write memory objects to this file.
Definition
TFile.cxx:2441
TH1F
1-D histogram with a float per channel (see TH1 documentation)
Definition
TH1.h:621
TH2F
2-D histogram with a float per channel (see TH1 documentation)
Definition
TH2.h:307
TRandom::SetSeed
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition
TRandom.cxx:615
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition
TString.cxx:2378
TTree
A TTree represents a columnar dataset.
Definition
TTree.h:79
TMVA_SOFIE_GNN_Parser.tree
tree
Definition
TMVA_SOFIE_GNN_Parser.py:169
Author
Definition in file
parallelMergeTest.C
.
tutorials
net
parallelMergeTest.C
ROOT v6-32 - Reference Guide Generated on Mon Mar 24 2025 14:12:01 (GVA Time) using Doxygen 1.10.0