Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_net.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 // Coherent WaveBurst production script for GW network
20 {
22 
23  TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
24  TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
25  TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
26 
27 
28  int i,j,n,m;
29 
30  if(search=='E' || search=='E') cout<<"\n un-modeled search (Energy): "<<SEARCH()<<endl;
31  if(search=='b' || search=='B') cout<<"\n un-modeled search (single stream): "<<SEARCH()<<endl;
32  if(search=='r' || search=='R') cout<<"\n un-modeled search (dual stream): "<<SEARCH()<<endl;
33  if(search=='i' || search=='I') cout<<"\n elliptical polarisation: "<<SEARCH()<<endl;
34  if(search=='g' || search=='G') cout<<"\n circular polarisation: "<<SEARCH()<<endl;
35  if(search=='s' || search=='S') cout<<"\n linear polarisation: "<<SEARCH()<<endl;
36 
37  // Check single detector mode
38  // if nIFO=1 the analysis is done as a network of 2 equal detectors
39  bool singleDetector=false;
40  if(nIFO==1) {
41  cout << "------> cWB in Sigle Detector Mode !!!" << endl;
42  singleDetector=true;
43  sprintf(ifo[1],"%s",ifo[0]);
44  strcpy(refIFO,ifo[0]);
47  strcpy(frFiles[2],frFiles[1]); // mdc frFiles
48  strcpy(frFiles[1],frFiles[0]);
49 
50  for(int i=0;i<nDQF;i++) DQF[i+nDQF]=DQF[i];
51  nDQF*=2;
52 
53  eDisbalance = false; // disable energy disbalance
54  lagSize = 1;
55  lagOff = 0;
56  mode = 1; // 1 - exclude duplicate delay configurations
57  delta = 0; // weak regulator
58  GAMMA() = 0; // force regulator not to be hard
59 
60  nIFO++;
61  }
62 
63 
64  cout<<" network of ";
65  for(i=0; i<nIFO; i++) cout<<ifo[i]<<" ";
66  cout<<" detectors\n\n";
67 
68 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
69 // declarations
70 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
71 
72  Meyer<double> B(1024); // set wavelet for resampling
73  Meyer<double> S(1024,2); // set wavelet for production
74 
77 
78  wavearray<double> x; // temporary time series
79  WSeries<double> wM; // mdc WSeries
80  WSeries<float> v[nIFO]; // noise variability
81  detector* pD[nIFO]; // pointers to detectors
82  WSeries<double>* pTF[nIFO]; // pointers to WSeries
83 
84  for(i=0; i<nIFO; i++) pD[i] = new detector(ifo[i]);
85 
86  network NET; // network
87 
88  for(i=0; i<nIFO; i++) NET.add(pD[i]);
90  NET.setAntenna();
91  NET.constraint(delta,GAMMA());
92  NET.setDelay(refIFO);
93  NET.Edge = segEdge;
94  NET.netCC = netCC;
95  NET.netRHO = netRHO;
96  NET.EFEC = EFEC;
97  NET.precision = precision;
98  NET.nSky = nSky;
100 
101  double mTau=NET.getDelay("MAX"); // maximum time delay
102  double dTau=NET.getDelay(); // time delay difference
103  cout<<"maximum time delay between detectors: "<<mTau<<endl;
104  cout<<" maximum time delay difference: "<<dTau<<endl;
105  cout<<" skymap search mode: "<<mode<<endl;
106  cout<<" skymap angular resolution: "<<angle<<endl;
107  cout<<" skymap size in polar angle: "<<Theta1<<", "<<Theta2<<endl;
108  cout<<" skymap size in azimuthal angle: "<<Phi1<<", "<<Phi2<<endl;
109  cout<<" netRHO and netCC: "<<netRHO<<", "<<netCC<<endl;
110  cout<<" regulator delta, local: "<<delta<<" "<<NET.local<<endl<<endl;
111 
112  injection mdc(nIFO);
113  livetime live;
114  netevent netburst(nIFO,Psave);
115  variability wavevar;
116  wavenoise noiserms;
117 
118  gSystem->Exec("/bin/date");
119  gSystem->Exec("/bin/hostname");
120  gRandom->SetSeed(0);
121 
122  // parse input
123 
124  int dump_infos_and_exit = TString(gSystem->Getenv("CWB_DUMP_INFOS_AND_EXIT")).Atoi();
125  int dump_sensitivity_and_exit = TString(gSystem->Getenv("CWB_DUMP_SENSITIVITY_AND_EXIT")).Atoi();
126 
127  TString srunID = TString(gSystem->Getenv("CWB_JOBID"));
128  runID = srunID.Atoi();
129 
130  cout<<"job ID: "<<runID<<endl;
131  cout<<"Output: "<<output_dir<<"\n label: "<<data_label<<endl;
132 
133  NET.setRunID(runID);
134 
135  // ---------------------------------------------------------------------
136  // CWB HISTORY INIT
137  // ---------------------------------------------------------------------
138 
139  CWB::Toolbox histTB;
140  char job_stage[256];
141  if(simulation==1) sprintf(job_stage,"SIMULATION");
142  else sprintf(job_stage,"PRODUCTION");
143 
144  char* cwbBuffer = histTB.getEnvCWB();
145  if(cwbBuffer!=NULL) {
146  history.AddHistory(job_stage, "CWB_ENV", cwbBuffer);
147  delete [] cwbBuffer;
148  }
149 
150  history.AddHistory(job_stage, "WATVERSION", watversion('s'));
151  history.AddHistory(job_stage, "WORKDIR", work_dir);
152  history.AddHistory(job_stage, "DATALABEL", data_label);
153 
154  char cmd_line[512]="";
155  for(int i=0;i<gApplication->Argc();i++) sprintf(cmd_line,"%s %s",cmd_line,gApplication->Argv(i));
156  history.AddHistory(job_stage, "CMDLINE", cmd_line);
157 
158  char* rootlogonBuffer = histTB.readFile("rootlogon.C");
159  if(rootlogonBuffer!=NULL) {
160  history.AddHistory(job_stage, "ROOTLOGON", rootlogonBuffer);
161  delete [] rootlogonBuffer;
162  }
163 
164  // save configuration files
165  TString cwb_parameters_name = TString(gSystem->Getenv("CWB_PARAMETERS_FILE"));
166  for(int i=0;i<gApplication->Argc()-1;i++) { // skip last argument (net.C)
167  if(TString(gApplication->Argv(i)).Contains(".C")) {
168  char* parametersBuffer = histTB.readFile(gApplication->Argv(i));
169  if(parametersBuffer!=NULL) {
170  if(TString(gApplication->Argv(i))==cwb_parameters_name) {
171  history.AddHistory(job_stage, "PARAMETERS", parametersBuffer);
172  } else {
173  history.AddLog(job_stage, parametersBuffer);
174  }
175  }
176  delete [] parametersBuffer;
177  }
178  }
179 
180  history.AddLog(job_stage, "START JOB");
181  int job_start_time=CWB::Time("now").GetGPS();
182 
183  // ---------------------------------------------------------------------
184  // JOB INIT
185  // ---------------------------------------------------------------------
186 
187  #include <vector>
188 
189  // cwb toolbox
191  CWB::Toolbox frTB[nIFO+1]; // the first nIFO positions contains the ifo frFiles, nIFO+1 contains the sim frFile
192  int nfrFiles[nIFO+1];
193  vector<waveSegment> detSegs;
194  vector<waveSegment> cat1List,cat2List;
195  int jobID;int slagID;int segID[20];
196  double mdcShift=0.;
197  vector<TString> ifos(nIFO);
198  for(int n=0;n<nIFO;n++) ifos[n]=ifo[n];
199 
200  if((simulation)&&((slagSize>1)||(lagSize!=1))) {
201  cout << "Error : slagSize<=1 & lagSize==1 in simulation mode !!!" << endl;exit(1);
202  }
203 
204  if(slagSize>0) { // SLAG Segments
205 
206  cout << endl << "START SLAG Init ..." << endl << endl;
207 
208  // get zero lag merged dq cat 1 list
209  // used only to get slagSegs && slagJobList
210  cat1List=slagTB.readSegList(nDQF, DQF, CWB_CAT1);
211 
212  // get number/list of possible super lag jobs
213  vector<waveSegment> slagJobList=slagTB.getSlagJobList(cat1List, segLen);
214  int slagSegs=slagJobList.size();
215 
216  // get super lag list
217  vector<slag> slagList=slagTB.getSlagList(nIFO, slagSize, slagSegs, slagOff, slagMin, slagMax, slagSite);
218 
219  // init slag structures
220  slag SLAG=slagTB.getSlag(slagList,runID);
221  if(SLAG.jobId!=runID) {cout << "jobID " << runID << " not found in the slag list !!!" << endl;exit(1);}
222  slagID = SLAG.slagId[0];
223  jobID = SLAG.jobId;
224  for(n=0; n<nIFO; n++) segID[n]=SLAG.segId[n];
225  cout << "SuperLag=" << slagID << " jobID=" << jobID;
226  for(n=0; n<nIFO; n++) cout << " segID[" << ifo[n] << "]=" << segID[n];cout << endl;
227 
228  // set slag shifts into the DQF structures
229  for(int n=0;n<nIFO;n++) ifos[n]=ifo[n];
230  slagTB.setSlagShifts(SLAG, ifos, segLen, nDQF, DQF);
231 
232  // get shifted merged dq cat 1 list
233  cat1List=slagTB.readSegList(nDQF, DQF, CWB_CAT1);
234 
235  // extract detector's slag segments range from dq cat 1
236  detSegs=slagTB.getSegList(SLAG, slagJobList, segLen, segMLS, segEdge, cat1List);
237  cout << "Slag Segments" << endl;
238 
239  cout << endl << "END SLAG Init ..." << endl << endl;
240 
241  } else { // Standard Segments
242 
243  jobID = runID;
244  slagID = 0;
245  for(int n=0;n<nIFO;n++) segID[n]=0;
246 
247  // get shifted merged dq cat 1 list
248  cat1List=slagTB.readSegList(nDQF, DQF, CWB_CAT1);
249 
250  // extract detector's segments range from dq cat 1
251  detSegs=slagTB.getSegList(jobID, nIFO, segLen, segMLS, segEdge, cat1List);
252  cout << "Standard Segments" << endl;
253  }
254 
255  // store slags in NET class
256  float slagShift[20];
257  for(n=0; n<nIFO; n++) slagShift[n]=(segID[n]-segID[0])*segLen;
258  slagShift[nIFO]=slagID;
259  netburst.setSLags(slagShift);
260 
261  // print detector's segments for this job
262  cout.precision(14);
263  for(int i=0;i<nIFO;i++) {
264  cout << "detSegs_dq1[" << ifo[i] << "] Range : " << detSegs[i].start << "-" << detSegs[i].stop << endl;
265  }
266  if(detSegs.size()==0) {cout << "no segments found for this job, job terminated !!!" << endl;exit(1);}
267 
268  // set & get frame file list
269  frfile FRF[nIFO+1];
270  for(n=0; n<nIFO; n++) {
271  nfrFiles[n]=frTB[n].frl2FrTree(frFiles[n]);
272  cout << ifo[n] << " -> nfrFiles : " << nfrFiles[n] << endl;
273  FRF[n] = frTB[n].getFrList(detSegs[n].start-dataShift[n], detSegs[n].stop-dataShift[n], segEdge); // dataShift
274  }
276  // set frame file list
277  nfrFiles[nIFO]=frTB[nIFO].frl2FrTree(frFiles[nIFO]);
278  cout << "MDC " << " -> nfrFiles : " << nfrFiles[nIFO] << endl;
279  if(mdc_shift.startMDC<0) {
280  // read mdc range from mdc frl files
281  waveSegment mdc_range = frTB[nIFO].getFrRange();
282  cout << "mdc_range : " << mdc_range.start << " " << mdc_range.stop << endl;
283  mdc_shift.startMDC=mdc_range.start;
284  mdc_shift.stopMDC=mdc_range.stop;
285  }
286  mdcShift = frTB[nIFO].getMDCShift(mdc_shift, detSegs[0].start);
287  cout << "mdcShift : " << mdcShift << endl;
288  FRF[nIFO] = frTB[nIFO].getFrList(detSegs[0].start-mdcShift, detSegs[0].stop-mdcShift, segEdge);
289  }
290 
291  // get shifted merged dq cat 2 list
292  cat2List=slagTB.readSegList(nDQF, DQF, CWB_CAT2);
293  // store cat2List into network class
295 
296  // check if seg+cat2 data length is not zero
297  vector<waveSegment> detSegs_dq2;
298  detSegs_dq2.push_back(detSegs[0]);
299  detSegs_dq2 = slagTB.mergeSegLists(detSegs_dq2,cat2List);
300  for(int i=0;i<detSegs_dq2.size();i++) {
301  cout << "detSegs_dq2[" << i << "] Range : " << detSegs_dq2[i].start << "-" << detSegs_dq2[i].stop << endl;
302  }
303  double detSegs_ctime = slagTB.getTimeSegList(detSegs_dq2);
304  cout << "live time after cat 2 : " << detSegs_ctime << endl;
305  if(detSegs_ctime<segTHR) {cout << "job segment live time after cat2 < " << segTHR << " sec, job terminated !!!" << endl;exit(1);}
306 
307  double Tb=detSegs[0].start;
308  double Te=detSegs[0].stop;
309  double dT = Te-Tb; // WB segment duration
310 
311  // read input framelist file
312 
313  char file[512], tdf00[512], tdf90[512], buFFer[1024];
314  int rnID = int(gRandom->Rndm(13)*1.e9); // random name ID
315 
316  if(simulation) { // reag MDC log file
317  i=NET.readMDClog(injectionList,double(long(Tb))-mdcShift);
318  printf("GPS: %16.6f saved, injections: %d\n",double(long(Tb)),i);
319  frTB[nIFO].shiftBurstMDCLog(NET.mdcList, ifos, mdcShift);
320  for(int i=0;i<NET.mdcTime.size();i++) NET.mdcTime[i]+=mdcShift;
321 
322  // check if seg+cat2+inj data length is not zero
323  vector<waveSegment> mdcSegs(NET.mdcTime.size());
324  for(int k=0;k<NET.mdcTime.size();k++) {mdcSegs[k].start=NET.mdcTime[k]-gap;mdcSegs[k].stop=NET.mdcTime[k]+gap;}
325  vector<waveSegment> mdcSegs_dq2 = slagTB.mergeSegLists(detSegs_dq2,mdcSegs);
326  double mdcSegs_ctime = slagTB.getTimeSegList(mdcSegs_dq2);
327  cout << "live time in zero lag after cat2+inj : " << mdcSegs_ctime << endl;
328  if(mdcSegs_ctime==0) {cout << "job segment with zero cat2+inj live time in zero lag, job terminated !!!" << endl;exit(1);}
329  }
330 
331  if(dump_infos_and_exit) exit(0);
332 
333  if(mask>0.) NET.setSkyMask(mask,skyMaskFile);
334 
335  for(i=0; i<nIFO; i++) {
336  frTB[i].readFrames(FRF[i],channelNamesRaw[i],x);
337  x.start(x.start()+dataShift[i]); // dataShift
338  x.start(x.start()-segLen*(segID[i]-segID[0])); // SLAG
339  if(singleDetector) TB.resampleToPowerOfTwo(x);
340  sprintf(file,"%s/%s_%d_%s_%d_%d.dat",
341  nodedir,ifo[i],int(Tb),data_label,runID,rnID);
342  if(dump_sensitivity_and_exit) { // used only to save sensitivity
343  sprintf(file,"%s/sensitivity_%s_%d_%s_job%d.txt",dump_dir,ifo[i],int(Tb),data_label,runID);
344  cout << endl << "Dump Sensitivity : " << file << endl << endl;
345  TB.makeSpectrum(file, x);
346  continue;
347  }
348  if(dcCal[i]>0.) x*=dcCal[i]; // DC correction
349  if(fResample>0) {
350  x.FFT(1); x.resize(fResample/x.rate()*x.size()); x.FFT(-1); x.rate(fResample); //RESAMPLING
351  }
352  pTF[i] = pD[i]->getTFmap();
353  pTF[i]->Forward(x,B,levelR);
354  pTF[i]->getLayer(x,0);
355  pTF[i]->Forward(x,S,levelD);
356  pTF[i]->DumpBinary(file);
357  n = pTF[i]->size();
358 
359  fprintf(stdout,"start=%f duration=%f rate=%f\n",
360  x.start(),x.size()/x.rate(),x.rate());
361  if(i>0 && pTF[0]->start() != x.start()) {
362  cout << "net.C - Error : data not synchronized" << endl;
363  cout << ifo[i] << " " << x.start() << " != " << ifo[0] << " " << pTF[0]->start() << endl;
364  exit(1);
365  }
366  if(i>0 && pTF[0]->rate() != x.rate()) {
367  cout << "net.C - Error : data have different rates" << endl;
368  cout << ifo[i] << " " << x.rate() << " != " << ifo[0] << " " << pTF[0]->rate() << endl;
369  exit(1);
370  }
371 
372  if(simulation) {
373  frTB[nIFO].readFrames(FRF[nIFO],channelNamesMDC[i],x); // SLAG
374  x.start(x.start()+mdcShift); // SLAG
375  sprintf(file,"%s/mdc%s_%d_%s_%d_%d.dat",
376  nodedir,ifo[i],int(Tb),data_label,runID,rnID);
377  cout<<file<<endl;
378  if(fResample>0) {
379  x.FFT(1); x.resize(fResample/x.rate()*x.size()); x.FFT(-1); x.rate(fResample); //RESAMPLING
380  }
381  wM.Forward(x,B,levelR);
382  wM.getLayer(x,0);
383  wM.Forward(x,S,levelD);
384  wM.DumpBinary(file);
385  m = wM.size();
386 
387  fprintf(stdout,"start=%f duration=%f rate=%f\n",
388  x.start(),x.size()/x.rate(),x.rate());
389  if(i>0 && wM.start() != x.start()) exit(1);
390  if(i>0 && wM.rate() != x.rate()) exit(1);
391  if(n != m) exit(1);
392  }
393  if(singleDetector) break;
394  }
395  if(dump_sensitivity_and_exit) exit(0);
396 
397  size_t lags = 0;
398  double factor = 1.0; // strain factor
399  double R = x.rate(); // data rate
400  x.resize(0);
401 
402  char tmpFile[1024];
403  char outFile[1024];
404  char endFile[1024];
405  char outDump[1024];
406  char endDump[1024];
407  char out_CED[1024];
408  char end_CED[1024];
409  char command[1024];
410  FileStat_t fstemp;
411 
412 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
413 // if simulation==1, loop on the injection strain factors
414 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
415 
416  if(!simulation) nfactor = 1;
417 
418  for(int iii=0; iii<nfactor; iii++) {
419 
420  if(simulation) {
421  factor=factors[iii];
422  cout<<"factor="<<factor<<endl;
423  char sim_label[512];
424  sprintf(sim_label,"%d_%d_%s_%g_job%d",int(Tb),int(dT),data_label,factor,runID);
425 
426  sprintf(outFile,"%s/wave_%s.root",nodedir,sim_label);
427  sprintf(endFile,"%s/wave_%s.root",output_dir,sim_label);
428  sprintf(tmpFile,"%s/wave_%s.root.tmp",nodedir,sim_label);
429  sprintf(outDump,"%s/wave_%s.txt",nodedir,sim_label);
430  sprintf(endDump,"%s/wave_%s.txt",output_dir,sim_label);
431  sprintf(out_CED,"%s/ced_%s",nodedir,sim_label);
432  sprintf(end_CED,"%s/ced_%s",output_dir,sim_label);
433 
434  if(!gSystem->GetPathInfo(endFile,fstemp)) {
435  printf("The file %s already exists - skip\n",endFile);
436  fflush(stdout);
437  TFile rf(endFile);
438  if(!rf.IsZombie()) continue;
439  }
440 
441  }
442  else {
443  char prod_label[512];
444  sprintf(prod_label,"%d_%d_%s_slag%d_lag%d_%d_job%d",
445  int(Tb),int(dT),data_label,slagID,lagOff,lagSize,runID);
446 
447  sprintf(outFile,"%s/wave_%s.root",nodedir,prod_label);
448  sprintf(endFile,"%s/wave_%s.root",output_dir,prod_label);
449  sprintf(tmpFile,"%s/wave_%s.root.tmp",nodedir,prod_label);
450  sprintf(outDump,"%s/wave_%s.txt",nodedir,prod_label);
451  sprintf(endDump,"%s/wave_%s.txt",output_dir,prod_label);
452  sprintf(out_CED,"%s/ced_%s",nodedir,prod_label);
453  sprintf(end_CED,"%s/ced_%s",output_dir,prod_label);
454  }
455 
456  cout<<"output file on the node: "<<outFile<<endl;
457  cout<<"final output file name : "<<endFile<<endl;
458  cout<<"temporary output file : "<<tmpFile<<endl;
459 
460  gSystem->Exec("/bin/date"); GetProcInfo();
461 
462 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
463 // data conditioning
464 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
465 
466  for(i=0; i<nIFO; i++) {
467  sprintf(file,"%s/%s_%d_%s_%d_%d.dat",
468  nodedir,ifo[i],int(Tb),data_label,runID,rnID);
469  pTF[i]->setLevel(levelD);
470  pTF[i]->ReadBinary(file);
471 
472  if(simulation) {
473  sprintf(file,"%s/mdc%s_%d_%s_%d_%d.dat",
474  nodedir,ifo[i],int(Tb),data_label,runID,rnID);
475  wM.setLevel(levelD);
476  wM.ReadBinary(file); wM*=factor;
477  pTF[i]->add(wM);
478  wM*=1./factor;
479  }
480 
481  pTF[i]->lprFilter(2,0,Tlpr,4.);
482  pTF[i]->setlow(fLow);
483  pD[i]->white(60.,1,8.,20.);
484  if(simulation) pD[i]->setsim(wM,NET.getmdcTime(),10.,8.,true);
485  pTF[i]->Inverse(levelD-levelF);
486  pTF[i]->lprFilter(2,0,Tlpr,4.);
487  pTF[i]->Forward(levelD-levelF);
488  pTF[i]->sethigh(fHigh);
489  v[i] = pTF[i]->variability();
490  pD[i]->bandPass(); // band pass filtering
491 
492  cout<<"After "<<ifo[i]<<" data conditioning"<<endl;
493  gSystem->Exec("/bin/date"); GetProcInfo();
494 
495  if(singleDetector) {*pD[1]=*pD[0]; break;}
496  }
497 /* MLAG
498  if(!simulation) { // setup lags
499  lags = NET.setTimeShifts(lagSize,lagStep,lagOff,lagMax,lagFile,lagMode,lagSite);
500  cout<<"lag step: "<<lagStep<<endl;
501  cout<<"number of time lags: "<<lags<<endl;
502  }
503  else if(!lags) lags = NET.setTimeShifts();
504 
505  double TL = NET.setVeto(gap);
506  cout<<"live time in zero lag: "<<TL<<endl<<endl; // set veto array
507  if(TL <= 0.) exit(1); // exit if live time is zero
508 */
509 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
510 // initialization of the output files
511 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
512 
513  TFile *froot = new TFile(tmpFile, "RECREATE");
514  TTree* net_tree = netburst.setTree();
515  TTree* live_tree= live.setTree();
516 
517  if(simulation) {
518  TTree* mdc_tree = mdc.setTree();
519  }
520  else {
521  TTree* var_tree = wavevar.setTree();
522  TTree* noise_tree = noiserms.setTree();
523  }
524 
525  //if(dump) netburst.dopen(outDump,"w");
526 
527 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
528 // start of the coherent search
529 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
530 
531  Long_t xid,xsize,xflags,xmt;
532  int xestat = gSystem->GetPathInfo(outDump,&xid,&xsize,&xflags,&xmt);
533  if (xestat==0) {
534  sprintf(command,"/bin/rm %s",outDump);
535  gSystem->Exec(command);
536  }
537 
538  int mlagSize=lagOff+lagSize;
539  int mlagOff=lagOff;
540 
541  if(mlagStep==0) mlagStep=lagSize; // if mlagStep=0 -> standard lag analysis
542 
543  for(int mlag=mlagOff;mlag<mlagSize;mlag+=mlagStep) {
544 
545  lagOff = mlag;
546  lagSize = lagOff+mlagStep<=mlagSize ? mlagStep : mlagSize-lagOff;
547  if(lagSize==0) continue;
548 
549  cout << "lagSize : " << lagSize << " lagOff : " << lagOff << endl;
550 
551 
552  if(!simulation) { // setup lags
553  lags = NET.setTimeShifts(lagSize,lagStep,lagOff,lagMax,lagFile,lagMode,lagSite);
554  cout<<"lag step: "<<lagStep<<endl;
555  cout<<"number of time lags: "<<lags<<endl;
556  }
557  else if(!lags) lags = NET.setTimeShifts();
558 
559  double TL = NET.setVeto(gap);
560  cout<<"live time in zero lag: "<<TL<<endl<<endl; // set veto array
561  if(TL <= 0.) exit(1); // exit if live time is zero
562 
563 
564  double Ao;
565  wavearray<int> np(NET.nLag); // pixel counter
566  bool append = false; // file append for savemode
567  int ceddir = 0; // flag if ced directory exists
568 
569  cout<<"Start coherent search: "; gSystem->Exec("/bin/date");
570 
571  for(i=levelD; i>=l_low; i--) { // loop over TF resolutions
572 
573  if(i<=l_high) {
574 
575  sprintf(tdf00,"%s/Meyer1024wat482_00_L%1d.dat",filter_dir,i);
576  NET.setDelayFilters(tdf00);
577  if(i==l_high) {
578  NET.setDelayIndex();
579  NET.setIndexMode(1);
580  }
581 
582  Ao = NET.threshold(bpp,dTau);
583  NET.set2or(x2or*Ao*Ao);
584  cout<<"pixel threshold in units of noise rms: "<<Ao<<endl;
585  cout<<"2 OR threshold in units of noise var: "<<x2or*Ao*Ao<<endl;
586 
587  cout<<"total pixels: "<<NET.coherence(Ao)<<" ";
588 
589  n = size_t(2.*Tgap*pD[0]->getTFmap()->resolution(0)+0.1);
590  m = size_t(Fgap/pD[0]->getTFmap()->resolution(0)+0.0001);
591 
592  cout<<"clusters: "<<NET.cluster(n,m)<<" ";
593  cout<<"selected pixels: "<<NET.likelihood('E',Acore)<<"\n";
594 
595  for(j=0; j<NET.nLag; j++) {
596  sprintf(file,"%s/pix_%d_%s_%d_%d_%d.lag",
597  nodedir,int(Tb),data_label,int(j),iii,rnID);
598  wc = *(NET.getwc(j));
599  if(!append) np.data[j] = wc.write(file,0);
600  else np.data[j] += wc.write(file,1);
601  cout<<wc.csize()<<"|"<<wc.size()<<"|"<<np.data[j]<<" ";
602  }
603  cout<<endl;
604  append = true;
605  }
606 
607  if(i>l_low) NET.Inverse(1);
608  gSystem->Exec("/bin/date"); GetProcInfo();
609 
610  }
611 
612 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
613 // supercluster analysis
614 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
615 
616  for(j=0; j<lags; j++){
617  sprintf(file,"%s/pix_%d_%s_%d_%d_%d.lag",
618  nodedir,int(Tb),data_label,int(j),iii,rnID);
619  wc.read(file);
620  m = wc.supercluster('L',NET.e2or,true);
621  pwc = NET.getwc(j); pwc->cpf(wc,true);
622  cout<<m<<"|"<<pwc->size()<<" ";
623  sprintf(command,"/bin/rm %s",file);
624  gSystem->Exec(command);
625  }
626  cout<<endl;
627  cout<<"events in the buffer: "<<NET.events()<<"\n";
628  gSystem->Exec("/bin/date"); GetProcInfo();
629 
630 
631 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
632 // likelihood
633 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
634 
635  for(i=l_low; i<=l_high; i++) {
636  sprintf(tdf00,"%s/Meyer1024wat482_00%s_L%1d.dat",filter_dir,filter,i);
637  sprintf(tdf90,"%s/Meyer1024wat482_90%s_L%1d.dat",filter_dir,filter,i);
638  NET.setDelayFilters(tdf00,tdf90);
639 
640  if(i==l_low) {
641  NET.setDelayIndex();
642  NET.setIndexMode(mode);
643  }
644 
645  cout<<"selected core pixels: "<<NET.likelihood(SEARCH(),Acore)<<" for level "<<i<<"\n";
646  cout<<"rejected weak pixels: "<<NET.netcut(netRHO,'r',0,1)<<"\n"; // remove weak glitches
647  cout<<"rejected loud pixels: "<<NET.netcut(netCC,'c',0,1)<<"\n"; // remove loud glitches
648  cout<<"events in the buffer: "<<NET.events()<<"\n";
649 
650  if(cedDump) {
651  cout<<"dump ced into "<<out_CED<<"\n";
652  //if(CED(&NET,out_CED,cedRHO)) ceddir = 1;
653  //if(netburst.ced(&NET,out_CED,cedRHO,factor)) ceddir = 1;
654  CWB::ced ced(&NET,&netburst,out_CED);
655  ced.SetOptions(cedRHO);
656  if(singleDetector) ced.SetChannelName(channelNamesRaw[0]);
657  bool fullCED = singleDetector ? false : true;
658  if(ced.Write(factor,fullCED)) ceddir = 1;
659  }
660 
661  if(i<l_high) NET.Forward(1);
662  }
663 
664  gSystem->Exec("/bin/date");
665  gSystem->Exec("/bin/date"); GetProcInfo();
666  cout<<"\nSearch done\n";
667  cout<<"reconstructed events: "<<NET.events()<<"\n";
668 
669  if(simulation) NET.printwc(0);
670 
671 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
672 // save data in root file
673 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
674 
675  if(dump) netburst.dopen(outDump,"w");
676 
677  //live.output(live_tree,&NET);
678  live.output(live_tree,&NET,slagShift); // FIX LIVETIME
679 
680  if(simulation) {
681  netburst.output(net_tree,&NET,factor);
682  mdc.output(mdc_tree,&NET,factor);
683  }
684  else {
685  netburst.output(net_tree,&NET);
686  for(i=0; i<nIFO; i++) {
687 // wavevar.output(var_tree,&v[i],i+1,segEdge);
688  noiserms.output(noise_tree,&pD[i].nRMS,i+1,R/2);
689  }
690  }
691 
692  history.AddLog(job_stage, "STOP JOB");
693  history.Write();
694 
695  froot->Write();
696  if(dump) netburst.dclose();
697 
698  } // end mlag loop
699 
700  froot->Close();
701 
702  sprintf(command,"/bin/mv %s %s", tmpFile, outFile);
703  if(!cedDump) gSystem->Exec(command);
704  sprintf(command,"/bin/mv %s %s",outFile,endFile);
705  if(!cedDump) gSystem->Exec(command);
706  sprintf(command,"/bin/mv %s %s",outDump,endDump);
707  if(!cedDump && dump) gSystem->Exec(command);
708  xestat = gSystem->GetPathInfo(end_CED,&xid,&xsize,&xflags,&xmt);
709  if (xestat==0) {
710  sprintf(command,"/bin/mv %s/* %s/.",out_CED,end_CED);
711  } else {
712  sprintf(command,"/bin/mv %s %s",out_CED,end_CED);
713  }
714  if(cedDump && ceddir) gSystem->Exec(command);
715 
716  }
717 
718 // clean-up temporary data files
719 
720  for(i=0; i<nIFO; i++) {
721  sprintf(file,"%s/%s_%d_%s_%d_%d.dat",nodedir,ifo[i],int(Tb),data_label,runID,rnID);
722  sprintf(command,"/bin/rm %s",file);
723  gSystem->Exec(command);
724 
725  if(simulation) {
726  sprintf(file,"%s/mdc%s_%d_%s_%d_%d.dat",nodedir,ifo[i],int(Tb),data_label,runID,rnID);
727  sprintf(command,"/bin/rm %s",file);
728  gSystem->Exec(command);
729  }
730  if(singleDetector) break;
731  }
732  cout<<"Stopping the job "<<runID<<endl;
733  gSystem->Exec("/bin/date");
734  int job_stop_time=CWB::Time("now").GetGPS();
735 
736  int job_elapsed_time = (job_stop_time-job_start_time);
737  int job_elapsed_hour = int(job_elapsed_time/3600);
738  int job_elapsed_min = int((job_elapsed_time-3600*job_elapsed_hour)/60);
739  int job_elapsed_sec = int(job_elapsed_time-3600*job_elapsed_hour-60*job_elapsed_min);
740  int job_data_size_sec = int(detSegs[0].stop-detSegs[0].start);
741  double job_speed_factor = double(job_data_size_sec)/double(job_elapsed_time);
742  cout << endl;
743  printf("Job Elapsed Time - %02d:%02d:%02d (hh:mm:ss)\n",job_elapsed_hour,job_elapsed_min,job_elapsed_sec);
744  printf("Job Speed Factor - %2.1fX\n",job_speed_factor);
745  cout << endl;
746 
747 // return 0;
748  exit(0);
749 }
char skyMaskFile[1024]
void sethigh(double f)
Definition: wseries.hh:132
TString outDump
double segMLS
Definition: test_config1.C:47
double netCC
Definition: network.hh:596
int slagSize
Definition: test_config1.C:65
double startMDC
Definition: Toolbox.hh:106
size_t write(const char *file, int app=0)
Definition: netcluster.cc:3008
size_t nLag
Definition: network.hh:573
TTree * setTree()
Definition: variability.cc:60
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
void printwc(size_t)
Definition: network.cc:2658
double start
Definition: network.hh:55
int job_elapsed_min
Definition: cwb_net.C:738
double lagStep
Definition: test_config1.C:53
char filter_dir[1024]
size_t * slagSite
Definition: test_config1.C:69
int slagOff
Definition: test_config1.C:68
mdcshift mdc_shift
Definition: test_config1.C:93
size_t add(detector *)
param: detector structure return number of detectors in the network
Definition: network.cc:2559
void set2or(double p)
param: threshold
Definition: network.hh:471
TString live
size_t readMDClog(char *, double=0., int=11, int=12)
param: MDC log file param: approximate gps time
Definition: network.cc:3370
void setAntenna(detector *)
param: detector (use theta, phi index array)
Definition: network.cc:2846
std::vector< double > * getmdcTime()
Definition: network.hh:422
char channelNamesMDC[NIFO_MAX][50]
double fHigh
virtual void rate(double r)
Definition: wavearray.hh:141
double delta
float factor
#define np
WSeries< double > * pTF[nIFO]
Definition: cwb_net.C:82
WSeries< float > v[nIFO]
Definition: cwb_net.C:80
char channelNamesRaw[NIFO_MAX][50]
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
double job_speed_factor
Definition: cwb_net.C:741
size_t * lagSite
Definition: test_config1.C:58
int n
Definition: cwb_net.C:28
double angle
char * watversion(char c='s')
Definition: watversion.hh:21
TString("c")
size_t setIndexMode(size_t=0)
Definition: network.cc:8105
double stopMDC
Definition: Toolbox.hh:107
double x2or
double bpp
Definition: test_config1.C:22
void add(const wavearray< DataType_t > &, int=0, int=0, int=0)
Definition: wavearray.cc:746
bool eDisbalance
Definition: network.hh:598
TString mdc[4]
virtual void ReadBinary(const char *, int=0)
Definition: wavearray.cc:410
char frFiles[NIFO_MAX+1][256]
Definition: test_config1.C:166
int slagMax
Definition: test_config1.C:67
CWB::Toolbox TB
wavearray< double > x
Definition: cwb_net.C:78
vector< int > segId
Definition: Toolbox.hh:102
void setlow(double f)
Definition: wseries.hh:125
size_t setSkyMask(double f, char *fname)
Definition: network.cc:3213
string search
Definition: cWB_conf.py:110
size_t lagOff
Definition: test_config1.C:54
double Te
CWB::History * history
double & gap
int i
Definition: cwb_net.C:28
CWB::Toolbox frTB[nIFO+1]
Definition: cwb_net.C:191
double Theta2
char refIFO[4]
Definition: test_config1.C:14
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
char command[1024]
Definition: cwb_compile.C:44
static double getTimeSegList(vector< waveSegment > list)
Definition: Toolbox.cc:611
virtual void start(double s)
Definition: wavearray.hh:137
vector< waveSegment > detSegs_dq2
Definition: cwb_net.C:297
double segEdge
Definition: test_config1.C:49
int j
Definition: cwb_net.C:28
int l_low
Definition: test_config1.C:40
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
size_t cluster(int kt, int kf)
param: time gap in pixels return: number of reconstructed clusters
Definition: network.hh:321
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
void setRunID(size_t n)
param: run
Definition: network.hh:455
int jobID
Definition: cwb_net.C:195
double netCC
Definition: test_config1.C:33
int jobId
Definition: Toolbox.hh:100
char ifo[NIFO_MAX][8]
double Tgap
Definition: test_config1.C:23
double Edge
Definition: network.hh:578
double Theta1
double fResample
Definition: test_config1.C:27
static char * getEnvCWB()
Definition: Toolbox.cc:5383
char injectionList[1024]
double mdcShift
Definition: cwb_net.C:196
int job_stop_time
Definition: cwb_net.C:734
nDQF
Definition: cwb_eced.C:109
int Psave
Definition: test_config1.C:75
fprintf(stdout,"start=%f duration=%f rate=%f\, x.start(), x.size()/x.rate(), x.rate())
CWB::Toolbox slagTB
Definition: cwb_net.C:190
double Acore
Definition: test_config1.C:28
void constraint(double d=1., double g=0.0001)
param: constraint parameter, p=0 - no constraint
Definition: network.hh:463
char * rootlogonBuffer
Definition: cwb_net.C:158
double segTHR
Definition: test_config1.C:48
bool singleDetector
size_t mode
nc append(pix)
#define nIFO
char tdf90[1024]
Definition: cwb_job_obj.C:34
virtual size_t size() const
Definition: wavearray.hh:145
char data_label[512]
Definition: test_config1.C:160
double precision
Definition: network.hh:593
TTree * setTree()
Definition: wavenoise.cc:62
static char * readFile(TString ifName)
Definition: Toolbox.cc:2835
int job_start_time
Definition: cwb_net.C:181
char end_CED[1024]
Definition: cwb_job_obj.C:35
void Forward(size_t k)
param: number of steps
Definition: network.hh:89
int levelD
TTree * net_tree
double setVeto(double=5.)
param: time window around injections
Definition: network.cc:3487
char lagMode[2]
Definition: test_config1.C:57
char tdf00[1024]
Definition: cwb_job_obj.C:33
bool local
Definition: network.hh:589
static void resampleToPowerOfTwo(wavearray< double > &w)
Definition: Toolbox.cc:6602
vector< slag > slagList
i() int(T_cor *100))
network NET
Definition: cwb_dump_inj.C:30
void setDelayIndex(double rate)
param: MDC log file
Definition: network.cc:2896
std::vector< std::string > mdcList
Definition: network.hh:612
dqfile DQF[12]
Definition: test_config1.C:171
double dataShift[NIFO_MAX]
Definition: test_config1.C:87
double getDelay(const char *c="")
Definition: network.cc:2818
bool EFEC
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
Definition: wseries.cc:193
static vector< waveSegment > getSlagJobList(vector< waveSegment > ilist, int seglen=600)
Definition: Toolbox.cc:1791
printf("total live time: non-zero lags = %10.1f \, liveTot)
int mlagStep
segLen
Definition: cwb_eced.C:24
detector * pD[nIFO]
Definition: cwb_net.C:81
double precision
frfile FRF[nIFO+1]
Definition: cwb_net.C:269
double cedRHO
bool eDisbalance
int k
netcluster * pwc
Definition: cwb_net.C:76
void Inverse(size_t k)
Definition: network.hh:91
std::vector< waveSegment > segList
Definition: network.hh:616
size_t cpf(const netcluster &, bool=false, int=0)
Definition: netcluster.cc:117
int nfrFiles[nIFO+1]
Definition: cwb_net.C:192
void output(TTree *waveTree, network *net, float *slag=NULL, vector< waveSegment > detSegs=DEFAULT_WAVESEGMENT)
Definition: livetime.cc:109
void setDelay(const char *="L1")
Definition: network.cc:2767
void bandPass(double f1, double f2, double a=0.)
Definition: detector.hh:283
double e2or
Definition: network.hh:584
void setLevel(size_t n)
Definition: wseries.hh:112
long likelihood(char='E', double=sqrt(2.), int=0, size_t=0, int=-1, bool=false)
Definition: network.cc:4446
double Phi1
size_t size()
Definition: netcluster.hh:147
void output(TTree *, WSeries< double > *, int=0, double=1.)
Definition: wavenoise.cc:84
TFile * froot
static double getMDCShift(mdcshift mshift, double time)
Definition: Toolbox.cc:2296
virtual void DumpBinary(const char *, int=0)
Definition: wavearray.cc:353
static slag getSlag(vector< slag > slagList, int jobid)
Definition: Toolbox.cc:1844
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
vector< waveSegment > detSegs
Definition: cwb_net.C:193
static void setSlagShifts(slag SLAG, vector< TString > ifos, double segLen, int nDQF, dqfile *DQF)
Definition: Toolbox.cc:2017
cout<<" network of ";for(i=0;i< nIFO;i++) cout<< ifo[i]<<" ";cout<<" detectors\\";Meyer< double > B(1024)
double dcCal[NIFO_MAX]
Definition: test_config1.C:78
static vector< slag > getSlagList(size_t nIFO, size_t slagSize, int slagSegs, int slagOff, size_t slagMin, size_t slagMax, size_t *slagSite, char *slagFile=NULL)
Definition: Toolbox.cc:809
char filter[1024]
static vector< waveSegment > readSegList(dqfile DQF)
Definition: Toolbox.cc:409
char cmd_line[512]
Definition: cwb_net.C:154
int job_elapsed_time
Definition: cwb_net.C:736
double Tb
double Fgap
Definition: test_config1.C:24
WSeries< double > wM
Definition: cwb_net.C:79
double fLow
WSeries< double > * getTFmap()
param: no parameters
Definition: detector.hh:179
Definition: Meyer.hh:36
TString cwb_parameters_name
Definition: cwb_net.C:165
vector< int > slagId
Definition: Toolbox.hh:101
size_t csize()
Definition: netcluster.hh:151
char dump_dir[512]
Definition: test_config1.C:156
int job_data_size_sec
Definition: cwb_net.C:740
double mTau
int slagID
Definition: cwb_net.C:195
char * lagFile
Definition: test_config1.C:56
virtual void lprFilter(double, int=0, double=0., double=0.)
Definition: wseries.cc:1126
static vector< waveSegment > getSegList(int jobId, int nIFO, double segLen, double segMLS, double segEdge, vector< waveSegment > dqList)
Definition: Toolbox.cc:2799
void AddLog(char *Stage, char *Log, TDatime *Time=NULL)
Definition: History.cc:187
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:246
vector< TString > ifos(nIFO)
strcpy(RunLabel, RUN_LABEL)
Definition: Toolbox.hh:99
Meyer< double > S(1024, 2)
netcluster * getwc(size_t n)
param: delay index
Definition: network.hh:439
int nfactor
Definition: test_config1.C:83
static void makeSpectrum(wavearray< double > &psd, wavearray< double > x, double chuncklen=8, double scratchlen=0, bool oneside=true)
Definition: Toolbox.cc:5489
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
double mask
double netRHO
Definition: test_config1.C:32
vector< waveSegment > cat2List
Definition: cwb_net.C:194
bool dump
void setDelayFilters(detector *=NULL)
Definition: network.cc:7739
static vector< waveSegment > mergeSegLists(vector< waveSegment > &ilist1, vector< waveSegment > &ilist2)
Definition: Toolbox.cc:350
int l_high
Definition: test_config1.C:41
char nodedir[1024]
Definition: test_config1.C:187
long nSky
Definition: network.hh:574
double detSegs_ctime
Definition: cwb_net.C:303
TTree * setTree()
Definition: livetime.cc:81
double Phi2
Definition: ced.hh:44
int job_elapsed_hour
Definition: cwb_net.C:737
char work_dir[512]
Definition: test_config1.C:143
int segID[20]
Definition: cwb_net.C:195
double dT
Definition: testWDM_5.C:12
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
long nSky
int levelR
Definition: test_config1.C:37
int slagMin
Definition: test_config1.C:66
cout<< "live time after cat 2 : "<< detSegs_ctime<< endl;if(detSegs_ctime< segTHR) {cout<< "job segment live time after cat2 < "<< segTHR<< " sec, job terminated !!!"<< endl;exit(1);} double Tb=detSegs[0].start;double Te=detSegs[0].stop;double dT=Te-Tb;char file[512], tdf00[512], tdf90[512], buFFer[1024];int rnID=int(gRandom->Rndm(13) *1.e9);if(simulation) { i=NET.readMDClog(injectionList, double(long(Tb)) -mdcShift);printf("GPS: %16.6f saved, injections: %d\", double(long(Tb)), i);frTB[nIFO].shiftBurstMDCLog(NET.mdcList, ifos, mdcShift);for(int i=0;i< NET.mdcTime.size();i++) NET.mdcTime[i]+=mdcShift;vector< waveSegment > mdcSegs(NET.mdcTime.size());for(int k=0;k< NET.mdcTime.size();k++) {mdcSegs[k].start=NET.mdcTime[k]-gap;mdcSegs[k].stop=NET.mdcTime[k]+gap;} vector< waveSegment > mdcSegs_dq2=slagTB.mergeSegLists(detSegs_dq2, mdcSegs);double mdcSegs_ctime=slagTB.getTimeSegList(mdcSegs_dq2);cout<< "live time in zero lag after cat2+inj : "<< mdcSegs_ctime<< endl;if(mdcSegs_ctime==0) {cout<< "job segment with zero cat2+inj live time in zero lag, job terminated !!!"<< endl;exit(1);} } if(dump_infos_and_exit) exit(0);if(mask >0.) NET.setSkyMask(mask, skyMaskFile);for(i=0;i< nIFO;i++) { frTB[i].readFrames(FRF[i], channelNamesRaw[i], x);x.start(x.start()+dataShift[i]);x.start(x.start() -segLen *(segID[i]-segID[0]));if(singleDetector) TB.resampleToPowerOfTwo(x);sprintf(file,"%s/%s_%d_%s_%d_%d.dat", nodedir, ifo[i], int(Tb), data_label, runID, rnID);if(dump_sensitivity_and_exit) { sprintf(file,"%s/sensitivity_%s_%d_%s_job%d.txt", dump_dir, ifo[i], int(Tb), data_label, runID);cout<< endl<< "Dump Sensitivity : "<< file<< endl<< endl;TB.makeSpectrum(file, x);continue;} if(dcCal[i]>0.) x *=dcCal[i];if(fResample >0) { x.FFT(1);x.resize(fResample/x.rate() *x.size());x.FFT(-1);x.rate(fResample);} pTF[i]=pD[i]-> getTFmap()
simulation
Definition: cwb_eced.C:26
double Tlpr
size_t read(const char *)
Definition: netcluster.cc:3115
int job_elapsed_sec
Definition: cwb_net.C:739
factors[0]
Definition: cwb_eced.C:27
virtual void resize(unsigned int)
Definition: wavearray.cc:463
int setTimeShifts(size_t=1, double=1., size_t=0, size_t=0, const char *=NULL, const char *="w", size_t *=NULL)
param number of time lags param time shift step in seconds param first lag ID param maximum lag ID pa...
Definition: network.cc:7321
char output_dir[512]
Definition: test_config1.C:146
void Inverse(int n=-1)
param: n - number of steps (-1 means full reconstruction)
Definition: wseries.cc:291
double stop
Definition: network.hh:56
size_t setsim(WSeries< double > &, std::vector< double > *, double=5., double=8., bool saveWF=false)
Definition: detector.cc:1377
double netRHO
Definition: network.hh:597
void GetProcInfo(TString str="")
Definition: Toolfun.hh:241
virtual void FFT(int=1)
Definition: wavearray.cc:832
void AddHistory(char *Stage, char *Type, char *History, TDatime *Time=NULL)
Definition: History.cc:225
#define SEARCH(TYPE)
Definition: xroot.hh:4
bool EFEC
Definition: network.hh:587
size_t lagMax
Definition: test_config1.C:55
bool cedDump
int levelF
netcluster wc
Definition: cwb_net.C:75
void setSkyMaps(double, double=0., double=180., double=0., double=360.)
param: sky map granularity step, degrees param: theta begin, degrees param: theta end...
Definition: network.cc:2687
exit(0)
#define GAMMA(TYPE)
Definition: xroot.hh:5
double threshold(double, double)
param: selected fraction of LTF pixels assuming Gaussian noise param: maximum time delay between dete...
Definition: network.cc:2644
size_t lagSize
Definition: test_config1.C:52
vector< waveSegment > cat1List
Definition: cwb_net.C:194