coherent WaveBurst
Library Reference Guide
home
cWB_docker
git
cWB
library
tools
cwb
tutorials
TestTObjectNetpixel.C
Go to the documentation of this file.
1
{
2
//
3
// Write & Read netpixel object to/from root file
4
// Author : Gabriele Vedovato
5
6
netpixel
pix
;
7
pix.
frequency
=100;
8
9
TFile *
froot
=
new
TFile(
"test.root"
,
"RECREATE"
);
10
if
(froot==NULL) {
11
cout <<
"Failed to create file !!! "
<< endl;
12
gSystem->Exit(1);
13
}
14
15
pix.Write(
"netpixel"
);
16
froot->Close();
17
18
TFile *
f
=
new
TFile(
"test.root"
);
19
if
(f==NULL) {
20
cout <<
"Failed to open file test.root !!! "
<< endl;
21
gSystem->Exit(1);
22
}
23
24
f->ls();
25
26
netpixel
*
pix2
= (
netpixel
*)f->Get(
"netpixel"
);
27
if
(pix2==NULL) {
28
cout <<
"Object pixel not exist !!! "
<< endl;
29
gSystem->Exit(1);
30
}
31
32
cout <<
"pix2 frequency "
<< pix2->
frequency
<< endl;
33
34
f->Close();
35
36
exit
(0);
37
}
pix2
netpixel * pix2
Definition:
TestTObjectNetpixel.C:26
netpixel::frequency
size_t frequency
Definition:
netpixel.hh:111
f
TFile * f
Definition:
TestTObjectNetpixel.C:18
pix
netpixel pix(nifo)
exit
exit(0)
netpixel
Definition:
netpixel.hh:44
froot
TFile * froot
Definition:
TestTObjectNetpixel.C:9