Logo coherent WaveBurst  
Library Reference Guide
Logo
revMonster.cc
Go to the documentation of this file.
1 #include "monster.hh"
2 #include "WDM.hh"
3 
4 #include "TRandom3.h"
5 #include "TSystem.h"
6 
7 const int nRES = 6;
11 
12 void init()
13 {
14  // read catalog
15 
16  char name[1024];
17  sprintf(name, "%s/wdmXTalk/OverlapCatalog_Lev_8_16_32_64_128_256_iNu_4_Prec_10.bin",
18  gSystem->Getenv("HOME_WAT_FILTERS") );
19  ovlp.read(name);
20 
21  // create WDM objects corresponding to the catalog resolutions
22  int layers[nRES] = {8, 16,32,64,128,256};
24  for(int i=0; i<nRES; i++) wdm[i] = new WDM<double>(layers[i],layers[i], 4, 8);
25 
26 
27  // create data: noise in Gaussian envelope to avoid boundary effects
28 
29  double Rate = 2048;
30  double Duration = 10;
31  double Decay2 = 1.5*1.5;
32  TRandom3 rnd0(0);
33 
34  wavearray<double> ts(Rate*Duration);
35  ts.rate(Rate);
36 
37  for(int i=0; i<Rate*Duration; ++i){
38  double ii = i/Rate - Duration/2;
39  ts[i] = 10*rnd0.Gaus()*exp(-ii*ii/2/Decay2);
40  }
41 
42  // create TF maps
43  for(int i=0; i<nRES; i++) pTF[i].Forward(ts, *wdm[i]);
44 }
45 
46 void testMonster(int r1, int r2)
47 {
48  if(r2>r1){ printf("Error: r2 must not be greater than r1!\n"); return;}
49 
50 
51 
52  int M1 = pTF[r1].getLevel();
53  int size1 = pTF[r1].size()/2;
54  double* map00_r1 = pTF[r1].data;
55  //for(int i=0; i<size1; ++i) map00_r1[i] = 0.1;
56 
57  subTF = pTF[r2];
58  int M2 = pTF[r2].getLevel();
59  int size2 = pTF[r2].size()/2;
60  double* map00_r2 = subTF.data;
61 
62  //printf("%d %d\n", M1, M2);
63 
64  int k = (M1/M2)*(M2+1);
65 
66  for(int m=0; m<=M1; ++m){
67  int odd = 0;
68  for(int i=m; i<size1; i+=M1+1){
69 
70  xtalkArray tmp = ovlp.catalog[r1][r2][m][odd];
71  odd = 1- odd;
72 
73  if(m==0 || m==M1)if(!odd)continue;
74 
75  for(int j=0; j<tmp.size; ++j){
76  int indx = i/( 2*(M1+1) ) * (2*k) + tmp.data[j].index;
77  if(indx<0 || indx>size2)continue;
78  map00_r2[indx] -= map00_r1[i]*tmp.data[j].CC[0];
79  }
80  }
81  }
82 
83  for(int i=0; i<size2; i+=M2+1)map00_r2[i] = map00_r2[i+M2] = 0;
84 
85  // watplot q;
86  // q.plot(subTF, 3);
87  // WDMPlotQuad(pTF[r2], 1, 0, 0., 0., 0);
88  // Plot(ts);
89 
90 }
tfmap Forward(ts, wdm)
virtual void rate(double r)
Definition: wavearray.hh:141
float M2
par [0] name
int index
Definition: monster.hh:30
monster ovlp
Definition: revMonster.cc:10
WDM< double > wdm(nLAYERS, nLAYERS, 6, 10)
int layers
int m
Definition: cwb_net.C:28
int j
Definition: cwb_net.C:28
i drho i
void testMonster(int r1, int r2)
Definition: revMonster.cc:46
virtual size_t size() const
Definition: wavearray.hh:145
int getLevel()
Definition: wseries.hh:109
static double r2
Definition: geodesics.cc:26
int Duration
double * tmp
Definition: testWDM_5.C:31
WSeries< double > pTF[nRES]
Definition: revMonster.cc:8
printf("total live time: non-zero lags = %10.1f \, liveTot)
void read(char *filename)
param: file name
Definition: monster.cc:244
WSeries< double > subTF
Definition: revMonster.cc:9
int k
void init()
Definition: revMonster.cc:12
xtalkArray(*** catalog)[2]
Definition: monster.hh:115
struct xtalk * data
Definition: monster.hh:32
wavearray< double > ts(N)
float M1
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
int size
Definition: monster.hh:32
float CC[4]
Definition: monster.hh:30
DataType_t * data
Definition: wavearray.hh:319
const int nRES
Definition: revMonster.cc:7