Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cwb_mkfad.C
Go to the documentation of this file.
1 // this macro compute the FAD statistic
2 // it is used in post production
3 // can be run in standalone or it is called from the sim report
4 
5 #include <vector>
6 
7 #define FAR_FILE_NAME "rate_threshold_veto.txt"
8 #define LIV_FILE_NAME "live.txt"
9 
10 // -----------------------------------------
11 // plot type : ptype
12 // -----------------------------------------
13 // "FARvsRHO"
14 // "REFFvsRHO"
15 // "REFFvsIRHO"
16 // "VISvsRHO"
17 // "PRODvsFAD"
18 // "EVTvsRHO"
19 // "FADvsRHO"
20 // "FAPvsRHO"
21 // "RECvsINJ"
22 // "OBSTIMEvsFAR"
23 // -----------------------------------------
24 
25 #define DENSITY_FORMULA
26 #define APPLY_ENORM
27 
28 void MakePlot(TString ptype, bool pAll);
29 TGraphErrors* Plot(int mtype, TString ptitle, TString xtitle, TString ytitle, bool save=true);
30 void RECvsINJ(int mtype, TString ptitle, TString xtitle, TString ytitle);
31 void MakeHtml(TString ptitle);
32 void MakeHtmlIndex(TString* ptype, int psize);
35 
36 // --------------------------------------------------------
37 // Global variables
38 // --------------------------------------------------------
39 TString gODIR = pp_dir; // output dir
40 TString gPTYPE = "VISvsRHO"; // plot type
41 int gMTYPE = -1; // mdc type
42 bool gFIT = false; // enable fit
43 TCanvas* gCANVAS = NULL; // canvas object
44 CWB::mdc* gMDC = NULL; // MDC object
45 TTree* gTRWAVE = NULL; // wave tree
46 TTree* gTRMDC = NULL; // mdc tree
47 bool gINSPIRAL = false; // inspiral/burst mdc
48 double gOBSTIME= 0.0; // observation livetime
49 double gBKGTIME= 0.0; // background livetime
50 double gRHOMIN = 5.; // minimum rho value selected for plots
51 int gNBINS = 100; // number of bins used in mdc histo
52 int gNZBINS = -1; // le_0 -> standard FAD statistic
53  // ge_0 -> modified FAD statistic
54 
55 vector<double> RHO; // rho
56 vector<double> eRHO; // RHO error
57 vector<double> VIS; // visible volume`
58 vector<double> eVIS; // VIS error
59 vector<double> FAR; // FAR
60 vector<double> eFAR; // FAR error
61 vector<double> dFAR; // differendial FAR
62 vector<double> normHRSS; // normalization hrss
63 
64 // --bkgrep : directory of the background report (used to read rate_threshold_veto.txt and live.txt)
65 // --hrss : if it is a number then it is used as normalization constant for all MDC types (def=0)
66 // if =0 then hrss rescale is not applied
67 // if it is a file then it is the list of hrss used for each MDC type
68 // (format : for each line -> hrss)
69 // --gfit : true/false -> enable/disable fit in the output plots (default=false)
70 // --rhomin : minimum rho value selected for plots (default = 5)
71 // --units : K -> Kpc,Kyr : M -> Mpc,Myr (def=M)
72 // --distr : formula/mdc -> radial distribution is computed from formula or from mdc injections (def=MDC)
73 // --nbins : number of bins used in hist to computed the radial distribution from the mdc injections
74 // --header : if true -> add cwb header to fad html file (def=false)
75 // --multi : if true -> FAD multi plot for each mdc set are created and substituted in the sim report
76 // page to the eff_freq plots (def=false)
77 // --title : title of the html page (default=FAD) : spaces must be filled with *
78 // --subtitle: subtitle of the html page (default="") : spaces must be filled with *
79 
80 
91 
92 #define nPLOT 10
93 
95  "FARvsRHO",
96  "RECvsINJ",
97  "VISvsRHO",
98  "REFFvsRHO",
99  "REFFvsIRHO",
100  "FADvsRHO",
101  "PRODvsFAD",
102  "EVTvsRHO",
103  "FAPvsRHO",
104  "OBSTIMEvsFAR"
105  };
106 
107 
108 void cwb_mkfad(TString odir="fad", int nzbins=-1, double obstime=0, bool bexit=true) {
109 //
110 // odir : output fad directory (default="fad")
111 // nzbins : (default is -1)
112 // - NOTE : if it is defined in pp_fad the input value is overwritten
113 // - if nzbin=0 the FAD statistic is computed with classical FAD
114 // - if nzbin>0 the FAD statistic is computed until there are nzbins
115 // consecutive bins with zero events inside
116 // - if nzbin<0 the FAD statistic is computed with classical FAD and min-hold
117 // obstime : zero lag observation time, if 0 then it is read from live.txt
118 // bexit : if true (def) then the macro exit at the end of the execution
119 //
120 // NOTE : pp_fad must be defined in user_pparameters.C file or in the input
121 // fad config file (fad.in) provided to the line command cwb_mkfad
122 // Ex: cwb_mkfad M1 fad.in fad
123 //
124 
126 
127  TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
128  TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
129  TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
130  TB.checkFile(gSystem->Getenv("CWB_PPARAMETERS_FILE"));
131  TB.checkFile(gSystem->Getenv("CWB_UPPARAMETERS_FILE"));
132  TB.checkFile(gSystem->Getenv("CWB_EPPARAMETERS_FILE"));
133 
134  // ------------------------------------------------
135  // cwb_mkfad works only with simulation=4 mode
136  // ------------------------------------------------
137 /*
138  if(simulation!=4) {
139  cout << "cwb_mkfad.C - Error : cwb_mkfad works only with simulation=4 mode" << endl;
140  exit(1);
141  }
142 */
143 
144  // ------------------------------------------------
145  // read pp_fad
146  // ------------------------------------------------
147  if(pp_fad=="") { // nothing to be done
148  cout<<endl<<"cwb_mkfad.C : Warning : pp_fad is not defined, macro is not executed !!!"<<endl<<endl;
149  exit(0);
150  }
151 
152  // get --bkgrep
153  pp_fad_bkgrep = CWB::Toolbox::getParameter(pp_fad,"--bkgrep");
154  if(pp_fad_bkgrep=="") {
155  cout<<"cwb_mkfad.C : Error : pp_fad --bkgrep not defined"<<endl;exit(1);}
156 
158 
159  // get --hrss
160  pp_fad_hrss = CWB::Toolbox::getParameter(pp_fad,"--hrss");
161  if(pp_fad_hrss=="") {pp_fad_hrss="0";
162  cout<<"cwb_mkfad.C : Info : pp_fad --hrss not defined : set hrss=1"<<endl;}
163 
164  if(!pp_fad_hrss.IsFloat()) {
165  // hrss normalization values are define in a file
167  }
168 
169  // get --rhomin
170  pp_fad_rhomin = CWB::Toolbox::getParameter(pp_fad,"--rhomin");
171  if(pp_fad_rhomin!="") {
172  if(pp_fad_rhomin.IsFloat()) {
173  gRHOMIN = pp_fad_rhomin.Atof();
174  } else {
175  cout<<"cwb_mkfad.C : Error : pp_fad --rhomin must be a number"<<endl;
176  exit(1);
177  }
178  }
179 
180  // get --gfit
181  pp_fad_gfit = CWB::Toolbox::getParameter(pp_fad,"--gfit");
182  if(pp_fad_gfit!="") {
183  if((pp_fad_gfit!="true")&&(pp_fad_gfit!="false")) {
184  cout<<"cwb_mkfad.C : Error : pp_fad --gfit bad value -> must be true/false"<<endl;
185  exit(1);
186  } else {
187  if(pp_fad_gfit=="true") gFIT=true;
188  if(pp_fad_gfit=="false") gFIT=false;
189  }
190  }
191 
192  // get --units
193  pp_fad_units = CWB::Toolbox::getParameter(pp_fad,"--units");
194  if(pp_fad_units=="") pp_fad_units="M";
195  pp_fad_units.ToUpper();
196  if((pp_fad_units!="K")&&(pp_fad_units!="M")) {
197  cout<<"cwb_mkfad.C : Error : pp_fad --units bad value -> must be K/M"<<endl;
198  exit(1);
199  }
200 
201  // get --distr
202  pp_fad_distr = CWB::Toolbox::getParameter(pp_fad,"--distr");
203  if(pp_fad_distr=="") pp_fad_distr="mdc";
204  pp_fad_distr.ToUpper();
205  if((pp_fad_distr!="MDC")&&(pp_fad_distr!="FORMULA")) {
206  cout<<"cwb_mkfad.C : Error : pp_fad --distr bad value -> must be MDC/FORMULA"<<endl;
207  exit(1);
208  }
209 
210  // get --nzbins (if it is defined in pp_fad the input value is overwritten)
211  gNZBINS = nzbins;
212  pp_fad_nzbins = CWB::Toolbox::getParameter(pp_fad,"--nzbins");
213  if(pp_fad_nzbins!="") {
214  TString _pp_fad_nzbins = pp_fad_nzbins;
215  if((_pp_fad_nzbins[0]=='+')||(_pp_fad_nzbins[0]=='-')) _pp_fad_nzbins.Remove(0,1);
216  if(_pp_fad_nzbins.IsDigit()) {
217  gNZBINS = pp_fad_nzbins.Atoi();
218  } else {
219  cout<<"cwb_mkfad.C : Error : pp_fad --nzbins must be an integer number"<<endl;
220  exit(1);
221  }
222  }
223 
224  // get --nbins
225  pp_fad_nbins = CWB::Toolbox::getParameter(pp_fad,"--nbins");
226  if(pp_fad_nbins!="") {
227  if(pp_fad_nbins.IsDigit()) {
228  gNBINS = pp_fad_nbins.Atoi();
229  } else {
230  cout<<"cwb_mkfad.C : Error : pp_fad --nbins must be an integer number"<<endl;
231  exit(1);
232  }
233  }
234 
235  // get --header
236  TString pp_fad_header = CWB::Toolbox::getParameter(pp_fad,"--header");
237  if(pp_fad_header=="") pp_fad_header="false";
238  pp_fad_header.ToUpper();
239 
240  // get --multi
241  TString pp_fad_multi = CWB::Toolbox::getParameter(pp_fad,"--multi");
242  if(pp_fad_multi=="") pp_fad_multi="false";
243  pp_fad_multi.ToUpper();
244 
245  // get --title
246  TString pp_fad_title = CWB::Toolbox::getParameter(pp_fad,"--title");
247  pp_fad_title.ReplaceAll("*"," ");
248  if(pp_fad_title=="") pp_fad_title="FAD";
249 
250  // get --subtitle
251  TString pp_fad_subtitle = CWB::Toolbox::getParameter(pp_fad,"--subtitle");
252  pp_fad_subtitle.ReplaceAll("*"," ");
253 
254  // ------------------------------------------------
255  // create canvas
256  // ------------------------------------------------
257  gCANVAS = new TCanvas("canvas", "canvas",16,30,825,546);
258  gCANVAS->Range(-19.4801,-9.25,-17.4775,83.25);
259  gCANVAS->SetBorderSize(2);
260  gCANVAS->SetFrameFillColor(0);
261  gCANVAS->SetGridx();
262  gCANVAS->SetGridy();
263 
264  gStyle->SetOptFit(kTRUE);
265 
266  // ------------------------------------------------
267  // define output dir
268  // ------------------------------------------------
269  gODIR = TString(pp_dir)+TString("/")+odir;
270 
271  // ------------------------------------------------
272  // export to CINT net,cfg
273  // exec config plugin
274  // if Burst MDC then extract mdcHRSS which is defined in config plugin
275  // ------------------------------------------------
276  char cmd[128];
277  //sprintf(cmd,"network* net = (network*)%p;",net);
278  sprintf(cmd,"network* net = new network;");
279  gROOT->ProcessLine(cmd);
280  CWB::config* cfg = new CWB::config;
281  cfg->Import();
282  sprintf(cmd,"CWB::config* cfg = (CWB::config*)%p;",cfg);
283  gROOT->ProcessLine(cmd);
284  sprintf(cmd,"int gIFACTOR=1;");
285  gROOT->ProcessLine(cmd);
286  configPlugin.Exec();
287  //MDC.Print();
288  gMDC = &MDC;
289 
290  gINSPIRAL = gMDC->GetInspiral()!="" ? true : false; // Inspiral/Burst MDC
291 
292  if(!gINSPIRAL) { // if burst then mdcHRSS must be declaren in the config plugin
293  // verify if mdcHRSS exist
294  TGlobal* global = (TGlobal*)gROOT->GetGlobal("mdcHRSS",true);
295  if(global!=NULL) {
296  cout << global->GetTypeName() << endl;
297  if(TString(global->GetTypeName())!="vector<double>") {
298  cout << "cwb_mkfad.C - Error : 'vector<double> mdcHRSS' do not exist in CINT" << endl;
299  gSystem->Exit(1);
300  }
301  }
302  }
303 
304  // ------------------------------------------------
305  // open wave/mdc trees
306  // ------------------------------------------------
307  // open wave file
308  TFile* fwave = TFile::Open(sim_file_name);
309  gTRWAVE = (TTree*) gROOT->FindObject("waveburst");
310  // open mdc file
311  TFile *fmdc = TFile::Open(mdc_file_name);
312  gTRMDC = (TTree*) gROOT->FindObject("mdc");
313 
314  // ------------------------------------------------
315  // get observation time
316  // ------------------------------------------------
317  char liv_file_path[1024];
318  sprintf(liv_file_path,"%s/%s",pp_fad_bkgrep.Data(),LIV_FILE_NAME);
319  int countlag=0;
320  gBKGTIME=GetLiveTime(liv_file_path,-1,-1,countlag); // get full livetime
321  gOBSTIME=GetLiveTime(liv_file_path,0,0,countlag); // get zero lag livetime
322  gBKGTIME-=gOBSTIME; // background livetime
323  if(obstime>0) gOBSTIME=obstime; // user provided zero lag livetime
324  cout << "Zero Lag Observation Time : " << gOBSTIME << " sec" << endl;
325  if(gOBSTIME==0) {
326  cout << "cwb_mkfad.C - Error : Observation Time is zero" << endl;
327  cout << " probably your set do not includes the zero lag" << endl << endl;
328  exit(1);
329  }
330  cout << "Background Observation Time : " << gBKGTIME << " sec" << endl;
331 
332  // ------------------------------------------------
333  // read cumulative rho far from rate_threshold_veto.txt file
334  // ------------------------------------------------
335 
336  char far_file_path[1024];
337  sprintf(far_file_path,"%s/%s",pp_fad_bkgrep.Data(),FAR_FILE_NAME);
338 
339  ifstream infar;
340  infar.open(far_file_path, ios::in);
341  if (!infar.good()) {cout << "Error Opening File : " << far_file_path << endl;exit(1);}
342  while (1) {
343  float irho,ifar;
344  infar >> irho >> ifar;
345  if (!infar.good()) break;
346  if(irho<gRHOMIN) continue;
347  if(ifar==0) break;
348  RHO.push_back(irho);
349  FAR.push_back(ifar);
350  eFAR.push_back(sqrt(gBKGTIME*ifar)/gBKGTIME);
351  dFAR.push_back(ifar);
352  }
353  infar.close();
354  // add one more value with FAR=0
355  float drho=RHO[RHO.size()-1]-RHO[RHO.size()-2];
356  RHO.push_back(RHO[RHO.size()-1]+drho);
357  FAR.push_back(0);
358  eFAR.push_back(0);
359  dFAR.push_back(0);
360 
361  // add eRHO
362  eRHO.resize(RHO.size());
363  for(int i=0;i<eRHO.size();i++) eRHO[i]=0;
364 
365  // compute the differential FAR
366  for(int i=0;i<RHO.size()-1;i++) {
367  dFAR[i]=dFAR[i]-dFAR[i+1];
368  }
369 
370  for(int i=0;i<RHO.size()-1;i++) {
371  //cout << i << " " <<RHO[i] << " " << dFAR[i] << endl;
372  }
373 
374  // ------------------------------------------------
375  // read normalization hrss
376  // ------------------------------------------------
377  int N = gMDC->wfList.size(); // get number of MDC types
378 
379  if(pp_fad_hrss.IsFloat()) { // apply the same valye to all mtypes
380 
381  for(int i=0;i<N;i++) normHRSS.push_back(pp_fad_hrss.Atof());
382 
383  } else { // hrss normalization values are define in a file
384 
385  ifstream in_hrss_norm;
386  in_hrss_norm.open(pp_fad_hrss.Data());
387  int count=0;
388  double hrss_temp;
389  while(1) {
390  in_hrss_norm >> hrss_temp;
391  if (!in_hrss_norm.good()) break;
392  //cout << hrss_temp << endl;
393  normHRSS.push_back(hrss_temp);
394  count++;
395  if(count>N) {
396  cout << "cwb_mkfad.C - Errors : too many waveforms on " << pp_fad_hrss << " file " << endl;
397  exit(1);
398  }
399  }
400  in_hrss_norm.close();
401  }
402 
403  // ------------------------------------------------
404  // create output dir
405  // ------------------------------------------------
406  TB.mkDir(gODIR,!pp_batch);
407 
408  // ------------------------------------------------
409  // create multiPlot - used in sim report page
410  // ------------------------------------------------
411  if(pp_fad_multi=="TRUE") MakeMultiPlotFAD(mdc_inj_file);
412 
413  // ------------------------------------------------
414  // create plots
415  // ------------------------------------------------
416  gMTYPE = -1; // reset initial value of mdc type
417  gCANVAS->cd(); // must be done because MakeMultiPlotFAD set a different canvas
418  for(int i=0;i<nPLOT;i++) MakePlot(ptype[i], false);
419 
420  // ------------------------------------------------
421  // make fad.html
422  // ------------------------------------------------
423  MakeHtmlIndex(ptype,nPLOT);
424  if(pp_fad_header=="TRUE") AddHtmlHeader(gODIR);
425 
426  if(bexit) gSystem->Exit(0); else return;
427 }
428 
429 void MakePlot(TString ptype, bool pAll) {
430 
431  gPTYPE = ptype;
432 
433  char rho_type[32];sprintf(rho_type,"rho[%d]",pp_irho);
434 
435  TString ptitle;
436  TString xtitle;
437  TString ytitle;
438 
439  if(gPTYPE=="REFFvsRHO") {
440  gCANVAS->SetLogx(false);
441  gCANVAS->SetLogy(false);
442  ptitle=TString("Effective Radius vs ")+rho_type;
443  gStyle->SetStatY(0.3);
444  xtitle=rho_type;
445  ytitle="Reff (Kpc)";
446 
447  } else if(gPTYPE=="REFFvsIRHO") {
448  gCANVAS->SetLogx(false);
449  gCANVAS->SetLogy(true);
450  ptitle=TString("Effective Radius vs inverse ")+rho_type;
451  xtitle=TString(rho_type)+"^{-1}";
452  ytitle="Reff (Kpc)";
453 
454  } else if(gPTYPE=="VISvsRHO") {
455  gCANVAS->SetLogx(false);
456  gCANVAS->SetLogy(true);
457  ptitle=TString("Visible Volume vs ")+rho_type;
458  xtitle=rho_type;
459  ytitle="Vvis (Kpc^{3})";
460 
461  } else if(gPTYPE=="PRODvsFAD") {
462  gCANVAS->SetLogx(true);
463  gCANVAS->SetLogy(false);
464  ptitle=TString("Productivity vs False Alarm Density");
465  xtitle="FAD (Kpc^{-3} Kyr^{-1})";
466  ytitle="Productivity (Kpc^{3} Kyr)";
467 
468  } else if(gPTYPE=="FADvsRHO") {
469  gCANVAS->SetLogx(false);
470  gCANVAS->SetLogy(true);
471  ptitle=TString("False Alarm Density vs ")+rho_type;
472  xtitle=rho_type;
473  ytitle="FAD (Kpc^{-3} Kyr^{-1})";
474 
475  } else if(gPTYPE=="FARvsRHO") {
476  gCANVAS->SetLogx(false);
477  gCANVAS->SetLogy(true);
478  ptitle=TString("False Alarm Rate vs ")+rho_type;
479  xtitle=rho_type;
480  ytitle="False Alarm Rate (sec^{-1})";
481 
482  } else if(gPTYPE=="FAPvsRHO") {
483  gCANVAS->SetLogx(false);
484  gCANVAS->SetLogy(true);
485  ptitle=TString("False Alarm Probability vs ")+rho_type;
486  xtitle=rho_type;
487  ytitle="False Alarm Probability";
488 
489  } else if(gPTYPE=="EVTvsRHO") {
490  gCANVAS->SetLogx(false);
491  gCANVAS->SetLogy(true);
492  ptitle=TString("Expected background events per Observation time vs ")+rho_type;
493  xtitle=rho_type;
494  ytitle="Expected Events";
495 
496  } else if(gPTYPE=="OBSTIMEvsFAR") {
497  gCANVAS->SetLogx(true);
498  gCANVAS->SetLogy(false);
499  ptitle=TString("Observation Time vs False Alarm Rate");
500  xtitle="FAR (sec^{-1})";
501  ytitle="Observation Time (sec)";
502 
503  } else if(gPTYPE=="RECvsINJ") {
504  gCANVAS->SetLogx(false);
505  gCANVAS->SetLogy(true);
506  ptitle="Reconstructed events vs Injected events";
507  gStyle->SetOptStat(0);
508  xtitle = "distance (Kpc)";
509  ytitle = "counts";
510  }
511 
512  // get number of MDC types
513  int N = gMDC->wfList.size();
514 
515  if(gPTYPE=="RECvsINJ") {
516 
517  if(pAll) for(int i=0;i<=N;i++) RECvsINJ(i, ptitle, xtitle, ytitle);
518  else RECvsINJ(0, ptitle, xtitle, ytitle);
519 
520  } else {
521 
522  if(gPTYPE=="EVTvsRHO") {
523  Plot(0, ptitle, xtitle, ytitle);
524  } else {
525 
526 #ifdef APPLY_ENORM
527  if(pAll) for(int i=0;i<=N;i++) Plot(i, ptitle, xtitle, ytitle);
528  else Plot(0, ptitle, xtitle, ytitle);
529 #else
530  for(int i=1;i<=N;i++) Plot(i, ptitle, xtitle, ytitle);
531  //Plot(1, ptitle);
532 #endif
533 
534  }
535  }
536 
537  return;
538 }
539 
541 
542  char sel[1024];
543  char cut[1024];
544  TF1 *vdens = NULL;
545 // TF1 *hdist = NULL;
546 
547  // INJECTED
548  if(mtype==0) {
549  sprintf(cut,"1==1");
550  } else {
551  //sprintf(cut,"type[0]==%d",mtype);
552  sprintf(cut,"type==%d",mtype);
553  }
554 
555  double min_dist = gTRMDC->GetMinimum("distance");
556  double max_dist = gTRMDC->GetMaximum("distance");
557 #ifdef APPLY_ENORM
558  double enorm_max=0;
559  for(int i=0;i<normHRSS.size();i++) {
560  double enorm=normHRSS[i]/mdcHRSS[i];
561  if(enorm>enorm_max) enorm_max=enorm;
562  }
563  min_dist *= enorm_max;
564  max_dist *= enorm_max;
565 #endif
566 
567  TH1F* hdist = new TH1F("hdist","hdist",gNBINS,1000*min_dist,1000*max_dist); // Mpc -> Kpc
568 
569  TTreeFormula mcut("mcut", cut, gTRMDC);
570  gTRMDC->SetBranchStatus("*",false);
571  gTRMDC->SetBranchStatus("distance",true);
572  gTRMDC->SetBranchStatus("type",true);
573  int type;
574  float distance;
575  gTRMDC->SetBranchAddress("distance",&distance);
576  gTRMDC->SetBranchAddress("type",&type);
577  int msize = gTRMDC->GetEntries();
578  int nmdc = 0;
579  for(int i=0;i<msize;i++) {
580  gTRMDC->GetEntry(i);
581  if(mcut.EvalInstance()==0) continue;
582  distance*=1000;
583 #ifdef APPLY_ENORM
584  // compute Normalization to hrss @ 10 Kpc
585  if(normHRSS.size()&&(normHRSS[type-1]>0)) {
586  distance *= normHRSS[type-1]/mdcHRSS[type-1];
587  }
588 #endif
589  hdist->Fill(distance);
590  nmdc++;
591  }
592  cout << "nmdc : " << nmdc << endl;
593  gTRMDC->SetBranchStatus("*",true);
594 
595 /*
596  double min_dist = gTRMDC->GetMinimum("distance");
597  double max_dist = gTRMDC->GetMaximum("distance");
598 
599  // get total number of inject MDC with TYPE=type
600  sprintf(sel,"1000*distance>>hdist1(%d,%f,%f)",gNBINS,1000*min_dist,1000*max_dist); // Mpc -> Kpc
601  if(mtype==0) {
602  sprintf(cut,"");
603  } else {
604  sprintf(cut,"type[0]==%d",mtype);
605  }
606  gTRMDC->Draw(sel,cut,"goff");
607  int nmdc = gTRMDC->GetSelectedRows();
608  cout << "nmdc : " << nmdc << endl;
609 */
610 
611  // get Sky Distribution parameters
612  TString sky_dist_formula = gMDC->GetSkyFile(); // get distribution formula
613  vector<mdcpar> sky_parms = gMDC->GetSkyParms();
614  bool error=false;
615  int entries = gMDC->GetPar("entries",sky_parms,error);
616  double min_dist = gMDC->GetPar("rho_min",sky_parms,error); // get rho min
617  if(error) min_dist=0.;
618  double dist_max = gMDC->GetPar("rho_max",sky_parms,error); // get rho max
619  if(error) dist_max=0.;
620 
621  bool formula = ((sky_dist_formula!="")&&(dist_max>0)) ? true : false;
622 
623  formula&=(pp_fad_distr=="FORMULA");
624 
625  if(formula) { // radial distribution is extract from the config plugin
626 
627  cout << "sky_dist_formula : " << sky_dist_formula << endl;
628  cout << "min_dist : " << min_dist << " dist_max : " << dist_max << endl;
629 
630  // compute the formula normalization
631  // the integral between min_dist and dist_max must be the total number
632  // of the injected mdc = nmdc
633  TF1 *fdist = new TF1("fdist",sky_dist_formula,min_dist,dist_max);
634  double norm=fdist->Integral(min_dist,dist_max);
635  norm=nmdc/norm;
636  cout << norm << endl;
637 
638  // visible volume density formula
639  char vdens_expression[256];
640  sprintf(vdens_expression,"(4*TMath::Pi()*x*x)/(%f*(%s))",norm,sky_dist_formula.Data());
641  cout << "vdens_expression : " << vdens_expression << endl;
642  vdens = new TF1("vdens",vdens_expression,min_dist,dist_max);
643 
644  } else { // radial distribution is extract from the mdc injection root file
645 
646 //hdist = (TH1F*)gDirectory->Get("hdist1");
647  if (hdist!=NULL) {
648  // compute radial distribution density histogram
649  for(int i=1;i<=hdist->GetNbinsX();i++) {
650  double value = hdist->GetBinContent(i);
651  value /= hdist->GetBinWidth(i);
652  hdist->SetBinContent(i,value);
653  }
654  //hdist->Draw();
655  //gCANVAS->Print("hdist.png");
656  } else {
657  cout << "cwb_mkfad.C - Error : hdist is NULL" << endl;
658  gSystem->Exit(1);
659  }
660  }
661 
662  int nRHO = RHO.size();
663 
664  // compute visible volume vs rho
665  VIS.resize(nRHO);
666  eVIS.resize(nRHO);
667  VIS[nRHO-1] = 0;
668  eVIS[nRHO-1] = 0;
669  for(int n=nRHO-1;n>=0;n--) {
670 
671  double rho_min = RHO[n];
672  double rho_max = n==nRHO-1 ? 1.e80 : RHO[n+1]; // when n=nRHO-1 the range is [RHO[n],1e80]
673 
674  sprintf(sel,"range[1]:type[1]");
675  if(mtype==0) {
676  sprintf(cut,"abs(time[0]-time[%d])<%f && netcc[%d]>%f && rho[%d]>%f && rho[%d]<=%f",
677  nIFO,T_win,pp_inetcc,T_cor,pp_irho,rho_min,pp_irho,rho_max);
678  } else {
679  sprintf(cut,"type[1]==%d && abs(time[0]-time[%d])<%f && netcc[%d]>%f && rho[%d]>%f && rho[%d]<=%f",
680  mtype,nIFO,T_win,pp_inetcc,T_cor,pp_irho,rho_min,pp_irho,rho_max);
681  }
682  if(T_vED>0) sprintf(cut,"%s && neted[0]/ecor<%f",cut,T_vED);
683  if(T_pen>0) sprintf(cut,"%s && penalty>%f",cut,T_pen);
684  gTRWAVE->Draw(sel,cut,"goff");
685  int nwave = gTRWAVE->GetSelectedRows();
686  //cout << "rho_min " << rho_min << "\trho_max " << rho_max << "\tnwave : " << nwave << endl;
687  double* range = gTRWAVE->GetV1();
688  double* itype = gTRWAVE->GetV2();
689 
690  double Pi = TMath::Pi();
691 
692  for(int i=0;i<nwave;i++) {
693  double dist=1000*range[i]; // Mpc -> Kpc
694 #ifdef APPLY_ENORM
695  // compute Normalization to hrss @ 10 Kpc
696  if(normHRSS.size()&&(normHRSS[itype[i]-1]>0)) {
697  dist *= normHRSS[itype[i]-1]/mdcHRSS[itype[i]-1];
698  }
699 #endif
700 
701  double ivdens;
702  if(formula) {
703  ivdens = vdens->Eval(dist);
704  } else {
705  ivdens = (4*TMath::Pi()*dist*dist)/hdist->Interpolate(dist);
706  }
707  VIS[n] +=ivdens;
708  eVIS[n]+=pow(ivdens,2);
709  }
710  eVIS[n]=sqrt(eVIS[n]);
711 
712  if(n>0) VIS[n-1]=VIS[n];
713 
714  if(pp_fad_units=="M") {VIS[n]*=1.e-9; eVIS[n]*=1.e-9;} // Kpc^3 -> Mpc^3
715 
716  //cout << n << " " << RHO[n] << " " << VIS[n] << endl;
717  //cout << n << " " << eRHO[n] << " " << eVIS[n] << endl;
718  }
719 
720  if(hdist) delete hdist;
721 
722  gMTYPE = mtype; // update global value
723  return;
724 }
725 
726 TGraphErrors* Plot(int mtype, TString ptitle, TString xtitle, TString ytitle, bool save) {
727 
728  // set RHO,eRHO,VIS,eVIS
729  // visible volume is computed only if mtype is different
730  // from the previous mtype value (stored in gMTYPE)
731  if(mtype!=gMTYPE) getVisibleVolume(mtype);
732 
733  if(pp_fad_units=="M") { // Kpc -> Mpc : Kyr -> Myr
734  ptitle.ReplaceAll("Kpc","Mpc");
735  xtitle.ReplaceAll("Kpc","Mpc");
736  ytitle.ReplaceAll("Kpc","Mpc");
737  ptitle.ReplaceAll("Kyr","Myr");
738  xtitle.ReplaceAll("Kyr","Myr");
739  ytitle.ReplaceAll("Kyr","Myr");
740  }
741 
742  int nRHO = RHO.size();
743  wavearray<double> x(nRHO);
744  wavearray<double> ex(nRHO);
745  wavearray<double> y(nRHO);
746  wavearray<double> ey(nRHO);
747 
748  if(gPTYPE=="FARvsRHO") {
749 
750  for(int n=0;n<nRHO;n++) {
751  x[n]=RHO[n];
752  ex[n]=eRHO[n];
753  y[n]=FAR[n];
754  ey[n]=eFAR[n];
755  }
756  }
757 
758  if((gPTYPE=="FADvsRHO")||(gPTYPE=="EVTvsRHO")||(gPTYPE=="FAPvsRHO")||
759  (gPTYPE=="PRODvsFAD")||(gPTYPE=="OBSTIMEvsFAR")) {
760 
761  double Kyr = 86400.*365.*1000.;
762  double Myr = 86400.*365.*1000000.;
763  wavearray<double> FAD(nRHO);
764  wavearray<double> eFAD(nRHO);
765 
766  if(gNZBINS<0) { // compute classic FAD statistic + min-hold
767  for(int n=0;n<nRHO;n++) {
768  FAD[n]=FAR[n]/VIS[n];
769  eFAD[n]=sqrt(pow(eFAR[n]/FAR[n],2)+pow(eVIS[n]/VIS[n],2))*FAD[n];
770  }
771 
772  // apply min hold to make FAD monothonic
773  wavearray<double> mFAD(nRHO);
774  wavearray<double> meFAD(nRHO);
775  mFAD=0;mFAD[0]=FAD[0];meFAD[0]=eFAD[0];
776  for(int n=1;n<nRHO;n++) {
777  if(FAD[n]<mFAD[n-1]) {mFAD[n]=FAD[n];meFAD[n]=eFAD[n];}
778  else {mFAD[n]=mFAD[n-1];meFAD[n]=meFAD[n-1];}
779  }
780  for(int n=0;n<nRHO;n++) {FAD[n]=mFAD[n];eFAD[n]=meFAD[n];}
781  } else if(gNZBINS==0) { // compute standard FAD statistic
782  for(int n=0;n<nRHO;n++) {
783  FAD[n]=dFAR[n]/VIS[n];
784  eFAD[n]=sqrt(pow(eFAR[n]/FAR[n],2)+pow(eVIS[n]/VIS[n],2))*FAD[n];
785  }
786  for(int n=nRHO-1;n>0;n--) FAD[n-1]+=FAD[n];
787  } else if(gNZBINS>0) { // compute classic FAD statistic + max hold
788  for(int n=0;n<nRHO;n++) {
789  FAD[n]=FAR[n]/VIS[n];
790  eFAD[n]=sqrt(pow(eFAR[n]/FAR[n],2)+pow(eVIS[n]/VIS[n],2))*FAD[n];
791  }
792  // find first gNZBINS consecutive zero FAR bin = zbin : start from n=1 because dFAR[0]=0
793  int nzbins=0;
794  for(int n=1;n<nRHO;n++) {
795  if(dFAR[n]==0) {
796  nzbins++;
797  if(nzbins==gNZBINS) {
798  nRHO=n-(gNZBINS-1);break;
799  }
800  } else nzbins=0;
801  }
802  x.resize(nRHO);
803  // apply max hold to make FAD monothonic
804  // max hold FAD is applied only below bin<zbin
805  wavearray<double> mFAD(nRHO);
806  mFAD=0;mFAD[nRHO-1]=FAD[nRHO-1];
807  for(int n=nRHO-2;n>=0;n--) {
808  if(FAD[n]>mFAD[n+1]) mFAD[n]=FAD[n]; else mFAD[n]=mFAD[n+1];
809  }
810  for(int n=0;n<nRHO;n++) FAD[n]=mFAD[n];
811  }
812 
813  double Xyr = (pp_fad_units=="M") ? Myr : Kyr;
814  // sec -> Kyr/Myr
815  for(int n=0;n<nRHO;n++) {FAD[n]*=Xyr;eFAD[n]*=Xyr;}
816 
817  for(int n=0;n<nRHO;n++) {
818  x[n]=RHO[n];
819  ex[n]=eRHO[n];
820  if(gPTYPE=="FADvsRHO") { y[n]=FAD[n]; ey[n]=eFAD[n]; }
821  if(gPTYPE=="PRODvsFAD") {
822  x[n]=FAD[n]; ex[n]=eFAD[n];
823  // if FAD not change the productivity not change
824  if(n && (FAD[n]==FAD[n-1])) {
825  y[n]=y[n-1]; ey[n]=ey[n-1];
826  } else {
827  y[n]=(gOBSTIME/Xyr)*VIS[n]; ey[n]=(gOBSTIME/Xyr)*eVIS[n];
828  }
829  }
830  if(gPTYPE=="EVTvsRHO") {
831  // if FAD not change the expected events not change
832  if(n && (FAD[n]==FAD[n-1])) {
833  y[n]=y[n-1]; ey[n]=ey[n-1];
834  } else {
835  y[n]=FAD[n]*(gOBSTIME/Xyr)*VIS[n]; ey[n]=0;
836  }
837  }
838  if(gPTYPE=="FAPvsRHO") {
839  // if FAD not change the FAP not change
840  if(n && (FAD[n]==FAD[n-1])) {
841  y[n]=y[n-1]; ey[n]=ey[n-1];
842  } else {
843  y[n]=FAD[n]*(gOBSTIME/Xyr)*VIS[n];
844  y[n]=1.-exp(-y[n]);
845  }
846  ey[n]=0;
847  }
848  }
849  }
850 
851  if(gPTYPE=="OBSTIMEvsFAR") {
852  for(int n=0;n<nRHO;n++) {
853  x[n]=FAR[n]; ex[n]=eFAR[n];
854  y[n]=gOBSTIME; ey[n]=0;
855  }
856  }
857 
858  if(gPTYPE=="VISvsRHO") {
859 
860  for(int n=0;n<nRHO;n++) {
861  x[n]=RHO[n];
862  ex[n]=eRHO[n];
863  y[n]=VIS[n];
864  ey[n]=eVIS[n];
865  }
866  }
867 
868  if(gPTYPE=="REFFvsRHO") {
869 
870  for(int n=0;n<nRHO;n++) {
871  x[n]=RHO[n];
872  ex[n]=eRHO[n];
873  y[n]=pow(3*VIS[n]/(4.*TMath::Pi()),1./3.);
874  ey[n]=y[n]/3.*(eVIS[n]/VIS[n]);
875  }
876  }
877 
878  if(gPTYPE=="REFFvsIRHO") {
879 
880  for(int n=0;n<nRHO;n++) {
881  x[n]=1./RHO[n];
882  ex[n]=eRHO[n] ? 1./eRHO[n] : 0.;
883  y[n]=pow(3*VIS[n]/(4.*TMath::Pi()),1./3.);
884  ey[n]=y[n]/3.*(eVIS[n]/VIS[n]);
885  }
886  }
887 
888  for(int n=0;n<nRHO;n++) {
889  //cout << n << " " << x[n] << " " << ex[n] << " " << y[n] << " " << ey[n] << endl;
890  }
891 
892  char title[256];
893 
894 #ifdef APPLY_ENORM
895  if(mtype==0) {
896  sprintf(title,"%s : %s", ptitle.Data(),"ALL");
897  } else {
898  if(normHRSS.size()) {
899  sprintf(title,"%s : %s : Strain @ 10Kpc = %g",
900  ptitle.Data(),gMDC->wfList[mtype-1].name.Data(),normHRSS[mtype-1]);
901  } else {
902  sprintf(title,"%s : %s",
903  ptitle.Data(),gMDC->wfList[mtype-1].name.Data());
904  }
905  }
906 #else
907  if(mtype==0) {
908  cout << "MakeFAD.C : Error - mtype=0 non allowed when data are not normalized" << endl;
909  gSystem->Exit(1);
910  }
911  sprintf(title,"%s : %s : Strain @ 10Kpc = %g",
912  ptitle.Data(),gMDC->wfList[mtype-1].name.Data(),mdcHRSS[mtype-1]);
913 #endif
914 
915  if(gPTYPE=="EVTvsRHO") sprintf(title,"%s : %s", ptitle.Data(),"ALL");
916 
917  TGraphErrors* gr = new TGraphErrors;
918  int cnt=0;
919  gr->SetPoint(cnt,x[0],y[0]);
920  gr->SetPointError(cnt++,0,0);
921  for(int i=1;i<nRHO;i++) {
922  double dx = (x[i]-x[i-1])/10000.;
923  gr->SetPoint(cnt,x[i],y[i-1]);
924  //gr->SetPointError(cnt++,0,ey[i-1]);
925  gr->SetPointError(cnt++,ex[i],ey[i-1]);
926  gr->SetPoint(cnt,x[i]+dx,y[i]);
927  //gr->SetPointError(cnt++,0,ey[i]);
928  gr->SetPointError(cnt++,ex[i],ey[i]);
929  }
930  gr->GetHistogram()->GetXaxis()->SetTitle(xtitle.Data());
931  gr->GetHistogram()->GetYaxis()->SetTitle(ytitle.Data());
932  gr->GetHistogram()->GetXaxis()->SetTitleOffset(1.4);
933  gr->GetHistogram()->GetYaxis()->SetTitleOffset(1.4);
934 
935  // convert logx,logy to linx,liny when x,y ranges are less than a 1 order of magnitude
936  double xmax=0;double xmin=1e80;
937  double ymax=0;double ymin=1e80;
938  for(int i=0;i<nRHO;i++) {if(x[i]>xmax) xmax=x[i]; if(x[i]<xmin && x[i]!=0) xmin=x[i];}
939  for(int i=0;i<nRHO;i++) {if(y[i]>ymax) ymax=y[i]; if(y[i]<ymin && y[i]!=0) ymin=y[i];}
940  if(xmax/xmin<10) gCANVAS->SetLogx(false);
941  if(ymax/ymin<10) gCANVAS->SetLogy(false);
942  gr->GetHistogram()->GetXaxis()->SetRangeUser(xmin,xmax);
943  gr->GetHistogram()->GetYaxis()->SetRangeUser(0.95*ymin,1.05*ymax);
944 
945  gr->SetTitle(title);
946  gr->SetLineColor(kRed);
947  gr->SetLineWidth(2);
948  gr->SetFillColor(2);
949  gr->SetFillStyle(3003);
950  gr->Draw("3AL");
951 
952  if(gFIT) {
953  TF1 *gfit=NULL;
954 
955  if(gPTYPE=="VISvsRHO") gfit = new TF1("gfit","[0]+[1]/pow(x,3)",x[0],x[nRHO-1]);
956  if(gPTYPE=="REFFvsRHO") gfit = new TF1("gfit","[0]/x",x[0],x[nRHO-1]);
957  if(gPTYPE=="REFFvsIRHO") gfit = new TF1("gfit","[0]*x",x[0],x[nRHO-1]);
958 
959  if((gPTYPE=="VISvsRHO") || (gPTYPE=="REFFvsRHO") || (gPTYPE=="REFFvsIRHO")) {
960  gr->Fit(gfit,"R");
961  gfit=gr->GetFunction("gfit");
962  gfit->SetLineColor(kBlue);
963  gfit->SetLineWidth(1);
964  }
965  }
966 
967  if(!save) return gr;
968 
969  // print plot
970  char ofname[256];
971  if(mtype==0) {
972  sprintf(ofname,"%s/%s_%s.png",
973  gODIR.Data(),gPTYPE.Data(),"ALL");
974  } else {
975  sprintf(ofname,"%s/%s_%s.png",
976  gODIR.Data(),gMDC->wfList[mtype-1].name.Data());
977  }
978  cout << ofname << endl;
979  gCANVAS->Print(ofname);
980  if(mtype==0) {
981  sprintf(ofname,"%s/%s_%s.txt",
982  gODIR.Data(),gPTYPE.Data(),"ALL");
983  cout << "Write values on: " << ofname << endl;
984  ofstream outf;
985  outf.open(ofname);
986  //for (int index=0; index<x.size(); index++) {out << x.data[index] << "\t" << y.data[index] << "\t" << ex.data[index] << " " << ey.data[index] << endl;}
987  for (int index=0; index<x.size(); index++) {outf << x.data[index] << "\t" << y.data[index] << endl;}
988  outf.close();
989  }
990 
991  return gr;
992 }
993 
994 void RECvsINJ(int itype, TString ptitle, TString xtitle, TString ytitle) {
995 
996  char cut[256];
997  char title[256];
998 
999  if(pp_fad_units=="M") xtitle.ReplaceAll("Kpc","Mpc");
1000 
1001  // INJECTED
1002  float ufactor;
1003  if(pp_fad_units=="M") { // Kyr -> Myr
1004  ufactor=1;
1005  } else { // Kpc -> Mpc
1006  ufactor=1000;
1007  }
1008  if(itype==0) {
1009  sprintf(cut,"1==1");
1010  } else {
1011  sprintf(cut,"type==%d",itype);
1012  }
1013 
1014  float dmin = gTRMDC->GetMinimum("distance");
1015  float dmax = gTRMDC->GetMaximum("distance");
1016 #ifdef APPLY_ENORM
1017  double enorm_max=0;
1018  for(int i=0;i<normHRSS.size();i++) {
1019  double enorm=normHRSS[i]/mdcHRSS[i];
1020  if(enorm>enorm_max) enorm_max=enorm;
1021  }
1022 #endif
1023  if(enorm_max==0) enorm_max=1;
1024  dmin*=ufactor*enorm_max;
1025  dmax*=ufactor*enorm_max;
1026 
1027  TH1F* mhist = new TH1F("mhist","mhist",100,dmin,dmax);
1028 
1029  TTreeFormula mcut("mcut", cut, gTRMDC);
1030  gTRMDC->SetBranchStatus("*",false);
1031  gTRMDC->SetBranchStatus("distance",true);
1032  gTRMDC->SetBranchStatus("type",true);
1033  int mtype;
1034  float distance;
1035  gTRMDC->SetBranchAddress("distance",&distance);
1036  gTRMDC->SetBranchAddress("type",&mtype);
1037  int msize = gTRMDC->GetEntries();
1038  int nmdc = 0;
1039  for(i=0;i<msize;i++) {
1040  gTRMDC->GetEntry(i);
1041  if(mcut.EvalInstance()==0) continue;
1042  distance*=ufactor;
1043 #ifdef APPLY_ENORM
1044  // compute Normalization to hrss @ 10 Kpc
1045  if(normHRSS.size()&&(normHRSS[mtype-1]>0)) {
1046  distance *= normHRSS[mtype-1]/mdcHRSS[mtype-1];
1047  }
1048 #endif
1049  mhist->Fill(distance);
1050  nmdc++;
1051  }
1052  gTRMDC->SetBranchStatus("*",true);
1053  cout << "nmdc : " << nmdc << endl;
1054 
1055  mhist->Draw();
1056  mhist->GetXaxis()->SetTitle(xtitle);
1057  mhist->GetYaxis()->SetTitle(ytitle);
1058  mhist->GetYaxis()->SetRangeUser(0.1,pow(10.,TMath::Ceil(TMath::Log10(mhist->GetMaximum()))));
1059 
1060  // DETECTED
1061  if(itype==0) {
1062  sprintf(cut,"abs(time[0]-time[%d])<%g && netcc[%d]>%g && rho[%d]>%g",
1064  } else {
1065  sprintf(cut,"type[1]==%d && abs(time[0]-time[%d])<%g && netcc[%d]>%g && rho[%d]>%g",
1067  }
1068  if(T_vED>0) sprintf(cut,"%s && neted[0]/ecor<%f",cut,T_vED);
1069  if(T_pen>0) sprintf(cut,"%s && penalty>%f",cut,T_pen);
1070 
1071  TH1F* whist = new TH1F("whist","whist",100,dmin,dmax);
1072 
1073  TTreeFormula wcut("wcut", cut, gTRWAVE);
1074  gTRWAVE->SetBranchStatus("*",false);
1075  gTRWAVE->SetBranchStatus("range",true);
1076  gTRWAVE->SetBranchStatus("type",true);
1077  gTRWAVE->SetBranchStatus("time",true);
1078  gTRWAVE->SetBranchStatus("neted",true);
1079  gTRWAVE->SetBranchStatus("ecor",true);
1080  gTRWAVE->SetBranchStatus("netcc",true);
1081  gTRWAVE->SetBranchStatus("rho",true);
1082  gTRWAVE->SetBranchStatus("penalty",true);
1083  int wtype[2];
1084  float range[2];
1085  gTRWAVE->SetBranchAddress("range",range);
1086  gTRWAVE->SetBranchAddress("type",wtype);
1087  int wsize = gTRWAVE->GetEntries();
1088  int nwave = 0;
1089  for(i=0;i<wsize;i++) {
1090  gTRWAVE->GetEntry(i);
1091  if(wcut.EvalInstance()==0) continue;
1092  distance=ufactor*range[1];
1093 #ifdef APPLY_ENORM
1094  // compute Normalization to hrss @ 10 Kpc
1095  if(normHRSS.size()&&(normHRSS[wtype[1]-1]>0)) {
1096  distance *= normHRSS[wtype[1]-1]/mdcHRSS[wtype[1]-1];
1097  }
1098 #endif
1099  whist->Fill(distance);
1100  nwave++;
1101  }
1102  gTRWAVE->SetBranchStatus("*",true);
1103  cout << "nwave : " << nwave << endl;
1104  whist->SetFillColor(kRed);
1105  whist->Draw("SAME");
1106 
1107  sprintf(title,"%s",cut);
1108 
1109  sprintf(title,"%s : inj = %d : rec : %d",ptitle.Data(),nmdc,nwave);
1110  mhist->SetTitle(title);
1111 
1112  // print plot
1113  char ofname[1024];
1114  if(itype==0) {
1115  sprintf(ofname,"%s/%s_%s.png",
1116  gODIR.Data(),gPTYPE.Data(),"ALL");
1117  } else {
1118  sprintf(ofname,"%s/%s_%s.png",
1119  gODIR.Data(),gPTYPE.Data(),gMDC->wfList[itype-1].name.Data());
1120  }
1121  cout << ofname << endl;
1122  gCANVAS->Print(ofname);
1123 
1124  // compute efficiency vs distance
1125  TH1F* ehist = new TH1F("ehist","ehist",100,dmin,dmax);
1126  for(int i=1;i<=mhist->GetNbinsX();i++) {
1127  double ndet = whist->GetBinContent(i);
1128  double ninj = mhist->GetBinContent(i);
1129  double eff = ninj ? ndet/ninj : 0.;
1130  ehist->SetBinContent(i,eff);
1131  }
1132  ehist->Draw();
1133  ehist->GetXaxis()->SetTitle(xtitle);
1134  ehist->GetYaxis()->SetTitle("efficiency");
1135  //ehist->GetYaxis()->SetRangeUser(0.1,pow(10.,TMath::Ceil(TMath::Log10(ehist->GetMaximum()))));
1136  ehist->SetTitle("Efficiency vs Distance");
1137  // print efficiency plot
1138  if(itype==0) {
1139  sprintf(ofname,"%s/%s_%s.png",
1140  gODIR.Data(),"EFFvsDIST","ALL");
1141  } else {
1142  sprintf(ofname,"%s/%s_%s.png",
1143  gODIR.Data(),"EFFvsDIST",gMDC->wfList[itype-1].name.Data());
1144  }
1145  cout << ofname << endl;
1146  gCANVAS->Print(ofname);
1147 
1148  delete mhist;
1149  delete whist;
1150  delete ehist;
1151 
1152  return;
1153 }
1154 
1155 void
1157 
1158  char index_file[1024];
1159 
1160  sprintf(index_file,"%s/%s/fad.html",gODIR.Data(), gPTYPE.Data());
1161 
1162  ofstream out;
1163  out.open(index_file,ios::out); // create index.html
1164  char oline[1024];
1165  out << "<html>" << endl;
1166  out << "<font color=\"black\" style=\"font-weight:bold;\"><center><p><h2>"
1167  << ptitle.Data() << "</h2><p><center></font>" << endl;
1168  out << "<hr><br>" << endl;
1169  int offset=1;
1170 #ifdef APPLY_ENORM
1171  offset=0;
1172 #endif
1173  int size=gMDC->wfList.size();
1174  if(gPTYPE=="EVTvsRHO") {offset=0; size=0;}
1175 
1176  for(int i=offset;i<=size;i++) {
1177  out << "<table border=0 cellpadding=2 align=\"center\">" << endl;
1178  out << "<tr align=\"center\">" << endl;
1179  if(i==0) {
1180  out << "<td><font style=\"font-weight:bold;\"><center><p><h2>"
1181  << "ALL" << "</h2><p><center></font></td>" << endl;
1182  } else {
1183  out << "<td><font style=\"font-weight:bold;\"><center><p><h2>"
1184  << gMDC->wfList[i-1].name.Data() << "</h2><p><center></font></td>" << endl;
1185  }
1186  out << "</tr>" << endl;
1187  out << "<tr align=\"center\">" << endl;
1188  char fname[1024];
1189  if(i==0) {
1190  sprintf(fname,"%s_%s_%s.png",gPTYPE.Data(),data_label,"ALL");
1191  } else {
1192  sprintf(fname,"%s_%s_%s.png",gPTYPE.Data(),data_label,gMDC->wfList[i-1].name.Data());
1193  }
1194  sprintf(oline,"<td><a href=\"%s\"><img src=\"%s\" width=650></a></td>",fname,fname);
1195  out << oline << endl;
1196  out << "</tr>" << endl;
1197  out << "</table>" << endl;
1198  }
1199  out << "</html>" << endl;
1200  out.close();
1201 
1202  return;
1203 }
1204 
1205 void
1206 MakeHtmlIndex(TString* pTYPE, int pSIZE) {
1207 
1208  // add EFFvsDIST plot to the pTYPE plot list
1209  int psize=pSIZE+1;
1210  TString* ptype = new TString[psize+1];
1211  int I=0;
1212  for(int i=0;i<pSIZE;i++) {
1213  ptype[I++]=pTYPE[i];
1214  if(pTYPE[i]=="RECvsINJ") ptype[I++]="EFFvsDIST";
1215  }
1216 
1217  TString info="";
1218 
1219  char index_file[1024];
1220  sprintf(index_file,"%s/fad.html",gODIR.Data());
1221 
1222  ofstream out;
1223  out.open(index_file,ios::out); // create index.html
1224  char oline[1024];
1225  out << "<html>" << endl;
1226  out << "<font color=\"black\" style=\"font-weight:bold;\"><center><p><h1>"
1227  << pp_fad_title << "</h1><p></center></font>" << endl;
1228  if(pp_fad_subtitle!="") {
1229  out << "<font color=\"red\" style=\"font-weight:bold;\"><center><p><h3>"
1230  << pp_fad_subtitle << "</h3><p></center></font>" << endl;
1231  }
1232  out << "<hr>" << endl;
1233  out << "<h3>FAD Options</h3>" << endl;
1234 
1235  TString odir = TString(gSystem->WorkingDirectory())+"/"+gODIR;
1236  out << "<ul>" << endl;
1237  out << "<li> odir : <font color=\"red\"> " << odir << "</font>" << endl;
1238  out << "</ul>" << endl;
1239 
1240  out << "<ul>" << endl;
1241  out << "<li> --bkgrep : <font color=\"red\"> " << pp_fad_bkgrep << "</font>" << endl;
1242  out << "</ul>" << endl;
1243 
1244  if(pp_fad_hrss.IsFloat()) {
1245  if(pp_fad_hrss=="0") info = " (hrss rescale is not applied)";
1246  else info = " (apply a constant hrss rescale)";
1247  } else info = " (hrss is rescaled using custom hrss factors)";
1248 
1249  out << "<ul>" << endl;
1250  out << "<li> --hrss : <font color=\"red\"> " << pp_fad_hrss << "</font>" << info << endl;
1251  out << "</ul>" << endl;
1252 
1253  if(gFIT) info = " (apply fit)";
1254  else info = " (fit not applied)";
1255 
1256  out << "<ul>" << endl;
1257  out << "<li> --gfit : <font color=\"red\"> " << gFIT << "</font>" << info << endl;
1258  out << "</ul>" << endl;
1259 
1260  out << "<ul>" << endl;
1261  out << "<li> --rhomin : <font color=\"red\"> " << gRHOMIN << "</font>"
1262  << " (rho minimum used to compute FAD plots)" << endl;
1263  out << "</ul>" << endl;
1264 
1265  if(gNZBINS<0) info = " (un-biased FAD)";
1266  else if(gNZBINS==0) info = " (standard FAD)";
1267  else if(gNZBINS>0) info = " (test FAD)";
1268 
1269  out << "<ul>" << endl;
1270  out << "<li> --nzbins : <font color=\"red\"> " << gNZBINS << "</font>" << info << endl;
1271  out << "</ul>" << endl;
1272 
1273  if(pp_fad_units=="K") info = " (Kpc,Kyr)";
1274  else info = " (Mpc,Myr)";
1275 
1276  out << "<ul>" << endl;
1277  out << "<li> --units : <font color=\"red\"> " << pp_fad_units << "</font>" << info << endl;
1278  out << "</ul>" << endl;
1279 
1280  if(pp_fad_distr=="FORMULA") info = " (radial distribution is computed from formula)";
1281  else info = " (radial distribution is computed from mdc injections)";
1282 
1283  out << "<ul>" << endl;
1284  out << "<li> --distr : <font color=\"red\"> " << pp_fad_distr << "</font>" << info << endl;
1285  out << "</ul>" << endl;
1286 
1287  out << "<ul>" << endl;
1288  out << "<li> --nbins : <font color=\"red\"> " << gNBINS << "</font>"
1289  << " (number of bins used in hist to computed the radial distribution from the MDC injections root file)" << endl;
1290  out << "</ul>" << endl;
1291 
1292  out << "<hr><br>" << endl;
1293 
1294  TString _ptype[nPLOT+1];
1295  int index=0;
1296  _ptype[index++]="FAPvsRHO";
1297  for(int i=0;i<nPLOT+1;i++) if(ptype[i]!="FAPvsRHO") _ptype[index++]=ptype[i];
1298 
1299  for(int i=0;i<psize;i++) {
1300  out << "<table border=0 cellpadding=2 align=\"center\">" << endl;
1301  out << "<tr align=\"center\">" << endl;
1302  out << "</tr>" << endl;
1303  out << "<tr align=\"center\">" << endl;
1304  char fname[1024];
1305  if(i==0) {
1306  sprintf(fname,"%s_%s.png",_ptype[i].Data(),"ALL");
1307  sprintf(oline,"<td><a href=\"%s\"><img src=\"%s\" width=650></a></td>",fname,fname);
1308  out << oline << endl;
1309  } else {
1310  sprintf(fname,"%s_%s.png",_ptype[i].Data(),"ALL");
1311  sprintf(oline,"<td><a href=\"%s\"><img src=\"%s\" width=520></a></td>",fname,fname);
1312  out << oline << endl;
1313  sprintf(fname,"%s_%s.png",_ptype[i+1].Data(),"ALL");
1314  sprintf(oline,"<td><a href=\"%s\"><img src=\"%s\" width=520></a></td>",fname,fname);
1315  out << oline << endl;
1316  }
1317  out << "</tr>" << endl;
1318  out << "</table>" << endl;
1319  if(i==0) out << "<hr><br>" << endl; else i++;
1320  }
1321  out << "</html>" << endl;
1322  out.close();
1323 
1324  return;
1325 }
1326 
1328 
1329  char cmd[1024];
1330 
1331  sprintf(cmd,"root -n -l -b ${CWB_ROOTLOGON_FILE} '${HOME_CWB}/info/macros/MakeHTML.C\(\"%s\",false\)'",odir.Data());
1332  gSystem->Exec(cmd);
1333  sprintf(cmd,"cp ${HOME_WAT}//html/etc/html/ROOT.css %s",odir.Data());
1334  gSystem->Exec(cmd);
1335  sprintf(cmd,"cp ${HOME_WAT}//html/etc/html/ROOT.js %s",odir.Data());
1336  gSystem->Exec(cmd);
1337  sprintf(cmd,"cp ${HOME_WAT}//html/etc/html/tabber.css %s",odir.Data());
1338  gSystem->Exec(cmd);
1339  sprintf(cmd,"cp ${HOME_WAT}//html/etc/html/tabber.js %s",odir.Data());
1340  gSystem->Exec(cmd);
1341 }
1342 
1344 
1345  #define NTYPE_MAX 20
1346  #define NMDC_MAX 64
1347 
1348  // read injection file types
1349  char imdc_set[NMDC_MAX][128]; // injection set
1350  size_t imdc_type[NMDC_MAX]; // injection type
1351  char imdc_name[NMDC_MAX][128]; // injection name
1352  double imdc_fcentral[NMDC_MAX]; // injection central frequencies
1353  double imdc_fbandwidth[NMDC_MAX]; // injection bandwidth frequencies
1354  size_t imdc_index[NMDC_MAX]; // type reference array
1355  size_t imdc_iset[NMDC_MAX]; // injection set index
1356 
1357  int ninj=ReadInjType(mdc_inj_file.Data(),NMDC_MAX,imdc_set,imdc_type,
1359  if(ninj==0) {cout << "Error - no injection - terminated" << endl;exit(1);}
1360 
1362  int nset=0;
1363  for(int i=0;i<ninj;i++) {
1364  bool bnew=true;
1365  for(int j=0;j<nset;j++) if(imdc_set[i]==imdc_set_name[j]) bnew=false;
1366  if(bnew) imdc_set_name[nset++]=imdc_set[i];
1367  }
1368  cout << "nset : " << nset << endl;
1369 
1370  for(int i=0;i<nset;i++) {
1371  for(int j=0;j<ninj;j++) if(imdc_set[j]==imdc_set_name[i]) imdc_iset[j]=i;
1372  }
1373  for (int iset=0;iset<nset;iset++) cout << iset << " " << imdc_set_name[iset].Data() << endl;
1374 
1375  Color_t colors[NMDC_MAX] = { 6, 3, 2, 8,43, 7, 8, 4, 4, 2,43, 1, 3, 1, 6, 7,
1376  6, 3, 2, 8,43, 7, 8, 4, 4, 2,43, 1, 3, 1, 6, 7,
1377  6, 3, 2, 8,43, 7, 8, 4, 4, 2,43, 1, 3, 1, 6, 7,
1378  6, 3, 2, 8,43, 7, 8, 4, 4, 2,43, 1, 3, 1, 6, 7 };
1379  Style_t markers[NMDC_MAX]= {20,21,22,23,29,29,21,22,20,21,22,23,29,20,21,22,
1380  21,22,23,29,29,21,22,20,21,22,23,29,20,21,22,20,
1381  21,22,23,29,29,21,22,20,21,22,23,29,20,21,22,20,
1382  21,22,23,29,29,21,22,20,21,22,23,29,20,21,22,20 };
1383 
1384  char title[256];
1385  char ofile[256];
1386  TCanvas* canvas[NTYPE_MAX];
1387  TMultiGraph* mg[NTYPE_MAX];
1388  TGraphErrors* gr[NMDC_MAX];
1389  TLegend* legend[NTYPE_MAX];
1390 
1391  char rho_type[32];sprintf(rho_type,"rho[%d]",pp_irho);
1392 
1393  for(int iset=0;iset<nset;iset++) {
1394 
1395  int iset_size=0; // iset size
1396  for(i=0; i<ninj; i++) if(imdc_iset[i]==iset) iset_size++;
1397  double hleg = 0.88-iset_size*0.08;
1398  legend[iset] = new TLegend(0.58,hleg,0.99,0.88,NULL,"brNDC");
1399  legend[iset]->AddEntry((TObject*)0, "", "");
1400 
1401  mg[iset] = new TMultiGraph();
1402 
1403  // set plot type
1404  gPTYPE = "FADvsRHO";
1405  TString ptitle=imdc_set_name[iset];
1406  TString xtitle=rho_type;
1407  TString ytitle="FAD (Kpc^{-3} Kyr^{-1})";
1408  if(pp_fad_units=="M") ytitle.ReplaceAll("Kpc","Mpc");
1409  if(pp_fad_units=="M") ytitle.ReplaceAll("Kyr","Myr");
1410 
1411  double ymin=1e40;
1412  double ymax=0;
1413  for(int i=0; i<ninj; i++) {
1414  if(imdc_iset[i]!=iset) continue; // skip unwanted injection types
1415  cout << "MakeMultiPlotFAD : Processing -> " << imdc_name[i] << endl;
1416  gr[i] = Plot(i+1, ptitle, xtitle, ytitle, false);
1417  gr[i]->SetLineColor(colors[i]);
1418  int N = gr[i]->GetN();
1419  double* Y = gr[i]->GetY();
1420  for(int k=0;k<N;k++) if(Y[k]>0 && Y[k]<ymin) ymin=Y[k];
1421  for(int k=0;k<N;k++) if(Y[k]>0 && Y[k]>ymax) ymax=Y[k];
1422  double fad_rho8 = gr[i]->Eval(8); // get FAD @ rho=8
1423  char legname[32];sprintf(legname,"%s, %5.1E",imdc_name[i], fad_rho8);
1424  legend[iset]->AddEntry(gr[i],legname,"lp");
1425  mg[iset]->Add(gr[i]);
1426  }
1427 
1428  char namecanvas[8];
1429  sprintf(namecanvas,"c%i",iset);
1430  canvas[iset] = new TCanvas(namecanvas,namecanvas,125+iset*10,82,976,576);
1431  canvas[iset]->Clear();
1432  canvas[iset]->ToggleEventStatus();
1433  canvas[iset]->SetLogy(true);
1434  canvas[iset]->SetLogx(true);
1435  canvas[iset]->SetGridx();
1436  canvas[iset]->SetGridy();
1437  canvas[iset]->SetFillColor(kWhite);
1438  canvas[iset]->cd();
1439 
1440  mg[iset]->SetTitle(ptitle);
1441  mg[iset]->Paint("alp");
1442  mg[iset]->GetHistogram()->GetXaxis()->SetTitle(xtitle);
1443  mg[iset]->GetHistogram()->GetYaxis()->SetTitle(ytitle);
1444  mg[iset]->GetHistogram()->GetXaxis()->CenterTitle(true);
1445  mg[iset]->GetHistogram()->GetXaxis()->SetLabelFont(42);
1446  mg[iset]->GetHistogram()->GetXaxis()->SetTitleFont(42);
1447  mg[iset]->GetHistogram()->GetXaxis()->SetTitleOffset(1.3);
1448  mg[iset]->GetHistogram()->GetYaxis()->SetLabelFont(42);
1449  mg[iset]->GetHistogram()->GetYaxis()->SetTitleFont(42);
1450  mg[iset]->GetHistogram()->GetXaxis()->SetRangeUser(RHO[0],RHO[RHO.size()-2]);
1451  mg[iset]->GetHistogram()->GetYaxis()->SetRangeUser(0.90*ymin,1.1*ymax);
1452  mg[iset]->GetHistogram()->GetXaxis()->SetMoreLogLabels();
1453 
1454  mg[iset]->Draw("alp");
1455 
1456  char leg_header[32];sprintf(leg_header,"FAD @ rho[%d]=8",pp_irho);
1457  legend[iset]->SetHeader(leg_header);
1458  legend[iset]->SetBorderSize(1);
1459  legend[iset]->SetTextAlign(22);
1460  legend[iset]->SetTextFont(12);
1461  legend[iset]->SetLineColor(1);
1462  legend[iset]->SetLineStyle(1);
1463  legend[iset]->SetLineWidth(1);
1464  legend[iset]->SetFillColor(0);
1465  legend[iset]->SetFillStyle(1001);
1466  legend[iset]->SetTextSize(0.04);
1467  legend[iset]->SetLineColor(kBlack);
1468  legend[iset]->SetFillColor(kWhite);
1469 
1470  legend[iset]->Draw();
1471 
1472  sprintf(ofile,"%s/fad_rho_%s.gif",gODIR.Data(),imdc_set_name[iset].Data());
1473  cout << ofile << endl;
1474  canvas[iset]->SaveAs(ofile);
1475  }
1476 
1477  return;
1478 }
CWB::config * cfg
Definition: TestCWB_Plugin.C:5
void AddHtmlHeader(TString odir)
Definition: cwb_mkfad.C:1327
char cut[512]
virtual size_t size() const
Definition: wavearray.hh:127
TGraphErrors * Plot(int mtype, TString ptitle, TString xtitle, TString ytitle, bool save=true)
Definition: cwb_mkfad.C:726
vector< double > FAR
Definition: cwb_mkfad.C:59
TString gPTYPE
Definition: cwb_mkfad.C:40
char xtitle[1024]
vector< mdcpar > GetSkyParms()
Definition: mdc.hh:263
vector< double > eVIS
Definition: cwb_mkfad.C:58
double T_pen
par[0] value
std::vector< double > mdcHRSS(K)
char mdc_inj_file[1024]
char cmd[1024]
int nwave
Definition: cbc_plots.C:820
double dist
Definition: ConvertGWGC.C:48
int offset
Definition: TestSTFT_2.C:19
void getVisibleVolume(int mtype)
Definition: cwb_mkfad.C:540
TString ptype[nPLOT]
Definition: cwb_mkfad.C:94
vector< double > eRHO
Definition: cwb_mkfad.C:56
int n
Definition: cwb_net.C:10
void GetLiveTime()
Definition: GetLiveTime.C:31
double rho_min
TString("c")
int nset
Definition: cwb_mkeff.C:57
TString pp_fad_units
Definition: cwb_mkfad.C:85
#define nRHO
Definition: Average.C:25
double T_cor
#define nPLOT
Definition: cwb_mkfad.C:92
int count
Definition: compare_bkg.C:373
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1)*itime+ifreq;double time=itime *dT;double freq=(ifreq >0)?ifreq *dF:dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
TTree * gTRMDC
Definition: cwb_mkfad.C:46
char odir[1024]
vector< double > RHO
Definition: cwb_mkfad.C:55
return wmap canvas
CWB::mdc * MDC
i pp_inetcc
Long_t size
#define FAR_FILE_NAME
Definition: cwb_mkfad.C:7
Color_t colors[16]
vector< double > eFAR
Definition: cwb_mkfad.C:60
TString gODIR
Definition: cwb_mkfad.C:39
void MakeMultiPlotFAD(TString mdc_inj_file)
Definition: cwb_mkfad.C:1343
char ofile[512]
int j
Definition: cwb_net.C:10
i drho i
TString GetSkyFile()
Definition: mdc.hh:262
void Import(TString umacro="")
Definition: config.cc:334
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:3956
#define N
size_t imdc_iset[NMDC_MAX]
Definition: cwb_mkeff.C:50
CWB::Toolbox TB
Definition: ComputeSNR.C:5
TString pp_fad_nbins
Definition: cwb_mkfad.C:87
float distance
Definition: cbc_plots.C:436
TString pp_fad_bkgrep
Definition: cwb_mkfad.C:81
double GetPar(TString name, vector< mdcpar > par, bool &error)
Definition: mdc.cc:405
#define nIFO
ofstream out
Definition: cwb_merge.C:196
vector< int > mtype
Definition: cwb_report_pe.C:48
char data_label[512]
Definition: test_config1.C:160
int nmdc
Definition: cbc_plots.C:791
vector< double > normHRSS
Definition: cwb_mkfad.C:62
size_t imdc_index[NMDC_MAX]
Definition: cwb_mkeff.C:49
TGlobal * global
Definition: config.cc:5
vector< double > VIS
Definition: cwb_mkfad.C:57
Definition: mdc.hh:216
TGraph * gr
TString pp_fad_title
Definition: cwb_mkfad.C:89
void RECvsINJ(int mtype, TString ptitle, TString xtitle, TString ytitle)
Definition: cwb_mkfad.C:994
TString pp_fad_distr
Definition: cwb_mkfad.C:86
double rho_max
double Pi
char oline[1024]
void MakeHtmlIndex(TString *ptype, int psize)
Definition: cwb_mkfad.C:1206
int ninj
Definition: cwb_mkeff.C:52
char fname[1024]
TString pp_fad_multi
CWB::mdc * gMDC
Definition: cwb_mkfad.C:44
#define NTYPE_MAX
int gNBINS
Definition: cwb_mkfad.C:51
int gNZBINS
Definition: cwb_mkfad.C:52
bool gINSPIRAL
Definition: cwb_mkfad.C:47
int k
bool gFIT
Definition: cwb_mkfad.C:42
char imdc_name[NMDC_MAX][128]
Definition: cwb_mkeff.C:46
#define NMDC_MAX
TString pp_fad_gfit
Definition: cwb_mkfad.C:84
vector< waveform > wfList
Definition: mdc.hh:355
double gBKGTIME
Definition: cwb_mkfad.C:49
int ReadInjType(TString ifName, int ntype_max, char set[][128], size_t type[], char name[][128], double fcentral[], double fbandwidth[])
Definition: Toolfun.hh:740
char sim_file_name[1024]
void MakePlot(TString ptype, bool pAll)
Definition: cwb_mkfad.C:429
TTree * gTRWAVE
Definition: cwb_mkfad.C:45
float irho
char title[256]
Definition: SSeriesExample.C:1
static TString getParameter(TString options, TString param="")
Definition: Toolbox.cc:5943
double gOBSTIME
Definition: cwb_mkfad.C:48
ifstream in
#define LIV_FILE_NAME
Definition: cwb_mkfad.C:8
double gRHOMIN
Definition: cwb_mkfad.C:50
wavearray< int > index
double T_win
TCanvas * gCANVAS
Definition: cwb_mkfad.C:43
char pp_dir[512]
Definition: test_config1.C:155
TString sel("slag[1]:rho[1]")
TString pp_fad_subtitle
Definition: cwb_mkfad.C:90
static void mkDir(TString dir, bool question=false, bool remove=true)
Definition: Toolbox.cc:4000
int gMTYPE
Definition: cwb_mkfad.C:41
int cnt
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
double T_cut
TString pp_fad_nzbins
Definition: cwb_mkfad.C:88
DataType_t * data
Definition: wavearray.hh:301
TMacro configPlugin
void cwb_mkfad(TString odir="fad", int nzbins=-1, double obstime=0, bool bexit=true)
Definition: cwb_mkfad.C:108
TString pp_fad_rhomin
Definition: cwb_mkfad.C:83
char formula[256]
size_t imdc_type[NMDC_MAX]
Definition: cwb_mkeff.C:45
vector< double > dFAR
Definition: cwb_mkfad.C:61
bool save
double T_vED
char mdc_file_name[1024]
TString pp_fad_hrss
Definition: cwb_mkfad.C:82
void MakeHtml(TString ptitle)
Definition: cwb_mkfad.C:1156
TString config
TString * imdc_set_name
Definition: cwb_mkeff.C:56
virtual void resize(unsigned int)
Definition: wavearray.cc:445
wavearray< double > y
Definition: Test10.C:31
double imdc_fcentral[NMDC_MAX]
Definition: cwb_mkeff.C:47
TMultiGraph * mg
i drho pp_irho
char imdc_set[NMDC_MAX][128]
Definition: cwb_mkeff.C:44
double imdc_fbandwidth[NMDC_MAX]
Definition: cwb_mkeff.C:48
exit(0)