Logo coherent WaveBurst  
Library Reference Guide
Logo
CWB_Plugin_cwb_inet.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 "gwavearray.hh"
28 #include "TString.h"
29 #include "TObjArray.h"
30 #include "TObjString.h"
31 #include "TRandom.h"
32 #include "TComplex.h"
33 #include "TMath.h"
34 #include "mdc.hh"
35 #include <vector>
36 
38 TString CWB_Plugin_CheckIFO(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
40 TString CWB_Plugin_CheckTYPE(TString cwb_inet_options,TFile* jfile, CWB::config* cfg, TString type);
41 void CWB_Plugin_frdisplay(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
42  network* net, WSeries<double>* x, TString ifo, int type);
43 void CWB_Plugin_psd(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
44  network* net, WSeries<double>* x, TString ifo, int type);
45 void CWB_Plugin_inj(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
46  network* net, WSeries<double>* x, TString ifo, int type);
47 void CWB_Plugin_nRMS(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
48  network* net, WSeries<double>* x, TString ifo, int type);
49 void CWB_Plugin_wdm(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
50  network* net, WSeries<double>* x, TString ifo, int type);
51 void CWB_Plugin_emax(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
52  network* net, WSeries<double>* xdummy, TString sdummy, int type);
53 void CWB_Plugin_sparse(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
54  network* net, TString ifo, int type);
55 void CWB_Plugin_ced(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
56  network* net, TString ifo, int type);
57 
58 void
60 
61 // Plugin to show data with frdisplay & psd with the cwb_inet command
62 
63  if(TString(cfg->analysis)!="2G") {
64  cout << "CWB_Plugin_cwb_inet.C : allowed only for 2G analysis" << endl;
65  gSystem->Exit(1);
66  }
67 
68  // get cwb_inet options
69  TString cwb_inet_options=TString(gSystem->Getenv("CWB_INET_OPTIONS"));
70 
71  cout << endl;
72  cout << "-----> plugins/CWB_Plugin_cwb_inet.C : ifo : " << ifo.Data() << " - type : " << type << endl;
73  cout << " options : " << cwb_inet_options << endl;
74  cout << endl;
75 
76  // get ifo : return if not equal to input plugin parameter (ifo)
77  TString cwb_inet_tool = CWB::Toolbox::getParameter(cwb_inet_options,"--tool");
78  cwb_inet_tool.ToUpper();
79  TString cwb_inet_type = CWB::Toolbox::getParameter(cwb_inet_options,"--type");
80  cwb_inet_type.ToUpper();
81 
82  // exit if cwb_inet_tool can not be applied
83  bool error = true;
84  // import istage,jstage
85  //CWB_STAGE gISTAGE=-1; IMPORT(CWB_STAGE,gISTAGE)
86  int gISTAGE=-1; IMPORT(int,gISTAGE)
87  int gJSTAGE=-1; IMPORT(int,gJSTAGE)
88 
89  if((gISTAGE<CWB_STAGE_STRAIN)&&(gJSTAGE>=CWB_STAGE_STRAIN)||(gJSTAGE==CWB_STAGE_FULL)) {
90  if((cwb_inet_tool=="PSD")&&((cwb_inet_type=="STRAIN")||(cwb_inet_type=="MDC"))) error=false;
91  if((cwb_inet_tool=="WDM")&&((cwb_inet_type=="STRAIN")||(cwb_inet_type=="MDC"))) error=false;
92  if((cwb_inet_tool=="FRDISPLAY")&&((cwb_inet_type=="STRAIN")||(cwb_inet_type=="MDC"))) error=false;
93  if(cwb_inet_tool=="INJ") error=false;
94  }
95  if((gISTAGE<CWB_STAGE_CSTRAIN)&&(gJSTAGE>=CWB_STAGE_CSTRAIN)||(gJSTAGE==CWB_STAGE_FULL)) {
96  if((cwb_inet_tool=="WDM")&&(cwb_inet_type=="STRAIN")) error=false;
97  if((cwb_inet_tool=="PSD")&&(cwb_inet_type=="WHITE")) error=false;
98  if((cwb_inet_tool=="WDM")&&(cwb_inet_type=="WHITE")) error=false;
99  if((cwb_inet_tool=="FRDISPLAY")&&(cwb_inet_type=="WHITE")) error=false;
100  if(cwb_inet_tool=="INJ") error=false;
101  if(cwb_inet_tool=="NRMS") error=false;
102  }
103  if((gISTAGE<CWB_STAGE_COHERENCE)&&(gJSTAGE>=CWB_STAGE_COHERENCE)||(gJSTAGE==CWB_STAGE_FULL)) {
104  if(cwb_inet_tool=="EMAX") error=false;
105  }
106  if((gISTAGE<CWB_STAGE_SUPERCLUSTER)&&(gJSTAGE>=CWB_STAGE_SUPERCLUSTER)||(gJSTAGE==CWB_STAGE_FULL)) {
107  if((cwb_inet_tool=="SPARSE")&&(cwb_inet_type=="SUPERCLUSTER")) error=false;
108  }
109  if((gISTAGE<CWB_STAGE_LIKELIHOOD)&&(gJSTAGE>=CWB_STAGE_LIKELIHOOD)||(gJSTAGE==CWB_STAGE_FULL)) {
110  if((cwb_inet_tool=="SPARSE")&&(cwb_inet_type=="LIKELIHOOD")) error=false;
111  if(cwb_inet_tool=="CED") error=false;
112  }
113 
114  if(error) {
115  cout << "CWB_Plugin_cwb_inet.C : cwb_inet option can not applied for this stage range , process terminated!!!" << endl;
116  cout << endl;
117  cout << "OPTIONS : " << cwb_inet_options << endl;
118  cout << "BEGIN STAGE : " << cwb::GetStageString(CWB_STAGE(gISTAGE)) << endl;
119  cout << "END STAGE : " << cwb::GetStageString(CWB_STAGE(gJSTAGE)) << endl;
120  cout << endl;
122  gSystem->Exit(1);
123  }
124 
125  // execute plugin
126  if(cwb_inet_tool=="FRDISPLAY") CWB_Plugin_frdisplay(cwb_inet_options, jfile, cfg, net, x, ifo, type);
127  else if(cwb_inet_tool=="PSD") CWB_Plugin_psd(cwb_inet_options, jfile, cfg, net, x, ifo, type);
128  else if(cwb_inet_tool=="INJ") CWB_Plugin_inj(cwb_inet_options, jfile, cfg, net, x, ifo, type);
129  else if(cwb_inet_tool=="NRMS") CWB_Plugin_nRMS(cwb_inet_options, jfile, cfg, net, x, ifo, type);
130  else if(cwb_inet_tool=="WDM") CWB_Plugin_wdm(cwb_inet_options, jfile, cfg, net, x, ifo, type);
131  else if(cwb_inet_tool=="EMAX") CWB_Plugin_emax(cwb_inet_options, jfile, cfg, net, x, ifo, type);
132  else if(cwb_inet_tool=="SPARSE") CWB_Plugin_sparse(cwb_inet_options, jfile, cfg, net, ifo, type);
133  else if(cwb_inet_tool=="CED") CWB_Plugin_ced(cwb_inet_options, jfile, cfg, net, ifo, type);
134  else {
135  cout << "CWB_Plugin_cwb_inet.C : Bad inet option --tool " << cwb_inet_tool << endl;
136  cout << "Select : --tool FRDISPLAY/PSD/NRMS/WDM/EMAX/SPARSE/CED" << endl << endl;
138  gSystem->Exit(1);
139  }
140 }
141 
142 void
143 CWB_Plugin_ced(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
144  network* net, TString ifo, int type) {
145 
146  if(type==CWB_PLUGIN_ILIKELIHOOD) { // save ced to jfile
147  cfg->cedDump = true;
148  unsigned int jobfOptions = cfg->jobfOptions;
149  jobfOptions |= CWB_JOBF_SAVE_CED;
150  cfg->jobfOptions = (CWB_JOBF_OPTIONS)jobfOptions;
151  return;
152  }
153  if(type!=CWB_PLUGIN_CLOSE_JOB) return;
154 
155  TString cwb_inet_draw = CWB::Toolbox::getParameter(cwb_inet_options,"--draw");
156  cwb_inet_draw.ToUpper();
157 
158  // get job file name
159  TString jname = jfile->GetPath();
160  jname.ReplaceAll(":/","");
161  cout << jname.Data() << endl;
162 
163  if(cwb_inet_draw=="TRUE") {
164  // creates a temporary file name
165  char fmacroName[1024];
166  unsigned int Pid = gSystem->GetPid(); // used to tag in a unique way the temporary files
167  sprintf(fmacroName,"%s/CWB_Plugin_cwb_inet_ced_macro_%s_%d_job%d.XXXXXX",
168  cfg->tmp_dir,cfg->data_label,Pid,net->nRun);
169  CWB::Toolbox::mksTemp(fmacroName); // create temporary file, must be deleted only at the end of run
170  ofstream out;
171  out.open(fmacroName,ios::out);
172  if(!out.good()) {
173  cout << "CWB_Plugin_cwb_inet.C - Error : Opening File : " << fmacroName << endl;
174  gSystem->Exit(1);
175  }
176  char line[1024];
177  sprintf(line,"{TFile* ifile = new TFile(\"%s\");TBrowser br(\"CWB\",ifile);}",jname.Data());
178  out << line << endl;
179  out.close();
180 
181  char cmd[1024];
182  // start root browser
183  sprintf(cmd,"root -l %s",fmacroName);
184  cout << cmd << endl; gSystem->Exec(cmd);
185  // remove temporary files
186  sprintf(cmd,"rm %s",jname.Data());
187  cout << cmd << endl; gSystem->Exec(cmd);
188  sprintf(cmd,"rm %s",fmacroName);
189  cout << cmd << endl; gSystem->Exec(cmd);
190  }
191 
193  gSystem->Exit(0);
194 }
195 
196 void
197 CWB_Plugin_sparse(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
198  network* net, TString ifo, int type) {
199 
200  // get type : return if not equal to input plugin parameter (type)
201  TString cwb_inet_type = CWB_Plugin_CheckTYPE(cwb_inet_options, jfile, cfg, type);
202  if(cwb_inet_type=="") return;
203  cwb_inet_type.ToLower();
204 
205  bool check=false;
206  if((type==CWB_PLUGIN_ISUPERCLUSTER)&&(cwb_inet_type=="supercluster")) check=true;
207  if((type==CWB_PLUGIN_ILIKELIHOOD)&&(cwb_inet_type=="likelihood")) check=true;
208  if(!check) return;
209 
210  // get ifo : return if not equal to input plugin parameter (ifo)
211  TString cwb_inet_ifo = CWB::Toolbox::getParameter(cwb_inet_options,"--ifo");
212  // check if ifo is in the network
213  if(cwb_inet_ifo!="") CWB_Plugin_CheckIFO(cwb_inet_options, jfile, cfg, net, ifo);
214 
215  watplot* WTS = new watplot(const_cast<char*>("WTS"));
216 
217  TString cwb_inet_draw = CWB::Toolbox::getParameter(cwb_inet_options,"--draw");
218  cwb_inet_draw.ToUpper();
219  TString odir = cfg->dump_dir;
220 
221  // get draw mode
222  TString cwb_inet_mode = CWB::Toolbox::getParameter(cwb_inet_options,"--mode");
223  int mode = (cwb_inet_mode!="") ? cwb_inet_mode.Atoi() : 1;
224  TString gmode="";
225  if(mode==0) mode=1;
226  if(mode==1) gmode="(E00+E90)/2";
227  if(mode==2) gmode="sqrt((E00+E90)/2)";
228  if(mode==3) gmode="amplitude:00";
229  if(mode==4) gmode="energy:00";
230  if(mode==5) gmode="|amplitude:00|";
231  if(mode==6) gmode="amplitude:90";
232  if(mode==7) gmode="energy:90";
233  if(mode==8) gmode="|amplitude:90|";
234 
235  // get core pixels selection
236  // core=true -> rebuild TF map using only core pixels
237  // core=false -> rebuild TF map using all pixels
238  TString cwb_inet_core = CWB::Toolbox::getParameter(cwb_inet_options,"--core");
239  cwb_inet_core = ((cwb_inet_core=="true")||(cwb_inet_core=="false")) ? cwb_inet_core : "true";
240 
241  // open ioutput root file
242  char fName[1024];
243  sprintf(fName,"%s/sparse_%s_%s_%d_%s_job%lu.root",
244  odir.Data(),cwb_inet_type.Data(),cwb_inet_ifo.Data(),mode,cfg->data_label,net->nRun);
245  TFile* ofile = new TFile(fName,"RECREATE");
246 
247  int nIFO = net->ifoListSize();
248  detector* pD[NIFO_MAX]; //! pointers to detectors
249  for(int n=0;n<nIFO;n++) pD[n] = net->getifo(n);
250  //for(int n=0;n<nIFO;n++) cout << n << " detector Name : " << pD[n]->Name << endl;
251 
252  bool singleDetector = false;
253  if(nIFO==2 && TString(pD[1]->Name)==pD[0]->Name) singleDetector=true;
254 
255  for(int n=0;n<nIFO;n++) { // loop over detectors
256  if(cwb_inet_ifo!="") if(net->getifo(n)->Name!=cwb_inet_ifo) continue;
257 
258  // create ifo root directory to store sparse TF
259  TDirectory* dsparse = ofile->mkdir(pD[n]->Name);
260  dsparse->cd();
261 
262  int nSS = pD[n]->vSS.size();
263  for(int i=0;i<nSS;i++) { // loop over levels
264 
265  int level;
266  if(cwb_inet_type=="supercluster") level = i+cfg->l_low;
267  if(cwb_inet_type=="likelihood") level = i+cfg->l_low;
268 
269  // create ifo root directory to store sparse TF
270  char dname[32]; sprintf(dname,"%s:level-%d",pD[n]->Name,level);
271  TDirectory* dlevel = dsparse->mkdir(dname);
272  dlevel->cd();
273 
274  size_t rateANA=cfg->inRate>>cfg->levelR;
275  int rate = rateANA>>level;
276  double dt = 1000./rate;
277  double df = rateANA/2./double(1<<level);
278  cout << "level : " << level << "\t rate : " << rate
279  << "\t df(hz) : " << df << "\t dt(ms) : " << dt << endl;
280 
281  bool core = (cwb_inet_core=="true") ? true : false;
282  pD[n]->vSS[i].Expand(core); // rebuild wseries from sparse table
283  //cout << "REBUILD SIZE " << pD[n]->vSS[i].size() << endl;
284 
285  WSeries<double>* WS = (WSeries<double>*)(&(pD[n]->vSS[i]));
286 
287  // Plot WDM Scalogram
288  double start = WS->start();
289  double stop = WS->start()+WS->size()/WS->rate();
290  double flow = cfg->fLow;
291  double fhigh = cfg->fHigh;
292 
293  WTS->plot(WS, mode, start, stop,const_cast<char*>("COLZ"));
294  WTS->hist2D->GetYaxis()->SetRangeUser(flow, fhigh);
295  char title[64];
296  sprintf(title,"SPARSE TF (%s) - ifo:%s - type:sparse - level:%d - dt:%g (ms) - df=%g (Hz)",
297  gmode.Data(),net->getifo(n)->Name,level,dt,df);
298  WTS->hist2D->SetTitle(title);
299  char name[64]; sprintf(name,"%s:tf:sparse:%d",net->getifo(n)->Name,level);
300  WTS->canvas->Write(name);
301 
302  // project hist2D to time axis
303  sprintf(name,"%s:t:sparse:%d",net->getifo(n)->Name,level);
304  sprintf(title,"SPARSE:TIME (%s) - ifo:%s - type:sparse - level:%d - dt:%g (ms) - df=%g (Hz)",
305  gmode.Data(),net->getifo(n)->Name,level,dt,df);
306  TH1D *tProjH2 = WTS->hist2D->ProjectionX(name);
307  WTS->canvas->Clear();
308  tProjH2->SetTitle(title);
309  tProjH2->SetStats(kFALSE);
310  tProjH2->Draw();
311  WTS->canvas->Write(name);
312 
313  // project hist2D to frequency axis
314  int hist2D_size = WTS->hist2D->GetNbinsX();
315  int edgeSize = (int)(hist2D_size*cfg->segEdge/(2*cfg->segEdge+cfg->segLen));
316  sprintf(name,"%s:f:sparse:%d",net->getifo(n)->Name,level);
317  sprintf(title,"SPARSE:FREQ (%s) - ifo:%s - type:sparse - level:%d - dt:%g (ms) - df=%g (Hz)",
318  gmode.Data(),net->getifo(n)->Name,level,dt,df);
319  TH1D *fProjH2 = WTS->hist2D->ProjectionY(name,edgeSize,hist2D_size-edgeSize);
320  WTS->canvas->Clear();
321  fProjH2->SetTitle(title);
322  fProjH2->SetStats(kFALSE);
323  fProjH2->Draw();
324  WTS->canvas->Write(name);
325 
326  }
327  if(singleDetector) break;
328  }
329 
330  delete WTS;
331  delete ofile;
332 
333  if(cwb_inet_draw=="TRUE") {
334  // creates a temporary file name
335  char fmacroName[1024];
336  unsigned int Pid = gSystem->GetPid(); // used to tag in a unique way the temporary files
337  sprintf(fmacroName,"%s/CWB_Plugin_cwb_inet_sparse_macro_%s_%d_job%d.XXXXXX",
338  cfg->tmp_dir,cfg->data_label,Pid,net->nRun);
339  CWB::Toolbox::mksTemp(fmacroName); // create temporary file, must be deleted only at the end of run
340  ofstream out;
341  out.open(fmacroName,ios::out);
342  if(!out.good()) {cout << "CWB_Plugin_cwb_inet.C - Error : Opening File : " << fmacroName << endl;gSystem->Exit(1);}
343  char line[1024];
344  sprintf(line,"{TFile* ifile = new TFile(\"%s\");TBrowser br(\"CWB\",ifile);}",fName);
345  out << line << endl;
346  out.close();
347 
348  char cmd[1024];
349  // start root browser
350  sprintf(cmd,"root -l %s",fmacroName);
351  cout << cmd << endl; gSystem->Exec(cmd);
352  // remove temporary files
353  sprintf(cmd,"rm %s",fName);
354  cout << cmd << endl; gSystem->Exec(cmd);
355  sprintf(cmd,"rm %s",fmacroName);
356  cout << cmd << endl; gSystem->Exec(cmd);
357  } else {
358  cout << endl << "Dump Sparse : " << fName << endl << endl;
359  }
360 
362  gSystem->Exit(0);
363 }
364 
365 void
366 CWB_Plugin_nRMS(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
367  network* net, WSeries<double>* x, TString ifo, int type) {
368 
369  if(type!=CWB_PLUGIN_ODATA_CONDITIONING) return;
370 
371  // get type : return if not equal to input plugin parameter (type)
372  TString cwb_inet_type = CWB_Plugin_CheckTYPE(cwb_inet_options, jfile, cfg, type);
373  if(cwb_inet_type=="") return;
374 
375  // get ifo : return if not equal to input plugin parameter (ifo)
376  TString cwb_inet_ifo = CWB_Plugin_CheckIFO(cwb_inet_options, jfile, cfg, net, ifo);
377  if(cwb_inet_ifo=="") return;
378 
379  if(x==NULL) {
380  cout << "CWB_Plugin_cwb_inet.C : Error : NULL data " << endl;
381  gSystem->Exit(1);
382  }
383 
384  TString cwb_inet_gps = CWB::Toolbox::getParameter(cwb_inet_options,"--gps");
385  double gps = 0;
386  if(cwb_inet_gps!="") {
387  if(!cwb_inet_gps.IsFloat()) {
388  cout<< "CWB_Plugin_cwb_inet.C : Error : --gps value is not a number" << endl;
389  exit(1);
390  }
391  if(cwb_inet_gps.Atof()>0) gps=cwb_inet_gps.Atof();
392  cout.precision(14);
393  cout << "CWB_Plugin_cwb_inet.C : gps = " << gps << endl;
394  }
395 
396  TString cwb_inet_draw = CWB::Toolbox::getParameter(cwb_inet_options,"--draw");
397  cwb_inet_draw.ToUpper();
398  TString odir = cfg->dump_dir;
399 
400  // get oneside option // default is TRUE
401  TString cwb_inet_oneside = CWB::Toolbox::getParameter(cwb_inet_options,"--oneside");
402  cwb_inet_oneside.ToUpper();
403  if(cwb_inet_oneside=="") cwb_inet_oneside="TRUE";
404  if((cwb_inet_oneside!="TRUE")&&(cwb_inet_oneside!="FALSE")) {
405  cout << "CWB_Plugin_cwb_inet.C : Error : wrong --oneside option , must be true/false" << endl;
406  gSystem->Exit(1);
407  }
408  TString psdtype = (cwb_inet_oneside=="TRUE") ? "oneside" : "doubleside";
409  bool oneside = (cwb_inet_oneside=="TRUE") ? true : false;
410 
411  // get nRMS
412  WSeries<double> nRMS;
413  int nIFO = net->ifoListSize();
414  for(int n=0;n<nIFO;n++) if(ifo==net->getifo(n)->Name) nRMS=net->getifo(n)->nRMS;
415 
416  int levels = nRMS.getLevel()+1; // number of levels
417  int slices = nRMS.size()/levels; // number of nRMS samples
418  double length = slices*cfg->whiteStride; // nRMS len in sec
419 
420  // nRMS do not come from a TF transform
421  // nRMS params must be fixed before to pass to watplot
422  double rate = nRMS.rate();
423  double fNinquist = rate/2.;
424  nRMS.rate(nRMS.size()/length);
425  WDM<double>* wdm = (WDM<double>*) nRMS.pWavelet;
426  wdm->nSTS=nRMS.size();
427 
428  // Plot nRMS Scalogram
429  double start = nRMS.start();
430  double stop = nRMS.start()+nRMS.size()/nRMS.rate();
431  double flow = cfg->fLow;
432  double fhigh = cfg->fHigh;
433 
434  if(gps>0) { // if options --gps value > 0 we extract rms at that time and produce PSD
435 
436  if(gps<start || gps>stop) {
437  cout.precision(14);
438  cout << "CWB_Plugin_cwb_inet.C : Error : --gps value is out of the data range ["
439  << start << ":" << stop << "]" << endl;
440  gSystem->Exit(1);
441  }
442 
443  int M = nRMS.getLevel();
444  const double scale = 1./nRMS.wrate();
445  int igps = (gps-nRMS.start())/scale + 1; // time index
446 
447  // dump nRMS to file
448  char file[1024];
449  double chuncklen=8; // default = 8 sec
450  // get chuncklen options - Example --chuncklen 8
451  TString cwb_inet_chuncklen = CWB::Toolbox::getParameter(cwb_inet_options,"--chuncklen");
452  if(cwb_inet_chuncklen.IsFloat()) chuncklen = cwb_inet_chuncklen.Atof();
453  if(chuncklen==0) chuncklen=x->size()/x->rate()-2*cfg->segEdge; // chuncklen = full buffer
454  sprintf(file,"%s/nrms_%s_gps%10.2f_%s_%s_%d_%s_job%lu.txt",
455  odir.Data(),psdtype.Data(),gps,cwb_inet_type.Data(),ifo.Data(),int(x->start()),cfg->data_label,net->nRun);
456  cout << endl << "Dump nRMS " << "(chuncklen = " << chuncklen << ")"
457  << " : " << file << endl << endl;
458  ofstream out;
459  out.open(file,ios::out);
460  if(!out.good()) {cout << "CWB_Plugin_cwb_inet.C : Error Opening File : " << file << endl;exit(1);}
461 
462  double inRate = cfg->fResample>0 ? cfg->fResample : cfg->inRate;
463  double rescale = oneside ? sqrt(2.)/sqrt(inRate) : 1./sqrt(inRate);
464 
465  double df=fNinquist/M;
466  for(int j=1; j<M; ++j) {
467  double f = j*df+df/2.;
468  if(f<flow || f>fhigh) continue;
469  out << j*df+df/2. << " " << nRMS.data[igps*(M+1)+j]*rescale << endl;
470  }
471  out.close();
472 
473  if(cwb_inet_draw=="TRUE") {
474  TString cwb_inet_save = CWB::Toolbox::getParameter(cwb_inet_options,"--save");
475  cwb_inet_save.ToUpper();
476  int save = cwb_inet_save=="TRUE" ? 1 : 0;
477  TString cwb_inet_range = CWB::Toolbox::getParameter(cwb_inet_options,"--range");
478  cwb_inet_range.ToUpper();
479  int range = cwb_inet_range=="FIX" ? 1 : 0;
480  char cmd[1024];
481  // execute cwb_draw_sensitivity
482  sprintf(cmd,"export CWB_SENSITIVITY_FILE_NAME=\"%s\";",file);
483  sprintf(cmd,"%s export CWB_SENSITIVITY_SAVE_PLOT=%d;",cmd,save);
484  sprintf(cmd,"%s export CWB_SENSITIVITY_RANGE_FIX=%d;",cmd,range);
485  sprintf(cmd,"%s root -n -l ${CWB_MACROS}/cwb_draw_sensitivity.C",cmd);
486  cout << cmd << endl; gSystem->Exec(cmd);
487 
488  // remove temporary files
489  sprintf(cmd,"rm %s",file);
490  cout << cmd << endl; gSystem->Exec(cmd);
491  }
492 
493  } else { // produce the T/F plot of nRMS
494 
495  // open ioutput root file
496  char fName[1024];
497  sprintf(fName,"%s/nRMS_%s_%d_%s_job%lu.root",
498  odir.Data(),ifo.Data(),int(x->start()),cfg->data_label,net->nRun);
499  TFile* ofile = new TFile(fName,"RECREATE");
500  cout << endl << "Dump nRMS : " << fName << endl << endl;
501 
502  watplot* WTS = new watplot(const_cast<char*>("nRMS"));
503  WTS->plot(nRMS, 3, start, stop,const_cast<char*>("COLZ"));
504  WTS->hist2D->GetYaxis()->Set(WTS->hist2D->GetNbinsY(),0, fNinquist); // correct freq range
505  WTS->hist2D->GetYaxis()->SetRangeUser(flow, fhigh);
506  char title[64];
507  sprintf(title,"nRMS TF - ifo:%s", ifo.Data());
508  WTS->hist2D->SetTitle(title);
509  char name[64]; sprintf(name,"%s",ifo.Data());
510  WTS->canvas->SetLogz(true);
511  WTS->canvas->Write(name);
512 // delete WTS; // this instruction is commented because it produces a crash (why?)
513 
514  delete ofile;
515 
516  if(cwb_inet_draw=="TRUE") {
517  // creates a temporary file name
518  char fmacroName[1024];
519  unsigned int Pid = gSystem->GetPid(); // used to tag in a unique way the temporary files
520  sprintf(fmacroName,"%s/CWB_Plugin_cwb_inet_nRMS_macro_%s_%d_job%d.XXXXXX",
521  cfg->tmp_dir,cfg->data_label,Pid,net->nRun);
522  CWB::Toolbox::mksTemp(fmacroName); // create temporary file, must be deleted only at the end of run
523  ofstream out;
524  out.open(fmacroName,ios::out);
525  if(!out.good()) {cout << "CWB_Plugin_cwb_inet.C - Error : Opening File : " << fmacroName << endl;gSystem->Exit(1);}
526  char line[1024];
527  sprintf(line,"{TFile* ifile = new TFile(\"%s\");TBrowser br(\"CWB\",ifile);}",fName);
528  out << line << endl;
529  out.close();
530 
531  char cmd[1024];
532  // start root browser
533  sprintf(cmd,"root -l %s",fmacroName);
534  cout << cmd << endl; gSystem->Exec(cmd);
535  // remove temporary files
536  sprintf(cmd,"rm %s",fName);
537  cout << cmd << endl; gSystem->Exec(cmd);
538  sprintf(cmd,"rm %s",fmacroName);
539  cout << cmd << endl; gSystem->Exec(cmd);
540  }
541  }
542 
544  gSystem->Exit(0);
545 }
546 
547 void
548 CWB_Plugin_wdm(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
549  network* net, WSeries<double>* x, TString ifo, int type) {
550 
551  // get type : return if not equal to input plugin parameter (type)
552  TString cwb_inet_type = CWB_Plugin_CheckTYPE(cwb_inet_options, jfile, cfg, type);
553  if(cwb_inet_type=="") return;
554  cwb_inet_type.ToLower();
555 
556  // get ifo : return if not equal to input plugin parameter (ifo)
557  TString cwb_inet_ifo = CWB_Plugin_CheckIFO(cwb_inet_options, jfile, cfg, net, ifo);
558  if(cwb_inet_ifo=="") return;
559 
560  if(x==NULL) {
561  cout << "CWB_Plugin_cwb_inet.C : Error : NULL data " << endl;
562  gSystem->Exit(1);
563  }
564 
565  watplot* WTS = new watplot(const_cast<char*>("WTS"));
566 
567  wavearray<double> y = *x; // copy original data to y (contains the final handled data)
568  WSeries<double> w; // temporary array for data manipulation
569  Meyer<double> B(1024); // set wavelet for resampling
570  WDM<double>* pwdm = NULL;
571 
572  if(type==CWB_PLUGIN_STRAIN) { // we must apply resampling
573  if(cfg->fResample>0) { // RESAMPLING
574  y.FFTW(1);
575  y.resize(cfg->fResample/y.rate()*y.size());
576  y.FFTW(-1);
577  y.rate(cfg->fResample);
578  }
579  w.Forward(y,B,cfg->levelR);
580  w.getLayer(y,0);
581  }
582 
583  TString cwb_inet_draw = CWB::Toolbox::getParameter(cwb_inet_options,"--draw");
584  cwb_inet_draw.ToUpper();
585  TString odir = cfg->dump_dir;
586 
587  // get draw mode
588  TString cwb_inet_mode = CWB::Toolbox::getParameter(cwb_inet_options,"--mode");
589  int mode = (cwb_inet_mode!="") ? cwb_inet_mode.Atoi() : 2;
590  TString gmode="";
591  if(mode==0) mode=2;
592  if(mode==1) gmode="(E00+E90)/2";
593  if(mode==2) gmode="sqrt((E00+E90)/2)";
594  if(mode==3) gmode="amplitude:00";
595  if(mode==4) gmode="energy:00";
596  if(mode==5) gmode="|amplitude:00|";
597  if(mode==6) gmode="amplitude:90";
598  if(mode==7) gmode="energy:90";
599  if(mode==8) gmode="|amplitude:90|";
600 
601  // open ioutput root file
602  char fName[1024];
603  sprintf(fName,"%s/wdm_%s_%s_%d_%s_job%lu.root",
604  odir.Data(),cwb_inet_type.Data(),ifo.Data(),int(x->start()),cfg->data_label,net->nRun);
605  TFile* ofile = new TFile(fName,"RECREATE");
606  cout << endl << "Dump WDM : " << fName << endl << endl;
607 
608  for(int level=cfg->l_high; level>=cfg->l_low; level--) { // loop over levels
609 
610  // create ifo root directory to store wdm TF
611  char dname[32]; sprintf(dname,"%s:level-%d",ifo.Data(),level);
612  TDirectory* dwdm = ofile->mkdir(dname);
613  dwdm->cd();
614 
615  int layers = level>0 ? 1<<level : 0; // get layers
616  cout << "level : " << level << " layers : " << layers << endl;
617 
618  size_t rateANA=cfg->inRate>>cfg->levelR;
619  int rate = rateANA>>level;
620  double dt = 1000./rate;
621  double df = rateANA/2./double(1<<level);
622  cout << "level : " << level << "\t rate : " << rate
623  << "\t df(hz) : " << df << "\t dt(ms) : " << dt << endl;
624 
625  pwdm = net->getwdm(layers+1); // get pointer to wdm transform
626  if(pwdm==NULL) {
627  cout << "CWB_Plugin_cwb_inet.C : Error - WDM not defined !!!" << endl;
628  gSystem->Exit(1);
629  }
630 
631  w.Forward(y,*pwdm); // apply wdm transformation
632  WSeries<double>* WS = (WSeries<double>*)(&w);
633 
634  // Plot WDM Scalogram
635  double start = WS->start();
636  double stop = WS->start()+WS->size()/WS->rate();
637  double flow = cfg->fLow;
638  double fhigh = cfg->fHigh;
639 
640  WTS->plot(WS, mode, start, stop,const_cast<char*>("COLZ"));
641  WTS->hist2D->GetYaxis()->SetRangeUser(flow, fhigh);
642  char title[64];
643  sprintf(title,"WDM:TF (%s) - ifo:%s - type:%s - level:%d - dt:%g (ms) - df=%g (Hz)",
644  gmode.Data(),ifo.Data(),cwb_inet_type.Data(),level,dt,df);
645  WTS->hist2D->SetTitle(title);
646  char name[64]; sprintf(name,"%s:tf:%s-%d",ifo.Data(),cwb_inet_type.Data(),level);
647  WTS->canvas->Write(name);
648 
649  // Project hist2D to time axis
650  sprintf(name,"%s:t:%s-%d",ifo.Data(),cwb_inet_type.Data(),level);
651  sprintf(title,"WDM:TIME (%s) - ifo:%s - type:%s - level:%d - dt:%g (ms) - df=%g (Hz)",
652  gmode.Data(),ifo.Data(),cwb_inet_type.Data(),level,dt,df);
653  TH1D *tProjH2 = WTS->hist2D->ProjectionX(name);
654  WTS->canvas->Clear();
655  tProjH2->SetTitle(title);
656  tProjH2->SetStats(kFALSE);
657  tProjH2->Draw();
658  WTS->canvas->Write(name);
659 
660  // Project hist2D to frequency axis
661  int hist2D_size = WTS->hist2D->GetNbinsX();
662  int edgeSize = (int)(hist2D_size*cfg->segEdge/(2*cfg->segEdge+cfg->segLen));
663  sprintf(name,"%s:f:%s-%d",ifo.Data(),cwb_inet_type.Data(),level);
664  sprintf(title,"WDM:FREQ (%s) - ifo:%s - type:%s - level:%d - dt:%g (ms) - df=%g (Hz)",
665  gmode.Data(),ifo.Data(),cwb_inet_type.Data(),level,dt,df);
666  TH1D *fProjH2 = WTS->hist2D->ProjectionY(name,edgeSize,hist2D_size-edgeSize);
667  WTS->canvas->Clear();
668  fProjH2->SetTitle(title);
669  fProjH2->SetStats(kFALSE);
670  fProjH2->Draw();
671  WTS->canvas->Write(name);
672 
673  w.Inverse(); // inverse transform
674  y = w; // copy manipulated data to y
675  }
676 
677  delete ofile;
678 // delete WTS; // this instruction is commented because it produces a crash (why?)
679 
680  if(cwb_inet_draw=="TRUE") {
681  // creates a temporary file name
682  char fmacroName[1024];
683  unsigned int Pid = gSystem->GetPid(); // used to tag in a unique way the temporary files
684  sprintf(fmacroName,"%s/CWB_Plugin_cwb_inet_wdm_macro_%s_%d_job%d.XXXXXX",
685  cfg->tmp_dir,cfg->data_label,Pid,net->nRun);
686  CWB::Toolbox::mksTemp(fmacroName); // create temporary file, must be deleted only at the end of run
687  ofstream out;
688  out.open(fmacroName,ios::out);
689  if(!out.good()) {cout << "CWB_Plugin_cwb_inet.C - Error : Opening File : " << fmacroName << endl;gSystem->Exit(1);}
690  char line[1024];
691  sprintf(line,"{TFile* ifile = new TFile(\"%s\");TBrowser br(\"CWB\",ifile);}",fName);
692  out << line << endl;
693  out.close();
694 
695  char cmd[1024];
696  // start root browser
697  sprintf(cmd,"root -l %s",fmacroName);
698  cout << cmd << endl; gSystem->Exec(cmd);
699  // remove temporary files
700  sprintf(cmd,"rm %s",fName);
701  cout << cmd << endl; gSystem->Exec(cmd);
702  sprintf(cmd,"rm %s",fmacroName);
703  cout << cmd << endl; gSystem->Exec(cmd);
704  }
705 
707  gSystem->Exit(0);
708 }
709 
710 void
711 CWB_Plugin_emax(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
712  network* net, WSeries<double>* xdummy, TString sdummy, int type) {
713 
714  if(type!=CWB_PLUGIN_XCOHERENCE) return;
715 
716  // import factor
717  int gIFACTOR=-1; IMPORT(int,gIFACTOR)
718  // import resolution
719  size_t gILEVEL=-1; IMPORT(size_t,gILEVEL)
720 
721  // get level : if level>0 then select only one level
722  TString cwb_inet_level = CWB::Toolbox::getParameter(cwb_inet_options,"--level");
723  int ilevel = cwb_inet_level.Atoi();
724  if(ilevel>0 && ilevel!=gILEVEL) return;
725 
726  TString cwb_inet_draw = CWB::Toolbox::getParameter(cwb_inet_options,"--draw");
727  cwb_inet_draw.ToUpper();
728  TString odir = cfg->dump_dir;
729 
730  int level = gILEVEL;
731  int layers = level>0 ? 1<<level : 0; // get layers
732 
733  size_t rateANA=cfg->inRate>>cfg->levelR;
734  int rate = rateANA>>level;
735  double dt = 1000./rate;
736  double df = rateANA/2./double(1<<level);
737  cout << "level : " << level << "\t rate(hz) : " << rate << "\t layers : " << layers
738  << "\t df(hz) : " << df << "\t dt(ms) : " << dt << endl;
739 
740  int nIFO = net->ifoListSize();
741  detector* pD[NIFO_MAX]; // pointers to detectors
742  for(int n=0;n<nIFO;n++) pD[n] = net->getifo(n);
743 
744  // open ioutput root file
745  char fName[1024];
746  sprintf(fName,"%s/emax_%d_%s_job%lu.root",
747  odir.Data(),int(pD[0]->getTFmap()->start()),cfg->data_label,net->nRun);
748  TFile* ofile = (ilevel||level==cfg->l_high) ? new TFile(fName,"RECREATE") : new TFile(fName,"UPDATE");
749  if(ofile==NULL||!ofile->IsOpen())
750  {cout << "CWB_Plugin_cwb_inet.C - Error opening : " << fName << endl;exit(1);}
751  cout << endl << "Dump EMAX : " << fName << endl << endl;
752 
753  watplot WTS(const_cast<char*>("WTS"));
754 
755  bool singleDetector = false;
756  if(nIFO==2 && TString(pD[1]->Name)==pD[0]->Name) singleDetector=true;
757 
758  WSeries<double> WSE = *pD[0]->getTFmap();
759  for(int n=0; n<=nIFO; n++) { // produce TF maps with max over the sky energy
760 
761  if(n<nIFO) WSE.add(*pD[n]->getTFmap()); // produce TF maps with sum of energy over the ifo
762 
763  TString ifo = n==nIFO ? "NET" : net->ifoName[n];
764 
765  // create ifo root directory to store emax TF
766  TDirectory* demax = ofile->mkdir(ifo.Data());
767  demax->cd();
768 
769  WSeries<double>* WS = n==nIFO ? &WSE : pD[n]->getTFmap();
770 
771  //scalogram maps
772  double start = WS->start()+cfg->segEdge;
773  double stop = WS->start()+WS->size()/WS->rate()-cfg->segEdge;
774  double flow = cfg->fLow;
775  double fhigh = cfg->fHigh;
776  WTS.plot(*WS, 0, start, stop,const_cast<char*>("COLZ"));
777  WTS.hist2D->GetYaxis()->SetRangeUser(flow, fhigh);
778 
779  // Dump EMAX Scalogram
780  char title[64];
781  sprintf(title,"EMAX:TF (energy) - ifo:%s - factor:%d - level:%d - dt:%g (ms) - df=%g (Hz)",
782  ifo.Data(),gIFACTOR,level,dt,df);
783  WTS.hist2D->SetTitle(title);
784  char name[64]; sprintf(name,"%s:tf:%d-%d",ifo.Data(),gIFACTOR,level);
785  WTS.canvas->Write(name);
786 
787  // Project hist2D to time axis
788  sprintf(name,"%s:t:%d-%d",ifo.Data(),gIFACTOR,level);
789  sprintf(title,"EMAX:TIME (energy) - ifo:%s - factor:%d - level:%d - dt:%g (ms) - df=%g (Hz)",
790  ifo.Data(),gIFACTOR,level,dt,df);
791  TH1D *tProjH2 = WTS.hist2D->ProjectionX(name);
792  WTS.canvas->Clear();
793  tProjH2->SetTitle(title);
794  tProjH2->SetStats(kFALSE);
795  tProjH2->Draw();
796  WTS.canvas->Write(name);
797 
798  // Project hist2D to frequency axis
799  int hist2D_size = WTS.hist2D->GetNbinsX();
800  int edgeSize = (int)(hist2D_size*cfg->segEdge/(2*cfg->segEdge+cfg->segLen));
801  sprintf(name,"%s:f:%d-%d",ifo.Data(),gIFACTOR,level);
802  sprintf(title,"EMAX:FREQ (energy) - ifo:%s - factor:%d - level:%d - dt:%g (ms) - df=%g (Hz)",
803  ifo.Data(),gIFACTOR,level,dt,df);
804  TH1D *fProjH2 = WTS.hist2D->ProjectionY(name,edgeSize,hist2D_size-edgeSize);
805  WTS.canvas->Clear();
806  fProjH2->SetTitle(title);
807  fProjH2->SetStats(kFALSE);
808  fProjH2->Draw();
809  WTS.canvas->Write(name);
810 
811  if(singleDetector) break;
812  }
813 
814  delete ofile;
815 
816  if(!ilevel && level!=cfg->l_low) return;
817 
818  if(cwb_inet_draw=="TRUE") {
819  // creates a temporary file name
820  char fmacroName[1024];
821  unsigned int Pid = gSystem->GetPid(); // used to tag in a unique way the temporary files
822  sprintf(fmacroName,"%s/CWB_Plugin_cwb_inet_wdm_macro_%s_%d_job%d.XXXXXX",
823  cfg->tmp_dir,cfg->data_label,Pid,net->nRun);
824  CWB::Toolbox::mksTemp(fmacroName); // create temporary file, must be deleted only at the end of run
825  ofstream out;
826  out.open(fmacroName,ios::out);
827  if(!out.good()) {cout << "CWB_Plugin_cwb_inet.C - Error : Opening File : " << fmacroName << endl;gSystem->Exit(1);}
828  char line[1024];
829  sprintf(line,"{TFile* ifile = new TFile(\"%s\");TBrowser br(\"CWB\",ifile);}",fName);
830  out << line << endl;
831  out.close();
832 
833  char cmd[1024];
834  // start root browser
835  sprintf(cmd,"root -l %s",fmacroName);
836  cout << cmd << endl; gSystem->Exec(cmd);
837  // remove temporary files
838  sprintf(cmd,"rm %s",fName);
839  cout << cmd << endl; gSystem->Exec(cmd);
840  sprintf(cmd,"rm %s",fmacroName);
841  cout << cmd << endl; gSystem->Exec(cmd);
842  }
843 
845  gSystem->Exit(0);
846 }
847 
848 void
849 CWB_Plugin_psd(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
850  network* net, WSeries<double>* x, TString ifo, int type) {
851 
852  // get type : return if not equal to input plugin parameter (type)
853  TString cwb_inet_type = CWB_Plugin_CheckTYPE(cwb_inet_options, jfile, cfg, type);
854  if(cwb_inet_type=="") return;
855 
856  // get ifo : return if not equal to input plugin parameter (ifo)
857  TString cwb_inet_ifo = CWB_Plugin_CheckIFO(cwb_inet_options, jfile, cfg, net, ifo);
858  if(cwb_inet_ifo=="") return;
859 
860  if(x==NULL) {
861  cout << "CWB_Plugin_cwb_inet.C : Error : NULL data " << endl;
862  gSystem->Exit(1);
863  }
864 
865  TString cwb_inet_draw = CWB::Toolbox::getParameter(cwb_inet_options,"--draw");
866  cwb_inet_draw.ToUpper();
867  TString odir = cfg->dump_dir;
868  //TString odir = (cwb_inet_draw=="TRUE") ? cfg->tmp_dir : cfg->dump_dir;
869 
870  double chuncklen=8; // default = 8 sec
871  // get chuncklen options - Example --chuncklen 8
872  TString cwb_inet_chuncklen = CWB::Toolbox::getParameter(cwb_inet_options,"--chuncklen");
873  if(cwb_inet_chuncklen.IsFloat()) chuncklen = cwb_inet_chuncklen.Atof();
874  if(chuncklen==0) chuncklen=x->size()/x->rate()-2*cfg->segEdge; // chuncklen = full buffer
875 
876  // get oneside option // default is TRUE
877  TString cwb_inet_oneside = CWB::Toolbox::getParameter(cwb_inet_options,"--oneside");
878  cwb_inet_oneside.ToUpper();
879  if(cwb_inet_oneside=="") cwb_inet_oneside="TRUE";
880  if((cwb_inet_oneside!="TRUE")&&(cwb_inet_oneside!="FALSE")) {
881  cout << "CWB_Plugin_cwb_inet.C : Error : wrong --oneside option , must be true/false" << endl;
882  gSystem->Exit(1);
883  }
884  TString psdtype = (cwb_inet_oneside=="TRUE") ? "oneside" : "doubleside";
885  bool oneside = (cwb_inet_oneside=="TRUE") ? true : false;
886 
887  char file[1024];
888  sprintf(file,"%s/psd_%s_%s_%s_%d_%s_job%lu.txt",
889  odir.Data(),psdtype.Data(),cwb_inet_type.Data(),ifo.Data(),int(x->start()),cfg->data_label,net->nRun);
890  cout << endl << "Dump PSD " << "(chuncklen = " << chuncklen << ")"
891  << " : " << file << endl << endl;
892  CWB::Toolbox::makeSpectrum(file, *x, chuncklen, cfg->segEdge, oneside); // dump spectrum
893 
894  if(cwb_inet_draw=="TRUE") {
895  TString cwb_inet_save = CWB::Toolbox::getParameter(cwb_inet_options,"--save");
896  cwb_inet_save.ToUpper();
897  int save = cwb_inet_save=="TRUE" ? 1 : 0;
898  TString cwb_inet_range = CWB::Toolbox::getParameter(cwb_inet_options,"--range");
899  cwb_inet_range.ToUpper();
900  int range = cwb_inet_range=="FIX" ? 1 : 0;
901  char cmd[1024];
902  // execute cwb_draw_sensitivity
903  sprintf(cmd,"export CWB_SENSITIVITY_FILE_NAME=\"%s\";",file);
904  sprintf(cmd,"%s export CWB_SENSITIVITY_SAVE_PLOT=%d;",cmd,save);
905  sprintf(cmd,"%s export CWB_SENSITIVITY_RANGE_FIX=%d;",cmd,range);
906  sprintf(cmd,"%s root -n -l ${CWB_MACROS}/cwb_draw_sensitivity.C",cmd);
907  cout << cmd << endl; gSystem->Exec(cmd);
908 
909  // remove temporary files
910  sprintf(cmd,"rm %s",file);
911  cout << cmd << endl; gSystem->Exec(cmd);
912  }
913 
915  gSystem->Exit(0);
916 }
917 
918 void
919 CWB_Plugin_inj(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
920  network* net, WSeries<double>* x, TString ifo, int type) {
921 
922  if(type!=CWB_PLUGIN_OREADDATA) return;
923 
924  TString cwb_inet_draw = CWB::Toolbox::getParameter(cwb_inet_options,"--draw");
925  cwb_inet_draw.ToUpper();
926  TString odir = cfg->dump_dir;
927 
928  int nIFO = net->ifoListSize();
929  detector* pD[NIFO_MAX]; // pointers to detectors
930  for(int n=0;n<nIFO;n++) pD[n] = net->getifo(n);
931 
932  // open ioutput root file
933  char fName[1024];
934  sprintf(fName,"%s/inj_%d_%s_job%lu.root",
935  odir.Data(),int(pD[0]->getTFmap()->start()),cfg->data_label,net->nRun);
936  TFile* ofile = new TFile(fName,"RECREATE");
937  if(ofile==NULL||!ofile->IsOpen())
938  {cout << "CWB_Plugin_cwb_inet.C - Error opening : " << fName << endl;exit(1);}
939  cout << endl << "Dump INJ : " << fName << endl << endl;
940 
941  for(int n=0;n<nIFO;n++) {
942 
943  // create ifo root directory to store injections
944  TDirectory* dinj = ofile->mkdir(pD[n]->Name);
945  dinj->cd();
946 
947  wavearray<double> w = pD[n]->HoT;
948  std::vector<double>* pT = net->getmdcTime();
949  double dT = cfg->iwindow/2.;
950  double offset = cfg->segEdge;
951 
952  int j,nstop,nstrt;
953  size_t k;
954  double F,T;
955  size_t K = pT->size();
956  size_t N = w.size();
957  double rate = w.rate(); // simulation rate
958 
959  dT = fabs(dT);
960 
961  // isolate injections
962  for(k=0; k<K; k++) {
963 
964  T = (*pT)[k] - w.start();
965 
966  nstrt = int((T - dT)*rate);
967  nstop = int((T + dT)*rate);
968  if(nstrt<=0) nstrt = 0;
969  if(nstop>=int(N)) nstop = N;
970  if(nstop<=0) continue; // outside of the segment
971  if(nstrt>=int(N)) continue; // outside of the segment
972 
973  gwavearray<double> gx(nstop-nstrt);
974  gx.rate(rate);
975  gx.start(0);
976 
977  for(j=nstrt; j<nstop; j++) gx.data[j-nstrt]=w.data[j];
978  gx.SetComment(net->mdcList[k]);
979  char name[256];sprintf(name,"%s:%2.2f",pD[n]->Name,nstrt/rate);
980  gx.Write(name);
981  }
982  }
983  delete ofile;
984 
985  if(cwb_inet_draw=="TRUE") {
986  // creates a temporary file name
987  char fmacroName[1024];
988  unsigned int Pid = gSystem->GetPid(); // used to tag in a unique way the temporary files
989  sprintf(fmacroName,"%s/CWB_Plugin_cwb_inet_wdm_macro_%s_%d_job%d.XXXXXX",
990  cfg->tmp_dir,cfg->data_label,Pid,net->nRun);
991  CWB::Toolbox::mksTemp(fmacroName); // create temporary file, must be deleted only at the end of run
992  ofstream out;
993  out.open(fmacroName,ios::out);
994  if(!out.good()) {cout << "CWB_Plugin_cwb_inet.C - Error : Opening File : " << fmacroName << endl;gSystem->Exit(1);}
995  char line[1024];
996  sprintf(line,"{TFile* ifile = new TFile(\"%s\");TBrowser br(\"CWB\",ifile);}",fName);
997  out << line << endl;
998  out.close();
999 
1000  char cmd[1024];
1001  // start root browser
1002  sprintf(cmd,"root -l %s",fmacroName);
1003  cout << cmd << endl; gSystem->Exec(cmd);
1004  // remove temporary files
1005  sprintf(cmd,"rm %s",fName);
1006  cout << cmd << endl; gSystem->Exec(cmd);
1007  sprintf(cmd,"rm %s",fmacroName);
1008  cout << cmd << endl; gSystem->Exec(cmd);
1009  }
1010 
1011  CWB_Plugin_RemoveTemporaryFiles(jfile, cfg);
1012  gSystem->Exit(0);
1013 }
1014 
1015 void
1016 CWB_Plugin_frdisplay(TString cwb_inet_options, TFile* jfile, CWB::config* cfg,
1017  network* net, WSeries<double>* x, TString ifo, int type) {
1018 
1019  // get type : return if not equal to input plugin parameter (type)
1020  TString cwb_inet_type = CWB_Plugin_CheckTYPE(cwb_inet_options, jfile, cfg, type);
1021  if(cwb_inet_type=="") return;
1022 
1023  // get ifo : return if not equal to input plugin parameter (ifo)
1024  TString cwb_inet_ifo = CWB_Plugin_CheckIFO(cwb_inet_options, jfile, cfg, net, ifo);
1025  if(cwb_inet_ifo=="") return;
1026 
1027  if(x==NULL) {
1028  cout << "CWB_Plugin_cwb_inet.C : Error : NULL data " << endl;
1029  gSystem->Exit(1);
1030  }
1031 
1032  // get ifo index
1033  int ifoID =0; for(int n=0;n<cfg->nIFO;n++) if(ifo==net->getifo(n)->Name) {ifoID=n;break;}
1034 
1035  // get frdisplay directory
1036  TString home_frdisplay="";
1037  if(gSystem->Getenv("HOME_FRDISPLAY")==NULL) {
1038  cout << "Error : environment HOME_FRDISPLAY is not defined!!!" << endl;
1039  gSystem->Exit(1);
1040  } else {
1041  home_frdisplay=TString(gSystem->Getenv("HOME_FRDISPLAY"));
1042  }
1043  cout << "home_frdisplay : " << home_frdisplay.Data() << endl;
1044 
1045  // get data buffer start,stop
1046  int job_start = x->start();
1047  int job_stop = x->stop();
1048  cout << "job_start : " << job_start << " job_stop : " << job_stop << endl;
1049 
1050  // prepare frame list format for frdisplay
1051  gRandom->SetSeed(0);
1052  int rnID = gRandom->Uniform(0,10000000); // random name ID
1053 
1054  // write temporary frame file
1055  char chName[64]; sprintf(chName,"%s",cfg->channelNamesRaw[ifoID]);
1056  char frLabel[64]; sprintf(frLabel,"CWB_Plugin_cwb_inet_%s_%s_%d",ifo.Data(),cwb_inet_type.Data(),rnID);
1057  TString frFile = CWB::Toolbox::WriteFrameFile(*x, chName, "FRDISPLAY", frLabel, cfg->tmp_dir);
1058 
1059  // write temporary ffl file
1060  char ffl[1024];
1061  sprintf(ffl,"%s/CWB_Plugin_cwb_inet_%s_%s_%d.ffl",cfg->tmp_dir,ifo.Data(),cwb_inet_type.Data(),rnID);
1062  cout << "ffl : " << ffl << endl;
1063 
1064  ofstream out;
1065  out.open(ffl,ios::out);
1066  if (!out.good()) {cout << "Error Opening File : " << ffl << endl;gSystem->Exit(1);}
1067  out << frFile.Data() << " " << job_start << " " << job_stop-job_start << " " << 0 << " " << 0 << endl;
1068  cout << frFile.Data() << endl;
1069  out.close();
1070 
1071  // build cmd frdisplay command
1072  char cmd[1024];
1073  sprintf(cmd,"%s/FrDisplay -d 5 -proc -t %s -i %s",home_frdisplay.Data(),chName,ffl);
1074 
1075  // get filter options - Example --filter 50,
1076  TString cwb_inet_hpf = CWB::Toolbox::getParameter(cwb_inet_options,"--hpf");
1077  if(cwb_inet_hpf!="") sprintf(cmd,"%s -k \"-Bu -Hp -o 6 -a %s\"",cmd,cwb_inet_hpf.Data());
1078 
1079  char xoptions[256]="";
1080  // get decimateby options - Example --decimateby 16
1081  TString cwb_inet_decimateby = CWB::Toolbox::getParameter(cwb_inet_options,"--decimateby");
1082  if(cwb_inet_decimateby!="") sprintf(xoptions,"%s -decimateby %s",xoptions,cwb_inet_decimateby.Data());
1083  // get -downmix options - Example --downmix 400
1084  TString cwb_inet_downmix = CWB::Toolbox::getParameter(cwb_inet_options,"--downmix");
1085  if(cwb_inet_downmix!="") sprintf(xoptions,"%s -downmix %s",xoptions,cwb_inet_downmix.Data());
1086  // get -uscaleby options - Example --uscaleby 0.5
1087  TString cwb_inet_uscaleby = CWB::Toolbox::getParameter(cwb_inet_options,"--uscaleby");
1088  if(cwb_inet_uscaleby!="") sprintf(xoptions,"%s -uscaleby %s",xoptions,cwb_inet_uscaleby.Data());
1089  // get -decimategain options - Example --decimategain 48
1090  TString cwb_inet_decimategain = CWB::Toolbox::getParameter(cwb_inet_options,"--decimategain");
1091  if(cwb_inet_decimategain!="") sprintf(xoptions,"%s -decimategain %s",xoptions,cwb_inet_decimategain.Data());
1092 
1093  // execute frdisplay command
1094  if(TString(xoptions)!="") sprintf(cmd,"%s -x \"%s\"",cmd,xoptions);
1095  cout << cmd << endl; gSystem->Exec(cmd);
1096 
1097  // remove temporary files
1098  sprintf(cmd,"rm %s %s",ffl,frFile.Data());
1099  cout << cmd << endl; gSystem->Exec(cmd);
1100 
1101  CWB_Plugin_RemoveTemporaryFiles(jfile, cfg);
1102  gSystem->Exit(0);
1103 }
1104 
1105 TString
1106 CWB_Plugin_CheckTYPE(TString cwb_inet_options, TFile* jfile, CWB::config* cfg, TString type) {
1107 
1108  // get type : return if not equal to input plugin parameter (type)
1109  TString cwb_inet_type = CWB::Toolbox::getParameter(cwb_inet_options,"--type");
1110  cwb_inet_type.ToUpper();
1111  if((cwb_inet_type=="STRAIN")||(cwb_inet_type=="MDC")||(cwb_inet_type=="WHITE")||
1112  (cwb_inet_type=="SUPERCLUSTER")||(cwb_inet_type=="LIKELIHOOD")) {
1113  bool selected=false;
1114  if((type==CWB_PLUGIN_DATA) &&(cwb_inet_type=="STRAIN")) selected=true;
1115  if((type==CWB_PLUGIN_MDC) &&(cwb_inet_type=="MDC")) selected=true;
1116  if((type==CWB_PLUGIN_WHITE) &&(cwb_inet_type=="WHITE")) selected=true;
1117  if((type==CWB_PLUGIN_IDATA_CONDITIONING)&&(cwb_inet_type=="STRAIN")) selected=true;
1118  if((type==CWB_PLUGIN_ODATA_CONDITIONING)&&(cwb_inet_type=="STRAIN")) selected=true;
1119  if((type==CWB_PLUGIN_ISUPERCLUSTER)&&(cwb_inet_type=="SUPERCLUSTER")) selected=true;
1120  if((type==CWB_PLUGIN_ILIKELIHOOD) &&(cwb_inet_type=="LIKELIHOOD")) selected=true;
1121  if(!selected) return "";
1122  } else {
1123  cout << "CWB_Plugin_cwb_inet.C : Option error --type " << cwb_inet_type << endl << endl;
1124  cout << "Select : --type strain/mdc/white/supercluster/likelihood" << endl << endl;
1125  CWB_Plugin_RemoveTemporaryFiles(jfile, cfg);
1126  gSystem->Exit(1);
1127  }
1128 
1129  return cwb_inet_type;
1130 }
1131 
1132 TString
1134 
1135  // get ifo : return if not equal to input plugin parameter (ifo)
1136  TString cwb_inet_ifo = CWB::Toolbox::getParameter(cwb_inet_options,"--ifo");
1137  cwb_inet_ifo.ToUpper();
1138  // check if ifo is in the network
1139  bool isPresentIFO=false;
1140  for(int n=0;n<cfg->nIFO;n++) if(cwb_inet_ifo==net->getifo(n)->Name) isPresentIFO=true;
1141  if(isPresentIFO) {
1142  if(ifo!="0") if(cwb_inet_ifo!=ifo) return "";
1143  } else {
1144  cout << "CWB_Plugin_cwb_inet.C : Option error --ifo " << cwb_inet_ifo << endl;
1145  char ifo_opts[32];strcpy(ifo_opts,net->getifo(0)->Name);
1146  for(int n=1;n<cfg->nIFO;n++) sprintf(ifo_opts,"%s/%s",ifo_opts,net->getifo(n)->Name);
1147  cout << "Select : --ifo " << ifo_opts << endl << endl;
1148  CWB_Plugin_RemoveTemporaryFiles(jfile, cfg);
1149  gSystem->Exit(1);
1150  }
1151 
1152  return cwb_inet_ifo;
1153 }
1154 
1155 void
1157 
1158  // remove temporary job file
1159  if(jfile) {
1160  TString jname = jfile->GetPath();
1161  bool remove = true;
1162  if(jname.Contains("init_")) remove=false;
1163  if(jname.Contains("strain_")) remove=false;
1164  if(jname.Contains("cstrain_")) remove=false;
1165  if(jname.Contains("coherence_")) remove=false;
1166  if(jname.Contains("supercluster_")) remove=false;
1167  if(jname.Contains("likelihood_")) remove=false;
1168  if(remove) {
1169  jname.ReplaceAll(":/","");
1170  //cout << jname.Data() << endl;
1171  gSystem->Exec(TString("rm "+jname).Data());
1172  }
1173  }
1174 
1175  // remove temporary plugin file
1176  gSystem->Exec((TString("rm ")+cfg->plugin.GetTitle()).Data());
1177 
1178  // remove temporary plugin config file
1179  TString configPluginName = cfg->configPlugin.GetTitle();
1180  if(configPluginName!="")
1181  gSystem->Exec((TString("rm ")+configPluginName).Data());
1182 
1183  // search output root file in the system list
1184  // & remove output root file
1185  TList *files = (TList*)gROOT->GetListOfFiles();
1186  if(files) {
1187  TIter next(files);
1188  TSystemFile *file;
1189  while ((file=(TSystemFile*)next())) {
1190  TString fname = file->GetName();
1191  if(fname.Contains("wave_")) gSystem->Exec((TString("rm ")+fname).Data());
1192  }
1193  }
1194 }
char ofile[1024]
std::vector< char * > ifoName
Definition: network.hh:609
CWB_JOBF_OPTIONS jobfOptions
Definition: config.hh:291
detector * getifo(size_t n)
param: detector index
Definition: network.hh:436
CWB::config * cfg
char analysis[8]
Definition: config.hh:117
double iwindow
Definition: config.hh:200
int job_start
Definition: cwb_frdisplay.C:82
int slices
double M
Definition: DrawEBHH.C:13
void CWB_Plugin_psd(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
TMacro configPlugin
Definition: config.hh:362
std::vector< double > * getmdcTime()
Definition: network.hh:422
wavearray< double > HoT
Definition: detector.hh:350
int offset
Definition: TestSTFT_2.C:19
virtual void rate(double r)
Definition: wavearray.hh:141
void CWB_Plugin_emax(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *xdummy, TString sdummy, int type)
CWB_JOBF_OPTIONS
Definition: config.hh:55
int error
Definition: cwb_compile.C:43
static TString WriteFrameFile(wavearray< double > x, TString chName, TString frName, TString frLabel, TString frDir="")
Definition: Toolbox.cc:7092
par [0] name
#define B
int n
Definition: cwb_net.C:28
TString("c")
size_t nRun
Definition: network.hh:572
ofstream out
Definition: cwb_merge.C:214
void CWB_Plugin_RemoveTemporaryFiles(TFile *jfile, CWB::config *cfg)
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
double fLow
Definition: config.hh:140
char odir[1024]
WDM< double > wdm(nLAYERS, nLAYERS, 6, 10)
void add(const wavearray< DataType_t > &, int=0, int=0, int=0)
Definition: wavearray.cc:746
static int mksTemp(char *fTemplate)
Definition: Toolbox.hh:341
bool cedDump
Definition: config.hh:297
std::vector< SSeries< double > > vSS[NIFO_MAX]
CWB_JOBF_OPTIONS jobfOptions
int layers
virtual void start(double s)
Definition: wavearray.hh:137
int j
Definition: cwb_net.C:28
i drho i
void plot(wavearray< double > &, char *=NULL, int=1, double=0., double=0., bool=false, float=0., float=0., bool=false, float=0., bool=false)
Definition: watplot.cc:150
#define N
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
Definition: ComputeSNR.C:75
char ifo[NIFO_MAX][8]
network ** net
NOISE_MDC_SIMULATION.
TH2F * hist2D
Definition: watplot.hh:193
size_t ifoListSize()
Definition: network.hh:431
void CWB_Plugin_wdm(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
WDM< double > * getwdm(size_t M)
param: number of wdm layers
Definition: network.hh:448
bool singleDetector
size_t mode
wavearray< double > w
Definition: Test1.C:27
double segEdge
Definition: config.hh:164
#define nIFO
void wrate(double r)
Definition: wseries.hh:120
virtual size_t size() const
Definition: wavearray.hh:145
TCanvas * canvas
Definition: watplot.hh:192
int getLevel()
Definition: wseries.hh:109
TString chName[NIFO_MAX]
size_t fResample
Definition: config.hh:142
void CWB_Plugin_frdisplay(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
jfile
Definition: cwb_job_obj.C:43
unsigned long nSTS
Definition: WaveDWT.hh:143
static TString GetStageString(CWB_STAGE jstage)
Definition: cwb.cc:2206
int l_high
Definition: config.hh:156
#define IMPORT(TYPE, VAR)
Definition: cwb.hh:69
WSeries< double > nRMS
Definition: detector.hh:358
watplot * WTS
Definition: ChirpMass.C:119
i() int(T_cor *100))
gwavearray< double > * gx
void CWB_Plugin_ced(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, TString ifo, int type)
void CWB_Plugin_sparse(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, TString ifo, int type)
std::vector< std::string > mdcList
Definition: network.hh:612
const int NIFO_MAX
Definition: wat.hh:22
double fhigh
char tmp_dir[1024]
Definition: config.hh:325
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
Definition: wseries.cc:193
TIter next(twave->GetListOfBranches())
char fname[1024]
void CWB_Plugin_nRMS(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
TString CWB_Plugin_CheckIFO(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, TString ifo)
char channelNamesRaw[NIFO_MAX][50]
Definition: config.hh:310
int k
void SetComment(TString comment)
Definition: gwavearray.hh:95
double F
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
COHERENCE.
size_t rateANA
Definition: test_config1.C:21
double dt
virtual void FFTW(int=1)
Definition: wavearray.cc:896
double flow
int l_low
Definition: config.hh:155
int job_stop
Definition: cwb_frdisplay.C:83
void CWB_Plugin_inj(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, network *net, WSeries< double > *x, TString ifo, int type)
char title[256]
Definition: SSeriesExample.C:1
double gps
double T
Definition: testWDM_4.C:11
double whiteStride
Definition: config.hh:190
static TString getParameter(TString options, TString param="")
Definition: Toolbox.cc:6727
double fHigh
Definition: config.hh:141
WSeries< double > * getTFmap()
param: no parameters
Definition: detector.hh:179
Definition: Meyer.hh:36
char Name[16]
Definition: detector.hh:327
virtual void stop(double s)
Definition: wavearray.hh:139
TMacro plugin
Definition: config.hh:361
double fabs(const Complex &x)
Definition: numpy.cc:55
int gIFACTOR
double segLen
Definition: config.hh:161
char dump_dir[1024]
Definition: config.hh:328
char cmd[1024]
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:246
strcpy(RunLabel, RUN_LABEL)
double df
static void makeSpectrum(wavearray< double > &psd, wavearray< double > x, double chuncklen=8, double scratchlen=0, bool oneside=true)
Definition: Toolbox.cc:5489
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
int nIFO
Definition: config.hh:120
DataType_t * data
Definition: wavearray.hh:319
TString CWB_Plugin_CheckTYPE(TString cwb_inet_options, TFile *jfile, CWB::config *cfg, TString type)
TString jname
WaveDWT< DataType_t > * pWavelet
Definition: wseries.hh:456
double dT
Definition: testWDM_5.C:12
bool save
cout<< "live time after cat 2 : "<< detSegs_ctime<< endl;if(detSegs_ctime< segTHR) {cout<< "job segment live time after cat2 < "<< segTHR<< " sec, job terminated !!!"<< endl;exit(1);} double Tb=detSegs[0].start;double Te=detSegs[0].stop;double dT=Te-Tb;char file[512], tdf00[512], tdf90[512], buFFer[1024];int rnID=int(gRandom->Rndm(13) *1.e9);if(simulation) { i=NET.readMDClog(injectionList, double(long(Tb)) -mdcShift);printf("GPS: %16.6f saved, injections: %d\", double(long(Tb)), i);frTB[nIFO].shiftBurstMDCLog(NET.mdcList, ifos, mdcShift);for(int i=0;i< NET.mdcTime.size();i++) NET.mdcTime[i]+=mdcShift;vector< waveSegment > mdcSegs(NET.mdcTime.size());for(int k=0;k< NET.mdcTime.size();k++) {mdcSegs[k].start=NET.mdcTime[k]-gap;mdcSegs[k].stop=NET.mdcTime[k]+gap;} vector< waveSegment > mdcSegs_dq2=slagTB.mergeSegLists(detSegs_dq2, mdcSegs);double mdcSegs_ctime=slagTB.getTimeSegList(mdcSegs_dq2);cout<< "live time in zero lag after cat2+inj : "<< mdcSegs_ctime<< endl;if(mdcSegs_ctime==0) {cout<< "job segment with zero cat2+inj live time in zero lag, job terminated !!!"<< endl;exit(1);} } if(dump_infos_and_exit) exit(0);if(mask >0.) NET.setSkyMask(mask, skyMaskFile);for(i=0;i< nIFO;i++) { frTB[i].readFrames(FRF[i], channelNamesRaw[i], x);x.start(x.start()+dataShift[i]);x.start(x.start() -segLen *(segID[i]-segID[0]));if(singleDetector) TB.resampleToPowerOfTwo(x);sprintf(file,"%s/%s_%d_%s_%d_%d.dat", nodedir, ifo[i], int(Tb), data_label, runID, rnID);if(dump_sensitivity_and_exit) { sprintf(file,"%s/sensitivity_%s_%d_%s_job%d.txt", dump_dir, ifo[i], int(Tb), data_label, runID);cout<< endl<< "Dump Sensitivity : "<< file<< endl<< endl;TB.makeSpectrum(file, x);continue;} if(dcCal[i]>0.) x *=dcCal[i];if(fResample >0) { x.FFT(1);x.resize(fResample/x.rate() *x.size());x.FFT(-1);x.rate(fResample);} pTF[i]=pD[i]-> getTFmap()
char line[1024]
char data_label[1024]
Definition: config.hh:332
std::vector< SSeries< double > > vSS
Definition: detector.hh:352
char fName[256]
virtual void resize(unsigned int)
Definition: wavearray.cc:463
int check
double length
Definition: TestBandPass.C:18
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
size_t inRate
Definition: config.hh:132
TString frLabel[NIFO_MAX]
int levelR
Definition: config.hh:152
detector ** pD
CWB_STAGE
Definition: cwb.hh:122
exit(0)