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
gwat
tutorials
TestTObjectGWavearray2.C
Go to the documentation of this file.
1
{
2
//
3
// Write & Read gwavearray object to/from root file
4
// Author : Gabriele Vedovato
5
6
gwavearray<double>
x1(1024*4);
7
x1.rate(1024*4);
8
double
dt
=1/x1.rate();
9
for
(
int
i
=0;
i
<x1.size();
i
++) x1[
i
]=sin(2*
PI
*100*dt*
i
);
10
11
wavearray<double>
x2(1024*4);
12
x2.rate(1024*4);
13
for
(
int
i=0;i<x2.size();i++) x2[i]=sin(2*
PI
*100*dt*i);
14
15
gwavearray<double>
x3(&x2);
16
17
TFile *
froot
=
new
TFile(
"gwavearray_test.root"
,
"RECREATE"
);
18
x2.resize(1024);
19
x2.Write(
"clusters-lev:1-lag:678"
);
20
x2.resize(2*1024);
21
x2.Write(
"clusters-lev:2-lag:678"
);
22
x2.resize(4*1024);
23
x2.Write(
"clusters-lev:3-lag:678"
);
24
froot->Close();
25
26
TFile *
f
=
new
TFile(
"gwavearray_test.root"
);
27
28
f->ls();
29
30
gwavearray<double>
* w1 = (
gwavearray<double>
*)f->Get(
"clusters-lev:1-lag:678"
);
31
cout << w1->
size
() << endl;
32
33
gwavearray<double>
* w2 = (
gwavearray<double>
*)f->Get(
"clusters-lev:2-lag:678"
);
34
cout << w2->
size
() << endl;
35
36
gwavearray<double>
* w3 = (
gwavearray<double>
*)f->Get(
"clusters-lev:3-lag:678"
);
37
cout << w3->
size
() << endl;
38
39
f->Close();
40
41
//exit(0);
42
}
wavearray::size
virtual size_t size() const
Definition:
wavearray.hh:127
cwb_online.f
tuple f
Definition:
cwb_online.py:91
wavearray< double >
i
i drho i
Definition:
cwb_epparameters.C:85
PI
#define PI
Definition:
watfun.hh:14
froot
TFile * froot
Definition:
TestReadWriteDetectorObject.C:11
dt
double dt
Definition:
TestTObjectGWavearray2.C:8
gwavearray
Definition:
gwavearray.hh:22