Logo coherent WaveBurst  
Library Reference Guide
Logo
config.cc
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 #include "config.hh"
20 #include "xroot.hh"
21 #include "TGlobal.h"
22 
23 TGlobal* global;
24 char cmdline[128];
25 
26 #ifdef _USE_ROOT6 // ------------------------------------------------------ ROOT6
27 
28 #define SETVAR(MODE,VAR,TYPE,SIZE1,SIZE2) { \
29  if(MODE==0) { \
30  global = (TGlobal*)gROOT->GetGlobal("gPOINTER",true); \
31  if(global==NULL) sprintf(cmdline,"void* gPOINTER = (void*)&%s;",#VAR); \
32  else sprintf(cmdline,"gPOINTER = (void*)&%s;",#VAR); \
33  gROOT->ProcessLine(cmdline); \
34  global = (TGlobal*)gROOT->GetGlobal("gPOINTER",true); \
35  if(global!=NULL) { \
36  void* gPOINTER=NULL; \
37  memcpy((void*)&gPOINTER,(void*)global->GetAddress(),sizeof(void*)); \
38  memcpy((void*)&VAR,(void*)gPOINTER,SIZE1*SIZE2*sizeof(TYPE)); \
39  } \
40  } else { \
41  global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
42  if(global==NULL) { \
43  if(SIZE1==1 && SIZE2==1) strcpy(cmdline,#TYPE" "#VAR";"); \
44  if(SIZE1>1 && SIZE2==1) strcpy(cmdline,#TYPE" "#VAR"["#SIZE1"];"); \
45  if(SIZE1>1 && SIZE2>1) strcpy(cmdline,#TYPE" "#VAR"["#SIZE1"]["#SIZE2"];"); \
46  gROOT->ProcessLine(cmdline); \
47  global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
48  } \
49  if(SIZE1==1 && SIZE2==1) { \
50  void* pVAR = (void*)&VAR; \
51  global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
52  sprintf(cmdline,#VAR" = *("#TYPE"*)%p;",pVAR); \
53  } else { \
54  void* pVAR = (void*)&VAR; \
55  global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
56  sprintf(cmdline,"memcpy((void*)%p,(void*)%p,"#SIZE1"*"#SIZE2"*sizeof("#TYPE"));", \
57  (void*)global->GetAddress(),pVAR); \
58  } \
59  gROOT->ProcessLine(cmdline); \
60  }}
61 
62 #else // -------------------------------------------------------------- ROOT5
63 
64 #define SETVAR(MODE,VAR,TYPE,SIZE1,SIZE2) { \
65  if(MODE==0) { \
66  global = (TGlobal*)gROOT->GetGlobal("gPOINTER",true); \
67  if(global==NULL) sprintf(cmdline,"void* gPOINTER = (void*)&%s;",#VAR); \
68  else sprintf(cmdline,"gPOINTER = (void*)&%s;",#VAR); \
69  gROOT->ProcessLine(cmdline); \
70  global = (TGlobal*)gROOT->GetGlobal("gPOINTER",true); \
71  if(global!=NULL) { \
72  void* gPOINTER=NULL; \
73  memcpy((void*)&gPOINTER,(void*)global->GetAddress(),sizeof(void*)); \
74  memcpy((void*)&VAR,(void*)gPOINTER,SIZE1*SIZE2*sizeof(TYPE)); \
75  } \
76  } else { \
77  global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject(#VAR); \
78  if(global==NULL) { \
79  if(SIZE1==1 && SIZE2==1) strcpy(cmdline,#TYPE" "#VAR";"); \
80  if(SIZE1>1 && SIZE2==1) strcpy(cmdline,#TYPE" "#VAR"["#SIZE1"];"); \
81  if(SIZE1>1 && SIZE2>1) strcpy(cmdline,#TYPE" "#VAR"["#SIZE1"]["#SIZE2"];"); \
82  gROOT->ProcessLine(cmdline); \
83  global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
84  } \
85  sprintf(cmdline,"memcpy((void*)%p,(void*)%p,"#SIZE1"*"#SIZE2"*sizeof("#TYPE"));", \
86  (void*)global->GetAddress(),(void*)&VAR); \
87  gROOT->ProcessLine(cmdline); \
88  }}
89 
90 #endif // ---------------------------------------------------------- END MACRO
91 
92 #define EXPORT(TYPE,VAR,CMD) { \
93  TGlobal* global = (TGlobal*)gROOT->GetGlobal(#VAR,true); \
94  char __cmdline[128]; \
95  if(global==NULL) sprintf(__cmdline,"%s %s;",#TYPE,CMD); \
96  else sprintf(__cmdline,"%s;",CMD); \
97  gROOT->ProcessLine(__cmdline); \
98 }
99 
100 
101 #define PRINT(ARG1,ARG2,ARG3,ARG4) { \
102  printf(" "#ARG1" "#ARG2"\t= "#ARG3";\t\t// "#ARG4"\n",ARG2); \
103  }
104 
105 ////////////////////////////////////////////////////////////////////////////////
106 /* BEGIN_HTML
107 <p>The config class is designed to manage the cwb configuration
108 
109 Overview:
110 <ol style="list-style-type: upper-roman;">
111  <li><a href="#usage">Usage</a></li>
112  <li><a href="#readwritetxt">Read/Write Configuration from/to text file</a></li>
113  <li><a href="#readwriteobj">Read/Write Configuration Object from/to root file</a></li>
114 </ol>
115 
116 <h3><a name="usage">I. Usage</a></h3>
117 <pre>
118  root[] CWB::config config; // define config object with the default parameters
119  root[] cout << config.nIFO << endl; // config.nIFO = 0
120  root[]
121  root[] config.Export(); // export config parameters to CINT
122  root[] // all parameters are visible in CINT
123  root[] cout << nIFO << endl; // nIFO = 0
124  root[] nIFO = 3;
125  root[] cout << nIFO << endl; // nIFO = 3
126  root[] config.Import(); // import CINT config parameters into config object
127  root[] cout << config.nIFO << endl; // config.nIFO = 3
128 </pre>
129 
130 <h3><a name="writeframetxt">II. Read/Write Configuration from/to text file</a></h3>
131 <pre>
132  root[] config.Import("config.C"); // import config parameters from file config.C
133  root[]
134  root[] config.Export("config.C"); // export config parameters from file config.C
135 </pre>
136 
137 <h3><a name="writeframeobj">III. Read/Write Configuration Object from/to root file</a></h3>
138 <pre>
139  root[] // --------------------------------------------------------
140  root[] // Write object config to root file
141  root[] // --------------------------------------------------------
142  root[] TFile *ofroot = new TFile("config.root", "RECREATE");
143  root[] config.Write("CC");
144  root[] ofroot->Close();
145  root[]
146  root[] // --------------------------------------------------------
147  root[] // Read object config from root file
148  root[] // --------------------------------------------------------
149  root[] TFile *ifroot = new TFile("config.root");
150  root[] ifroot.ls();
151  root[] CWB::config *iconfig = (CWB::config*)f->Get("CC");
152  root[] ifroot->Close();
153 </pre>
154 
155 </p>
156 
157 END_HTML */
158 ////////////////////////////////////////////////////////////////////////////////
159 
160 ClassImp(CWB::config)
161 
162 //______________________________________________________________________________
164 //
165 // default constructor
166 //
167 
168  umacro=="" ? Init() : Import(umacro);
169 }
170 
171 //______________________________________________________________________________
173 //
174 // default destructor
175 //
176 
177 }
178 
179 //______________________________________________________________________________
180 void
181 CWB::config::Browse(TBrowser *b) {
182 //
183 // Browse
184 //
185 
186  View();
187 }
188 
189 //______________________________________________________________________________
190 void
192 //
193 // Reset parameters to 0/NULL/""/' '
194 //
195 
196  strcpy(this->analysis,"");
197  online = false;
198 
199  nIFO = 0;
200  search = ' ';
201  optim = false;
202 
203  inRate= 0;
204  bpp = 0.;
205  Tgap = 0.;
206  Fgap = 0.;
207  TFgap = 0.;
208  fLow = 0.;
209  fHigh = 0.;
210  fResample = 0;
211  Acore = 0.;
212  Tlpr = 0.;
213 
214  x2or = 0.;
215  netRHO= 0.;
216 
217  levelR = 0;
218  levelF = 0;
219  levelD = 0;
220  l_low = 0;
221  l_high = 0;
222 
223  segLen = 0.;
224  segMLS = 0.;
225  segTHR = 0.;
226  segEdge = 0.;
227  segOverlap = 0.;
228 
229  lagSize = 0;
230  lagStep = 0.;
231  lagOff = 0;
232  lagMax = 0;
233  lagFile = NULL;
234  strcpy(lagMode," ");
235  lagSite = NULL;
236  for(int i=0;i<NIFO_MAX;i++) shift[i] = 0.;
237 
238  mlagStep = 0;
239 
240  slagSize = 0;
241  slagMin = 0;
242  slagMax = 0;
243  slagOff = 0;
244  slagSite = NULL;
245  slagFile = NULL;
246 
247  whiteWindow = 0.;
248  whiteStride = 0.;
249 
250  Psave = 0;
251 
252  for(int i=0;i<NIFO_MAX;i++) dcCal[i] = 0.;
253 
254  simulation = 0;
255  iwindow = 0.;
256  nfactor = 0;
257 
258  for(int i=0;i<NIFO_MAX;i++) dataShift[i] = 0.;
259 
260  mdc_shift.startMDC = 0;
261  mdc_shift.stopMDC = 0;
262  mdc_shift.offset = 0;
263 
264  strcpy(wdmXTalk,"");
265  upTDF = 0;
266  TDSize = 0;
267  strcpy(filter,"");
268 
269  pattern= 0;
270  BATCH = 0;
271  LOUD = 0;
272  subnet = 0.;
273  subcut = 0.;
274 
275  delta = 0.;
276  gamma = 0.;
277  eDisbalance = false;
278 
279  EFEC = false;
280  mode = 0;
281  angle = 0.;
282  Theta1 = 0.;
283  Theta2 = 0.;
284  Phi1 = 0.;
285  Phi2 = 0.;
286  mask = 0.00;
287  healpix= 0;
288 
289  precision = 0.;
290 
293 
294  dumpHistory = false;
295  dump = false;
296  savemode = false;
297  cedDump = false;
298  cedRHO = 0.;
299  nSky = 0;
300 
301  for(int i=0;i<2*NIFO_MAX;i++) strcpy(frFiles[i],"");
302 
303  frRetryTime = 0;
304 
305  strcpy(filter_dir,"");
306 
307  strcpy(injectionList,"");
308  strcpy(skyMaskFile,"");
309  strcpy(skyMaskCCFile,"");
310  for(int i=0;i<NIFO_MAX;i++) strcpy(channelNamesRaw[i],"");
311  for(int i=0;i<NIFO_MAX;i++) strcpy(channelNamesMDC[i],"");
312 
313  strcpy(work_dir , "");
314  strcpy(config_dir , "");
315  strcpy(input_dir , "");
316  strcpy(output_dir , "");
317  strcpy(merge_dir , "");
318  strcpy(condor_dir , "");
319  strcpy(report_dir , "");
320  strcpy(macro_dir , "");
321  strcpy(log_dir , "");
322  strcpy(data_dir , "");
323  strcpy(tmp_dir , "");
324  strcpy(ced_dir , "");
325  strcpy(pp_dir , "");
326  strcpy(dump_dir , "");
327  strcpy(www_dir , "");
328  strcpy(data_label , "");
329  strcpy(condor_log , "");
330  strcpy(condor_tag , "");
331  strcpy(nodedir , "");
332 
333  nDQF = 0;
334 
335  plugin.SetName("");
336  configPlugin.SetName("");
337  strcpy(parPlugin , "");
338  dataPlugin=false;
339  mdcPlugin=false;
340  dcPlugin=false;
341  cohPlugin=false;
342  scPlugin=false;
343  outPlugin=false;
344 
345  strcpy(comment , "");
346 
347  return;
348 }
349 
350 //______________________________________________________________________________
351 void
353 //
354 // Import from macro or CINT the configuration parameters
355 //
356 // Input: umacro - unnamed root macro
357 // if umacro="" then parameters are imported from CINT
358 //
359 // NOTE: macro must be unnamed, parameters in macro must be declared with type
360 //
361 // WARNING: if umacro!="" all CINT global variables with the same name are overwritten !!!
362 //
363 
364 #ifdef _USE_ROOT6
365  // The interpreter of root6 if full c++ compliant
366  // When unamed macros are loaded the symbols which have been redeclared with the same name are not allowed
367  // The following code check if umacro has been already loaded from the root command line
368  // if already loaded the macro umacro is not reloaded
369  // This patch fix the job running with condor
370  for(int i=0;i<gApplication->Argc();i++) {
371  bool check=true;
372  if(TString(gApplication->Argv(i)).EndsWith(".C")) {
373 
374  char* file1 = CWB::Toolbox::readFile(gApplication->Argv(i));
375  if(file1==NULL) {check=false;continue;}
376  char* file2 = CWB::Toolbox::readFile(umacro);
377  if(file2==NULL) {delete [] file1;check=false;continue;}
378 
379  //cout << "file1 : " << gApplication->Argv(i) << " " << strlen(file2) << endl;
380  //cout << "file2 : " << umacro << " " << strlen(file2) << endl;
381  if(strlen(file1)==strlen(file2)) {
382  for(int i=0;i<strlen(file1);i++) {if(file1[i]!=file2[i]) check=false;break;}
383  } else check=false;
384  delete [] file1;
385  delete [] file2;
386  } else check=false;
387  if(check==true) return;
388  }
389 #endif
390 
391  int err=0;
392  if(umacro!="") {
393  gROOT->ProcessLine("#include \"xroot.hh\""); // define macros SEARCH,GAMMA,XROOT
394  gROOT->Macro(umacro,&err);
395  if(err!=0) {
396  cout << "CWB::config::Import : Error Loading Macro " << umacro.Data() << endl;
397  exit(1);
398  }
399  }
400 
401  SetVar(0);
402 }
403 
404 //______________________________________________________________________________
405 void
407 //
408 // Export to macro or CINT the configuration parameters
409 //
410 // Input: fname - output unnamed macro file name
411 // if fname="" then parameters are exported to CINT
412 //
413 
414  if(fname.Sizeof()>1) Print(fname);
415  else SetVar(1);
416 }
417 
418 //______________________________________________________________________________
419 void
421 //
422 // Import/Export from/to CINT the configuration parameters
423 //
424 // Input: MODE - 0/1 -> Import/Export
425 //
426 
427 // config parameters
428 
429  SETVAR(MODE,analysis,char,8,1);
430  SETVAR(MODE,online,bool,1,1);
431 
432  SETVAR(MODE,nIFO,int,1,1);
433 #ifdef _USE_ROOT6
434  char cfg_search;
435  if(MODE==0) { // import
436  SETVAR(MODE,cfg_search,char,1,1);
438  } else { // export
439  cfg_search=search;
440  SETVAR(MODE,cfg_search,char,1,1);
441  }
442 #else
443  SETVAR(MODE,search,char,1,1);
444 #endif
445  SETVAR(MODE,optim,bool,1,1);
446 
447  SETVAR(MODE,ifo,char,NIFO_MAX,8);
448  SETVAR(MODE,refIFO,char,4,1);
450 
451  // cWB settings
452 
453  SETVAR(MODE,inRate,size_t,1,1);
454  SETVAR(MODE,bpp,double,1,1);
455  SETVAR(MODE,Tgap,double,1,1);
456  SETVAR(MODE,Fgap,double,1,1);
457  SETVAR(MODE,TFgap,double,1,1);
458  SETVAR(MODE,fLow,double,1,1);
459  SETVAR(MODE,fHigh,double,1,1);
460  SETVAR(MODE,fResample,size_t,1,1);
461 
462  SETVAR(MODE,Acore,double,1,1);
463  SETVAR(MODE,Tlpr,double,1,1);
464 
465  SETVAR(MODE,x2or,double,1,1);
466  SETVAR(MODE,netRHO,double,1,1);
467  SETVAR(MODE,netCC,double,1,1);
468 
469  // wavelet transformation settings
470 
471  SETVAR(MODE,levelR,int,1,1);
472  SETVAR(MODE,levelF,int,1,1);
473  SETVAR(MODE,levelD,int,1,1);
474  SETVAR(MODE,l_low,int,1,1);
475  SETVAR(MODE,l_high,int,1,1);
476 
477  // segments
478  SETVAR(MODE,segLen,double,1,1);
479  SETVAR(MODE,segMLS,double,1,1);
480  SETVAR(MODE,segTHR,double,1,1);
481  SETVAR(MODE,segEdge,double,1,1);
482  SETVAR(MODE,segOverlap,double,1,1);
483 
484  // lags
485  SETVAR(MODE,lagSize,size_t,1,1);
486  SETVAR(MODE,lagStep,double,1,1);
487  SETVAR(MODE,lagOff,size_t,1,1);
488  SETVAR(MODE,lagMax,size_t,1,1);
489  SETVAR(MODE,lagFile,char*,1,1);
490  SETVAR(MODE,lagMode,char,2,1);
491  SETVAR(MODE,lagSite,size_t*,1,1);
492  SETVAR(MODE,shift,double,NIFO_MAX,1);
493 
494  // multi lags
495  SETVAR(MODE,mlagStep,int,1,1);
496 
497  // super lags
498  SETVAR(MODE,slagSize,int,1,1);
499  SETVAR(MODE,slagMin,int,1,1);
500  SETVAR(MODE,slagMax,int,1,1);
501  SETVAR(MODE,slagOff,int,1,1);
502  SETVAR(MODE,slagSite,size_t*,1,1);
503  SETVAR(MODE,slagFile,char*,1,1);
504 
505  // whitening parameters
506  SETVAR(MODE,whiteWindow,double,1,1);
507  SETVAR(MODE,whiteStride,double,1,1);
508 
509  // Skymap probability pixels to be saved in the final output root file
510  SETVAR(MODE,Psave,int,1,1);
511 
512  // DC corrections
513  SETVAR(MODE,dcCal,double,NIFO_MAX,1);
514 
515  // simulation parameters
516  SETVAR(MODE,simulation,int,1,1);
517  SETVAR(MODE,iwindow,double,1,1);
518  SETVAR(MODE,nfactor,int,1,1);
519  SETVAR(MODE,factors,double,FACTORS_MAX,1);
520 
521  // noise shift data
522  SETVAR(MODE,dataShift,double,NIFO_MAX,1);
523 
524  // parameter to shift in time the injections (sec)
525  SETVAR(MODE,mdc_shift,mdcshift,1,1);
526 
527  // delay filter
528  SETVAR(MODE,wdmXTalk,char,1024,1);
529  SETVAR(MODE,upTDF,size_t,1,1);
530  SETVAR(MODE,TDSize,size_t,1,1);
531  SETVAR(MODE,filter,char,1024,1);
532 
533  // coherence stage
534  SETVAR(MODE,pattern,int,1,1);
535 
536  // supercluster stage
537  SETVAR(MODE,BATCH,int,1,1);
538  SETVAR(MODE,LOUD,int,1,1);
539  SETVAR(MODE,subnet,double,1,1);
540  SETVAR(MODE,subcut,double,1,1);
541 
542  // regulator
543  SETVAR(MODE,delta,double,1,1);
544 #ifdef _USE_ROOT6
545  double cfg_gamma;
546  if(MODE==0) { // import
547  SETVAR(MODE,cfg_gamma,double,1,1);
549  } else { // export
550  cfg_gamma=gamma;
551  SETVAR(MODE,cfg_gamma,double,1,1);
552  }
553 #else
554  SETVAR(MODE,gamma,double,1,1);
555 #endif
556 
557  SETVAR(MODE,eDisbalance,bool,1,1);
558 
559  // sky settings
560 
561  SETVAR(MODE,EFEC,bool,1,1);
562  SETVAR(MODE,mode,size_t,1,1);
563  SETVAR(MODE,angle,double,1,1);
564  SETVAR(MODE,Theta1,double,1,1);
565  SETVAR(MODE,Theta2,double,1,1);
566  SETVAR(MODE,Phi1,double,1,1);
567  SETVAR(MODE,Phi2,double,1,1);
568  SETVAR(MODE,mask,double,1,1);
569  SETVAR(MODE,healpix,size_t,1,1);
570 
571  // error regions settings
572 
573  SETVAR(MODE,precision,double,1,1);
574 
575  // file dump MODE
576 
579  SETVAR(MODE,dumpHistory,bool,1,1);
580  SETVAR(MODE,dump,bool,1,1);
581  SETVAR(MODE,savemode,bool,1,1);
582  SETVAR(MODE,cedDump,bool,1,1);
583  SETVAR(MODE,cedRHO,double,1,1);
584  SETVAR(MODE,nSky,long,1,1);
585 
586  // directories, file names
587 
588  SETVAR(MODE,filter_dir,char,1024,1);
589 
590  SETVAR(MODE,injectionList,char,1024,1);
591  SETVAR(MODE,skyMaskFile,char,1024,1);
592  SETVAR(MODE,skyMaskCCFile,char,1024,1);
593 
594  SETVAR(MODE,channelNamesRaw,char,NIFO_MAX,50);
595  SETVAR(MODE,channelNamesMDC,char,NIFO_MAX,50);
596 
597  // working dir
598  SETVAR(MODE,work_dir,char,1024,1);
599 
600  SETVAR(MODE,config_dir,char,1024,1);
601  SETVAR(MODE,input_dir,char,1024,1);
602  SETVAR(MODE,output_dir,char,1024,1);
603  SETVAR(MODE,merge_dir,char,1024,1);
604  SETVAR(MODE,condor_dir,char,1024,1);
605  SETVAR(MODE,report_dir,char,1024,1);
606  SETVAR(MODE,macro_dir,char,1024,1);
607  SETVAR(MODE,log_dir,char,1024,1);
608  SETVAR(MODE,data_dir,char,1024,1);
609  SETVAR(MODE,tmp_dir,char,1024,1);
610  SETVAR(MODE,ced_dir,char,1024,1);
611  SETVAR(MODE,pp_dir,char,1024,1);
612  SETVAR(MODE,dump_dir,char,1024,1);
613  SETVAR(MODE,www_dir,char,1024,1);
614 
615  // data label
616  SETVAR(MODE,data_label,char,1024,1);
617 
618  // condor declarations
619  SETVAR(MODE,condor_log,char,1024,1);
620 
621  // Define a Unique Tag for Condor Jobs
622  SETVAR(MODE,condor_tag,char,1024,1);
623 
624  // frame files list : [0:nIFO-1]/[nIFO:2*nIFO-1] contains strain/mdc file names
625  // If all mdc channels are in a single frame file -> mdc must be declared in the nIFO position
626  SETVAR(MODE,frFiles,char,(2*NIFO_MAX),1024);
627  // frame reading retry time (sec) : 0 -> disable
628  SETVAR(MODE,frRetryTime,int,1,1);
629 
630  // dq file list
631  // {ifo, dqcat_file, dqcat[0/1/2], shift[sec], inverse[false/true], 4columns[true/false]}
632  SETVAR(MODE,nDQF,int,1,1);
633  SETVAR(MODE,DQF,dqfile,DQF_MAX,1);
634 
635  // read and dump data on local disk (nodedir)
636  SETVAR(MODE,nodedir,char,1024,1);
637 
638  // plugin
639  if(MODE==0) { // import from CINT
640  global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject("plugin");
641  if(global!=NULL)
642  plugin = *(TMacro*)global->GetAddress();
643  if(TString(plugin.GetName())!="") {
644  // check if code is empty
645  TList* list = plugin.GetListOfLines();
646  if(list->GetSize()==0) {
647  cout << "CWB::config::SetVar - Error loading plugin : "
648  << plugin.GetTitle() << endl;
649  exit(1);
650  }
651  }
652  } else { // export to CINT
653  global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject("plugin");
654  if(global==NULL) {
655  sprintf(cmdline,"plugin;");
656  EXPORT(TMacro,plugin,cmdline);
657  }
658  if(TString(plugin.GetName())!="") {
659  // export to CINT macro plugin object
660  sprintf(cmdline,"pplugin = (TMacro*)%p;",&plugin);
661  EXPORT(TMacro*,pplugin,cmdline);
662  sprintf(cmdline,"plugin = TMacro(*pplugin);");
663  gROOT->ProcessLine(cmdline);
664  //sprintf(cmdline,"plugin.SetTitle("");"); // macro is only in memory (no disk)
665  sprintf(cmdline,"plugin.SetTitle(\"%s\");",plugin.GetTitle());
666  gROOT->ProcessLine(cmdline);
667  }
668  }
669  // configPlugin
670  if(MODE==0) { // import from CINT
671  global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject("configPlugin");
672  if(global!=NULL) {
673  configPlugin = *(TMacro*)global->GetAddress();
674  if(TString(configPlugin.GetName())!="") {
675  // check if code is empty
676  TList* list = configPlugin.GetListOfLines();
677  if(list->GetSize()==0) {
678  cout << "CWB::config::SetVar - Error loading configPlugin : "
679  << configPlugin.GetTitle() << endl;
680  exit(1);
681  }
682  }
683  }
684  } else { // export to CINT
685  global = (TGlobal*)gROOT->GetListOfGlobals()->FindObject("configPlugin");
686  if(global==NULL) {
687  sprintf(cmdline,"configPlugin;");
688  EXPORT(TMacro,configPlugin,cmdline);
689  global = (TGlobal*)gROOT->GetGlobal("configPlugin",true);
690  }
691  char tmpFile[1024]="";
692  if(TString(configPlugin.GetName())!="") {
693  // export to CINT macro configPlugin object
694  sprintf(cmdline,"pconfigPlugin = (TMacro*)%p;",&configPlugin);
695  EXPORT(TMacro*,pconfigPlugin,cmdline);
696  sprintf(cmdline,"configPlugin = TMacro(*pconfigPlugin);");
697  gROOT->ProcessLine(cmdline);
698  //sprintf(cmdline,"configPlugin.SetTitle("");"); // macro is only in memory (no disk)
699  sprintf(cmdline,"configPlugin.SetTitle(\"%s\");",configPlugin.GetTitle());
700  gROOT->ProcessLine(cmdline);
701  }
702  }
703  SETVAR(MODE,parPlugin,char,1024,1);
704  SETVAR(MODE,dataPlugin,bool,1,1);
705  SETVAR(MODE,mdcPlugin,bool,1,1);
706  SETVAR(MODE,dcPlugin,bool,1,1);
707  SETVAR(MODE,cohPlugin,bool,1,1);
708  SETVAR(MODE,scPlugin,bool,1,1);
709  SETVAR(MODE,outPlugin,bool,1,1);
710 
711  // user defined comment
712  SETVAR(MODE,comment,char,1024,1);
713 
714  return;
715 }
716 /*
717 void
718 CWB::config::Streamer(TBuffer &R__b) {
719 
720  // Stream an object of class detector.
721 
722  UInt_t R__s, R__c;
723  if (R__b.IsReading()) {
724  Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
725  TObject::Streamer(R__b);
726  R__b.CheckByteCount(R__s, R__c, config::IsA());
727  } else {
728  R__c = R__b.WriteVersion(config::IsA(), kTRUE);
729  TObject::Streamer(R__b);
730  R__b.SetByteCount(R__c, kTRUE);
731  }
732 }
733 */
734 
735 //______________________________________________________________________________
736 void
737 CWB::config::Print(Option_t* option) {
738 //
739 // printf configuration parameters
740 //
741 // Input: option - if option="" then parameters are displayed to the stdout
742 // otherwise to file name = option
743 //
744 
745  FILE* stream = stdout;
746  if(TString(option).Sizeof()>1)
747  if((stream = fopen(option, "w")) == NULL) {
748  cout << "CWB::config::Print : Error opening file " << option << endl;
749  exit(1);
750  }
751 
752  char comma[NIFO_MAX];
753  if(nIFO==0) {for(int n=0;n<NIFO_MAX-1;n++) comma[n]=','; comma[NIFO_MAX-1]=' ';}
754  else {for(int n=0;n<nIFO-1;n++) comma[n]=','; comma[nIFO-1]=' ';}
755 
756  if(TString(option).Sizeof()>1) fprintf(stream,"{\n\n");
757 
758  fprintf(stream," #ifndef CWB_USER_PARAMETER_FILE\n");
759  fprintf(stream," #define CWB_USER_PARAMETER_FILE\n\n");
760 
761  fprintf(stream," #include \"xroot.hh\" // defines macro to manage ROOT5 vs ROOT6\n");
762 
763  fprintf(stream,"\n");
764  fprintf(stream," char analysis[8] \t= \"%s\";\t\t// cWB analysis\n",analysis);
765  fprintf(stream," bool online\t\t= %d;\t\t// true/false -> online/offline\n",online);
766  fprintf(stream,"\n");
767  fprintf(stream," int nIFO\t\t= %d;\t\t// size of network starting with first detector ifo[]\n",nIFO);
768  fprintf(stream," SEARCH(char)\t\t= '%c';\t\t// see description below\n",search);
769  fprintf(stream," bool optim\t\t= %d;\t\t// true -> optimal resolution likelihood analysis\n",optim);
770  fprintf(stream,"\n");
771 
772  if(nIFO==0) {
773  fprintf(stream," char ifo[NIFO_MAX][8];\n");
774  fprintf(stream," char refIFO[4];\t\t\t// reference IFO\n");
775  fprintf(stream," \n");
776  fprintf(stream," // user define detectors list : is selected if detectorParams[n].name!=\"\"\n");
777  fprintf(stream," // {name, latitude, longitude, elevation, AltX, AzX, AltY, AzY}\n");
778  fprintf(stream," detectorParams detParms[NIFO_MAX];\n");
779  } else {
780  char ifos[32]="";for(int n=0;n<nIFO;n++) sprintf(ifos,"%s\"%s\"%c",ifos,ifo[n],comma[n]);
781  fprintf(stream," char ifo[%d][8]\t= {%s};\n",nIFO,ifos);
782  fprintf(stream," char refIFO[4]\t= \"%s\";\t\t// reference IFO\n",refIFO);
783  fprintf(stream," \n");
784  fprintf(stream," // user define detectors list : is selected if detectorParams[n].name!=\"\"\n");
785  fprintf(stream," // {name, latitude, longitude, elevation, AltX, AzX, AltY, AzY}\n");
786  fprintf(stream," detectorParams detParms[%d] = {\n",nIFO);
787  for(int i=0;i<nIFO;i++) fprintf(stream," {\"%s\", %g, %g, %g, %g, %g, %g, %g},\n",
788  detParms[i].name,detParms[i].latitude,detParms[i].longitude,
789  detParms[i].elevation,detParms[i].AltX,detParms[i].AzX,
790  detParms[i].AltY,detParms[i].AzY);
791  fprintf(stream," };\n");
792  }
793 
794  fprintf(stream,"\n");
795  fprintf(stream," // cWB settings\n");
796  fprintf(stream,"\n");
797 
798  fprintf(stream," size_t inRate\t\t= %lu;\t// input data rate\n",inRate);
799  fprintf(stream," double bpp\t\t= %g;\t// probability for pixel selection\n",bpp);
800  if(TString(analysis)=="1G") {
801  fprintf(stream," double Tgap\t\t= %g;\t// time gap between clusters (sec)\n",Tgap);
802  fprintf(stream," double Fgap\t\t= %g;\t// frequency gap between clusters (Hz)\n",Fgap);
803  } else {
804  fprintf(stream," double Tgap\t\t= %g;\t// defragmentation time gap between clusters (sec)\n",Tgap);
805  fprintf(stream," double Fgap\t\t= %g;\t// defragmentation frequency gap between clusters (Hz)\n",Fgap);
806  fprintf(stream," double TFgap\t\t= %g;\t// threshold on the time-frequency separation between two pixels\n",TFgap);
807  }
808  fprintf(stream," double fLow\t\t= %g;\t// low frequency of the search\n",fLow);
809  fprintf(stream," double fHigh\t\t= %g;\t// high frequency of the search\n",fHigh);
810  fprintf(stream," size_t fResample\t= %lu;\t\t// if>0 the inRate is resampled to fResample\n",fResample);
811  fprintf(stream," double Acore\t\t= %g;\t// threshold for selection of core pixels\n",Acore);
812  fprintf(stream," double Tlpr\t\t= %g;\t// training time for LPR filter\n",Tlpr);
813 
814  fprintf(stream,"\n");
815 
816  fprintf(stream," double x2or\t\t= %g;\t// 2 OR threshold\n",x2or);
817  if(TString(analysis)=="1G") {
818  fprintf(stream," double netRHO\t\t= %g;\t// threshold on rho\n",netRHO);
819  } else {
820  fprintf(stream," double netRHO\t\t= %g;\t// (4.5-5.5) - kills weak clusters to reduce output pixel rate (supercluster)\n",netRHO);
821  }
822  fprintf(stream," double netCC\t\t= %g;\t// threshold on network correlation\n",netCC);
823 
824  fprintf(stream,"\n");
825  fprintf(stream," // wavelet transformation settings\n");
826  fprintf(stream,"\n");
827 
828  fprintf(stream," int levelR\t\t= %d;\t\t// resampling level : inRate[fResample]/(2^levelR) Hz\n",levelR);
829  fprintf(stream," int levelF\t\t= %d;\t\t// level where second LPR filter is applied\n",levelF);
830  fprintf(stream," int levelD\t\t= %d;\t\t// decomposition level\n",levelD);
831  fprintf(stream," int l_low\t\t= %d;\t\t// low frequency resolution level (2^l_low Hz)\n",l_low);
832  fprintf(stream," int l_high\t\t= %d;\t\t// high frequency resolution level (2^l_high Hz)\n",l_high);
833 
834  fprintf(stream,"\n");
835  fprintf(stream," // time shift analysis settings\n");
836  fprintf(stream,"\n");
837 
838  fprintf(stream," // segments\n");
839 
840  fprintf(stream," double segLen\t\t= %g;\t// Segment length [sec]\n",segLen);
841  fprintf(stream," double segMLS\t\t= %g;\t// Minimum Segment Length after DQ_CAT1 [sec]\n",segMLS);
842  fprintf(stream," double segTHR\t\t= %g;\t// Minimum Segment Length after DQ_CAT2 [sec]\n",segTHR);
843  fprintf(stream," double segEdge\t= %g;\t// wavelet boundary offset [sec]\n",segEdge);
844  fprintf(stream," double segOverlap\t= %g;\t// overlap between job segments [sec]\n",segOverlap);
845 
846  fprintf(stream,"\n");
847  fprintf(stream," // lags\n");
848 
849  fprintf(stream," size_t lagSize\t= %lu;\t\t// number of lags (simulation=1)\n",lagSize);
850  fprintf(stream," double lagStep\t= %g;\t// time interval between lags [sec]\n",lagStep);
851  fprintf(stream," size_t lagOff\t\t= %lu;\t\t// first lag id (lagOff=0 - include zero lag )\n",lagOff);
852  fprintf(stream," size_t lagMax\t\t= %lu;\t\t// 0/>0 - standard/extended lags\n",lagMax);
853  if(lagFile==NULL) fprintf(stream," char* lagFile\t= NULL;\t\t// lag file list\n");
854  else {
855  fprintf(stream," char* lagFile\t= new char[1024];\t\t// lag file list\n");
856  fprintf(stream," sprintf(lagFile,\"%s\");\n",lagFile);
857  }
858  fprintf(stream," char lagMode[2]\t= \"%s\";\t\t// w/r - write/read lag list\n",lagMode);
859  if(lagSite==NULL) {
860  fprintf(stream," size_t* lagSite\t= NULL;\t\t// site index starting with 0\n");
861  } else {
862  char sites[32];for(int n=0;n<nIFO;n++) sprintf(sites,"%s%lu%c",sites,lagSite[n],comma[n]);
863  fprintf(stream," size_t lagSite[%d]\t= {%s};\t\t// site index starting with 0\n",nIFO,sites);
864  }
865  char shifts[64]="";
866  if(nIFO==0) {for(int n=0;n<NIFO_MAX;n++) sprintf(shifts,"%s%1.0f%c",shifts,0.,comma[n]);
867  fprintf(stream," double shift[NIFO_MAX] = {%s};\t// use for standard shifts\n",shifts);
868  } else { for(int n=0;n<nIFO;n++) sprintf(shifts,"%s%g%c",shifts,shift[n],comma[n]);
869  fprintf(stream," double shift[%d]\t= {%s};\t// use for standard shifts\n",nIFO,shifts);
870  }
871 
872  fprintf(stream,"\n");
873  fprintf(stream," // multi lags\n");
874  fprintf(stream," int mlagStep\t= %d;\t\t// if mlagStep=0 then 'standard lag mode'\n",mlagStep);
875  fprintf(stream," \t\t\t\t\t// else cicle over lags with step mlagStep\n");
876 
877  fprintf(stream,"\n");
878  fprintf(stream," // super lags\n");
879  fprintf(stream," int slagSize\t= %d;\t\t// number of super lags (simulation=1) - if slagSize=0 -> Standard Segments\n",slagSize);
880  fprintf(stream," int slagMin\t= %d;\t\t// select the minimum available slag distance : slagMin must be <= slagMax\n",slagMin);
881  fprintf(stream," int slagMax\t= %d;\t\t// select the maximum available slag distance\n",slagMax);
882  fprintf(stream," int slagOff\t= %d;\t\t// first slag id (slagOff=0 - include zero slag )\n",slagOff);
883  if(slagSite==NULL) {
884  fprintf(stream," size_t* slagSite\t= NULL;\t\t// site index starting with 0\n");
885  } else {
886  char sites[32];
887  for(int n=0;n<nIFO;n++) sprintf(sites,"%s%lu%c",sites,slagSite[n],comma[n]);
888  fprintf(stream," size_t slagSite[%d]\t= {%s};\t\t// site index starting with 0\n",nIFO,sites);
889  }
890  if(slagFile==NULL) fprintf(stream," char* slagFile\t= NULL;\t\t// slag file list\n");
891  else {
892  fprintf(stream," char* slagFile\t= new char[1024];\t\t// slag file list\n");
893  fprintf(stream," sprintf(slagFile,\"%s\");\n",slagFile);
894  }
895 
896  fprintf(stream,"\n");
897  fprintf(stream," // whitening parameters\n");
898  fprintf(stream," double whiteWindow\t= %g;\t// time window dT. if = 0 - dT=T, where T is wavearray duration\n",whiteWindow);
899  fprintf(stream," double whiteStride\t= %g;\t// noise sampling interval (window stride)\n",whiteStride);
900 
901  fprintf(stream,"\n");
902  fprintf(stream," int Psave\t\t= %d;\t\t// Skymap probability to be saved in the final output root file\n",Psave);
903  fprintf(stream," \t\t\t\t\t// (saved if !=0 : see nSky)\n");
904 
905  fprintf(stream,"\n");
906  fprintf(stream," // DC corrections\n");
907  char dcCals[64]="";
908  if(nIFO==0) {for(int n=0;n<NIFO_MAX;n++) sprintf(dcCals,"%s%1.0f%c",dcCals,0.,comma[n]);
909  fprintf(stream," double dcCal[NIFO_MAX] = {%s};\t// use for standard dcCals\n",dcCals);
910  } else { for(int n=0;n<nIFO;n++) sprintf(dcCals,"%s%g%c",dcCals,dcCal[n],comma[n]);
911  fprintf(stream," double dcCal[%d]\t= {%s};\t// use for standard dcCals\n",nIFO,dcCals);
912  }
913 
914  fprintf(stream,"\n");
915  fprintf(stream," // simulation parameters\n");
916  fprintf(stream," int simulation\t= %d;\t\t// 1 for simulation, 0 for production\n",simulation);
917  fprintf(stream," double iwindow\t= %g;\t// analysis time window for injections (Range = Tinj +/- iwindow/2)\n",iwindow);
918  fprintf(stream," int nfactor\t\t= %d;\t\t// number of strain factors\n",nfactor);
919  if(nfactor==0) {
920  fprintf(stream," double factors[FACTORS_MAX];\t\t\t// array of strain factors\n");
921  } else {
922  fprintf(stream," double factors[] = {\t\t\t// array of strain factors\n");
923  for(int i=0;i<nfactor-1;i++) fprintf(stream," %g,\n",factors[i]);
924  if(nfactor>0) fprintf(stream," %g\n",factors[nfactor-1]);
925  fprintf(stream," };\n");
926  }
927 
928  fprintf(stream,"\n");
929  fprintf(stream," // noise shift data\n");
930  char dataShifts[64]="";
931  if(nIFO==0) {for(int n=0;n<NIFO_MAX;n++) sprintf(dataShifts,"%s%1.0f%c",dataShifts,0.,comma[n]);
932  fprintf(stream," double dataShift[NIFO_MAX] = {%s};\t// use for standard dataShifts\n",dataShifts);
933  } else { for(int n=0;n<nIFO;n++) sprintf(dataShifts,"%s%g%c",dataShifts,dataShift[n],comma[n]);
934  fprintf(stream," double dataShift[%d]\t= {%s};\t// use for standard dataShifts\n",nIFO,dataShifts);
935  }
936 
937  fprintf(stream,"\n");
938  fprintf(stream," // use this parameter to shift in time the injections (sec)\n");
939  fprintf(stream," // use {0,0,0} to set mdc_shift to 0\n");
940  fprintf(stream," // if {-1,0,0} the shift is automaticaly selected\n");
941  fprintf(stream," // {startMDC, stopMDC}\n");
942  fprintf(stream," mdcshift mdc_shift = {%g, %g, %g};\n",mdc_shift.startMDC,mdc_shift.stopMDC,mdc_shift.offset);
943 
944  fprintf(stream,"\n");
945  fprintf(stream," // delay filter\n");
946  fprintf(stream,"\n");
947 
948  if(TString(analysis)=="1G") {
949  fprintf(stream," char filter[1024] = \"%s\";\t\t// delay filter suffix: \"\", or \"up1\", or \"up2\" [1G]\n",filter);
950  } else {
951  fprintf(stream," \t\t\t\t\t// catalog of WDM cross-talk coefficients [2G]\n");
952  fprintf(stream," char wdmXTalk[1024] = \"%s\";\n",wdmXTalk);
953  fprintf(stream," size_t upTDF\t\t= %lu;\t\t// upsample factor to obtain rate of TD filter\n",upTDF);
954  fprintf(stream," \t\t\t\t\t// TDRate = (inRate>>levelR)*upTDF [2G]\n");
955  fprintf(stream," size_t TDSize\t\t= %lu;\t\t// time-delay filter size (max 20) [2G]\n",TDSize);
956  }
957 
958  if(TString(analysis)=="2G") {
959  fprintf(stream,"\n");
960  fprintf(stream," // coherence stage\n");
961  fprintf(stream,"\n");
962 
963  fprintf(stream," int pattern\t= %d;\t\t// select pixel pattern used to produce the energy max maps for pixel's selection [2G]\n",pattern);
964 
965  fprintf(stream,"\n");
966  fprintf(stream," // supercluster stage\n");
967  fprintf(stream,"\n");
968 
969  fprintf(stream," int BATCH\t= %d;\t\t// max number of pixel to process in one loadTDamp batch [2G]\n",BATCH);
970  fprintf(stream," int LOUD\t= %d;\t\t\t// number of pixel per cluster to load TD amplitudes [2G]\n",LOUD);
971  fprintf(stream," double subnet\t= %g;\t\t// sub network threshold (supercluster) [2G]\n",subnet);
972  fprintf(stream," double subcut\t= %g;\t\t// sub network threshold in the skyloop (supercluster) [2G]\n",subcut);
973  }
974 
975  fprintf(stream,"\n");
976  fprintf(stream," // regulator\n");
977  fprintf(stream,"\n");
978 
979  if(TString(analysis)=="1G") {
980  fprintf(stream," double delta\t= %g;\t\t// [0/1] -> [weak/soft]\n",delta);
981  fprintf(stream," GAMMA(double)\t= %g;\t\t// set params in net5, [0/1]->net5=[nIFO/0],\n",gamma);
982  fprintf(stream," \t\t\t\t\t// if net5>[threshold=(nIFO-1)] weak/soft[according to delta] else hard\n");
983  fprintf(stream," bool eDisbalance\t= %d;\n",eDisbalance);
984  } else {
985  fprintf(stream," double delta\t= %g;\t\t// 2G: [-1:1] - regulate 2 Detector sky locations\n",delta);
986  fprintf(stream," \t\t\t\t\t// 2G: delta=0 : regulator is disabled, delta<0 : select Lo as skystat instead of Lr\n");
987  fprintf(stream," GAMMA(double)\t= %g;\t\t// 2G: [-1,1] - \n",gamma);
988  fprintf(stream," \t\t\t\t\t// 2G: gamma=0 : regulator is disabled, gamma<0 : sky prior is applied\n");
989  }
990 
991  fprintf(stream,"\n");
992  fprintf(stream," // sky settings\n");
993  fprintf(stream,"\n");
994 
995  fprintf(stream," bool EFEC\t\t= %d;\t\t// Earth Fixed / Selestial coordinates\n",EFEC);
996  fprintf(stream," size_t mode\t\t= %lu;\t\t// sky search mode\n",mode);
997  fprintf(stream," double angle\t\t= %g;\t// angular resolution\n",angle);
998  fprintf(stream," double Theta1\t\t= %g;\t// start theta\n",Theta1);
999  fprintf(stream," double Theta2\t\t= %g;\t// end theta\n",Theta2);
1000  fprintf(stream," double Phi1\t\t= %g;\t// start theta\n",Phi1);
1001  fprintf(stream," double Phi2\t\t= %g;\t// end theta\n",Phi2);
1002  fprintf(stream," double mask\t\t= %g;\t// sky mask fraction\n",mask);
1003  fprintf(stream," size_t healpix\t= %lu;\t\t// if not 0 use healpix sky map (healpix order)\n",healpix);
1004 
1005  fprintf(stream,"\n");
1006  fprintf(stream," // error regions settings\n");
1007  fprintf(stream,"\n");
1008 
1009  if(TString(analysis)=="1G") {
1010  fprintf(stream," double precision\t= %g;\t// No = nIFO*(K+KZero)+precision*E\n",precision);
1011  } else {
1012  fprintf(stream," double precision\t= %g;\t// set parameters for big clusters events management",precision);
1013  }
1014 
1015  fprintf(stream,"\n");
1016  fprintf(stream," // file dump mode\n");
1017  fprintf(stream,"\n");
1018 
1019  fprintf(stream," // job file options\n");
1020  fprintf(stream," CWB_JOBF_OPTIONS jobfOptions;\n");
1021  fprintf(stream," jobfOptions = CWB_JOBF_SAVE_DISABLE;\n");
1022  if(jobfOptions&CWB_JOBF_SAVE_CONFIG) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_CONFIG;\n");
1023  if(jobfOptions&CWB_JOBF_SAVE_NETWORK) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_NETWORK;\n");
1024  if(jobfOptions&CWB_JOBF_SAVE_HISTORY) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_HISTORY;\n");
1025  if(jobfOptions&CWB_JOBF_SAVE_STRAIN) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_STRAIN;\n");
1026  if(jobfOptions&CWB_JOBF_SAVE_MDC) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_MDC;\n");
1027  if(jobfOptions&CWB_JOBF_SAVE_CSTRAIN) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_CSTRAIN;\n");
1028  if(jobfOptions&CWB_JOBF_SAVE_COHERENCE) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_COHERENCE;\n");
1029  if(jobfOptions&CWB_JOBF_SAVE_SUPERCLUSTER) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_SUPERCLUSTER;\n");
1030  if(jobfOptions&CWB_JOBF_SAVE_LIKELIHOOD) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_LIKELIHOOD;\n");
1031  if(jobfOptions&CWB_JOBF_SAVE_CED) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_CED;\n");
1032  if(jobfOptions&CWB_JOBF_SAVE_JNET_MACRO) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_JNET_MACRO;\n");
1033  if(jobfOptions&CWB_JOBF_SAVE_CWB) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_CWB;\n");
1034  if(jobfOptions&CWB_JOBF_SAVE_SPARSE) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_SPARSE;\n");
1035  if(jobfOptions&CWB_JOBF_SAVE_WFINJ) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_WFINJ;\n");
1036  if(jobfOptions&CWB_JOBF_SAVE_WFREC) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_WFREC;\n");
1037  if(jobfOptions&CWB_JOBF_SAVE_NODE) fprintf(stream," jobfOptions &= CWB_JOBF_SAVE_NODE;\n");
1038  fprintf(stream," // output root file options\n");
1039  fprintf(stream," CWB_OUTF_OPTIONS outfOptions;\n");
1040  fprintf(stream," outfOptions = CWB_OUTF_SAVE_DISABLE;\n");
1041  if(jobfOptions&CWB_OUTF_SAVE_VAR) fprintf(stream," jobfOptions &= CWB_OUTF_SAVE_VAR;\n");
1042  if(jobfOptions&CWB_OUTF_SAVE_NOISE) fprintf(stream," jobfOptions &= CWB_OUTF_SAVE_NOISE;\n");
1043  fprintf(stream,"\n");
1044  fprintf(stream," bool dumpHistory\t= %d;\t\t// dump history into output root file\n",dumpHistory);
1045  fprintf(stream," bool dump\t\t= %d;\t\t// dump triggers into ascii file\n",dump);
1046  fprintf(stream," bool savemode\t\t= %d;\t\t// temporary save clusters on disc\n",savemode);
1047  fprintf(stream," bool cedDump\t\t= %d;\t\t// dump ced plots with rho>cedRHO\n",cedDump);
1048  fprintf(stream," double cedRHO\t\t= %g;\n",cedRHO);
1049  fprintf(stream," long nSky\t\t= %lu;\t\t// # of skymap prob pixels dumped to ascii\n",nSky);
1050  fprintf(stream," \t\t\t\t\t//(nSky=0 -> (#pixels==1000 || cum prob > 0.99))\n");
1051 
1052  fprintf(stream,"\n");
1053  fprintf(stream," // directories, file names\n");
1054  fprintf(stream,"\n");
1055 
1056  fprintf(stream," char filter_dir[1024]\t\t= \"%s\";\n",filter_dir);
1057 
1058  fprintf(stream," char injectionList[1024]\t= \"%s\";\n",injectionList);
1059  fprintf(stream," char skyMaskFile[1024]\t= \"%s\";\n",skyMaskFile);
1060  fprintf(stream," char skyMaskCCFile[1024]\t= \"%s\";\n",skyMaskCCFile);
1061  if(nIFO==0) {
1062  fprintf(stream," char channelNamesRaw[NIFO_MAX][50];\n");
1063  } else {
1064  fprintf(stream," char channelNamesRaw[%d][50] = {\n",nIFO);
1065  for(int n=0;n<nIFO;n++) fprintf(stream," \"%s\"%c\n",channelNamesRaw[n],comma[n]);
1066  fprintf(stream," };\n");
1067  }
1068  if(nIFO==0) {
1069  fprintf(stream," char channelNamesMDC[NIFO_MAX][50];\n");
1070  } else {
1071  fprintf(stream," char channelNamesMDC[%d][50] = {\n",nIFO);
1072  for(int n=0;n<nIFO;n++) fprintf(stream," \"%s\"%c\n",channelNamesMDC[n],comma[n]);
1073  fprintf(stream," };\n");
1074  }
1075 
1076  fprintf(stream,"\n");
1077  fprintf(stream," // working dir\n");
1078  fprintf(stream," char work_dir[1024]\t= \"%s\";\n",work_dir);
1079 
1080  fprintf(stream," char config_dir[1024]\t= \"%s\";\n",config_dir);
1081  fprintf(stream," char input_dir[1024]\t= \"%s\";\n",input_dir);
1082  fprintf(stream," char output_dir[1024]\t= \"%s\";\n",output_dir);
1083  fprintf(stream," char merge_dir[1024]\t= \"%s\";\n",merge_dir);
1084  fprintf(stream," char condor_dir[1024]\t= \"%s\";\n",condor_dir);
1085  fprintf(stream," char report_dir[1024]\t= \"%s\";\n",report_dir);
1086  fprintf(stream," char macro_dir[1024]\t= \"%s\";\n",macro_dir);
1087  fprintf(stream," char log_dir[1024]\t= \"%s\";\n",log_dir);
1088  fprintf(stream," char data_dir[1024]\t= \"%s\";\n",data_dir);
1089  fprintf(stream," char tmp_dir[1024]\t= \"%s\";\n",tmp_dir);
1090  fprintf(stream," char ced_dir[1024]\t= \"%s\";\n",ced_dir);
1091  fprintf(stream," char pp_dir[1024]\t= \"%s\";\n",pp_dir);
1092  fprintf(stream," char dump_dir[1024]\t= \"%s\";\n",dump_dir);
1093  fprintf(stream," char www_dir[1024]\t= \"%s\";\n",www_dir);
1094 
1095  fprintf(stream,"\n");
1096  fprintf(stream," // data label\n");
1097  fprintf(stream," char data_label[1024]\t= \"%s\";\n",data_label);
1098 
1099  fprintf(stream,"\n");
1100  fprintf(stream," // condor declarations\n");
1101  fprintf(stream," char condor_log[1024]\t= \"%s\";\n",condor_log);
1102 
1103  fprintf(stream,"\n");
1104  fprintf(stream," // Define a Unique Tag for Condor Jobs\n");
1105  fprintf(stream," char condor_tag[1024]\t= \"%s\";\n",condor_tag);
1106 
1107  fprintf(stream,"\n");
1108  fprintf(stream," // frame files list : [0:nIFO-1]/[nIFO:2*nIFO-1] contains strain/mdc file names\n");
1109  fprintf(stream," // If all mdc channels are in a single frame file -> mdc must be declared in the nIFO position\n");
1110  if(nIFO==0) {
1111  fprintf(stream," char frFiles[2*NIFO_MAX][1024];\n");
1112  } else {
1113  fprintf(stream," char frFiles[%d][1024] = {\n",2*nIFO);
1114  for(int n=0;n<2*nIFO-1;n++) fprintf(stream," \"%s\",\n",frFiles[n]);
1115  fprintf(stream," \"%s\" \n",frFiles[2*nIFO-1]);
1116  fprintf(stream," };\n");
1117  fprintf(stream,"\n");
1118  }
1119  fprintf(stream," // frame reading retry time (sec) : 0 -> disable\n");
1120  fprintf(stream," int frRetryTime = %d;\n",frRetryTime);
1121 
1122  fprintf(stream,"\n");
1123  fprintf(stream," // dq file list\n");
1124  fprintf(stream," // {ifo, dqcat_file, dqcat[0/1/2], shift[sec], inverse[false/true], 4columns[true/false]}\n");
1125  fprintf(stream," int nDQF = %d;\n",nDQF);
1126  if(nDQF==0) {
1127  fprintf(stream," dqfile DQF[DQF_MAX];\n");
1128  } else {
1129  fprintf(stream," dqfile DQF[%d] = {\n",nDQF);
1130  for(int i=0;i<nDQF;i++) fprintf(stream," {\"%s\", \"%s\", (CWB_CAT)%d, %g, %d, %d},\n",
1131  DQF[i].ifo,DQF[i].file,DQF[i].cat,DQF[i].shift,DQF[i].invert,DQF[i].c4);
1132  fprintf(stream," };\n");
1133  }
1134 
1135  fprintf(stream,"\n");
1136  fprintf(stream," // read and dump data on local disk (nodedir)\n");
1137  fprintf(stream," char nodedir[1024]\t= \"%s\";\n",nodedir);
1138  fprintf(stream,"\n");
1139 
1140  fprintf(stream,"\n");
1141  fprintf(stream," // cwb config path\n");
1142  fprintf(stream," char cwb_config_env[1024]\t= \"%s\";\n",cwb_config_env);
1143  fprintf(stream," // cluster site name\n");
1144  fprintf(stream," char site_cluster_env[1024]\t= \"%s\";\n",site_cluster_env);
1145  fprintf(stream,"\n");
1146 
1147  fprintf(stream," // plugin name\n");
1148  fprintf(stream," TMacro plugin;\n");
1149  if(TString(plugin.GetTitle())!="") {
1150  TString pluginPath = plugin.GetTitle();
1151  pluginPath.ReplaceAll("_C.so",".C");
1152  fprintf(stream," plugin = TMacro(\"%s\");\n",pluginPath.Data());
1153  fprintf(stream," plugin.SetTitle(\"%s\");\n",plugin.GetTitle());
1154  }
1155  fprintf(stream," TMacro configPlugin;\n");
1156  if(TString(configPlugin.GetTitle())!="") {
1157  //fprintf(stream," configPlugin.SetName(\"%s\");\n",configPlugin.GetName()); // (removed to get unique md5)
1158  fprintf(stream," configPlugin = TMacro(\"%s\");\n",configPlugin.GetTitle());
1159  }
1160  fprintf(stream," char parPlugin[1024]\t= \"%s\";\n",parPlugin);
1161  fprintf(stream," bool dataPlugin\t= %d;\t\t// if dataPlugin=true disable read data from frames\n",dataPlugin);
1162  fprintf(stream," bool mdcPlugin\t= %d;\t\t// if mdcPlugin=true disable read data from frames\n",mdcPlugin);
1163  fprintf(stream," bool dcPlugin\t\t= %d;\t\t// if dcPlugin=true disable built-in data conditioning (only 2G)\n",dcPlugin);
1164  fprintf(stream," bool cohPlugin\t= %d;\t\t// if cohPlugin=true disable built-in coherence stage (only 2G)\n",cohPlugin);
1165  fprintf(stream," bool scPlugin\t\t= %d;\t\t// if scPlugin=true disable built-in supercluster function (only 2G)\n",scPlugin);
1166  fprintf(stream," bool outPlugin\t= %d;\t\t// if outPlugin=true disable built-in output wave file (only 2G)\n",outPlugin);
1167  fprintf(stream,"\n");
1168 
1169  fprintf(stream," char comment[1024]\t= \"%s\";\n",comment);
1170 
1171  if(TString(analysis)=="1G") {
1172  fprintf(stream," // statistics\n");
1173  fprintf(stream," // L - likelihood\n");
1174  fprintf(stream," // c - network correlation coefficient\n");
1175  fprintf(stream," // A - energy disbalance asymmetry\n");
1176  fprintf(stream," // P - penalty factor based on correlation coefficients <x,s>/sqrt(<x,x>*<s,s>)\n");
1177  fprintf(stream," // E - total energy in the data streams\n");
1178  fprintf(stream,"\n");
1179  fprintf(stream," // search modes\n");
1180  fprintf(stream," // 'c' - un-modeled search, fast S5 cWB version, requires constraint settings\n");
1181  fprintf(stream," // 'h' - un-modeled search, S5 cWB version, requires constraint settings\n");
1182  fprintf(stream," // 'B' - un-modeled search, max(P*L*c/E)\n");
1183  fprintf(stream," // 'b' - un-modeled search, max(P*L*c*A/E)\n");
1184  fprintf(stream," // 'I' - elliptical plarisation, max(P*L*c/E)\n");
1185  fprintf(stream," // 'S' - linear plarisation, max(P*L*c/E)\n");
1186  fprintf(stream," // 'G' - circular plarisation, max(P*L*c/E)\n");
1187  fprintf(stream," // 'i' - elliptical plarisation, max(P*L*c*A/E)\n");
1188  fprintf(stream," // 's' - linear plarisation, max(P*L*c*A/E)\n");
1189  fprintf(stream," // 'g' - circular plarisation, max(P*L*c*A/E)\n");
1190  } else {
1191  fprintf(stream," // search modes\n");
1192  fprintf(stream," // r - un-modeled\n");
1193  fprintf(stream," // i - iota - wave (no dispersion correction)\n");
1194  fprintf(stream," // p - Psi - wave\n");
1195  fprintf(stream," // l,s - linear\n");
1196  fprintf(stream," // c,g - circular\n");
1197  fprintf(stream," // e,b - elliptical (no dispersion correction)\n");
1198  }
1199  fprintf(stream,"\n");
1200 
1201  fprintf(stream," #endif\n");
1202 
1203  if(TString(option).Sizeof()>1) fprintf(stream,"\n}\n");
1204  if(TString(option).Sizeof()>1) fclose(stream);
1205 }
1206 
1207 //______________________________________________________________________________
1208 void
1209 CWB::config::DumpPlugin(const char* filename) {
1210 //
1211 // Save macro plugin source into filename
1212 //
1213 // Input: filename - filename where source macro is saved
1214 // if filename="" then the source code is dumped to stdout
1215 //
1216 
1217  if(sizeof(filename)==0) {
1218  cout << "CWB::config::DumpPlugin - Error : no input filename" << endl;
1219  cout.flush();
1220  return;
1221  }
1222  if(TString(filename)=="") {
1223  TList* list=plugin.GetListOfLines();
1224  for(int i=0;i<list->GetSize();i++) {
1225  TObjString* string = (TObjString*)list->At(i);
1226  cout << string->GetString() << endl;
1227  }
1228  } else {
1229  plugin.SaveSource(filename);
1230  cout << "plugin saved into : " << filename << endl;
1231  cout.flush();
1232  }
1233 }
1234 
1235 //______________________________________________________________________________
1236 void
1237 CWB::config::DumpConfigPlugin(const char* filename) {
1238 //
1239 // Save macro configPlugin source into filename
1240 //
1241 // Input: filename - filename where source macro is saved
1242 // if filename="" then the source code is dumped to stdout
1243 //
1244 
1245  if(sizeof(filename)==0) {
1246  cout << "CWB::config::DumpConfigPlugin - Error : no input filename" << endl;
1247  cout.flush();
1248  return;
1249  }
1250  if(TString(filename)=="") {
1251  TList* list=configPlugin.GetListOfLines();
1252  for(int i=0;i<list->GetSize();i++) {
1253  TObjString* string = (TObjString*)list->At(i);
1254  cout << string->GetString() << endl;
1255  }
1256  } else {
1257  configPlugin.SaveSource(filename);
1258  cout << "configPlugin saved into : " << filename << endl;
1259  cout.flush();
1260  }
1261 }
1262 
1263 //______________________________________________________________________________
1264 int
1266 //
1267 // compare config with this->config, display the differences
1268 //
1269 // Input: config - config object to be compared with this object
1270 //
1271 
1272  gRandom->SetSeed(0);
1273  int rnID = int(gRandom->Rndm(13)*1.e9);
1274  UserGroup_t* uinfo = gSystem->GetUserInfo();
1275  TString uname = uinfo->fUser;
1276  gSystem->Exec(TString("mkdir -p /dev/shm/")+uname);
1277 
1278  char ofile1[1024];
1279  sprintf(ofile1,"/dev/shm/%s/cwb_config_1_%d.txt",uname.Data(),rnID);
1280  char ofile2[1024];
1281  sprintf(ofile2,"/dev/shm/%s/cwb_config_2_%d.txt",uname.Data(),rnID);
1282 
1283  config.Print(ofile1);
1284  this->Print(ofile2);
1285 
1286  gSystem->Exec(TString("diff ")+TString(ofile1)+" "+TString(ofile2));
1287 
1288  gSystem->Exec(TString("rm ")+ofile1);
1289  gSystem->Exec(TString("rm ")+ofile2);
1290 
1291  return 0;
1292 }
1293 
1294 //______________________________________________________________________________
1295 void
1297 //
1298 // Show config with a editor defined in CWB_CONFIG_VIEWER environment
1299 //
1300 
1301  gRandom->SetSeed(0);
1302  int rnID = int(gRandom->Rndm(13)*1.e9);
1303  UserGroup_t* uinfo = gSystem->GetUserInfo();
1304  TString uname = uinfo->fUser;
1305  gSystem->Exec(TString("mkdir -p /dev/shm/")+uname);
1306 
1307  char fName[1024];
1308  sprintf(fName,"/dev/shm/%s/cwb_config_%d.C",uname.Data(),rnID);
1309  Print(fName);
1310 
1311  int ret;
1312  char tmpStr[1024];
1313 
1314  if (getenv("CWB_CONFIG_VIEWER") != NULL) {
1315  sprintf(tmpStr, "%s %s", getenv("CWB_CONFIG_VIEWER"), fName);
1316  ret = system(tmpStr);
1317  if (ret != 0) {
1318  sprintf(tmpStr, "vim %s", fName);
1319  system(tmpStr);
1320  }
1321  }
1322  else {
1323  sprintf(tmpStr, "vim %s", fName);
1324  system(tmpStr);
1325  }
1326 
1327  sprintf(tmpStr, "rm -f %s", fName);
1328  system(tmpStr);
1329 
1330  return;
1331 }
1332 
1333 //______________________________________________________________________________
1334 void
1335 CWB::config::DumpConfig(const char* filename, Option_t* option) {
1336 //
1337 // Save configuration to file
1338 //
1339 // Input: filename - output file name
1340 //
1341 
1342  if(sizeof(filename)==0) {
1343  cout << "CWB::config::DumpConfig - Error : no input filename" << endl;
1344  cout.flush();
1345  return;
1346  }
1347  Print(filename);
1348  return;
1349 }
1350 
1351 void
1353 //
1354 // Set configuration in 1 detector mode
1355 // The first detector (if declared) is selected
1356 //
1357 
1358  if(TString(ifo[0])!="" || TString(detParms[0].name)!="") {
1359  cout << "------> Set Sigle Detector Mode !!!" << endl;
1360  // all parameters are declared twice because cWB works only with nIFO>1
1361  // the analysis is done as a network of 2 equal detectors
1362  sprintf(ifo[1],"%s",ifo[0]);
1363  detParms[1] = detParms[0];
1364  dataShift[1] = dataShift[0];
1365  if(TString(ifo[0])!="") strcpy(refIFO,ifo[0]);
1366  else strcpy(refIFO,detParms[0].name); // user defined detector
1369  strcpy(frFiles[2],frFiles[nIFO]); // mdc frFiles
1370  strcpy(frFiles[1],frFiles[0]);
1371 
1372  // select ifo[0] DQ
1373  int k=0;
1374  for(int i=0;i<nDQF;i++) if(TString(DQF[i].ifo)==refIFO) DQF[k++]=DQF[i];
1375  nDQF=k;
1376  for(int i=0;i<nDQF;i++) DQF[i+nDQF]=DQF[i];
1377  nDQF*=2;
1378 
1379  eDisbalance = false; // disable energy disbalance
1380  if(slagSize!=0) {
1381  slagSize = 1;
1382  slagMin = 0;
1383  slagMax = 0;
1384  slagOff = 0;
1385  slagFile = NULL;
1386  }
1387  lagSize = 1;
1388  lagStep = 1;
1389  lagOff = 0;
1390  mode = 1; // 1 - exclude duplicate delay configurations
1391  delta = 0; // weak regulator
1392  if(TString(analysis)=="1G") {
1393  gamma = 0; // force regulator not to be hard
1394  } else {
1395  gamma = 1.0;
1396  precision = 0.0;
1397  }
1398  nSky = 1; // dump only 1 sky location (for single detector there is no sky loop)
1399 
1400  nIFO=2;
1401 
1402  } else {
1403  cout << "CWB::config::SetSingleDetectorMode - Error : ifo[0] not defined !!! " << endl;
1404  exit(1);
1405  }
1406 
1407  return;
1408 }
1409 
1410 void
1412 //
1413 // Check consistency of the parameters
1414 //
1415 
1416  if(TString(analysis)!="1G" && TString(analysis)!="2G")
1417  {cout<<"config::Check : analisys parameter non valid "<<analysis<<endl;exit(1);}
1418 
1419  // check consistency with the environment CWB_ANALYSIS
1420  if(gSystem->Getenv("CWB_ANALYSIS")!=NULL) {
1421  if(TString(analysis)!=TString(gSystem->Getenv("CWB_ANALYSIS"))) {
1422  cout << "CWB::config::Check - Error : analysis=" << analysis;
1423  cout << " is inconsistent with the environment CWB_ANALYSIS="
1424  << gSystem->Getenv("CWB_ANALYSIS") << endl;
1425  cout << " check analysis parameter in user_parameters.C" << endl;
1426  cout << " check CWB_ANALYSIS env in watenv setup" << endl;
1427  cout << " use 'cwb_setpipe 1G/2G' command to switch analysis type" << endl;
1428  exit(1);
1429  }
1430  } else {
1431  cout << "" << endl;
1432  cout << "CWB_ANALYSIS env not defined in watenv setup" << endl;
1433  cout << "add in watenv setup the following statement" << endl;
1434  cout << "" << endl;
1435  cout << "setenv CWB_ANALYSIS '1G' # 1G analysis " << endl;
1436  cout << "or" << endl;
1437  cout << "setenv CWB_ANALYSIS '2G' # 2G analysis " << endl;
1438  cout << "" << endl;
1439  exit(1);
1440  }
1441 
1442  if(nIFO<=0 || nIFO>XIFO) {
1443  cout<<"config::Check : nIFO parameter non valid -> "<<nIFO<<endl;
1444  cout<<" WAT is compiled with XIFO = "<<XIFO<<endl<<endl;
1445  exit(1);
1446  }
1447 
1448  if(nIFO==2) {
1449  TString detName1 = TString(ifo[0])!="" ? ifo[0] : detParms[0].name;
1450  TString detName2 = TString(ifo[1])!="" ? ifo[1] : detParms[1].name;
1451  if(detName1==detName2) {
1452  if(lagSize!=1) {
1453  cout<<"config::Check : Error - when nIFO=2 & ifo[0]=ifo[1] -> lagSize must be 1"<<endl;
1454  exit(1);
1455  }
1456  if(slagSize==1) {
1457  if((slagMin!=0)||(slagMax!=0)||(slagOff!=0)||(slagFile!=NULL)) {
1458  cout<<"config::Check : Error - when nIFO=2 & ifo[0]=ifo[1] -> slagSize must be 0 or 1"<<endl;
1459  cout<<" if slagSize=1 -> slagMin=slagMax=slagOff=0, slagFile=NULL "<<endl;
1460  exit(1);
1461  }
1462  }
1463  }
1464  }
1465  if(nIFO>2) {
1466  for(int n=0;n<nIFO;n++) {
1467  for(int m=n+1;m<nIFO;m++) {
1468  TString detName1 = TString(ifo[n])!="" ? ifo[n] : detParms[n].name;
1469  TString detName2 = TString(ifo[m])!="" ? ifo[m] : detParms[m].name;
1470  if(detName1==detName2) {
1471  cout<<"config::Check : Error - ifo["<<n<<"]=ifo["<<m<<"]"<<endl;
1472  cout<<"config::Check : when nIFO>2 detector names must be different"<<endl;
1473  exit(1);
1474  }
1475  }
1476  }
1477  }
1478 
1479  if(TString(analysis)=="1G") {
1480  if((search!='r')&&(search!='c')&&(search!='h')&&(search!='B')&&(search!='b')&&(search!='I')&&
1481  (search!='S')&&(search!='G')&&(search!='i')&&(search!='s')&&(search!='g'))
1482  {cout<<"config::Check : 1G search parameter non valid "<<search<<endl;exit(1);}
1483  }
1484  if(TString(analysis)=="2G") {
1485  char _search = std::tolower(search);
1486  if((_search!='r')&&(_search!='i')&&(_search!='p')&&
1487  (_search!='l')&&(_search!='s')&&(_search!='c')&&
1488  (_search!='g')&&(_search!='e')&&(_search!='b'))
1489  {cout<<"config::Check : 2G search parameter non valid "<<search<<endl;exit(1);}
1490  if(fabs(delta)>1)
1491  {cout<<"config::Check : 2G delta parameter non valid "<<delta<<" - must be [-1:1]"<<endl;exit(1);}
1492  if(fabs(gamma)>1)
1493  {cout<<"config::Check : 2G gamma parameter non valid "<<gamma<<" - must be [-1:1]"<<endl;exit(1);}
1494 
1495  if(fmod(precision,1)!=0) {
1496  {cout<<"config::Check : precision must be integer : "<<precision<<endl;exit(1);}
1497  }
1498  if(precision!=0 && healpix==0) {
1499  {cout<<"config::Check : precision is enabled only for healpix>0 : "<<precision<<endl;exit(1);}
1500  }
1501  if(precision!=0 && healpix>0) {
1502  int iprecision = int(fabs(precision));
1503  int csize = iprecision%65536; // get number of pixels threshold per level
1504  int order = (iprecision-csize)/65536; // get resampled order
1505  if(csize==0)
1506  {cout<<"config::Check : precision must be defined with csize>0 && order>0 : "<<csize<<" " <<order<<endl;exit(1);}
1507  if(order==0 || order>healpix)
1508  {cout<<"config::Check : precision must be defined with order<=healpix : "<<order<<endl;exit(1);}
1509  }
1510  }
1511 
1512  if(TString(analysis)=="2G") {
1513  int x=upTDF; // must be power of 2
1514  if(!((x != 0) && ((x & (~x + 1)) == x)) || upTDF<=0)
1515  {cout<<"config::Check : upTDF parameter non valid : must be power of 2 : "<<upTDF<<endl;exit(1);}
1516  }
1517 
1518  int x=inRate; // must be power of 2
1519  if(!((x != 0) && ((x & (~x + 1)) == x)) || inRate<=0)
1520  {cout<<"config::Check : inRate parameter non valid : must be power of 2 : "<<inRate<<endl;exit(1);}
1521 
1522  if(!(inRate>>levelR))
1523  {cout<<"config::Check : levelR parameter non valid "<<levelR<<endl;exit(1);}
1524 
1525  if((TString(analysis)=="1G")&&(levelF>levelD))
1526  {cout<<"config::Check : levelF must be <= levelD "<<levelF<<" " <<levelD<<endl;exit(1);}
1527 
1528  if(l_high<l_low)
1529  {cout<<"config::Check : l_low must be <= l_high "<<l_low<<" " <<l_high<<endl;exit(1);}
1530 
1531  if(l_low<0)
1532  {cout<<"config::Check : l_low must be >0 "<<l_low<<endl;exit(1);}
1533 
1534  if((TString(analysis)=="2G")&&(l_high-l_low+1>NRES_MAX)) {
1535  cout<<"config::Check : number of resolutions must le NRES_MAX="<<NRES_MAX<<endl;
1536  cout<<" l_low : "<<l_low <<endl;
1537  cout<<" l_high : "<<l_high<<endl;
1538  cout<<" l_high-l_low+1 : "<<l_high-l_low+1<<endl;
1539  exit(1);
1540  }
1541 
1542  if((TString(analysis)=="1G")&&(l_high>levelD))
1543  {cout<<"config::Check : l_high must be <= levelD "<<l_high<<" " <<levelD<<endl;exit(1);}
1544 
1545  if((TString(analysis)=="1G")&&((simulation<0)||(simulation>3)))
1546  {cout<<"config::Check : simulation parameter not valid [0:3] "<<simulation<<endl;exit(1);}
1547 
1548  if((TString(analysis)=="2G")&&((simulation<0)||(simulation>4)))
1549  {cout<<"config::Check : simulation parameter not valid [0:4] "<<simulation<<endl;exit(1);}
1550 
1551  if((simulation==0)&&(nfactor!=1))
1552  {cout<<"config::Check : nfactor must be 1 when simulation=0 "<<endl;exit(1);}
1553 
1554  if((simulation!=0)&&(lagSize!=1))
1555  {cout<<"config::Check : lagSize must be 1 when simulation!=0 "<<endl;exit(1);}
1556 
1557  if(segLen<whiteWindow)
1558  {cout<<"config::Check : segLen must be ge whiteWindow"<<endl;exit(1);}
1559 
1560  if((TString(analysis)=="1G")&&(dcPlugin || outPlugin))
1561  {cout<<"config::Check : dcPlugin ot outPlugin not enabled in 1G"<<endl;exit(1);}
1562 
1563  // segment parameters must be integers
1564  if(fmod(segLen,1)) {cout<<"config::Check : segLen must be integer"<<endl;exit(1);}
1565  if(fmod(segMLS,1)) {cout<<"config::Check : segMLS must be integer"<<endl;exit(1);}
1566  if(fmod(segTHR,1)) {cout<<"config::Check : segTHR must be integer"<<endl;exit(1);}
1567  if(fmod(segEdge,1)) {cout<<"config::Check : segEdge must be integer"<<endl;exit(1);}
1568  if(fmod(segOverlap,1)) {cout<<"config::Check : segOverlap must be integer"<<endl;exit(1);}
1569  // segment parameters must be positive
1570  if(segLen<=0) {cout<<"config::Check : segLen must be >0"<<endl;exit(1);}
1571  if(segMLS<=0) {cout<<"config::Check : segMLS must be >0"<<endl;exit(1);}
1572  // segment parameters must be greater than zero
1573  if(segTHR<0) {cout<<"config::Check : segTHR must be >=0"<<endl;exit(1);}
1574  if(segEdge<0) {cout<<"config::Check : segEdge must be >=0"<<endl;exit(1);}
1575  if(segOverlap<0) {cout<<"config::Check : segOverlap must be >=0"<<endl;exit(1);}
1576  // segment parameters consistent checks
1577  if(segMLS>segLen) {cout<<"config::Check : segMLS must be <= segLen"<<endl;exit(1);}
1578 
1579  if(simulation==0) {
1580  if(lagStep<=0) {
1581  cout<<"config::Check : when simulation=0 factors[0] lagStep must be >0"<<endl;
1582  exit(1);
1583  }
1584  if(lagMax>segMLS/lagStep) {
1585  cout<<"config::Check : when simulation=0 lagMax must be <= segMLS/lagStep"<<endl;
1586  exit(1);
1587  }
1588  }
1589 
1590  // nfactor must be > 0
1591  if(nfactor<=0) {
1592  cout<<"config::Check : nfactor must be > 0"<<endl;
1593  exit(1);
1594  }
1595  // if simulation==1 || simulation==2 factors must be > 0
1596  if(simulation==1 || simulation==2) {
1597  for(int i=0;i<nfactor;i++) if(factors[i]<=0) {
1598  cout<<"config::Check : factors["<<i<<"]="<<factors[i]<<endl;
1599  cout<<"config::Check : factors must be > 0"<<endl;
1600  exit(1);
1601  }
1602  }
1603 
1604  // jobfOptions=CWB_JOBF_SAVE_TRGFILE is not allowed in simulation mode
1605  if(simulation!=0) {
1607  cout<<"config::Check : jobfOptions=CWB_JOBF_SAVE_TRGFILE is not allowed in simulation mode!!!"<<endl;
1608  exit(1);
1609  }
1610  }
1611 
1612  // for simulation=4 factors are used as tags for the output root files
1613  if(simulation==4) {
1614  if(fmod(factors[0],1)) {
1615  cout<<"config::Check : when simulation=4 factors[0] is the offset and must be integer>0"<<endl;
1616  exit(1);
1617  }
1618  if(factors[0]<0) {
1619  cout<<"config::Check : when simulation=4 factors[0] is the offset and must be integer>=0"<<endl;
1620  exit(1);
1621  }
1622  bool fcheck=true;
1623  for(int i=1;i<nfactor;i++) {
1624  if(factors[i]!=factors[0]+i-1) fcheck=false;
1625  }
1626  if(!fcheck) {
1627  for(int i=1;i<nfactor;i++) {
1628  if(factors[i]!=0) {
1629  cout<<endl;
1630  cout<<"config::Check : when simulation=4 only factors[0] must be declared"<<endl;
1631  cout<<" factors are generated automatically by the pipeline"<<endl;
1632  cout<<endl;
1633  cout<<"factors[1]=offset;"<<endl;
1634  cout<<"factors[2]=offset+1;"<<endl;
1635  cout<<"..."<<endl;
1636  cout<<"factors[N]=offset+N-1;"<<endl;
1637  cout<<endl;
1638  cout<<"where offset=factors[0] which must be integer>0"<<endl;
1639  cout<<"where N=nfactor"<<endl;
1640  cout<<"if factors[0]==0 then factors[0] is set to 1"<<endl;
1641  cout<<endl;
1642  exit(1);
1643  }
1644  }
1645  }
1646  }
1647 
1649  cout<<"config::Check : error : mdc_shift.stopMDC must be > =mdc_shift.startMDC"<<endl;
1650  exit(1);
1651  }
1652 
1653 }
1654 
1655 //______________________________________________________________________________
1656 void
1657 CWB::config::Streamer(TBuffer &R__b) {
1658 
1659  // Stream an object of class CWB::config.
1660 
1661  //This works around a msvc bug and should be harmless on other platforms
1662  int size;
1663  typedef ::CWB::config thisClass;
1664  UInt_t R__s, R__c;
1665  if (R__b.IsReading()) {
1666  Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
1667  TNamed::Streamer(R__b);
1668  if(R__v > 1) R__b.ReadStaticArray((char*)analysis);
1669  if(R__v > 3) R__b >> online;
1670  R__b >> nIFO;
1671  R__b >> search;
1672  if(R__v > 13) R__b >> optim;
1673  R__b.ReadStaticArray((char*)ifo);
1674  R__b.ReadStaticArray((char*)refIFO);
1675  int R__i;
1676  for (R__i = 0; R__i < 9; R__i++)
1677  R__b.StreamObject(&(detParms[R__i]),typeid(detectorParams));
1678 // detParms[R__i].Streamer(R__b);
1679  if(R__v > 1) R__b >> inRate;
1680  R__b >> bpp;
1681  R__b >> Tgap;
1682  R__b >> Fgap;
1683  if(R__v > 11) R__b >> TFgap;
1684  R__b >> fLow;
1685  R__b >> fHigh;
1686  R__b >> fResample;
1687  R__b >> Acore;
1688  R__b >> Tlpr;
1689  R__b >> x2or;
1690  R__b >> netRHO;
1691  R__b >> netCC;
1692  R__b >> levelR;
1693  R__b >> levelF;
1694  R__b >> levelD;
1695  R__b >> l_low;
1696  R__b >> l_high;
1697  R__b >> segLen;
1698  R__b >> segMLS;
1699  R__b >> segTHR;
1700  R__b >> segEdge;
1701  if(R__v > 12) R__b >> segOverlap;
1702  R__b >> lagSize;
1703  R__b >> lagStep;
1704  R__b >> lagOff;
1705  R__b >> lagMax;
1706  if(R__v > 7) {
1707  R__b >> size; lagFile = size ? new char[size] : NULL;
1708  if(lagFile) R__b.ReadStaticArray((char*)lagFile);
1709  }
1710  R__b.ReadStaticArray((char*)lagMode);
1711  if(R__v > 7) {
1712  R__b >> size; lagSite = size ? new size_t[size] : NULL;
1713  if(lagSite) R__b.ReadStaticArray((size_t*)lagSite);
1714  }
1715  R__b.ReadStaticArray((double*)shift);
1716  R__b >> mlagStep;
1717  R__b >> slagSize;
1718  R__b >> slagMin;
1719  R__b >> slagMax;
1720  R__b >> slagOff;
1721  if(R__v > 7) {
1722  R__b >> size; slagSite = size ? new size_t[size] : NULL;
1723  if(slagSite) R__b.ReadStaticArray((size_t*)slagSite);
1724  }
1725  if(R__v > 7) {
1726  R__b >> size; slagFile = size ? new char[size] : NULL;
1727  if(slagFile) R__b.ReadStaticArray((char*)slagFile);
1728  }
1729  R__b >> whiteWindow;
1730  R__b >> whiteStride;
1731  R__b >> Psave;
1732  R__b.ReadStaticArray((double*)dcCal);
1733  R__b >> simulation;
1734  R__b >> iwindow;
1735  R__b >> nfactor;
1736  R__b.ReadStaticArray((double*)factors);
1737  R__b.ReadStaticArray((double*)dataShift);
1738  R__b.StreamObject(&(mdc_shift),typeid(mdcshift));
1739  if(R__v > 3) R__b.ReadStaticArray((char*)wdmXTalk);
1740  if(R__v > 3) R__b >> upTDF;
1741  if(R__v > 4) R__b >> TDSize;
1742  R__b.ReadStaticArray((char*)filter);
1743  if(R__v > 20) R__b >> pattern;
1744  if(R__v > 4) R__b >> BATCH;
1745  if(R__v > 4) R__b >> LOUD;
1746  if(R__v > 4) R__b >> subnet;
1747  if(R__v > 18) R__b >> subcut;
1748  R__b >> delta;
1749  R__b >> gamma;
1750  R__b >> eDisbalance;
1751  R__b >> EFEC;
1752  R__b >> mode;
1753  R__b >> angle;
1754  R__b >> Theta1;
1755  R__b >> Theta2;
1756  R__b >> Phi1;
1757  R__b >> Phi2;
1758  R__b >> mask;
1759  if(R__v > 1) R__b >> healpix;
1760  if((R__v < 7)||(R__v > 19)) R__b >> precision;
1761  if(R__v > 2) {
1762  void *ptr_jobfOptions = (void*)&jobfOptions;
1763  R__b >> *reinterpret_cast<Int_t*>(ptr_jobfOptions);
1764  }
1765  if(R__v > 6) {
1766  void *ptr_outfOptions = (void*)&outfOptions;
1767  R__b >> *reinterpret_cast<Int_t*>(ptr_outfOptions);
1768  }
1769  bool bool_dummy;
1770  if(R__v < 3) R__b >> bool_dummy; // previous was bool saveTemp
1771  R__b >> dumpHistory;
1772  R__b >> dump;
1773  R__b >> savemode;
1774  R__b >> cedDump;
1775  R__b >> cedRHO;
1776  R__b >> nSky;
1777  R__b.ReadStaticArray((char*)filter_dir);
1778  R__b.ReadStaticArray((char*)injectionList);
1779  R__b.ReadStaticArray((char*)skyMaskFile);
1780  R__b.ReadStaticArray((char*)skyMaskCCFile);
1781  R__b.ReadStaticArray((char*)channelNamesRaw);
1782  R__b.ReadStaticArray((char*)channelNamesMDC);
1783  R__b.ReadStaticArray((char*)work_dir);
1784  R__b.ReadStaticArray((char*)config_dir);
1785  R__b.ReadStaticArray((char*)input_dir);
1786  R__b.ReadStaticArray((char*)output_dir);
1787  R__b.ReadStaticArray((char*)merge_dir);
1788  R__b.ReadStaticArray((char*)condor_dir);
1789  R__b.ReadStaticArray((char*)report_dir);
1790  R__b.ReadStaticArray((char*)macro_dir);
1791  R__b.ReadStaticArray((char*)log_dir);
1792  R__b.ReadStaticArray((char*)data_dir);
1793  R__b.ReadStaticArray((char*)tmp_dir);
1794  R__b.ReadStaticArray((char*)ced_dir);
1795  R__b.ReadStaticArray((char*)pp_dir);
1796  R__b.ReadStaticArray((char*)dump_dir);
1797  R__b.ReadStaticArray((char*)www_dir);
1798  R__b.ReadStaticArray((char*)data_label);
1799  R__b.ReadStaticArray((char*)condor_log);
1800  if(R__v > 17) R__b.ReadStaticArray((char*)condor_tag);
1801  R__b.ReadStaticArray((char*)frFiles);
1802  if(R__v > 3) R__b >> frRetryTime;
1803  R__b >> nDQF;
1804  if(R__v > 23)
1805  for (R__i = 0; R__i < DQF_MAX; R__i++) R__b.StreamObject(&(DQF[R__i]),typeid(dqfile));
1806  else
1807  for (R__i = 0; R__i < 20; R__i++) R__b.StreamObject(&(DQF[R__i]),typeid(dqfile));
1808 // DQF[R__i].Streamer(R__b);
1809  R__b.ReadStaticArray((char*)nodedir);
1810  if(R__v > 22) R__b.ReadStaticArray((char*)cwb_config_env);
1811  if(R__v > 22) R__b.ReadStaticArray((char*)site_cluster_env);
1812  plugin.Streamer(R__b);
1813  configPlugin.Streamer(R__b);
1814  if(R__v > 21) R__b.ReadStaticArray((char*)parPlugin);
1815  R__b >> dataPlugin;
1816  R__b >> mdcPlugin;
1817  if(R__v > 5) R__b >> dcPlugin;
1818  if(R__v > 14) R__b >> cohPlugin;
1819  if(R__v > 15) R__b >> scPlugin;
1820  if(R__v > 9) R__b >> outPlugin;
1821  if(R__v > 21) R__b.ReadStaticArray((char*)comment);
1822  R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
1823  } else {
1824  R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
1825  TNamed::Streamer(R__b);
1826  R__b.WriteArray(analysis, 8);
1827  R__b << online;
1828  R__b << nIFO;
1829  R__b << search;
1830  R__b << optim;
1831  R__b.WriteArray((char*)ifo, 72);
1832  R__b.WriteArray(refIFO, 4);
1833  int R__i;
1834  for (R__i = 0; R__i < 9; R__i++)
1835  R__b.StreamObject(&(detParms[R__i]),typeid(detectorParams));
1836 // detParms[R__i].Streamer(R__b);
1837  R__b << inRate;
1838  R__b << bpp;
1839  R__b << Tgap;
1840  R__b << Fgap;
1841  R__b << TFgap;
1842  R__b << fLow;
1843  R__b << fHigh;
1844  R__b << fResample;
1845  R__b << Acore;
1846  R__b << Tlpr;
1847  R__b << x2or;
1848  R__b << netRHO;
1849  R__b << netCC;
1850  R__b << levelR;
1851  R__b << levelF;
1852  R__b << levelD;
1853  R__b << l_low;
1854  R__b << l_high;
1855  R__b << segLen;
1856  R__b << segMLS;
1857  R__b << segTHR;
1858  R__b << segEdge;
1859  R__b << segOverlap;
1860  R__b << lagSize;
1861  R__b << lagStep;
1862  R__b << lagOff;
1863  R__b << lagMax;
1864  if(lagFile!=NULL) {size=strlen(lagFile)+1;R__b << size;R__b.WriteArray(lagFile, size);}
1865  else R__b << 0;
1866  R__b.WriteArray(lagMode, 2);
1867  if(lagSite!=NULL) {size=NIFO_MAX;R__b << size;R__b.WriteArray(lagSite, size);}
1868  else R__b << 0;
1869  R__b.WriteArray(shift, 9);
1870  R__b << mlagStep;
1871  R__b << slagSize;
1872  R__b << slagMin;
1873  R__b << slagMax;
1874  R__b << slagOff;
1875  if(slagSite!=NULL) {size=NIFO_MAX;R__b << size;R__b.WriteArray(slagSite, size);}
1876  else R__b << 0;
1877  if(slagFile!=NULL) {size=strlen(slagFile)+1;R__b << size;R__b.WriteArray(slagFile, size);}
1878  else R__b << 0;
1879  R__b << whiteWindow;
1880  R__b << whiteStride;
1881  R__b << Psave;
1882  R__b.WriteArray(dcCal, 9);
1883  R__b << simulation;
1884  R__b << iwindow;
1885  R__b << nfactor;
1886  R__b.WriteArray(factors, FACTORS_MAX);
1887  R__b.WriteArray(dataShift, 9);
1888  R__b.StreamObject(&(mdc_shift),typeid(mdcshift));
1889  R__b.WriteArray(wdmXTalk, 1024);
1890  R__b << upTDF;
1891  R__b << TDSize;
1892  R__b.WriteArray(filter, 1024);
1893  R__b << pattern;
1894  R__b << BATCH;
1895  R__b << LOUD;
1896  R__b << subnet;
1897  R__b << subcut;
1898  R__b << delta;
1899  R__b << gamma;
1900  R__b << eDisbalance;
1901  R__b << EFEC;
1902  R__b << mode;
1903  R__b << angle;
1904  R__b << Theta1;
1905  R__b << Theta2;
1906  R__b << Phi1;
1907  R__b << Phi2;
1908  R__b << mask;
1909  R__b << healpix;
1910  R__b << precision;
1911  R__b << jobfOptions;
1912  R__b << outfOptions;
1913  R__b << dumpHistory;
1914  R__b << dump;
1915  R__b << savemode;
1916  R__b << cedDump;
1917  R__b << cedRHO;
1918  R__b << nSky;
1919  R__b.WriteArray(filter_dir, 1024);
1920  R__b.WriteArray(injectionList, 1024);
1921  R__b.WriteArray(skyMaskFile, 1024);
1922  R__b.WriteArray(skyMaskCCFile, 1024);
1923  R__b.WriteArray((char*)channelNamesRaw, NIFO_MAX*50);
1924  R__b.WriteArray((char*)channelNamesMDC, NIFO_MAX*50);
1925  R__b.WriteArray(work_dir, 1024);
1926  R__b.WriteArray(config_dir, 1024);
1927  R__b.WriteArray(input_dir, 1024);
1928  R__b.WriteArray(output_dir, 1024);
1929  R__b.WriteArray(merge_dir, 1024);
1930  R__b.WriteArray(condor_dir, 1024);
1931  R__b.WriteArray(report_dir, 1024);
1932  R__b.WriteArray(macro_dir, 1024);
1933  R__b.WriteArray(log_dir, 1024);
1934  R__b.WriteArray(data_dir, 1024);
1935  R__b.WriteArray(tmp_dir, 1024);
1936  R__b.WriteArray(ced_dir, 1024);
1937  R__b.WriteArray(pp_dir, 1024);
1938  R__b.WriteArray(dump_dir, 1024);
1939  R__b.WriteArray(www_dir, 1024);
1940  R__b.WriteArray(data_label, 1024);
1941  R__b.WriteArray(condor_log, 1024);
1942  R__b.WriteArray(condor_tag, 1024);
1943  R__b.WriteArray((char*)frFiles, 2*NIFO_MAX*1024);
1944  R__b << frRetryTime;
1945  R__b << nDQF;
1946  for (R__i = 0; R__i < DQF_MAX; R__i++)
1947  R__b.StreamObject(&(DQF[R__i]),typeid(dqfile));
1948 // DQF[R__i].Streamer(R__b);
1949  R__b.WriteArray(nodedir, 1024);
1950  R__b.WriteArray(cwb_config_env, 1024);
1951  R__b.WriteArray(site_cluster_env, 1024);
1952  plugin.Streamer(R__b);
1953  configPlugin.Streamer(R__b);
1954  R__b.WriteArray(parPlugin, 1024);
1955  R__b << dataPlugin;
1956  R__b << mdcPlugin;
1957  R__b << dcPlugin;
1958  R__b << cohPlugin;
1959  R__b << scPlugin;
1960  R__b << outPlugin;
1961  R__b.WriteArray(comment, 1024);
1962  R__b.SetByteCount(R__c, kTRUE);
1963  }
1964 }
1965 
char channelNamesMDC[NIFO_MAX][50]
Definition: config.hh:311
CWB_JOBF_OPTIONS jobfOptions
Definition: config.hh:291
char analysis[8]
Definition: config.hh:117
double iwindow
Definition: config.hh:200
double startMDC
Definition: Toolbox.hh:106
double x2or
Definition: config.hh:146
char www_dir[1024]
Definition: config.hh:329
double precision
Definition: config.hh:286
size_t TDSize
Definition: config.hh:217
bool optim
Definition: config.hh:122
void Export(TString fname="")
Definition: config.cc:406
void Init()
Definition: ChirpMass.C:284
char cmdline[128]
Definition: config.cc:24
void Print(Option_t *option="")
Definition: config.cc:737
int levelF
Definition: config.hh:153
TMacro configPlugin
Definition: config.hh:362
bool mdcPlugin
Definition: config.hh:365
Definition: ced.hh:42
cout<< cfg-> nodedir<< endl;cfg-> Import("../../../cwb/macros/cwb_inet.C")
void View()
Definition: config.cc:1296
double cedRHO
Definition: config.hh:298
char name[32]
Definition: detector.hh:50
char skyMaskFile[1024]
Definition: config.hh:308
size_t upTDF
Definition: config.hh:216
CWB_JOBF_OPTIONS
Definition: config.hh:55
bool dataPlugin
Definition: config.hh:364
par [0] name
int n
Definition: cwb_net.C:28
char data_dir[1024]
Definition: config.hh:324
TString("c")
bool cohPlugin
Definition: config.hh:367
double stopMDC
Definition: Toolbox.hh:107
double shift[NIFO_MAX]
Definition: config.hh:175
const int DQF_MAX
Definition: config.hh:87
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1) *itime+ifreq;double time=itime *dT;double freq=(ifreq >0) ? ifreq *dF :dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
void Check()
Definition: config.cc:1411
double whiteWindow
Definition: config.hh:189
double fLow
Definition: config.hh:140
int pattern
Definition: config.hh:241
bool dcPlugin
Definition: config.hh:366
bool cedDump
Definition: config.hh:297
void Init()
Definition: config.cc:191
dqfile DQF[DQF_MAX]
Definition: config.hh:349
size_t * slagSite
Definition: config.hh:185
double netRHO
Definition: config.hh:147
char * lagFile
Definition: config.hh:172
Long_t size
int m
Definition: cwb_net.C:28
int slagMin
Definition: config.hh:182
char report_dir[1024]
Definition: config.hh:321
i drho i
void Import(TString umacro="")
Definition: config.cc:352
char nodedir[1024]
Definition: config.hh:352
TList * list
double segTHR
Definition: config.hh:163
char macro_dir[1024]
Definition: config.hh:322
double Phi1
Definition: config.hh:279
int levelD
Definition: config.hh:154
CWB_OUTF_OPTIONS
Definition: config.hh:79
bool outPlugin
Definition: config.hh:369
double segOverlap
Definition: config.hh:165
int slagOff
Definition: config.hh:184
bool online
Definition: config.hh:118
double Tlpr
Definition: config.hh:144
fprintf(stdout,"start=%f duration=%f rate=%f\, x.start(), x.size()/x.rate(), x.rate())
int Psave
Definition: config.hh:193
char comment[1024]
Definition: config.hh:371
double segEdge
Definition: config.hh:164
#define SETVAR(MODE, VAR, TYPE, SIZE1, SIZE2)
Definition: config.cc:64
size_t mode
Definition: config.hh:275
detectorParams detParms[NIFO_MAX]
Definition: config.hh:128
double dcCal[NIFO_MAX]
Definition: config.hh:196
double Theta2
Definition: config.hh:278
void DumpPlugin(const char *filename="")
Definition: config.cc:1209
const int FACTORS_MAX
Definition: config.hh:86
size_t fResample
Definition: config.hh:142
TGlobal * global
Definition: config.cc:23
static char * readFile(TString ifName)
Definition: Toolbox.cc:2835
char filter_dir[1024]
Definition: config.hh:305
size_t lagOff
Definition: config.hh:170
char condor_log[1024]
Definition: config.hh:335
int simulation
Definition: config.hh:199
int l_high
Definition: config.hh:156
int nDQF
Definition: config.hh:348
double Fgap
Definition: config.hh:136
char input_dir[1024]
Definition: config.hh:317
CWB_OUTF_OPTIONS outfOptions
Definition: config.hh:292
char search
Definition: config.hh:121
size_t * lagSite
Definition: config.hh:174
int Compare(CWB::config config)
Definition: config.cc:1265
char site_cluster_env[1024]
Definition: config.hh:358
i() int(T_cor *100))
char output_dir[1024]
Definition: config.hh:318
void SetVar(bool MODE)
Definition: config.cc:420
const int NIFO_MAX
Definition: wat.hh:22
int BATCH
Definition: config.hh:245
char tmp_dir[1024]
Definition: config.hh:325
int slagMax
Definition: config.hh:183
char parPlugin[1024]
Definition: config.hh:363
double delta
Definition: config.hh:252
char fname[1024]
bool eDisbalance
Definition: config.hh:270
double dataShift[NIFO_MAX]
Definition: config.hh:205
char channelNamesRaw[NIFO_MAX][50]
Definition: config.hh:310
int slagSize
Definition: config.hh:181
double Acore
Definition: config.hh:143
char cwb_config_env[1024]
Definition: config.hh:355
int k
int frRetryTime
Definition: config.hh:344
double offset
Definition: Toolbox.hh:108
UserGroup_t * uinfo
Definition: cwb_frdisplay.C:91
char log_dir[1024]
Definition: config.hh:323
int nfactor
Definition: config.hh:201
size_t healpix
Definition: config.hh:282
char refIFO[4]
Definition: config.hh:125
char filter[1024]
Definition: config.hh:218
char condor_tag[1024]
Definition: config.hh:338
size_t lagSize
Definition: config.hh:168
const int NRES_MAX
Definition: wat.hh:23
long nSky
Definition: config.hh:299
char lagMode[2]
Definition: config.hh:173
char pp_dir[1024]
Definition: config.hh:327
char injectionList[1024]
Definition: config.hh:307
double netCC
Definition: config.hh:148
bool EFEC
Definition: config.hh:274
double subnet
Definition: config.hh:247
mdcshift mdc_shift
Definition: config.hh:211
int l_low
Definition: config.hh:155
#define EXPORT(TYPE, VAR, CMD)
Definition: config.cc:92
double whiteStride
Definition: config.hh:190
char * slagFile
Definition: config.hh:186
double fHigh
Definition: config.hh:141
bool savemode
Definition: config.hh:296
int mlagStep
Definition: config.hh:178
int LOUD
Definition: config.hh:246
TMacro plugin
Definition: config.hh:361
char ifo[NIFO_MAX][8]
Definition: config.hh:124
double fabs(const Complex &x)
Definition: numpy.cc:55
char ced_dir[1024]
Definition: config.hh:326
char work_dir[1024]
Definition: config.hh:314
void DumpConfig(const char *filename="", Option_t *option="")
Definition: config.cc:1335
double segLen
Definition: config.hh:161
char dump_dir[1024]
Definition: config.hh:328
void DumpConfigPlugin(const char *filename="")
Definition: config.cc:1237
strcpy(RunLabel, RUN_LABEL)
virtual void Browse(TBrowser *b)
Definition: config.cc:181
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
double subcut
Definition: config.hh:248
double Phi2
Definition: config.hh:280
char skyMaskCCFile[1024]
Definition: config.hh:309
int nIFO
Definition: config.hh:120
double mask
Definition: config.hh:281
double Tgap
Definition: config.hh:134
double factors[FACTORS_MAX]
Definition: config.hh:202
bool dumpHistory
Definition: config.hh:294
int cat
char config_dir[1024]
Definition: config.hh:316
size_t lagMax
Definition: config.hh:171
char data_label[1024]
Definition: config.hh:332
char wdmXTalk[1024]
Definition: config.hh:215
fclose(ftrig)
TString config
double lagStep
Definition: config.hh:169
char fName[256]
double TFgap
Definition: config.hh:138
double bpp
Definition: config.hh:133
int check
double Theta1
Definition: config.hh:277
char merge_dir[1024]
Definition: config.hh:319
char condor_dir[1024]
Definition: config.hh:320
size_t inRate
Definition: config.hh:132
double gamma
Definition: config.hh:258
double segMLS
Definition: config.hh:162
int levelR
Definition: config.hh:152
char frFiles[2 *NIFO_MAX][1024]
Definition: config.hh:342
void SetSingleDetectorMode()
Definition: config.cc:1352
bool scPlugin
Definition: config.hh:368
TString ifos[60]
double angle
Definition: config.hh:276
exit(0)
bool dump
Definition: config.hh:295