Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CWB_Plugin_bandPass.C
Go to the documentation of this file.
1 #define XIFO 4
2 
3 #pragma GCC system_header
4 
5 #include "cwb.hh"
6 #include "config.hh"
7 #include "network.hh"
8 #include "wavearray.hh"
9 #include "TString.h"
10 #include "TObjArray.h"
11 #include "TObjString.h"
12 #include "TRandom.h"
13 #include "Toolbox.hh"
14 
15 #define DUMP_WHITE_PSD
16 
17 struct fBand {
18  double flow;
19  double fhigh;
20 };
21 
22 #define nBAND 6
23 
24 fBand fband[nBAND]={
25  {77,83},
26  {116,125},
27  {175,185},
28  {196,204},
29  {491,497},
30  {573,580}
31  };
32 
33 void
35 //!DATA_CONDITIONING
36 // Plugin which implement the bandFilter data conditioning on whitened data
37 
38  cout << endl;
39  cout << "-----> CWB_Plugin_bandPass.C" << endl;
40  cout << "ifo " << ifo.Data() << endl;
41  cout << "type " << type << endl;
42  cout << endl;
43 
44  if(type==CWB_PLUGIN_WHITE) {
46  int level=-1;
47  if(TString(cfg->analysis)=="1G") {
48  level=x->getLevel();
49  x->Inverse(-1);
50  }
51 
53 
54  int layers = px->rate()/2;
55  WDM<double> wdm(layers,layers,6,10); // df = (px->rate()/2)/layers
56  detector D;
57  D.getTFmap()->Forward(*px,wdm);
58  for(int i=0;i<nBAND;i++) D.bandCut(fband[i].flow,fband[i].fhigh); // band cut filter
59  D.getTFmap()->Inverse(); // return to time domain
60  *px = *D.getTFmap(); // get band filtered data
61 
62 #ifdef DUMP_WHITE_PSD
63  // dump spectrum
64  char file[1024];
65  sprintf(file,"%s/sensitivity_white_%s_%d_%s_job%lu.txt",
66  cfg->dump_dir,ifo.Data(),int(x->start()),cfg->data_label,net->nRun);
67  cout << endl << "Dump Sensitivity : " << file << endl << endl;
68  TB.makeSpectrum(file, *x);
69  int nIFO=net->ifoListSize();
70  if(TString(ifo).CompareTo(net->ifoName[nIFO-1])==0) gSystem->Exit(0); // last ifo
71 #endif
72 
73  if(TString(cfg->analysis)=="1G") x->Forward(level);
74  }
75 
76  return;
77 }
std::vector< char * > ifoName
Definition: network.hh:591
CWB::config * cfg
Definition: TestCWB_Plugin.C:5
char analysis[8]
Definition: config.hh:99
detector D
Definition: TestBandPass.C:15
virtual void rate(double r)
Definition: wavearray.hh:123
TString("c")
size_t nRun
Definition: network.hh:554
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<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t 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
WDM< double > wdm(nLAYERS, nLAYERS, 6, 10)
int layers
fBand fband[nBAND]
virtual void start(double s)
Definition: wavearray.hh:119
i drho i
CWB::Toolbox TB
Definition: ComputeSNR.C:5
char ifo[NIFO_MAX][8]
network ** net
NOISE_MDC_SIMULATION.
size_t ifoListSize()
Definition: network.hh:413
#define nIFO
int getLevel()
Definition: wseries.hh:91
jfile
Definition: cwb_job_obj.C:25
wavearray< double > * px
i() int(T_cor *100))
double fhigh
double flow
#define nBAND
WSeries< double > * getTFmap()
param: no parameters
Definition: detector.hh:161
string file
Definition: cwb_online.py:385
char dump_dir[1024]
Definition: config.hh:310
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:228
static void makeSpectrum(wavearray< double > &psd, wavearray< double > x, double chuncklen=8, double scratchlen=0, bool oneside=true)
Definition: Toolbox.cc:4705
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
char data_label[1024]
Definition: config.hh:314
void Inverse(int n=-1)
param: n - number of steps (-1 means full reconstruction)
Definition: wseries.cc:273
void bandCut(double f1, double f2)
Definition: detector.hh:268