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