Logo coherent WaveBurst  
Library Reference Guide
Logo
CWB_Plugin_WDM_freqCuts.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 #define XIFO 4
20 
21 #pragma GCC system_header
22 
23 #include "cwb.hh"
24 #include "config.hh"
25 #include "network.hh"
26 #include "wavearray.hh"
27 #include "TString.h"
28 #include "TObjArray.h"
29 #include "TObjString.h"
30 #include "TRandom.h"
31 #include "Toolbox.hh"
32 
33 void
35 //!DATA_CONDITIONING
36 // Implements the 2G frequency cuts after the whitening
37 
38  cout << endl;
39  cout << "-----> CWB_Plugin_WDM_freqCuts.C" << endl;
40  cout << "ifo " << ifo.Data() << endl;
41  cout << "type " << type << endl;
42  cout << endl;
43 
45  if(TString(cfg->analysis)!="2G") {
46  cout << "CWB_Plugin_freqCuts.C is implmenented only for 2G analysis" << endl;
47  gSystem->Exit(1);
48  }
49 
50  // cuts around the H1 S6A upconversion frequency ranges
51  int nfreqCuts = 6;
52  double freqCuts[100][2];
53  freqCuts[0][0]=58; freqCuts[0][1]=62;
54  freqCuts[1][0]=78; freqCuts[1][1]=81;
55  freqCuts[2][0]=118; freqCuts[2][1]=122;
56  freqCuts[3][0]=176; freqCuts[3][1]=184;
57  freqCuts[4][0]=188; freqCuts[4][1]=191;
58  freqCuts[5][0]=198; freqCuts[5][1]=201;
59 
60  // select max resolution level (the one used for whitening)
61  int layers = 0;
62  for(int level=cfg->l_high; level>=cfg->l_low; level--) {
63  for(int j=0;j<net->wdmMRA.nRes;j++)
64  if(layers<net->wdmMRA.layers[j]) layers=net->wdmMRA.layers[j];
65  }
66  WDM<double> WDMwhite(layers,layers,6,10);
67 
68  // WDM transform
70  wM.Forward(*x,WDMwhite);
71 
73  layers = wM.maxLayer();
74  for(int j=0;j<layers;j++) {
75  double freq = wM.frequency(j);
76  double layer = j+0.01; // -epsilon select 0 layer for 90 phase
77  for(int k=0;k<nfreqCuts;k++) {
78  // apply frequency cuts
79  if((freq>freqCuts[k][0])&&(freq<freqCuts[k][1])) {
80  wM.getLayer(z, layer);z=0;wM.putLayer(z, layer); // 0 phase
81  wM.getLayer(z,-layer);z=0;wM.putLayer(z,-layer); // 90 phase
82  }
83  }
84  }
85 
86  // inverse WDM transform
89  wM.Inverse();
90  wM2.Inverse(-2);
91  *y = wM;
92  *y += wM2;
93  *y *= 0.5;
94  }
95 
96  return;
97 }
monster wdmMRA
list of pixel pointers for MRA
Definition: network.hh:651
CWB::config * cfg
char analysis[8]
Definition: config.hh:117
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
wavearray< double > z
Definition: Test10.C:32
TString("c")
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1) *itime+ifreq;double time=itime *dT;double freq=(ifreq >0) ? ifreq *dF :dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
int layers
int j
Definition: cwb_net.C:28
char ifo[NIFO_MAX][8]
network ** net
NOISE_MDC_SIMULATION.
wavearray< double > freq
Definition: Regression_H1.C:79
jfile
Definition: cwb_job_obj.C:43
int l_high
Definition: config.hh:156
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
Definition: wseries.cc:193
int k
WSeries< double > wM
Definition: cwb_job_obj.C:41
int l_low
Definition: config.hh:155
int * layers
Definition: monster.hh:121
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:246
int nRes
Definition: monster.hh:117
float wM2[PE_MAX_EVENTS]
Definition: cwb_pereport.C:332
void Inverse(int n=-1)
param: n - number of steps (-1 means full reconstruction)
Definition: wseries.cc:291
wavearray< double > y
Definition: Test10.C:31
void putLayer(wavearray< DataType_t > &, double n)
param: n - layer number
Definition: wseries.cc:219
double frequency(int l)
Definition: wseries.cc:117
int maxLayer()
Definition: wseries.hh:139