Logo coherent WaveBurst  
Library Reference Guide
Logo
CWB_Plugin_CE.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2020 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 "mdc.hh"
33 #include "gwavearray.hh"
34 #include <vector>
35 
36 // ---------------------------------------------------------------------------------
37 // WHAT IS?
38 // this plugin can be used in simulation mode to apply calibration errors to the injected signals
39 // HOW TO CONFIGURE THE CE PLUGIN
40 // the following is an example : must be included in the config/user_parameters.C file
41 // see the DumpUserOptions function for the full description of parameters
42 // ---------------------------------------------------------------------------------
43 /*
44  plugin = TMacro(gSystem->ExpandPathName("$HOME_CWB/plugins/CWB_Plugin_CE.C")); // Macro source
45 
46  TString optce = ""; // NOTE : add space at the end of each line
47  optce += "ce_type=uniform "; // calibration error type -> det 1
48  optce += "ce_eamp=0.1 "; // max percentage -> amplitude miscalibration (uniform in -0.9,+1.1) -> det 1
49  optce += "ce_ephs=10 "; // max phase (degrees) -> phase miscalibration (uniform in -10,+10) -> det 1
50  optce += "ce_etim=0.005 "; // max time (sec) -> time miscalibration (uniform in -0.005,+0.005) -> det 1
51  optce += "ce_type=fixed "; // ... -> det 2
52  optce += "ce_eamp=0.1 "; // ... -> det 2
53  optce += "ce_ephs=10 "; // ... -> det 2
54  optce += "ce_etim=0 "; // ... -> det 2
55  optce += "ce_seed=1234 "; // seed used by CE for ramdom generation
56 
57  strcpy(parPlugin,optce.Data()); // set CE plugin parameters
58  strcpy(comment,"ce configuration example");
59 
60 */
61 
62 // ---------------------------------------------------------------------------------
63 // DEFINES
64 // ---------------------------------------------------------------------------------
65 
66 #define CE_eAMP 1 // max percentage of amplitude error (1 -> no amplitude error)
67 #define CE_ePHS 0 // max phase (degrees) phase error (0 -> no phase error)
68 #define CE_eTIM 0 // max time (sec) error (0 -> no time error)
69 #define CE_SEED 150914 // seed used by CE for ramdom generation
70 #define CE_TYPE "fixed" // CE type: fixed(default)/uniform/gussian
71  // fixed: the ce_(eamp/ephs/etim) is used as calibration error for all IFOs
72  // uniform: the ce_(eamp/ephs/etim) is used to randomly extract the calibration error
73  // from a uniform distribution in the range [-ce_(eamp/ephs/etim),+ce_(eamp/ephs/etim)]
74  // guassian: the ce_(eamp/ephs/etim) is used to randomly extract the calibration error
75  // from a gaussian distribution with median (1/0) and sigma=ce_(eamp/ephs/etim)
76  // file: use the ce_file
77  // the file format is the same used by the posterior samples output PE analysis
78 #define CE_CFILE "" // is the file that contains the list of eamp/epha vs frequency
79  // the file format is the same used by the posterior samples output PE analysis
80 #define CE_GDUMP false // if true -> dump in/out injections to root file in the working dir 'report/dump', used only for debugging
81 #define CE_VERBOSE false // if true -> output debug infos
82 
83 // ---------------------------------------------------------------------------------
84 // FUNCTIONS
85 // ---------------------------------------------------------------------------------
86 
87 void SetCalibrationErrors(wavearray<double>& x, int ifoid);
89 double GetNearestCalibrationEntry(double time, int& simulation_id);
90 
91 // ---------------------------------------------------------------------------------
92 // USER CONFIG OPTIONS
93 // ---------------------------------------------------------------------------------
94 
95 struct uoptions {
96  float eamp[NIFO_MAX];
97  float ephs[NIFO_MAX];
98  float etim[NIFO_MAX];
99  TString type[NIFO_MAX];
100  TString cfile;
101  int seed;
102  bool gdump;
103  bool verbose;
104 };
105 
106 void ResetUserOptions();
110 
111 // ---------------------------------------------------------------------------------
112 // Global Variables
113 // ---------------------------------------------------------------------------------
114 
115 uoptions gOPT; // global User Options
116 TString gFDUMP; // file name used to dump inj comparison into temporary root file
118 
119 void
121 //!MISCELLANEA
122 // Plugin used for Calibration Errors
123 
124  if(type==CWB_PLUGIN_CONFIG) {
125 
126  ResetUserOptions(); // set default config options
127  ReadUserOptions(cfg->parPlugin); // user config options : read from parPlugin
128 
129  gFDUMP="";
130 
131  cout << endl;
132  for(int n=0;n<cfg->nIFO;n++) {
133 
134  if(gOPT.type[n]=="file") {
135  // Check if calibration file exist
136  cout << "CWB_Plugin_CE : check if calibration file defined in plugin parameter ce_cfile=" << gOPT.cfile << " exist" << endl;
137  CWB::Toolbox::checkFile(gOPT.cfile);
138  }
139  }
140  cout << endl;
141  }
142 
143  if(type==CWB_PLUGIN_NETWORK) {
144  PrintUserOptions(cfg); // print config options
145 
146  gMDC = new CWB::mdc(NET); // init gMDC
147  for(int n=0;n<cfg->nIFO;n++) {
148  if(gOPT.type[n]=="file") {
149  gMDC->SetInspiralCLB(gOPT.cfile); // setup calibration file
150  }
151  }
152  }
153 
154  if(type==CWB_PLUGIN_MDC) { // stage after reading injections
155 
156  // import ifactor
157  int gIFACTOR=-1; IMPORT(int,gIFACTOR)
158  int ifactor = (cfg->simulation==4) ? gIFACTOR : 0;
159 
160  // get ifo id
161  int ifoid=-1;
162  for(int n=0;n<cfg->nIFO;n++) if(ifo==NET->ifoName[n]) {ifoid=n;break;}
163  if(ifoid<0) {cout << "CWB_Plugin_CE : Error - bad ifo ifoid" << endl; gSystem->Exit(1);}
164 
165  gwavearray<double> ginj_in; // injection before calibration error (in)
166  gwavearray<double> ginj_out; // injection after calibration error (out)
167 
168  // init the output root file name used to store plots in/out injections
169  if((gOPT.gdump) && (gFDUMP=="")) {
170  TString jname = jfile->GetPath();
171  jname.ReplaceAll(":/","");
172  jname.ReplaceAll(".root","_ce_gdump.root");
173  gFDUMP=jname;
174  TFile *froot = new TFile(gFDUMP, "RECREATE");
175  froot->Close();
176  cout << endl << "CWB_Plugin_CE : Created file: " << gFDUMP << endl << endl;
177  }
178 
179  // loop over the injected events and apply amp/phs/tim errors to the injections
180  for(int nmdc=0; nmdc<(int)NET->mdcListSize(); nmdc++) {
181 
182  int seed = gOPT.seed+NET->nRun+ifoid+ifactor+nmdc;
183  gRandom->SetSeed(seed); // for each injection/run/ifo/factor set a unique seed (used CE random generation)
184 
185  if(gOPT.verbose) cout << "CWB_Plugin_CE : injection_id=" << nmdc << "\trun=" << NET->nRun
186  << "\tifoid=" << ifoid << "\tfactor=" << ifactor << "\tseed=" << seed << endl;
187 
188  TString mdcstring(NET->getmdcList(nmdc));
189  TObjArray* token = mdcstring.Tokenize(' ');
190  TObjString* iname = (TObjString*)token->At(11);
191  TString wavename = iname->GetString();
192  TObjString* itime = (TObjString*)token->At(10);
193  TString wavetime = itime->GetString();
194  double mdctime = wavetime.Atof();
195  if (mdctime<x->start()||mdctime>x->start()+x->size()/x->rate()) continue;
196  //cout << mdcstring.Data() << endl;
197  //printf(" Time : %s %f %f %f\t", wavetime.Data(), mdctime, x->start(), x->start()+x->size()/x->rate());
198  //cout << "String: " << wavename.Data() << " time : " << wavetime.Data() << " " <<mdctime << endl;
199  int istart = (mdctime - x->start()-cfg->iwindow/2.)*x->rate();
200  int istop = (mdctime - x->start()+cfg->iwindow/2.)*x->rate();
201  if(istart<0) istart=0;
202  if(istop>(int)x->size()) istop=x->size();
203  int isize = istop-istart;
204 
205  // save in injection into ginj_in
206  ginj_in.resize(isize);
207  ginj_in.start(0);
208  ginj_in.rate(x->rate());
209  for(int i=0; i<isize; i++) ginj_in[i] = x->data[i+istart];
210 
211  // copy jnjection into a temporary wavearray X
212  wavearray<double> X = ginj_in;
213 
214  if(gOPT.type[ifoid]=="file") {
215 
216  // Apply Amplitude/Phase Calibration Errors from file gOPT.cfile
217  SetCalibrationErrors(X, ifo, mdctime);
218 
219  } else {
220 
221  // Apply Amplitude/Phase Calibration Errors
222  SetCalibrationErrors(X, ifoid);
223  }
224 
225  // copy calibrated data into the original data wavearray x
226  for(int i=0; i<isize; i++) x->data[i+istart] = X[i];
227 
228  // save in injection into ginj_out
229  ginj_out.resize(isize);
230  ginj_out.start(0);
231  ginj_out.rate(x->rate());
232  for(int i=0; i<isize; i++) ginj_out[i] = x->data[i+istart];
233 
234  // store in/out injection into root file
235  if(gOPT.gdump) {
236 
237  TFile *froot = new TFile(gFDUMP, "UPDATE");
238 
239  watplot* plot;
240  TString name;
241 
242  ginj_in.Draw(GWAT_TIME);
243  ginj_in.Draw(&ginj_out,GWAT_TIME,"SAME",kRed);
244  plot = ginj_in.GetWATPLOT(); // get pointer to watplot object
245  name = TString::Format("%s_INJ_Time_InOut_%d",ifo.Data(),TMath::Nint(mdctime));
246  plot->canvas->Write(name.Data());
247 
248  ginj_in.Draw(GWAT_FFT);
249  ginj_in.Draw(&ginj_out,GWAT_FFT,"SAME",kRed);
250  plot = ginj_in.GetWATPLOT(); // get pointer to watplot object
251  name = TString::Format("%s_INJ_FFT_InOut_%d",ifo.Data(),TMath::Nint(mdctime));
252  plot->canvas->Write(name.Data());
253 
254  froot->Close();
255 
256  // move root file from tmp to report/dump directory
257  if(ifoid==cfg->nIFO-1) {
258  TString ofdump = gFDUMP;
259  ofdump.ReplaceAll(TString::Format("%s/",cfg->tmp_dir).Data(),TString::Format("%s/",cfg->dump_dir).Data());
260  char cmd[1024];
261  sprintf(cmd,"mv %s %s",gFDUMP.Data(),ofdump.Data());
262  cout << endl << cmd << endl << endl;
263  gSystem->Exec(cmd);
264  }
265  }
266  }
267  }
268 
269  return;
270 }
271 
273 
274  cout << "-----------------------------------------" << endl;
275  cout << "CE config options " << endl;
276  cout << "-----------------------------------------" << endl << endl;
277  for(int n=0;n<cfg->nIFO;n++) {
278  cout << "CE_TYPE " << cfg->ifo[n] << " " << gOPT.type[n] << endl;
279  cout << "CE_eAMP " << cfg->ifo[n] << " " << gOPT.eamp[n] << endl;
280  cout << "CE_ePHS " << cfg->ifo[n] << " " << gOPT.ephs[n] << endl;
281  cout << "CE_eTIM " << cfg->ifo[n] << " " << gOPT.etim[n] << endl << endl;
282  }
283  cout << "CE_CFILE " << gOPT.cfile << endl;
284  cout << "CE_SEED " << gOPT.seed << endl;
285  cout << "CE_GDUMP " << gOPT.gdump << endl;
286  cout << "CE_VERBOSE " << gOPT.verbose << endl;
287 
288  cout << endl;
289 }
290 
292 
293  TString ofName = odir+"/ce_config.txt";
294 
295  ofstream out;
296  out.open(ofName,ios::out);
297  if(!out.good()) {cout << "DumpUserOptions : Error Opening File : " << ofName << endl;exit(1);}
298 
299  TString info="";
300  TString tabs="\t\t\t\t";
301 
302  char version[128];
303  sprintf(version,"WAT Version : %s - SVN Revision : %s - Tag/Branch : %s",watversion('f'),watversion('r'),watversion('b'));
304 
305  out << endl;
306  out << "--------------------------------" << endl;
307  out << "CE config options " << endl;
308  out << "--------------------------------" << endl;
309  out << endl;
310 
311  for(int n=0;n<cfg->nIFO;n++) {
312  out << "ce_eamp " << cfg->ifo[n] << " " << gOPT.eamp[n] << endl;
313  }
314  info = "// max percentage of amplitude miscalibration : def(0) -> disabled";
315  out << tabs << info << endl;
316 
317  for(int n=0;n<cfg->nIFO;n++) {
318  out << "ce_ephs " << cfg->ifo[n] << " " << gOPT.ephs[n] << endl;
319  }
320  info = "// max phase (degrees) miscalibration : def(0) -> disabled";
321  out << tabs << info << endl;
322 
323  for(int n=0;n<cfg->nIFO;n++) {
324  out << "ce_etim " << cfg->ifo[n] << " " << gOPT.etim[n] << endl;
325  }
326  info = "// max time (sec) miscalibration : def(0) -> disabled";
327  out << tabs << info << endl;
328 
329  for(int n=0;n<cfg->nIFO;n++) {
330  out << "ce_type " << cfg->ifo[n] << " " << gOPT.type[n] << endl;
331  }
332 
333  out << "ce_seed " << gOPT.seed << endl;
334  info = "// seed used by CE for random generation - 0(def) -> random seed";
335  out << tabs << info << endl;
336 
337  out << "ce_gdump " << gOPT.gdump << endl;
338  out << tabs << info << endl;
339 
340  out << "ce_verbose " << gOPT.verbose << endl;
341  out << tabs << info << endl;
342 
343  out << "ce_cfile " << gOPT.cfile << endl;
344  out << tabs << info << endl;
345 
346  out.close();
347 }
348 
350 
351  for(int n=0;n<NIFO_MAX;n++) {
352  gOPT.eamp[n] = CE_eAMP;
353  gOPT.ephs[n] = CE_ePHS;
354  gOPT.etim[n] = CE_eTIM;
355  gOPT.type[n] = CE_TYPE;
356  }
357  gOPT.cfile = CE_CFILE;
358  gOPT.seed = CE_SEED;
359  gOPT.gdump = CE_GDUMP;
360  gOPT.verbose = CE_VERBOSE;
361 }
362 
364 
365  int n_type=0;
366  int n_eamp=0;
367  int n_ephs=0;
368  int n_etim=0;
369  if(options.CompareTo("")!=0) {
370  cout << options << endl;
371  if(!options.Contains("--")) { // parameters are used only by cwb_inet
372 
373  TObjArray* token = TString(options).Tokenize(TString(' '));
374  for(int j=0;j<token->GetEntries();j++){
375 
376  TObjString* tok = (TObjString*)token->At(j);
377  TString stok = tok->GetString();
378 
379  if(stok.Contains("ce_eamp=")) {
380  TString ce_eamp=stok;
381  ce_eamp.Remove(0,ce_eamp.Last('=')+1);
382  if(ce_eamp.IsFloat()) gOPT.eamp[n_eamp]=ce_eamp.Atof();
383  if(n_eamp<(NIFO_MAX-1)) n_eamp++;
384  }
385 
386  if(stok.Contains("ce_ephs=")) {
387  TString ce_ephs=stok;
388  ce_ephs.Remove(0,ce_ephs.Last('=')+1);
389  if(ce_ephs.IsFloat()) gOPT.ephs[n_ephs]=ce_ephs.Atof();
390  if(n_ephs<(NIFO_MAX-1)) n_ephs++;
391  }
392 
393  if(stok.Contains("ce_etim=")) {
394  TString ce_etim=stok;
395  ce_etim.Remove(0,ce_etim.Last('=')+1);
396  if(ce_etim.IsFloat()) gOPT.etim[n_etim]=ce_etim.Atof();
397  if(n_etim<(NIFO_MAX-1)) n_etim++;
398  }
399 
400  if(stok.Contains("ce_type=")) {
401  TString type=stok;
402  type.Remove(0,type.Last('=')+1);
403  gOPT.type[n_type]=type;
404  if(n_type<(NIFO_MAX-1)) n_type++;
405  }
406 
407  if(stok.Contains("ce_cfile=")) {
408  TString cfile=stok;
409  cfile.Remove(0,cfile.Last('=')+1);
410  gOPT.cfile=cfile;
411  }
412 
413  if(stok.Contains("ce_seed=")) {
414  TString ce_seed=stok;
415  ce_seed.Remove(0,ce_seed.Last('=')+1);
416  if(ce_seed.IsDigit()) gOPT.seed=ce_seed.Atoi();
417  }
418 
419  if(stok.Contains("ce_gdump=")) {
420  TString gdump=stok;
421  gdump.Remove(0,gdump.Last('=')+1);
422  gOPT.gdump=gdump;
423  }
424 
425  if(stok.Contains("ce_verbose=")) {
426  TString verbose=stok;
427  verbose.Remove(0,verbose.Last('=')+1);
428  gOPT.verbose=verbose;
429  }
430  }
431  }
432  }
433 }
434 
435 //______________________________________________________________________________
436 void
438 //
439 // apply amplitude/phase calibration errors
440 //
441 //
442 // Input: x - wavearray which contains the waveform data
443 // ifo - eg: L1/H1/V1
444 // time - event gps time
445 //
446 
447  // get from the calibration file the nearest time entry
448  int simulation_id=0;
449  time = GetNearestCalibrationEntry(time, simulation_id);
450 
451  // search begin,end of non zero data
452  int ibeg=0; int iend=0;
453  for(int i=0;i<(int)x.size();i++) {
454  if(x[i]!=0 && ibeg==0) ibeg=i;
455  if(x[i]!=0) iend=i;
456  }
457  int ilen=iend-ibeg+1;
458  // create temporary array for FFTW & add scratch buffer + tShift
459  int isize = 2*ilen;
460  isize = isize + (isize%4 ? 4 - isize%4 : 0); // force to be multiple of 4
461  wavearray<double> w(isize);
462  w.rate(x.rate()); w=0;
463  // copy x data !=0 in the middle of w array & set x=0
464  for(int i=0;i<ilen;i++) {w[i+isize/4]=x[ibeg+i];x[ibeg+i]=0;}
465 
466  gMDC->CalibrateInspiral(w, ifo, time, simulation_id); // apply calibration errors
467 
468  // copy shifted data to input x array
469  for(int i=0;i<(int)w.size();i++) {
470  int j=ibeg-isize/4+i;
471  if((j>=0)&&(j<(int)x.size())) x[j]=w[i];
472  }
473 
474  return;
475 }
476 
477 double GetNearestCalibrationEntry(double time, int& simulation_id) {
478 
479  ifstream in;
480  in.open(gOPT.cfile.Data(),ios::in);
481  if(!in.good()) {
482  cout << endl << "CWB_Plugin_CE - "
483  << "Error Opening Calibration File : " << gOPT.cfile.Data() << endl;
484  exit(1);
485  }
486 
487  std::map<TString, int> hsample; // header sample
488 
489  // get header line
490  char hline[4*1024];
491  in.getline(hline,4*1024);
492 
493  TObjArray* token = TString(hline).Tokenize('\t');
494  TString first_sheader="";
495  for(int j=0;j<token->GetEntries();j++) {
496  TString sheader = ((TObjString*)token->At(j))->GetString();
497  sheader.ReplaceAll(" " ,"");
498  // the first entry is used to check is an item is present. hsample["whatever itime not in the list"] returns 0
499  // we move the first item to the end of the list
500  if(j==0) {
501  hsample[""] = j;
502  first_sheader=sheader;
503  } else {
504  hsample[sheader] = j;
505  }
506  }
507  hsample[first_sheader] = token->GetEntries();
508 
509  // extract parameters at GPS=time with simulation_id value
510  bool spcal = false;
511  int hsize=token->GetEntries();
512  std::vector<double> sample(hsample.size());
513  double min_diff_time=1e20;
514  double nearest_time=time;
515  while (1) {
516  for(int i=0;i<hsize;i++) in >> sample[i];
517  sample[hsize]=sample[0]; // we move the first item to the end of the list (see comment above)
518  if(!in.good()) break;
519  if(fabs(time-sample[hsample["time"]])<min_diff_time) {
520  min_diff_time=fabs(time-sample[hsample["time"]]);
521  nearest_time=sample[hsample["time"]];
522  simulation_id=sample[hsample["simulation_id"]];
523  }
524  }
525  in.close();
526 
527  return nearest_time;
528 }
529 
530 //______________________________________________________________________________
531 void
533 //
534 // apply amplitude/phase calibration errors
535 //
536 //
537 // Input: x - wavearray which contains the waveform data
538 // ifod - eg: L1/H1/V1 -> 0/1/2
539 //
540 
541  if(gOPT.verbose) cout << endl;
542 
543  // select amplitude calibration error eamp
544  double eamp=1.;
545  if(gOPT.eamp[ifoid]!=0) {
546  if(gOPT.type[ifoid]=="fixed") eamp = 1.+gOPT.eamp[ifoid];
547  if(gOPT.type[ifoid]=="uniform") eamp = gRandom->Uniform(1-fabs(gOPT.eamp[ifoid]),1+fabs(gOPT.eamp[ifoid]));
548  if(gOPT.type[ifoid]=="gaussian") eamp = gRandom->Gaus(1,fabs(gOPT.eamp[ifoid]));
549  cout.precision(3);
550  if(gOPT.verbose) cout << "CWB_Plugin_CE : selected amplitude error (" << gOPT.eamp[ifoid] <<"%) -> eamp : " << eamp << endl;
551  }
552 
553  // select phase calibration error ephs
554  double ephs=0.;
555  if(gOPT.ephs[ifoid]!=0) {
556  if(gOPT.type[ifoid]=="fixed") ephs = gOPT.ephs[ifoid];
557  if(gOPT.type[ifoid]=="uniform") ephs = gRandom->Uniform(-fabs(gOPT.ephs[ifoid]),fabs(gOPT.ephs[ifoid]));
558  if(gOPT.type[ifoid]=="gaussian") ephs = gRandom->Gaus(0,fabs(gOPT.ephs[ifoid]));
559  cout.precision(3);
560  if(gOPT.verbose) cout << "CWB_Plugin_CE : selected phase error (" << gOPT.ephs[ifoid] <<" deg) -> ephs : " << ephs << " deg" << endl;
561  }
562 
563  // select time calibration error etim
564  double etim=0.;
565  if(gOPT.etim[ifoid]!=0) {
566  if(gOPT.type[ifoid]=="fixed") etim = gOPT.etim[ifoid];
567  if(gOPT.type[ifoid]=="uniform") etim = gRandom->Uniform(-fabs(gOPT.etim[ifoid]),fabs(gOPT.etim[ifoid]));
568  if(gOPT.type[ifoid]=="gaussian") etim = gRandom->Gaus(0,fabs(gOPT.etim[ifoid]));
569  cout.precision(5);
570  if(gOPT.verbose) cout << "CWB_Plugin_CE : selected time error (" << gOPT.etim[ifoid] <<" sec) -> etim : " << etim << " sec" << endl;
571  }
572 
573  if(gOPT.verbose) cout << endl;
574 
575  // Apply Amplitude Calibration Error
576  if(eamp!=1) x *= eamp;
577 
578  // Apply Phase Calibration Error
579  if(ephs!=0) CWB::mdc::PhaseShift(x,ephs);
580 
581  // Apply Time Calibration Error
582  if(etim!=0) CWB::mdc::TimeShift(x,etim);
583 
584  return;
585 }
std::vector< char * > ifoName
Definition: network.hh:609
CWB::config * cfg
double iwindow
Definition: config.hh:200
TString ofName
void ResetUserOptions()
virtual void rate(double r)
Definition: wavearray.hh:141
par [0] name
int n
Definition: cwb_net.C:28
char * watversion(char c='s')
Definition: watversion.hh:21
TString("c")
size_t nRun
Definition: network.hh:572
ofstream out
Definition: cwb_merge.C:214
static void PhaseShift(wavearray< double > &x, double pShift=0.)
Definition: mdc.cc:2955
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
char odir[1024]
TString mdc[4]
string getmdcList(size_t n)
Definition: network.hh:418
TString gFDUMP
virtual void start(double s)
Definition: wavearray.hh:137
int j
Definition: cwb_net.C:28
i drho i
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
int nmdc
int isize
size_t mdcListSize()
Definition: network.hh:408
char ifo[NIFO_MAX][8]
CWB::mdc * gMDC
wavearray< double > w
Definition: Test1.C:27
virtual size_t size() const
Definition: wavearray.hh:145
TCanvas * canvas
Definition: watplot.hh:192
#define CE_eAMP
Definition: CWB_Plugin_CE.C:66
#define CE_GDUMP
Definition: CWB_Plugin_CE.C:80
x plot
jfile
Definition: cwb_job_obj.C:43
Definition: mdc.hh:248
#define CE_SEED
Definition: CWB_Plugin_CE.C:69
int simulation
Definition: config.hh:199
#define IMPORT(TYPE, VAR)
Definition: cwb.hh:69
i() int(T_cor *100))
network NET
Definition: cwb_dump_inj.C:30
int ifactor
const int NIFO_MAX
Definition: wat.hh:22
char tmp_dir[1024]
Definition: config.hh:325
char parPlugin[1024]
Definition: config.hh:363
#define CE_VERBOSE
Definition: CWB_Plugin_CE.C:81
void SetCalibrationErrors(wavearray< double > &x, int ifoid)
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *NET, WSeries< double > *x, TString ifo, int type)
TObjArray * token
#define CE_TYPE
Definition: CWB_Plugin_CE.C:70
TFile * froot
TString GetString(TTree *tree, int run, int lag, TString psfix)
Definition: Toolfun.hh:283
static void TimeShift(wavearray< double > &x, double tShift=0.)
Definition: mdc.cc:2903
char options[256]
#define CE_CFILE
Definition: CWB_Plugin_CE.C:78
#define CE_ePHS
Definition: CWB_Plugin_CE.C:67
void PrintUserOptions(CWB::config *cfg)
Definition: gwat.hh:30
ifstream in
double GetNearestCalibrationEntry(double time, int &simulation_id)
char ifo[NIFO_MAX][8]
Definition: config.hh:124
double fabs(const Complex &x)
Definition: numpy.cc:55
int gIFACTOR
char dump_dir[1024]
Definition: config.hh:328
char cmd[1024]
void DumpUserOptions(TString odir, CWB::config *cfg)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
int nIFO
Definition: config.hh:120
watplot * GetWATPLOT()
Definition: gwavearray.hh:88
DataType_t * data
Definition: wavearray.hh:319
TString jname
double * itime
uoptions gOPT
string version
Definition: cWB_conf.py:108
#define CE_eTIM
Definition: CWB_Plugin_CE.C:68
virtual void resize(unsigned int)
Definition: wavearray.cc:463
void ReadUserOptions(TString options)
void Draw(GWAT_DRAW type=GWAT_TIME, TString options="ALP", Color_t color=kBlack)
Definition: gwavearray.cc:89
exit(0)