coherent WaveBurst
Library Reference Guide
home
cWB_docker
git
cWB
library
tools
cwb
tutorials
TestTObjectWaveDWT.C
Go to the documentation of this file.
1
{
2
//
3
// Write & Read WaveDMT object to/from root file
4
// Author : Gabriele Vedovato
5
6
7
WaveDWT<double>
S
(512,2);
8
S
.setLevel(2);
9
cout <<
"S "
<<
S
.getLevel() << endl;
10
11
TFile *
froot
=
new
TFile(
"test.root"
,
"RECREATE"
);
12
if
(froot==NULL) {
13
cout <<
"Failed to create file !!! "
<< endl;
14
gSystem->Exit(1);
15
}
16
17
S
.Write(
"WaveDWT<double>"
);
18
froot->Close();
19
20
TFile *
f
=
new
TFile(
"test.root"
);
21
if
(f==NULL) {
22
cout <<
"Failed to open file test.root !!! "
<< endl;
23
gSystem->Exit(1);
24
}
25
26
f->ls();
27
28
WaveDWT<double>
*
S2
= (
WaveDWT<double>
*)f->Get(
"WaveDWT<double>;1"
);
29
if
(S2==NULL) {
30
cout <<
"Object WaveDWT not exist !!! "
<< endl;
31
gSystem->Exit(1);
32
}
33
34
cout <<
"S2 "
<< S2->
getLevel
() << endl;
35
36
f->Close();
37
38
exit
(0);
39
}
WaveDWT< double >
Wavelet::getLevel
virtual int getLevel()
Definition:
Wavelet.hh:88
f
TFile * f
Definition:
TestTObjectWaveDWT.C:20
froot
TFile * froot
Definition:
TestReadWriteDetectorObject.C:11
S2
WaveDWT< double > * S2
Definition:
TestTObjectWaveDWT.C:28
S
Meyer< double > S(1024, 2)
exit
exit(0)