Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CWB_Plugin_QLveto.C
Go to the documentation of this file.
1 #define XIFO 4
2 
3 #pragma GCC system_header
4 
5 #include "cwb.hh"
6 #include "config.hh"
7 #include "network.hh"
8 #include "wavearray.hh"
9 #include "TString.h"
10 #include "TObjArray.h"
11 #include "TObjString.h"
12 #include "TRandom.h"
13 #include "TComplex.h"
14 #include "TMath.h"
15 #include "mdc.hh"
16 #include "watplot.hh"
17 #include "gwavearray.hh"
18 #include <vector>
19 
20 //#define PLOT_LIKELIHOOD
21 //#define PLOT_WHITENED_WAVEFORMS
22 
23 #define NTHR 1
24 #define ATHR 7.58859
25 
26 void GetQveto(wavearray<double>* wf, float &Qveto, float &Qfactor);
27 void GetLveto(netcluster* pwc, int cid, int nifo, float* Lveto);
29  CWB::config* cfg, bool fft=false, bool strain=false);
31 
32 std::vector<netpixel> DoPCA(network* NET, CWB::config* cfg, int lag, int id);
33 void ResetPCA(network* NET, CWB::config* cfg, netcluster* pwc, std::vector<netpixel>* vPIX, int ID);
34 
35 
36 void
38 //!MISCELLANEA
39 // Extract whitened reconstructed waveforms, and compute the Qveto, Lveto parameters
40 
41  cout << endl;
42  cout << "-----> CWB_Plugin_QLveto.C" << endl;
43  cout << "ifo " << ifo.Data() << endl;
44  cout << "type " << type << endl;
45  cout << endl;
46 
47  float Qveto[2]; // Qveto
48  float Lveto[3]; // Lveto
49 
50  if(type==CWB_PLUGIN_CONFIG) {
51  cfg->outPlugin=true; // disable built-in output root file
52  }
53 
54  if(type==CWB_PLUGIN_ILIKELIHOOD) {
55  NET->wfsave=true; // enable waveform save
56 
57  // search output root file in the system list
58  TFile* froot = NULL;
59  TList *files = (TList*)gROOT->GetListOfFiles();
60  TString outDump="";
61  netevent* EVT;
62  int nIFO = NET->ifoListSize(); // number of detectors
63  if (files) {
64  TIter next(files);
65  TSystemFile *file;
66  TString fname;
67  bool check=false;
68  while ((file=(TSystemFile*)next())) {
69  fname = file->GetName();
70  // set output root file as the current file
71  if(fname.Contains("wave_")) {
72  froot=(TFile*)file;froot->cd();
73  outDump=fname;
74  outDump.ReplaceAll(".root.tmp",".txt");
75  //cout << "output file name : " << fname << endl;
76  }
77  }
78  if(!froot) {
79  cout << "CWB_Plugin_QLveto.C : Error - output root file not found" << endl;
80  gSystem->Exit(1);
81  }
82  } else {
83  cout << "CWB_Plugin_QLveto.C : Error - output root file not found" << endl;
84  gSystem->Exit(1);
85  }
86 
87  TTree* net_tree = (TTree *) froot->Get("waveburst");
88  if(net_tree==NULL) {
89  EVT = new netevent(nIFO);
90  net_tree = EVT->setTree();
91  net_tree->Branch("Qveto",Qveto,TString::Format("Qveto[%i]/F",2));
92  net_tree->Branch("Lveto",Lveto,TString::Format("Lveto[%i]/F",3));
93  } else {
94  TBranch* branch;
95  bool qveto_exists=false;
96  bool lveto_exists=false;
97  TIter next(net_tree->GetListOfBranches());
98  while ((branch=(TBranch*)next())) {
99  if(TString("Qveto").CompareTo(branch->GetName())==0) qveto_exists=true;
100  if(TString("Lveto").CompareTo(branch->GetName())==0) lveto_exists=true;
101  }
102  next.Reset();
103  if(!qveto_exists) net_tree->Branch("Qveto",Qveto,TString::Format("Qveto[%i]/F",2));
104  if(!lveto_exists) net_tree->Branch("Lveto",Lveto,TString::Format("Lveto[%i]/F",3));
105  }
106  }
107 
108  if(type==CWB_PLUGIN_OLIKELIHOOD) {
109 
110  if(TString(cfg->analysis)!="2G") {
111  cout << "CWB_Plugin_QLveto.C -> "
112  << "CWB_PLUGIN_OLIKELIHOOD implemented only for 2G" << endl;
113  gSystem->Exit(1);
114  }
115 
116  // import ifactor
117  int gIFACTOR=-1; IMPORT(int,gIFACTOR)
118  cout << "-----> CWB_Plugin_QLveto.C -> "
119  << " gIFACTOR : " << gIFACTOR << endl;
120 
121  // import slagShift
122  float* gSLAGSHIFT=NULL; IMPORT(float*,gSLAGSHIFT)
123 
124  int nIFO = NET->ifoListSize(); // number of detectors
125  int K = NET->nLag; // number of time lag
126  netevent* EVT;
128  //double factor = cfg->simulation==3||cfg->simulation==4 ? -gIFACTOR : cfg->factors[gIFACTOR];
129  double factor = cfg->factors[gIFACTOR];
130  int rate = 0; // select all resolutions
131 
132  // search output root file in the system list
133  TFile* froot = NULL;
134  TList *files = (TList*)gROOT->GetListOfFiles();
135  TString outDump="";
136  if (files) {
137  TIter next(files);
138  TSystemFile *file;
139  TString fname;
140  bool check=false;
141  while ((file=(TSystemFile*)next())) {
142  fname = file->GetName();
143  // set output root file as the current file
144  if(fname.Contains("wave_")) {
145  froot=(TFile*)file;froot->cd();
146  outDump=fname;
147  outDump.ReplaceAll(".root.tmp",".txt");
148  //cout << "output file name : " << fname << endl;
149  }
150  }
151  if(!froot) {
152  cout << "CWB_Plugin_QLveto.C : Error - output root file not found" << endl;
153  gSystem->Exit(1);
154  }
155  } else {
156  cout << "CWB_Plugin_QLveto.C : Error - output root file not found" << endl;
157  gSystem->Exit(1);
158  }
159 
160  TTree* net_tree = (TTree *) froot->Get("waveburst");
161  if(net_tree!=NULL) {
162  EVT = new netevent(net_tree,nIFO);
163  net_tree->SetBranchAddress("Qveto",Qveto);
164  net_tree->SetBranchAddress("Lveto",Lveto);
165  } else {
166  EVT = new netevent(nIFO);
167  net_tree = EVT->setTree();
168  net_tree->Branch("Qveto",Qveto,TString::Format("Qveto[%i]/F",2));
169  net_tree->Branch("Lveto",Lveto,TString::Format("Lveto[%i]/F",3));
170  }
171  EVT->setSLags(gSLAGSHIFT); // set slags into netevent
172 
173  for(int k=0; k<K; k++) { // loop over the lags
174 
175  id = NET->getwc(k)->get(const_cast<char*>("ID"), 0, 'L', rate);
176 
177  for(int j=0; j<(int)id.size(); j++) { // loop over cluster index
178 
179  int ID = size_t(id.data[j]+0.5);
180 
181  if(NET->getwc(k)->sCuts[ID-1]!=-1) continue; // skip rejected/processed clusters
182 
183  double ofactor=0;
184  if(cfg->simulation==4) ofactor=-factor;
185  else if(cfg->simulation==3) ofactor=-gIFACTOR;
186  else ofactor=factor;
187 
188  EVT->output2G(NULL,NET,ID,k,ofactor); // get reconstructed parameters
189 
190  wavearray<double>** pwfREC = new wavearray<double>*[nIFO];
191  detector* pd = NET->getifo(0);
192  int idSize = pd->RWFID.size();
193 
194  int wfIndex=-1;
195  for (int mm=0; mm<idSize; mm++) if (pd->RWFID[mm]==ID) wfIndex=mm;
196  if(wfIndex==-1) continue;
197 
198  netcluster* pwc = NET->getwc(k);
199  cout << endl << "----------------------------------------------------------------" << endl;
200 
201  // extract whitened reconstructed waveforms
202  Qveto[0]=Qveto[1]=1.e20;
203  for(int n=0; n<nIFO; n++) {
204 
205  pd = NET->getifo(n);
206 
207  pwfREC[n] = pd->RWFP[wfIndex];
208  wavearray<double>* wfREC = pwfREC[n]; // array of reconstructed waveforms
209 
210 #ifdef PLOT_WHITENED_WAVEFORMS
211  //PlotWaveform(NET->ifoName[n], wfREC, cfg, false, false);
212  PlotWaveform(NET->ifoName[n], wfREC, cfg, true, false);
213 #endif
214  // store in Qveto[0/1] the minimum velue of Qveto/Qfactor between the reconstructed,whitened waveforms in all ifos
215  float qveto,qfactor;
216 
217  // reconstructed whitened waveform
218  NET->getMRAwave(ID,k,'S',0,true);
219  GetQveto(&(pd->waveForm), qveto, qfactor);
220  if(qveto<Qveto[0]) Qveto[0]=qveto;
221  if(qfactor<Qveto[1]) Qveto[1]=qfactor;
222 
223  // whitened waveform
224  NET->getMRAwave(ID,k,'W',0,true);
225  GetQveto(&(pd->waveBand), qveto, qfactor);
226  if(qveto<Qveto[0]) Qveto[0]=qveto;
227  if(qfactor<Qveto[1]) Qveto[1]=qfactor;
228 
229  cout << "Qveto : " << pd->Name << " Qveto[0] = " << Qveto[0]
230  << " Qveto[1] = " << Qveto[1] << endl;
231 
232  if(!cfg->simulation) ClearWaveforms(pd); // release waveform memory
233  }
234  delete [] pwfREC;
235 
236  std::vector<netpixel> vPIX;
237  if(cfg->pattern>0) vPIX = DoPCA(NET, cfg, k, ID); // do PCA analysis
238  GetLveto(pwc, ID, nIFO, Lveto);
239  if(cfg->pattern>0) ResetPCA(NET, cfg, pwc, &vPIX, ID); // restore WP pwc
240 
241  cout << endl;
242  cout << "Lveto : " << "fmean : " << Lveto[0] << " frms : " << Lveto[1]
243  << " Energy Ratio : " << Lveto[2] << endl << endl;
244  cout << "----------------------------------------------------------------" << endl;
245 
246  std::vector<int> sCuts = NET->getwc(k)->sCuts; // save cCuts
247  // set sCuts=1 to the events which must be not copied with cps to pwc
248  for(int i=0; i<(int)sCuts.size(); i++) if(i!=ID-1) NET->getwc(k)->sCuts[i]=1;
249 
250  // ID can not be used to get the event, to get event use ID=1 (ex: for watplot)
251  NET->getwc(k)->sCuts = sCuts; // restore cCuts
252 
253  if(cfg->dump) EVT->dopen(outDump.Data(),const_cast<char*>("a"),false);
254  EVT->output2G(net_tree,NET,ID,k,ofactor); // get reconstructed parameters
255  if(cfg->dump) {
256  // add Qveto to dump file
257  fprintf(EVT->fP,"Qveto: ");
258  for(int i=0; i<2*nIFO; i++) fprintf(EVT->fP,"%f ",Qveto[i]);
259  fprintf(EVT->fP,"\n");
260  // add Lveto to dump file
261  fprintf(EVT->fP,"Lveto: ");
262  for(int i=0; i<3; i++) fprintf(EVT->fP,"%f ",Lveto[i]);
263  fprintf(EVT->fP,"\n");
264  }
265  if(cfg->dump) EVT->dclose();
266  if(!cfg->cedDump) NET->getwc(k)->sCuts[ID-1]=1; // mark as processed
267  }
268  }
269 
270  jfile->cd();
271  if(EVT) delete EVT;
272  }
273  return;
274 }
275 
276 void
277 GetQveto(wavearray<double>* wf, float &Qveto, float &Qfactor) {
278 
279  wavearray<double> x = *wf;;
280 
281  // resample data by a factor 4
282  int xsize=x.size();
283  x.FFTW(1);
284  x.resize(4*x.size());
285  x.rate(4*x.rate());
286  for(int j=xsize;j<x.size();j++) x[j]=0;
287  x.FFTW(-1);
288 
289  // extract max/min values and save the absolute values in the array 'a'
290  wavearray<double> a(x.size());
291  int size=0;
292  double dt = 1./x.rate();
293  double prev=x[0];
294  double xmax=0;
295  for (int i=1;i<x.size();i++) {
296  if(fabs(x[i])>xmax) xmax=fabs(x[i]);
297  if(prev*x[i]<0) {
298  a[size]=xmax;
299  size++;
300  xmax=0;
301  }
302  prev=x[i];
303  }
304 
305  // find max value/index ans save on amax/imax
306  int imax=-1;
307  double amax=0;
308  for (int i=1;i<size;i++) {
309  if(a[i]>amax) {amax=a[i];imax=i;}
310  }
311 
312 /*
313  cout << endl;
314  cout << "a[imax-2] " << a[imax-2] << endl;
315  cout << "a[imax-1] " << a[imax-1] << endl;
316  cout << "a[imax] " << a[imax] << endl;
317  cout << "a[imax+1] " << a[imax+1] << endl;
318  cout << "a[imax+2] " << a[imax+2] << endl;
319  cout << endl;
320 */
321 
322  // compute Qveto
323  double ein=0; // energy of max values inside NTHR
324  double eout=0; // energy of max values outside NTHR
325  for (int i=0;i<size;i++) {
326  if(abs(imax-i)<=NTHR) {
327  ein+=a[i]*a[i];
328  //cout << i << " ein " << a[i] << " " << amax << endl;
329  } else {
330  if(a[i]>amax/ATHR) eout+=a[i]*a[i];
331  //if(a[i]>amax/ATHR) cout << i << " eout " << a[i] << " " << amax << endl;
332  }
333  }
334  Qveto = ein>0 ? eout/ein : 0.;
335  //cout << "Qveto : " << Qveto << " ein : " << ein << " eout : " << eout << endl;
336 
337  // compute Qfactor
338  float R = (a[imax-1]+a[imax+1])/a[imax]/2.;
339  Qfactor = sqrt(-pow(TMath::Pi(),2)/log(R)/2.);
340  //cout << "Qfactor : " << Qfactor << endl;
341 
342  return;
343 }
344 
345 void
346 GetLveto(netcluster* pwc, int cid, int nifo, float* Lveto) {
347 //
348 // input
349 // pwc : pointer to netcluster object
350 // cid : cluster id
351 // nifo : number of detectors
352 // output
353 // Lveto[0] : line frequency
354 // Lveto[1] : line bandwitdh
355 // Lveto[2] : line enery ratio (line_energy / total_energy)
356 //
357 
358  Lveto[0] = Lveto[1] = Lveto[2] = 0;
359 
360  std::vector<int>* vint = &(pwc->cList[cid-1]); // pixel list
361  int V = vint->size(); // cluster size
362  if(!V) return;
363 
364  // ------------------------------------------------------------------
365  // Find max pixel parameters
366  // ------------------------------------------------------------------
367 
368  double likeMax=0; // maximum pixel's energy
369  double likeTot=0; // total cluster energy
370  double freqMax; // frequency of the pixel with max energy
371  double dfreqMax; // df of the pixel with max energy
372  for(int n=0; n<V; n++) {
373  netpixel* pix = pwc->getPixel(cid,n);
374  if(pix->layers%2==0) {
375  cout << "CWB_Plugin_QLveto.C - Error : is enabled only for WDM (2G)" << endl;
376  exit(1);
377  }
378  if(!pix->core) continue; // select only the principal components pixels
379 
380  double likePix=0;
381  for(int m=0; m<nifo; m++) {
382  likePix += pow(pix->getdata('S',m),2); // like whitened reconstructed signal 00
383  likePix += pow(pix->getdata('P',m),2); // like whitened reconstructed signal 90
384  }
385 
386  double freq = pix->frequency*pix->rate/2.;
387  double df = pix->rate/2.;
388 
389  likeTot+=likePix;
390  if(likePix>likeMax) {likeMax=likePix;freqMax=freq;dfreqMax=df;}
391  }
392  //cout << "likeMax : " << likeMax << " likeTot : " << likeTot
393  // << " freqMax : " << freqMax << " dfreqMax : " << dfreqMax << endl;
394 
395  // ------------------------------------------------------------------
396  // Compute Lveto parameters
397  // ------------------------------------------------------------------
398 
399  double fmean=0; // line mean frequency
400  double frms=0; // line bandwidth
401  double likeLin=0; // line energy
402  for(int n=0; n<V; n++) {
403  netpixel* pix = pwc->getPixel(cid,n);
404  if(!pix->core) continue; // select only the principal components pixels
405 
406  double likePix=0;
407  for(int m=0; m<nifo; m++) {
408  likePix += pow(pix->getdata('S',m),2); // like whitened reconstructed signal 00
409  likePix += pow(pix->getdata('P',m),2); // like whitened reconstructed signal 90
410  }
411 
412  // the estimation is done for all pixels
413  // with freq in the range [freqMax-dfreqMax, freqMax+dfreqMax]
414  double freq = pix->frequency*pix->rate/2.;
415  if(fabs(freq-freqMax)<=dfreqMax) {
416  likeLin += likePix;
417  fmean += likePix*freq;
418  frms += likePix*freq*freq;
419  }
420  }
421 
422  fmean = fmean/likeLin;
423  frms = frms/likeLin-fmean*fmean;
424  frms = frms>0 ? sqrt(frms) : 0.;
425 
426  if(frms<dfreqMax/2.) frms=dfreqMax/2.;
427 
428  // ------------------------------------------------------------------
429  // Save Lveto parameters
430  // ------------------------------------------------------------------
431 
432  Lveto[0] = fmean; // line mean frequency
433  Lveto[1] = frms; // line bandwidth
434  Lveto[2] = likeTot>0. ? likeLin/likeTot : 0.; // energy ratio energy inside_line/total
435 
436  // ------------------------------------------------------------------
437  // plot time-frequency energy
438  // ------------------------------------------------------------------
439 
440 #if defined PLOT_LIKELIHOOD
441  watplot WTS(const_cast<char*>("wts"));
442  WTS.plot(pwc, cid, nifo, 'L', 0, const_cast<char*>("COLZ"));
443  WTS.canvas->Print("l_tfmap_scalogram.png");
444 #endif
445 
446  return;
447 }
448 
449 void
451  CWB::config* cfg, bool fft, bool strain) {
452 
453  watplot PTS(const_cast<char*>("ptswrc"),200,20,800,500);
454 
455  //cout << "Print " << fname << endl;
456  double tmin = wfREC->start();
457  wfREC->start(wfREC->start()-tmin);
458  if(fft) {
459  PTS.plot(wfREC, const_cast<char*>("ALP"), 1, 0, 0, true, cfg->fLow, cfg->fHigh);
460  } else {
461  PTS.plot(wfREC, const_cast<char*>("ALP"), 1, 0, 0);
462  }
463  PTS.graph[0]->SetLineWidth(1);
464  wfREC->start(wfREC->start()+tmin);
465 
466  char label[64]="";
467  if(fft) sprintf(label,"%s","fft");
468  else sprintf(label,"%s","time");
469  if(strain) sprintf(label,"%s_%s",label,"strain");
470  else sprintf(label,"%s_%s",label,"white");
471 
472  char fname[1024];
473  //sprintf(fname, "%s_wf_%s_rec_gps_%d.root",ifo.Data(),label,int(tmin));
474  sprintf(fname, "%s_wf_%s_rec_gps_%d.png",ifo.Data(),label,int(tmin));
475  PTS.canvas->Print(fname);
476  cout << "write : " << fname << endl;
477  //PTS.canvas->Write(REPLACE(fname,dirCED,gtype));
478 }
479 
480 void
482 
483  int n;
484 
485  n = ifo->IWFP.size();
486  for (int i=0;i<n;i++) {
488  delete wf;
489  }
490  ifo->IWFP.clear();
491  ifo->IWFID.clear();
492 
493  n = ifo->RWFP.size();
494  for (int i=0;i<n;i++) {
496  delete wf;
497  }
498  ifo->RWFP.clear();
499  ifo->RWFID.clear();
500 }
501 
502 std::vector<netpixel> DoPCA(network* NET, CWB::config* cfg, int lag, int id) {
503 
504  double ee;
505 
506  size_t nIFO = NET->ifoList.size();
507 
508  float En = 2*NET->acor*NET->acor*nIFO; // network energy threshold in the sky loop
509 
510  int size = NET->a_00.size();
511  int f_ = NIFO/4;
512 
513  netpixel* pix;
514  netcluster* pwc = NET->getwc(lag);
515  std::vector<netpixel> vPIX;
516 
517  std::vector<int> pI = NET->wdmMRA.getXTalk(pwc, id, false); // buffer for pixel IDs
518  int V = pI.size();
519  if(V>cfg->BATCH) return vPIX; // attach TD amp to pixels < V
520 
521  wavearray<float> xi(size); xi=0; // PC 00 array
522  wavearray<float> XI(size); XI=0; // PC 90 array
523 
524  __m128* _xi = (__m128*) xi.data; // set pointer to PC 00 array
525  __m128* _XI = (__m128*) XI.data; // set pointer to PC 90 array
526 
527  __m128* _aa = (__m128*) NET->a_00.data; // set pointer to 00 array
528  __m128* _AA = (__m128*) NET->a_90.data; // set pointer to 90 array
529 
530  int nPC = 0;
531  for(int j=0; j<V; j++) {
532  int jf = j*f_; // source sse pointer increment
533  _sse_zero_ps(_xi+jf); // zero MRA amplitudes
534  _sse_zero_ps(_XI+jf); // zero MRA amplitudes
535  ee = _sse_abs_ps(_aa+jf,_AA+jf); // total pixel energy / quadrature
536  if(ee>En) nPC++; else ee=0.; // count core pixels
537  NET->rNRG.data[j] = ee; // init residual energy array
538  NET->pNRG.data[j] = NET->rNRG.data[j]; // init residual energy array
539  }
540 
541  nPC = NET->_sse_mra_ps(xi.data,XI.data,En,nPC); // get principal components
542 
543  for(int j=0; j<V; j++) { // loop over principal components
544  pix = pwc->getPixel(id,pI[j]);
545  vPIX.push_back(*pix); // save original pixels
546  pix->core = false;
547  ee = NET->pNRG.data[j]; // total pixel energy
548  if(ee<En) continue;
549  pix->core = true;
550  for(int i=0; i<nIFO; i++) {
551  pix->setdata(double(xi.data[j*NIFO+i]),'S',i); // store 00 whitened response PC
552  pix->setdata(double(XI.data[j*NIFO+i]),'P',i); // store 90 whitened response PC
553  }
554  }
555 
556  return vPIX;
557 }
558 
559 void ResetPCA(network* NET, CWB::config* cfg, netcluster* pwc, std::vector<netpixel>* vPIX, int ID) {
560 
561  std::vector<int> pI = NET->wdmMRA.getXTalk(pwc, ID, false); // buffer for pixel IDs
562  int V = pI.size();
563  if(V>cfg->BATCH) return; // attach TD amp to pixels < V
564  for(int j=0; j<V; j++) {
565  netpixel* pix = pwc->getPixel(ID,pI[j]);
566  *pix = (*vPIX)[j];
567  }
568 
569  while(!vPIX->empty()) vPIX->pop_back();
570  vPIX->clear(); std::vector<netpixel>().swap(*vPIX);
571 }
monster wdmMRA
list of pixel pointers for MRA
Definition: network.hh:633
std::vector< char * > ifoName
Definition: network.hh:591
detector * getifo(size_t n)
param: detector index
Definition: network.hh:418
CWB::config * cfg
Definition: TestCWB_Plugin.C:5
char analysis[8]
Definition: config.hh:99
static float _sse_abs_ps(__m128 *_a)
Definition: watsse.hh:119
TString outDump
virtual size_t size() const
Definition: wavearray.hh:127
#define NIFO
Definition: wat.hh:56
size_t nLag
Definition: network.hh:555
void GetLveto(netcluster *pwc, int cid, int nifo, float *Lveto)
#define ATHR
void setSLags(float *slag)
Definition: netevent.cc:404
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
wavearray< double > a(hp.size())
size_t frequency
Definition: netpixel.hh:93
void ResetPCA(network *NET, CWB::config *cfg, netcluster *pwc, std::vector< netpixel > *vPIX, int ID)
int n
Definition: cwb_net.C:10
static void _sse_zero_ps(__m128 *_p)
Definition: watsse.hh:26
cout<< "skymap size : "<< L<< endl;for(int l=0;l< L;l++) sm.set(l, l);sm > const_cast< char * >("skymap.dat")
wavearray< float > a_90
buffer for cluster sky 00 amplitude
Definition: network.hh:635
TTree * setTree()
Definition: netevent.cc:412
TString("c")
int ID
Definition: TestMDC.C:70
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
wavearray< double > get(char *name, size_t index=0, char atype='R', int type=1, bool=true)
param: string with parameter name param: index in the amplitude array, which define detector param: c...
Definition: netcluster.cc:2188
std::vector< wavearray< double > * > RWFP
Definition: detector.hh:364
int _sse_mra_ps(float *, float *, float, int)
Definition: network.hh:1258
double fLow
Definition: config.hh:122
int pattern
Definition: config.hh:223
netpixel pix(nifo)
netcluster * pwc
Definition: cwb_job_obj.C:20
std::vector< TGraph * > graph
Definition: watplot.hh:176
bool cedDump
Definition: config.hh:279
waveform wf
Long_t size
WSeries< double > waveBand
Definition: detector.hh:338
size_t layers
Definition: netpixel.hh:94
int m
Definition: cwb_net.C:10
std::vector< vector_int > cList
Definition: netcluster.hh:379
virtual void start(double s)
Definition: wavearray.hh:119
int j
Definition: cwb_net.C:10
bool getMRAwave(size_t ID, size_t lag, char atype='S', int mode=0, bool tof=false)
Definition: network.cc:3635
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:132
std::vector< detector * > ifoList
Definition: network.hh:590
bool outPlugin
Definition: config.hh:351
std::vector< netpixel > DoPCA(network *NET, CWB::config *cfg, int lag, int id)
bool core
Definition: netpixel.hh:102
char ifo[NIFO_MAX][8]
void dopen(const char *fname, char *mode, bool header=true)
Definition: netevent.hh:291
size_t ifoListSize()
Definition: network.hh:413
#define nIFO
#define NTHR
wavearray< float > pNRG
buffers for cluster residual energy
Definition: network.hh:637
void CWB_Plugin(TFile *jfile, CWB::config *cfg, network *NET, WSeries< double > *x, TString ifo, int type)
COHERENCE.
TCanvas * canvas
Definition: watplot.hh:174
double factor
jfile
Definition: cwb_job_obj.C:25
void output2G(TTree *, network *, size_t, int, double)
Definition: netevent.cc:687
TTree * net_tree
int simulation
Definition: config.hh:181
#define IMPORT(TYPE, VAR)
Definition: cwb.hh:51
watplot * WTS
Definition: ChirpMass.C:115
xtalk getXTalk(int nLay1, size_t indx1, int nLay2, size_t indx2)
param: numbers of layers identifying the resolution of the first pixel param: TF map index of the fir...
Definition: monster.cc:351
TCut qveto("qveto","Qveto[0]>0.3 && Qveto[1]>0.3")
i() int(T_cor *100))
network NET
Definition: cwb_dump_inj.C:12
TString label
Definition: MergeTrees.C:21
double Pi
void ClearWaveforms(detector *ifo)
bool log
Definition: WaveMDC.C:41
int BATCH
Definition: config.hh:227
wavearray< float > a_00
wdm multi-resolution analysis
Definition: network.hh:634
int gIFACTOR
TIter next(twave->GetListOfBranches())
char fname[1024]
std::vector< int > RWFID
Definition: detector.hh:363
int k
std::vector< wavearray< double > * > IWFP
Definition: detector.hh:361
double acor
Definition: network.hh:567
std::vector< int > IWFID
Definition: detector.hh:360
TFile * froot
netpixel * getPixel(size_t n, size_t i)
Definition: netcluster.hh:395
double dt
virtual void FFTW(int=1)
Definition: wavearray.cc:878
int nifo
FILE * fP
injected reconstructed xcor waveform
Definition: netevent.hh:122
void PlotWaveform(TString ifo, wavearray< double > *wfREC, CWB::config *cfg, bool fft=false, bool strain=false)
bool wfsave
Definition: network.hh:582
netevent EVT(itree, nifo)
std::vector< int > sCuts
Definition: netcluster.hh:374
WSeries< double > waveForm
Definition: detector.hh:337
void dclose()
Definition: netevent.hh:300
double fHigh
Definition: config.hh:123
char Name[16]
Definition: detector.hh:309
double fabs(const Complex &x)
Definition: numpy.cc:37
string file
Definition: cwb_online.py:385
TBranch * branch
double df
netcluster * getwc(size_t n)
param: delay index
Definition: network.hh:421
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void GetQveto(wavearray< double > *wf, float &Qveto, float &Qfactor)
DataType_t * data
Definition: wavearray.hh:301
wavearray< float > rNRG
buffer for cluster sky 90 amplitudes
Definition: network.hh:636
Long_t id
double factors[FACTORS_MAX]
Definition: config.hh:184
list files
Definition: cwb_online.py:529
float rate
Definition: netpixel.hh:95
double getdata(char type='R', size_t n=0)
Definition: netpixel.hh:56
virtual void resize(unsigned int)
Definition: wavearray.cc:445
int check
exit(0)
bool setdata(double a, char type='R', size_t n=0)
Definition: netpixel.hh:40
bool dump
Definition: config.hh:277