Coherent WaveBurst
Reference Guide
CWB Documentation
Main Page
Namespaces
All Classes
Files
gitlab
ROOT
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
SOFT
cWB
library
master_0bc430d
tools
cwb
tutorials
TestTObjectWSeries.C
Go to the documentation of this file.
1
{
2
//
3
// Write & Read wavearray, Wseries objects to/from root file
4
// Author : Gabriele Vedovato
5
6
7
wavearray<double>
x1(1024*128);
8
x1.rate(1024*4);
9
for
(
int
i
=0;
i
<x1.size();
i
++) x1[
i
]=
i
;
10
11
Meyer<double>
S
(512,2);
12
WSeries<double>
w1(x1,
S
);
13
w1.Forward(1);
14
cout <<
"w1 level "
<< w1.getLevel() << endl;
15
16
TFile *
froot
=
new
TFile(
"test.root"
,
"RECREATE"
);
17
if
(froot==NULL) {
18
cout <<
"Failed to create file !!! "
<< endl;
19
gSystem->Exit(1);
20
}
21
22
w1.Write(
"WSeries<double>"
);
23
froot->Close();
24
25
TFile *
f
=
new
TFile(
"test.root"
);
26
if
(f==NULL) {
27
cout <<
"Failed to open file test.root !!! "
<< endl;
28
gSystem->Exit(1);
29
}
30
31
f->ls();
32
33
WSeries<double>
*
w
= (
WSeries<double>
*)f->Get(
"WSeries<double>;1"
);
34
if
(w==NULL) {
35
cout <<
"Object WSeries not exist !!! "
<< endl;
36
gSystem->Exit(1);
37
}
38
39
cout << w->
size
() << endl;
40
cout <<
"w level "
<< w->
getLevel
() << endl;
41
for
(
int
i
=0;
i
<10;
i
++) cout <<
i
<<
" "
<< w->
data
[
i
] << endl;
42
43
f->Close();
44
45
exit
(0);
46
}
wavearray::size
virtual size_t size() const
Definition:
wavearray.hh:127
f
TFile * f
Definition:
TestTObjectWSeries.C:25
wavearray< double >
i
i drho i
Definition:
cwb_epparameters.C:85
WSeries::getLevel
int getLevel()
Definition:
wseries.hh:91
WSeries< double >
froot
TFile * froot
Definition:
TestReadWriteDetectorObject.C:11
w
WSeries< double > * w
Definition:
TestTObjectWSeries.C:33
Meyer
Definition:
Meyer.hh:18
S
Meyer< double > S(1024, 2)
wavearray::data
DataType_t * data
Definition:
wavearray.hh:301
exit
exit(0)