Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb1G.cc
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato, Sergey Klimenko
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 #include "cwb1G.hh"
20 
21 #define EXIT(ERR) gSystem->Exit(ERR) // better exit handling for ROOT stuff
22 
23 ClassImp(cwb1G)
24 
25 cwb1G::~cwb1G() {
26 //
27 // Destructor
28 //
29 }
30 
31 void
33 //
34 // Initialize & Check variables
35 //
36 
37  // check & set analysis stage
38  if(TString(cfg.analysis)!="1G")
39  {cout << "cwb1G::Init - Error : analysis must be 1G" << endl;EXIT(1);}
41  {cout << "cwb1G::Init - Error : if analysis=1G then stage must be CWB_STAGE_FULL" << endl;EXIT(1);}
42 
43  // Check if lagStep is a multiple of the max time resolution
44  // This condition is necessary to ensure a shift of an integer
45  // number of pixels when circular buffer is used for lag shift
46  int rate_min = rateANA>>cfg.l_high;
47  double dt_max = 1./rate_min;
48  if((cfg.lagStep*rate_min-TMath::Nint(cfg.lagStep*rate_min))>1e-12) {
49  cout << "cwb1G::Init - Error : lagStep is not a multple of max-time-resolution" << endl;
50  cout << "lagStep(sec) : " << cfg.lagStep << "\t max dt(sec) : " << dt_max << endl << endl;
51  EXIT(1);
52  }
53 
54  return;
55 }
56 
57 double
59 //
60 // Read Noise & MDC data from frame file or from the "On The Fly" generator
61 //
62 
63  // data are loaded from root file
64  if(iname!="") return cwb::ReadData(iname);
65 
66  PrintStageInfo(CWB_STAGE_STRAIN,"cwb1G::ReadData");
67 
68  // data are loaded from root file
69  if(iname!="") return cwb::ReadData(iname);
70 
71  Meyer<double> B(1024); // set wavelet for resampling
72  Meyer<double> S(1024,2); // set wavelet for production
73 
74  wavearray<double> x,z; // temporary time series
75  std::vector<wavearray<double> > y; // temporary time series for snr mode
76  y.resize(nIFO);
77  WSeries<double> wM; // mdc WSeries
78 
79  int xsize=0.;
80  double xrate=0.;
81  double xstart=0.;
82 
83  // data are loaded from frame files
84  jfile = new TFile(jname,"UPDATE");
85  if(jfile==NULL||!jfile->IsOpen())
86  {cout << "cwb1G::ReadData - Error opening root file : " << jname << endl;EXIT(1);}
87  TDirectory* cdstrain = (TDirectory*)jfile->Get("strain");
88  if(cdstrain==NULL) cdstrain = jfile->mkdir("strain");
89 
90  for(int i=0; i<nIFO; i++) {
91  if(cfg.dataPlugin) {
92  x.rate(cfg.inRate); x.start(FRF[i].start); x.resize(int(x.rate()*(FRF[i].stop-FRF[i].start)));
93  } else {
95  if(x.rate()!=cfg.inRate)
96  {cout << "cwb1G::ReadData - input rate from frame " << x.rate()
97  << " do not match the one defined in config : " << cfg.inRate << endl;EXIT(1);}
98  }
100  x.start(x.start()+cfg.dataShift[i]); // dataShift
101  x.start(x.start()-cfg.segLen*(segID[i]-segID[0])); // SLAG
103  if(cfg.dcCal[i]>0.) x*=cfg.dcCal[i]; // DC correction
104  if(cfg.fResample>0) { // RESAMPLING
105  x.FFTW(1);
106  x.resize(cfg.fResample/x.rate()*x.size());
107  x.FFTW(-1);
108  x.rate(cfg.fResample);
109  }
110  pTF[i] = pD[i]->getTFmap();
111  pTF[i]->Forward(x,B,cfg.levelR);
112  pTF[i]->getLayer(x,0);
113  pTF[i]->Forward(x,S,cfg.levelD);
114 
115  // save ifo data to temporary job file
116  cdstrain->cd(); pTF[i]->Write(ifo[i]);
117 
118  if(i==0) {xrate=x.rate();xstart=x.start();xsize=x.size();}
119 
120  fprintf(stdout,"start=%f duration=%f rate=%f\n", x.start(),x.size()/x.rate(),x.rate());
121  if(i>0 && xstart != x.start()) {
122  cout << "cwb1G::ReadData - Error : ifo noise data not synchronized" << endl;
123  cout << ifo[i] << " " << x.start() << " != " << ifo[0] << " " << xstart << endl;
124  EXIT(1);
125  }
126  if(i>0 && xrate != x.rate()) {
127  cout << "cwb1G::ReadData - Error : ifo noise data have different rates" << endl;
128  cout << ifo[i] << " " << x.rate() << " != " << ifo[0] << " " << xrate << endl;
129  EXIT(1);
130  }
131 
132  if(cfg.simulation) {
133  TDirectory* cdmdc = (TDirectory*)jfile->Get("mdc");
134  if(cdmdc==NULL) cdmdc = jfile->mkdir("mdc");
135 
136  if(cfg.mdcPlugin) {
137  x.rate(cfg.inRate); x.start(FRF[i+nIFO].start); x.resize(int(x.rate()*(FRF[i+nIFO].stop-FRF[i+nIFO].start)));
138  } else {
139  fr[nIFO].readFrames(FRF[i+nIFO],cfg.channelNamesMDC[i],x);
140  if(x.rate()!=cfg.inRate)
141  {cout << "cwb1G::ReadData - input rate from frame " << x.rate()
142  << " do not match the one defined in config : " << cfg.inRate << endl;EXIT(1);}
143  }
144 
146  x.start(x.start()+mdcShift);
147  if(cfg.fResample>0) { // RESAMPLING
148  x.FFTW(1);
149  x.resize(cfg.fResample/x.rate()*x.size());
150  x.FFTW(-1);
151  x.rate(cfg.fResample);
152  }
153  if(cfg.simulation==2) y[i] = x; // snr mode
154  wM.Forward(x,B,cfg.levelR);
155  wM.getLayer(x,0);
156  wM.Forward(x,S,cfg.levelD);
157  if(cfg.simulation==2) { // snr mode
158  pTF[i]->lprFilter(2,0,cfg.Tlpr,4.);
159  pTF[i]->setlow(cfg.fLow);
161  // set to 0 f<fLow to avoid whitening issues when psd noise is not well defined for f<fLow
162  int layers = wM.maxLayer()+1;
163  for(int j=0;j<layers;j++) if(wM.frequency(j)<cfg.fLow) {wM.getLayer(z,j);z=0;wM.putLayer(z,j);}
164  // compute snr
165  pD[i]->setsim(wM,NET.getmdcTime(),cfg.iwindow/2.,cfg.segEdge,false);
166  } else {
167  cdmdc->cd();wM.Write(ifo[i]);
168  }
169 
170  fprintf(stdout,"start=%f duration=%f rate=%f\n", x.start(),x.size()/x.rate(),x.rate());
171  if(xstart != x.start()) {
172  cout << "cwb1G::ReadData - Error : mdc/noise data with different start time" << endl;
173  printf("start time : noise = %10.6f - mdc = %10.6f\n",xstart,x.start());
174  EXIT(1);
175  }
176  if(xrate != x.rate()) {
177  cout << "cwb1G::ReadData - Error : mdc/noise data with different rate" << endl;
178  printf("rate : noise = %10.6f - mdc = %10.6f\n",xrate,x.rate());
179  EXIT(1);
180  }
181  if(xsize != x.size()) {
182  cout << "cwb1G::ReadData - Error : mdc/noise data with different buffer size" << endl;
183  printf("buffer size : noise = %d - mdc = %lu\n",xsize,x.size());
184  EXIT(1);
185  }
186  }
187  if(singleDetector) break;
188  }
189 
190  // if simulation==2 the factors parameters set the mdc snr
191  if(cfg.simulation==2) {
192  TDirectory* cdmdc = (TDirectory*)jfile->Get("mdc");
193  if(cdmdc==NULL) cdmdc = jfile->mkdir("mdc");
194 
195  // compute rescale factor -> snr network=1
196  std::vector<double> mdcFactor;
197  for (int k=0;k<(int)pD[0]->ISNR.size();k++) {
198  double snr=0;
199  if(singleDetector) {
200  for(int i=0; i<nIFO; i++) snr+=pD[0]->ISNR.data[k];
201  } else {
202  for(int i=0; i<nIFO; i++) snr+=pD[i]->ISNR.data[k];
203  }
204  snr=sqrt(snr);
205  if(snr>0) mdcFactor.push_back(1./snr); else mdcFactor.push_back(0.);
206  }
207 
208  size_t K = mdcFactor.size();
209  for(int k=0; k<K; k++) {
210  if(mdcFactor[k]) cout << k << " mdcFactor : " << mdcFactor[k] << endl;
211  }
212 
213  // rescale mdc snr network to 1
214  for(int i=0; i<nIFO; i++) {
215  pD[i]->setsnr(y[i],NET.getmdcTime(),&mdcFactor,cfg.iwindow/2.,cfg.segEdge);
217 
218  wM.Forward(y[i],B,cfg.levelR);
219  wM.getLayer(y[i],0);
220  wM.Forward(y[i],S,cfg.levelD);
221  cdmdc->cd();wM.Write(ifo[i]);
222 
223  y[i].resize(0);
224  if(singleDetector) break;
225  }
226 
227  // rescale amplitudes stored in the mdcList
228  for(int k=0; k<(int)K; k++) {
229  int ilog[5] = {1,3,12,13,14};
230  for(int l=0;l<5;l++) {
231  double mfactor = l<2 ? mdcFactor[k] : mdcFactor[k]*mdcFactor[k];
232  TString slog = TB.GetMDCLog(NET.mdcList[k], ilog[l]);
233  NET.mdcList[k]=TB.SetMDCLog(NET.mdcList[k], ilog[l], mfactor*slog.Atof());
234  }
235  }
236  }
237 
239 
240  jfile->Close();
241 
242  x.resize(0);
243  z.resize(0);
244 
245  return x.rate();
246 }
247 
248 void
250 //
251 // Apply line predictor filter to remove lines & whiten data
252 //
253 
254  PrintStageInfo(CWB_STAGE_CSTRAIN,"cwb1G::DataConditioning");
255 
256  WSeries<double> wM; // mdc WSeries
257  WSeries<double>* pWS;
259  TDirectory* cdcstrain=NULL;
260  double factor=cfg.factors[ifactor];
261 
262  // data are loaded from root file
263  //if(!cfg.simulation && iname!="") return cwb::DataConditioning(iname);
264 
265  jfile = new TFile(jname, "UPDATE");
266  if(jfile!=NULL && (cfg.jobfOptions&CWB_JOBF_SAVE_CSTRAIN)) cdcstrain=jfile->mkdir("cstrain");
267 
268  if(jfile==NULL||!jfile->IsOpen())
269  {cout << "cwb1G::DataConditioning - Error : file " << jname << " not found" << endl;EXIT(1);}
270 
271  for(int i=0; i<nIFO; i++) {
272  pWS = (WSeries<double>*)jfile->Get(TString("strain/")+ifo[i]);
273  *pTF[i] = *pWS;
274  delete pWS;
275 
276  if(cfg.simulation) {
277  pWS = (WSeries<double>*)jfile->Get(TString("mdc/")+ifo[i]);
278  if(cfg.simulation==3) { // time shift : factor is the shift time
279  int nshift = int(factor*pWS->rate()); // number of shifted samples
280  int level = pWS->getLevel();
281  pWS->Inverse();
282  wM = *pWS; wM=0;
283  int jstart = nshift<0 ? -nshift : 0;
284  int jstop = nshift<0 ? pWS->size() : pWS->size()-nshift;
285  for(int j=jstart;j<jstop;j++) wM.data[j+nshift] = pWS->data[j];
286  wM.Forward(level); // return to the original decomposition level
287  pTF[i]->add(wM);
288 
289  double tshift=nshift/pWS->rate(); // time shift (sec)
290  // take into account of the previous applied time shift
291  tshift = ifactor==0 ? tshift : tshift-int(cfg.factors[ifactor-1]*pWS->rate())/pWS->rate();
292 
293  // tshift saved injected waveforms
294  for(int k=0; k<(int)pD[i]->IWFP.size(); k++) {
295  wavearray<double>* pwf = pD[i]->IWFP[k];
296  pwf->start(pwf->start()+tshift);
297  }
298  // tshift saved central times
299  for(int k=0; k<(int)pD[i]->TIME.size(); k++) pD[i]->TIME[k]+=tshift;
300 
301  // shift times stored in the NET.mdcList & NET.mdcTime
302  if(i==0) {
303  vector<TString> ifos(nIFO);
304  for(int n=0;n<nIFO;n++) ifos[n]=ifo[n];
305  TB.shiftBurstMDCLog(NET.mdcList, ifos, tshift);
306  for(int k=0;k<(int)NET.mdcTime.size();k++) NET.mdcTime[k]+=tshift;
307  }
308  } else {
309  wM = *pWS;
310  (*pWS)*=factor;
311  pTF[i]->add(*pWS);
312  }
313  delete pWS;
314  }
315 
317 
318  if(!cfg.dcPlugin) { // built in data conditioning
319  pTF[i]->lprFilter(2,0,cfg.Tlpr,4.);
320  pTF[i]->setlow(cfg.fLow);
322  if(cfg.simulation) {
323  // set to 0 f<fLow to avoid whitening issues when psd noise is not well defined for f<fLow
324  int layers = wM.maxLayer()+1;
325  for(int j=0;j<layers;j++) if(wM.frequency(j)<cfg.fLow) {wM.getLayer(x,j);x=0;wM.putLayer(x,j);}
326  // compute mdc params & save whiten mdc
327  pD[i]->setsim(wM,NET.getmdcTime(),cfg.iwindow/2.,cfg.segEdge,true);
328  }
330  pTF[i]->lprFilter(2,0,cfg.Tlpr,4.);
332  pTF[i]->sethigh(cfg.fHigh);
333  v[i] = pTF[i]->variability();
334  pD[i]->bandPass1G(); // band pass filtering
335  } else { // data conditioning is provided by the user plugin
336  char cmd[128];
337  // export to CINT variables
338  sprintf(cmd,"gMDC = %p;",&wM); EXPORT(void*,gMDC,cmd);
340  }
341 
343 
344  if(cfg.jobfOptions&CWB_JOBF_SAVE_CSTRAIN) {cdcstrain->cd();pTF[i]->Write(ifo[i]);}
345 
346  cout<<"After "<<ifo[i]<<" data conditioning"<<endl;
347  gSystem->Exec("/bin/date"); GetProcInfo();
348 
349  if(singleDetector) {
350  *pD[1]=*pD[0];
351  // copy detector data not implemented in the copy operator
352  pD[1]->HRSS = pD[0]->HRSS;
353  pD[1]->ISNR = pD[0]->ISNR;
354  pD[1]->FREQ = pD[0]->FREQ;
355  pD[1]->BAND = pD[0]->BAND;
356  pD[1]->TIME = pD[0]->TIME;
357  pD[1]->TDUR = pD[0]->TDUR;
358  pD[1]->IWFID = pD[0]->IWFID;
359  pD[1]->IWFP = pD[0]->IWFP;
360  pD[1]->RWFID = pD[0]->RWFID;
361  pD[1]->RWFP = pD[0]->RWFP;
362  break;
363  }
364  }
365  jfile->Close();
366 
367  x.resize(0);
368 
369  // strains and mdc data are removed if not set in the jobfOptions (only for the last factor)
370  if(ifactor==cfg.nfactor-1) { // the last factor
371  vector<TString> delObjList;
372  if(!(cfg.jobfOptions&CWB_JOBF_SAVE_STRAIN)) delObjList.push_back("strain");
373  if(cfg.simulation && !(cfg.jobfOptions&CWB_JOBF_SAVE_MDC)) delObjList.push_back("mdc");
374  FileGarbageCollector(jname,"",delObjList);
375  }
376 
377  return;
378 }
379 
380 void
382 //
383 // Set pixel energy threshold
384 // Select the significant pixels
385 // Single level clustering
386 //
387 
388  PrintStageInfo(CWB_STAGE_COHERENCE,"cwb1G::Coherence");
389 
390  int n,m;
391  char tdf00[1024];
392  double Ao;
393  netcluster wc;
394 
395  double TL = NET.setVeto(cfg.iwindow);
396  cout<<"live time in zero lag: "<<TL<<endl<<endl; // set veto array
397  if(TL <= 0.) {froot->Close();EXIT(1);} // exit if live time is zero
398 
399  jfile = new TFile(jname,"UPDATE");
400  if(jfile==NULL||!jfile->IsOpen())
401  {cout << "cwb1G::Coherence - Error : file " << jname << " not found" << endl;EXIT(1);}
402 
403  if(bplugin) {
404  char sfactor[8];sprintf(sfactor,"%d",ifactor);
405  CWB_Plugin(jfile,&cfg,&NET,NULL,sfactor,CWB_PLUGIN_ICOHERENCE);
406  }
407 
408  for(int i=cfg.levelD; i>=cfg.l_low; i--) { // loop over TF resolutions
409 
410  if(i<=cfg.l_high) {
411 
412  sprintf(tdf00,"%s/data64_wat-4.8.2/Meyer1024wat482_00_L%1d.dat",cfg.filter_dir,i);
413  NET.setDelayFilters(tdf00);
414  if(i==cfg.l_high) {
415  NET.setDelayIndex();
416  NET.setIndexMode(1);
417  }
418 
419  Ao = NET.threshold(cfg.bpp,dTau);
420  NET.set2or(cfg.x2or*Ao*Ao);
421  cout<<"pixel threshold in units of noise rms: "<<Ao<<endl;
422  cout<<"2 OR threshold in units of noise var: "<<cfg.x2or*Ao*Ao<<endl;
423 
424  cout<<"total pixels: "<<NET.coherence(Ao)<<" ";
425 
426  n = size_t(2.*cfg.Tgap*pD[0]->getTFmap()->resolution(0)+0.1);
427  m = size_t(cfg.Fgap/pD[0]->getTFmap()->resolution(0)+0.0001);
428 
429  cout<<"clusters: "<<NET.cluster(n,m)<<" ";
430  cout<<"selected pixels: "<<NET.likelihood('E',cfg.Acore)<<"\n";
431 
432  for(int j=0; j<(int)NET.nLag; j++) {
433  wc = *(NET.getwc(j));
434  // write cluster data
435  int cycle = cfg.simulation ? ifactor : Long_t(wc.shift);
436  wc.write(jfile,"coherence","clusters",0,cycle);
437  wc.write(jfile,"coherence","clusters",-1,cycle);
438  cout<<wc.csize()<<"|"<<wc.size()<<" ";cout.flush();
439  wc.clear();
440  }
441  cout<<endl;
442  }
443 
444  if(i>cfg.l_low) NET.Inverse(1);
445  gSystem->Exec("/bin/date"); GetProcInfo();
446 
447  }
448 
449  if(bplugin) {
450  char sfactor[8];sprintf(sfactor,"%d",ifactor);
451  CWB_Plugin(jfile,&cfg,&NET,NULL,sfactor,CWB_PLUGIN_OCOHERENCE);
452  }
453 
454  jfile->Write();
455  jfile->Close();
456 
457  return;
458 }
459 
460 void
462 //
463 // Multi level clustering
464 //
465 
466  PrintStageInfo(CWB_STAGE_SUPERCLUSTER,"cwb1G::SuperCluster");
467 
468  netcluster wc;
469 
470  jfile = new TFile(jname);
471  if(jfile==NULL||!jfile->IsOpen())
472  {cout << "cwb1G::SuperCluster - Error : file " << jname << " not found" << endl;EXIT(1);}
473 
475 
476  for(int j=0; j<(int)lags; j++) {
477  // read clusters from temporary job file
478  int cycle = cfg.simulation ? ifactor : Long_t(NET.wc_List[j].shift);
479  // read metadata netcluster object
480  wc.read(jfile,"coherence","clusters",0,cycle);
481  // read cluster objects
482  for(int i=cfg.l_low; i<=cfg.l_high; i++) {
483  wc.read(jfile,"coherence","clusters",-1,cycle,rateANA>>i);
484  }
485  if(cfg.l_high==cfg.l_low) wc.pair=false; // if only one resolution is used pair is false
486  int m = wc.supercluster('L',NET.e2or,true);
487  netcluster* pwc = NET.getwc(j); pwc->cpf(wc,true);
488  cout<<m<<"|"<<pwc->size()<<" ";
489  wc.clear();
490  }
491 
493 
494  jfile->Close();
495 
496  // coherence clusters are removed if not set in the jobfOptions (only for the last factor)
497  if(ifactor==cfg.nfactor-1) { // the last factor
498  vector<TString> delObjList;
499  // coherence clusters are removed if not set in the jobfOptions
500  if(!(cfg.jobfOptions&CWB_JOBF_SAVE_COHERENCE)) delObjList.push_back("coherence");
501  FileGarbageCollector(jname,"",delObjList);
502  }
503 
504  return;
505 }
506 
507 bool
509 //
510 // event reconstruction
511 // event parameters estimation
512 //
513 
514  PrintStageInfo(CWB_STAGE_LIKELIHOOD,"cwb1G::Likelihood");
515 
516  char tdf00[1024], tdf90[1024];
517 
518  int ceddir = 0; // flag if ced directory exists
519 
520  for(int i=cfg.l_low; i<=cfg.l_high; i++) {
521  sprintf(tdf00,"%s/data64_wat-4.8.2/Meyer1024wat482_00%s_L%1d.dat",cfg.filter_dir,cfg.filter,i);
522  sprintf(tdf90,"%s/data64_wat-4.8.2/Meyer1024wat482_90%s_L%1d.dat",cfg.filter_dir,cfg.filter,i);
523  NET.setDelayFilters(tdf00,tdf90);
524 
525  if(i==cfg.l_low) {
526  NET.setDelayIndex();
528  }
529 
530  cout<<"selected core pixels: "<<NET.likelihood(cfg.search,cfg.Acore)<<" for level "<<i<<"\n";
531  cout<<"rejected weak pixels: "<<NET.netcut(cfg.netRHO,'r',0,1)<<"\n"; // remove weak glitches
532  cout<<"rejected loud pixels: "<<NET.netcut(cfg.netCC,'c',0,1)<<"\n"; // remove loud glitches
533  cout<<"events in the buffer: "<<NET.events()<<"\n";
534 
535  if(cfg.cedDump) {
536  CWB::ced *ced = NULL;
538  // save ced to temporary job file
539  cout<<"dump ced into "<<jname<<"\n";
540  jfile = new TFile(jname,"UPDATE");
541  if(jfile==NULL||!jfile->IsOpen())
542  {cout << "cwb1G::Likelihood - Error : file " << jname << " not found" << endl;EXIT(1);}
543  TDirectory* cdced = NULL;
544  cdced = (TDirectory*)jfile->Get("ced");
545  if(cdced == NULL) cdced = jfile->mkdir("ced");
546  ced = new CWB::ced(&NET,netburst,cdced);
547  } else {
548  cout<<"dump ced into "<<ced_dir<<"\n";
549  ced = new CWB::ced(&NET,netburst,ced_dir);
550  }
553  bool fullCED = singleDetector ? false : true;
554  if(ced->Write(cfg.factors[ifactor],fullCED)) ceddir = 1;
555  if(cfg.jobfOptions&CWB_JOBF_SAVE_CED) jfile->Close();
556  delete ced;
557  }
558 
559  if(bplugin) {
560  jfile = new TFile(jname);
561  if(jfile==NULL||!jfile->IsOpen())
562  {cout << "cwb1G::Likelihood - Error : file " << jname << " not found" << endl;EXIT(1);}
564  jfile->Close();
565  }
566 
567  if(i<cfg.l_high) NET.Forward(1);
568  }
569 
570  return ceddir;
571 }
char channelNamesMDC[NIFO_MAX][50]
Definition: config.hh:311
void SetOptions(int simulation, double rho, double inRate, bool useSparse=false, char *gtype=const_cast< char *>("png"), int paletteId=0)
Definition: ced.hh:88
CWB_JOBF_OPTIONS jobfOptions
Definition: config.hh:291
void sethigh(double f)
Definition: wseries.hh:132
size_t rateANA
Definition: cwb.hh:279
char analysis[8]
Definition: config.hh:117
TString outDump
double iwindow
Definition: config.hh:200
virtual void resize(unsigned int)
Definition: wseries.cc:901
CWB::frame fr[2 *NIFO_MAX]
Definition: cwb.hh:251
size_t write(const char *file, int app=0)
Definition: netcluster.cc:3008
double x2or
Definition: config.hh:146
size_t nLag
Definition: network.hh:573
double dTau
maximum time delay
Definition: cwb.hh:286
void white(double dT=0, int wtype=1, double offset=0., double stride=0.)
what it does: see algorithm description in wseries.hh
Definition: detector.hh:258
static size_t GetProcInfo(bool mvirtual=true)
Definition: cwb.cc:1847
bool Likelihood(int ifactor, char *ced_dir, netevent *output=NULL, TTree *net_tree=NULL, char *outDump=NULL)
Definition: cwb1G.cc:508
void FileGarbageCollector(TString ifName, TString ofName="", vector< TString > delObjList=vector< TString >())
Definition: cwb.cc:2338
std::vector< netcluster > wc_List
Definition: network.hh:610
int stop
Definition: Toolbox.hh:94
int levelF
Definition: config.hh:153
bool singleDetector
used for the stage stuff
Definition: cwb.hh:277
void set2or(double p)
param: threshold
Definition: network.hh:471
WSeries< double > * pTF[NIFO_MAX]
pointers to detectors
Definition: cwb.hh:264
std::vector< double > * getmdcTime()
Definition: network.hh:422
bool mdcPlugin
Definition: config.hh:365
size_t setsnr(wavearray< double > &, std::vector< double > *, std::vector< double > *, double=5., double=8.)
Definition: detector.cc:1670
virtual void rate(double r)
Definition: wavearray.hh:141
double cedRHO
Definition: config.hh:298
float factor
virtual WSeries< float > variability(double=0., double=-1., double=-1.)
param: first - time window to calculate normalization constants second - low frequency boundary for c...
Definition: wseries.cc:1296
bool dataPlugin
Definition: config.hh:364
#define B
int n
Definition: cwb_net.C:28
#define EXIT(ERR)
Definition: cwb1G.cc:21
TString iname
stage benchmark
Definition: cwb.hh:241
void CWB_Plugin(TFile *jfile, CWB::config *, network *, WSeries< double > *, TString, int)
COHERENCE.
wavearray< double > z
Definition: Test10.C:32
detector * pD[NIFO_MAX]
noise variability
Definition: cwb.hh:263
TString("c")
bool bplugin
Definition: cwb.hh:297
size_t setIndexMode(size_t=0)
Definition: network.cc:8105
TFile * jfile
output root file
Definition: cwb.hh:259
int start
Definition: Toolbox.hh:93
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
std::vector< wavearray< double > * > RWFP
Definition: detector.hh:382
wavearray< double > HRSS
Definition: detector.hh:371
double whiteWindow
Definition: config.hh:189
double fLow
Definition: config.hh:140
void add(const wavearray< DataType_t > &, int=0, int=0, int=0)
Definition: wavearray.cc:746
TFile * froot
Definition: cwb.hh:256
netcluster * pwc
Definition: cwb_job_obj.C:38
bool dcPlugin
Definition: config.hh:366
CWB_STAGE jstage
Definition: cwb.hh:248
bool cedDump
Definition: config.hh:297
void setlow(double f)
Definition: wseries.hh:125
int layers
char ifo[NIFO_MAX][8]
Definition: cwb.hh:245
virtual double ReadData(double mdcShift, int ifactor)
Definition: cwb.hh:201
double netRHO
Definition: config.hh:147
void DataConditioning(int ifactor)
Definition: cwb1G.cc:249
virtual size_t supercluster(char atype, double S, bool core)
param: statistic: E - excess power, L - likelihood param: selection threshold T for likelihood cluste...
Definition: netcluster.cc:808
int m
Definition: cwb_net.C:28
virtual void start(double s)
Definition: wavearray.hh:137
int j
Definition: cwb_net.C:28
i drho i
size_t lags
Definition: cwb.hh:293
std::vector< double > mdcTime
Definition: network.hh:614
long coherence(double, double=0., double=0.)
param: threshold on lognormal pixel energy (in units of noise rms) param: threshold on total pixel en...
Definition: network.cc:3815
network NET
pointers to WSeries
Definition: cwb.hh:266
size_t cluster(int kt, int kf)
param: time gap in pixels return: number of reconstructed clusters
Definition: network.hh:321
int levelD
Definition: config.hh:154
char ced_dir[512]
Definition: test_config1.C:154
double Tlpr
Definition: config.hh:144
double mdcShift
Definition: cwb_net.C:196
CWB::mdc * gMDC
fprintf(stdout,"start=%f duration=%f rate=%f\, x.start(), x.size()/x.rate(), x.rate())
double segEdge
Definition: config.hh:164
size_t mode
Definition: config.hh:275
char tdf90[1024]
Definition: cwb_job_obj.C:34
virtual size_t size() const
Definition: wavearray.hh:145
double dcCal[NIFO_MAX]
Definition: config.hh:196
int getLevel()
Definition: wseries.hh:109
size_t fResample
Definition: config.hh:142
void Forward(size_t k)
param: number of steps
Definition: network.hh:89
void Coherence(int ifactor)
Definition: cwb1G.cc:381
TTree * net_tree
double setVeto(double=5.)
param: time window around injections
Definition: network.cc:3487
char filter_dir[1024]
Definition: config.hh:305
static TString GetMDCLog(TString log, int pos)
Definition: Toolbox.cc:2278
double shift
Definition: netcluster.hh:382
char tdf00[1024]
Definition: cwb_job_obj.C:33
int simulation
Definition: config.hh:199
int l_high
Definition: config.hh:156
void bandPass1G(double f1=0., double f2=0.)
Definition: detector.cc:1310
double Fgap
Definition: config.hh:136
int segID[20]
Definition: cwb.hh:291
char search
Definition: config.hh:121
static void resampleToPowerOfTwo(wavearray< double > &w)
Definition: Toolbox.cc:6602
wavearray< double > TIME
Definition: detector.hh:375
i() int(T_cor *100))
void setDelayIndex(double rate)
param: MDC log file
Definition: network.cc:2896
int ifactor
std::vector< std::string > mdcList
Definition: network.hh:612
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
Definition: wseries.cc:193
printf("total live time: non-zero lags = %10.1f \, liveTot)
int l
double dataShift[NIFO_MAX]
Definition: config.hh:205
std::vector< int > RWFID
Definition: detector.hh:381
int Write(double factor, bool fullCED=true)
Definition: ced.cc:607
char channelNamesRaw[NIFO_MAX][50]
Definition: config.hh:310
void SetChannelName(char *chName)
Definition: ced.hh:101
double Acore
Definition: config.hh:143
void PrintStageInfo(CWB_STAGE stage, TString comment, bool out=true, bool log=true, TString fname="")
Definition: cwb.cc:2020
int k
char jname[1024]
job file object
Definition: cwb.hh:260
void Inverse(size_t k)
Definition: network.hh:91
int nfactor
Definition: config.hh:201
std::vector< wavearray< double > * > IWFP
Definition: detector.hh:379
size_t cpf(const netcluster &, bool=false, int=0)
Definition: netcluster.cc:117
char filter[1024]
Definition: config.hh:218
wavearray< double > TDUR
Definition: detector.hh:376
double e2or
Definition: network.hh:584
std::vector< int > IWFID
Definition: detector.hh:378
double e
WSeries< double > wM
Definition: cwb_job_obj.C:41
frfile FRF[2 *NIFO_MAX]
Definition: cwb.hh:253
long likelihood(char='E', double=sqrt(2.), int=0, size_t=0, int=-1, bool=false)
Definition: network.cc:4446
CWB::Toolbox TB
Definition: cwb.hh:243
size_t size()
Definition: netcluster.hh:147
double netCC
Definition: config.hh:148
wavearray< double > BAND
Definition: detector.hh:374
int * xstart
virtual void FFTW(int=1)
Definition: wavearray.cc:896
size_t events()
Definition: network.hh:329
static int shiftBurstMDCLog(std::vector< std::string > &mdcList, vector< TString > ifos, double mdc_shift)
Definition: Toolbox.cc:2174
CWB::config cfg
Definition: cwb.hh:192
int l_low
Definition: config.hh:155
#define EXPORT(TYPE, VAR, CMD)
Definition: config.cc:92
double whiteStride
Definition: config.hh:190
double fHigh
Definition: config.hh:141
WSeries< double > * getTFmap()
param: no parameters
Definition: detector.hh:179
Definition: Meyer.hh:36
size_t csize()
Definition: netcluster.hh:151
double resolution(int=0)
Definition: wseries.hh:155
static TString SetMDCLog(TString log, int pos, TString val)
Definition: Toolbox.cc:2238
double segLen
Definition: config.hh:161
Definition: cwb1G.hh:31
void readFrames(char *filename, char *channel, wavearray< double > &w)
Definition: frame.cc:828
virtual void lprFilter(double, int=0, double=0., double=0.)
Definition: wseries.cc:1126
char cmd[1024]
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:246
Meyer< double > S(1024, 2)
netcluster * getwc(size_t n)
param: delay index
Definition: network.hh:439
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
netevent * netburst
livetime object
Definition: cwb.hh:270
void setDelayFilters(detector *=NULL)
Definition: network.cc:7739
DataType_t * data
Definition: wavearray.hh:319
double Tgap
Definition: config.hh:134
netcluster wc
wavearray< double > FREQ
Definition: detector.hh:373
Definition: ced.hh:44
double factors[FACTORS_MAX]
Definition: config.hh:202
size_t netcut(double, char='L', size_t=0, int=1)
param: threshold param: minimum cluster size processed by the corrcut param: cluster type return: num...
Definition: network.cc:2998
int nIFO
Toolbox.
Definition: cwb.hh:244
double lagStep
Definition: config.hh:169
size_t read(const char *)
Definition: netcluster.cc:3115
virtual void resize(unsigned int)
Definition: wavearray.cc:463
double bpp
Definition: config.hh:133
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
size_t setsim(WSeries< double > &, std::vector< double > *, double=5., double=8., bool saveWF=false)
Definition: detector.cc:1377
size_t inRate
Definition: config.hh:132
WSeries< float > v[NIFO_MAX]
Definition: cwb.hh:262
double frequency(int l)
Definition: wseries.cc:117
wavearray< double > ISNR
Definition: detector.hh:372
int maxLayer()
Definition: wseries.hh:139
void SuperCluster(int ifactor)
Definition: cwb1G.cc:461
int levelR
Definition: config.hh:152
double ReadData(double mdcShift, int ifactor)
Definition: cwb1G.cc:58
void Init()
Definition: cwb1G.cc:32
TString ifos[60]
double threshold(double, double)
param: selected fraction of LTF pixels assuming Gaussian noise param: maximum time delay between dete...
Definition: network.cc:2644
void clear()
Definition: netcluster.hh:427