Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cwb_pparameters.C
Go to the documentation of this file.
1 {
2  #define WATFUN_HH
3 
4  bool pp_batch = false; // if true then the interactive questions are disabled
5 
8  char pp_data_dir[1024] = "data";
9  double pp_drho = (TString(analysis)=="1G") ? 0.1 : 0.2; // rho step size of bins in FAR histogram
10  double pp_rho_min = (TString(analysis)=="1G") ? 2 : 4;
11  double pp_rho_max = (TString(analysis)=="1G") ? 10 : 15;
12  int pp_rho_bin = 0; // number of bins for FAR histogram, it is initialized in $CWB_EPPARAMETERS_FILE
13  int pp_max_nloudest_list = 25; // maximum number of loudest event in the report list
14  bool pp_rho_log = false; // if true then rho is plotted in log scale
15 
16  // hrss range used in eff_freq plots
17  double pp_hrss_min = 1e-23;
18  double pp_hrss_max = 1e-20;
19 
20  // Create jet_benchmark.png (estimation time plot)
21  // (0) -> disabled - (>0) -> max value - (<0) -> auto max
23  // Create mem_benchmark.png (maximum memory)
24  // (0) -> disabled - (>0) -> max value - (<0) -> auto max
26 
27  // create job status table : list of jobs not finished (def = false)
28  bool pp_job_status = false;
29 
30  // default index used for rho = rho[pp_irho] (used by T_cut)
31  int pp_irho = (TString(analysis)=="1G") ? 1 : 0; // 0/1
32  // default index used for cc = netcc[pp_inetcc] (used by T_cor)
33  int pp_inetcc = 0; // 0/1
34 
35  // compute efficiency vs threshold for each mdc type @ specific (custom/auto) factor
36  // used to build ROC plots
37  // syntax : "--mode disable/auto/file_name --rho_min xxx"
38  // disabled : not computed
39  // auto : factor is automatically computed -> is the nearest to the 50% efficiency
40  // file_name : factor is provided by the input file
41  // rho_min : efficiency is computed for rho>rho_min
42  TString pp_eff_vs_thr = "--mode disabled --quit false";
43 
44  // options for the PE report
45  // mdc : used to declare the mdc type[1] to be displayed
46  // -1 : use the list of mdc declared in the production parameter injectionList
47  // 0 : all types are displayed together (default)
48  // k : only type[1]=k is displayed : k = [1:N]
49  // i/j/.../k : display multiple mdc types -> i/j/.../k : i,j,...,k=[1:N]
50  TString pp_pe = "--mdc 0";
51 
52  // pp_sreport is an array used to add auxiliary reports to the current report
53  // --link LINK : www link of the auxiliary report
54  // --link <tab> open a sub tab
55  // --link </tab> close sub tab
56  // --label LABEL: report label - used in the html tabs
57  // --high HIGH: report window height (optional : def=4000)
58  // --name NAME: report html name (optional : def = "header.html, body.html")
59  vector<TString> pp_sreport;
60  pp_sreport.resize(100);
61  for(int i=0;i<100;i++) pp_sreport[i]="";
62 
63  // enable/disable draw efficiency fit curves
64  // true (default) : show fit curve, eff@hrss10/50/90 are derived from fit
65  // false : show lines connecting points, eff@hrss10/50/90 are not showed
66  bool pp_show_eff_fit_curve = true;
67 
68  // enable/disable merge MDC types
69  // false (default) : the efficiencies curves are produced individually for each MDC type
70  // true : all MDC types are used to produce only one MDC efficiency curve
71  bool pp_merge_types = false;
72 
73  // enable/disable draw of rho_vs_rate with no_multiplicity
74  // false/true : disable/enable (default=false)
75  bool pp_rho_vs_rate_no_multiplicity = false;
76 
77  // enable/disable FAD report (default is disabled)
78  // if == "" -> disabled
79  // --bkgrep : directory of the background report (used to read rate_threshold_veto.txt and live.txt)
80  // --hrss : if it is a number then it is used as normalization constant for all MDC types (def=0)
81  // if =0 then hrss rescale is not applied
82  // if it is a file then it is the list of hrss used for each MDC type
83  // (format : for each line -> hrss)
84  // --gfit : true/false -> enable/disable fit in the output plots (default=false)
85  // --rhomin : minimum rho value selected for plots (default = 5)
86  // --nzbins : (default is 0)
87  // if nzbins=0 the standard FAD statistic is used
88  // if nzbin>0 the FAD statistic is computed until there are nzbins
89  // consecutive bins with zero events inside
90  // if nzbin<0 the FAD statistic is computed with classical FAD and min-hold
91  // --units : K -> Kpc,Kyr : M -> Mpc,Myr (def=M)
92  // --distr : formula/mdc -> radial distribution is computed from formula or from mdc injections (def=MDC)
93  // --nbins : number of bins used in hist to computed the radial distribution from the mdc injections
94  // --header : if true -> add cwb header to fad html file (def=false)
95  // --multi : if true -> FAD multi plot for each mdc set are created and substituted in the sim report
96  // page to the eff_freq plots (def=false)
97  // --title : title of the html page (default=FAD) : spaces must be filled with *
98  // --subtitle: subtitle of the html page (default="") : spaces must be filled with *
99  //
100  TString pp_fad="";
101 
102  // if pp_factor2distance > 0 && simulation==1 the efficiency plots are converted from 'eff vs hrss' to 'eff vs distance'
103  // distance = pp_hrss2distance/factor
104  // pp_factor2distance is the distance in Kpc when factor=1
105  double pp_factor2distance = 0.;
106 
108  if(gSystem->Getenv("CWB_MERGE_LABEL")==NULL) {
109  cout << "Error : environment CWB_MERGE_LABEL is not defined!!!" << endl;exit(1);
110  } else {
111  cwb_merge_label=TString(gSystem->Getenv("CWB_MERGE_LABEL"));
112  }
113 
114  int cwb_slag_number=-1; // slag>0
115  if(gSystem->Getenv("CWB_SLAG_NUMBER")==NULL) {
116  cout << "Error : environment CWB_SLAG_NUMBER is not defined!!!" << endl;exit(1);
117  }
118  if(TString(gSystem->Getenv("CWB_SLAG_NUMBER")).IsDigit()) {
119  cwb_slag_number=TString(gSystem->Getenv("CWB_SLAG_NUMBER")).Atoi();
120  }
121 
122  int cwb_lag_number=-1; // lag>0
123  if(gSystem->Getenv("CWB_LAG_NUMBER")==NULL) {
124  cout << "Error : environment CWB_LAG_NUMBER is not defined!!!" << endl;exit(1);
125  }
126  if(TString(gSystem->Getenv("CWB_LAG_NUMBER")).IsDigit()) {
127  cwb_lag_number=TString(gSystem->Getenv("CWB_LAG_NUMBER")).Atoi();
128  }
129 
130  // ----------------------------------------------------------
131  // title & subtitle
132  // ----------------------------------------------------------
133  char title[1024]="";
134  char subtitle[1024]="";
135 
136  // ----------------------------------------------------------
137  // thresholds
138  // ----------------------------------------------------------
139  double T_ifar = 0.0; // ifar cut (years) : can be applied only for tree where the ifar is included
140  double T_cor = 0.60; // cc cut
141  double T_cut = 3.5; // rho high frequency cut
142  double T_scc = 0.0; // subcc (netcc[2]) : subnetwork consistency coefficient [2G]
143  double T_acor = 0.0; // output threshold
144  double T_out = 3.5; // output threshold
145  double T_vED = 0.0; // vED threshold
146  double T_pen = 0.; // penalty threshold
147  double T_hrss = 0.0; // penalty threshold
148  double T_win = 0.1; // time window used to skip random coincidence in simplot
149  double T_mchirp = 0.0; // cut on reconstructed chirp
150  double T_sphr = 0.0; // cut on sphericity of reconstructed chirp
151  double T_efrac = 0.0; // cut on Energy fraction
152  int i_hrss1 = 0;
153  int i_hrss2 = 1;
154  double T_rms = 0.; // penalty threshold
155  double hours = 24; // bin size in hours for rate vs time plot
156 
157  float ratio_hrss = 1; //CORRECTION FREQUENCY
158  float pp_freq_offset = 0.; //CORRECTION FREQUENCY (SIM)
159 
160  char RunLabel[1024]="";
161 
162  // ----------------------------------------------------------
163  // Input data files
164  // ----------------------------------------------------------
165 
166  char sim_file_name[1024];
167  char mdc_file_name[1024];
168  char net_file_name[1024];
169  char liv_file_name[1024];
170  char mdc_inj_file[1024];
171 
172  if(simulation>0) { // simulation
173  sprintf(sim_file_name,"%s/wave_%s.%s.root",merge_dir,data_label,cwb_merge_label.Data());
174  sprintf(mdc_file_name,"%s/mdc_%s.%s.root",merge_dir,data_label,cwb_merge_label.Data());
175  cout << sim_file_name << endl;
176  cout << mdc_file_name << endl;
177 
178  // Declare inj list
179  if(TString(injectionList).Sizeof()<=1) {
180  cout << "cwb_pparameters.C - Error : injectionList must be declared in simulation mode !!!" << endl;
181  exit(1);
182  }
183 
184  TObjArray* token;
185  // extract file name
186  token = TString(injectionList).Tokenize(TString("/"));
187  TString injName = ((TObjString*)token->At(token->GetEntries()-1))->GetString();
188  TString fext = "";
189  // extract file extention
190  if(injName.Contains(".")) { // there is an extention
191  token = TString(injName).Tokenize(TString("."));
192  fext = TString(".")+((TObjString*)token->At(token->GetEntries()-1))->GetString();
193  sprintf(mdc_inj_file,"%s",injName.ReplaceAll(fext,"").Data());
194  } else {
195  sprintf(mdc_inj_file,"%s",injName.Data());
196  }
197  // extract the name if mdc injection list
198  char _mdc_inj_file[1024];
199  sprintf(_mdc_inj_file,"%s/%s.inj",input_dir,mdc_inj_file);
200  strcpy(mdc_inj_file,_mdc_inj_file);
201 
202  // Check if files exist
203  CWB::Toolbox::checkFile(sim_file_name);
204  CWB::Toolbox::checkFile(mdc_file_name);
205  CWB::Toolbox::checkFile(mdc_inj_file);
206  } else if (simulation==0) { // production
207  sprintf(net_file_name,"%s/wave_%s.%s.root",merge_dir,data_label,cwb_merge_label.Data());
208  sprintf(liv_file_name,"%s/live_%s.%s.root",merge_dir,data_label,cwb_merge_label.Data());
209  cout << net_file_name << endl;
210  cout << liv_file_name << endl;
211 
212  // Check if files exist
213  CWB::Toolbox::checkFile(net_file_name);
214  CWB::Toolbox::checkFile(liv_file_name);
215  }
216 
217  // ----------------------------------------------------------
218  // Create output directory
219  // ----------------------------------------------------------
220  char netdir[1024];
221 
222  // ----------------------------------------------------------
223  // templates file for www
224  // ----------------------------------------------------------
225  char html_index_template[1024]="";
226  char html_header_template[1024]="";
227  char html_body_prod_template[1024]="";
228 
229  if(gSystem->Getenv("CWB_HTML_INDEX")==NULL) {
230  cout << "Error : environment CWB_HTML_INDEX is not defined!!!" << endl;exit(1);
231  } else {
232  strcpy(html_index_template,gSystem->Getenv("CWB_HTML_INDEX"));
233  }
234  if(gSystem->Getenv("CWB_HTML_HEADER")==NULL) {
235  cout << "Error : environment CWB_HTML_HEADER is not defined!!!" << endl;exit(1);
236  } else {
237  strcpy(html_header_template,gSystem->Getenv("CWB_HTML_HEADER"));
238  }
239  if(gSystem->Getenv("CWB_HTML_BODY_PROD")==NULL) {
240  cout << "Error : environment CWB_HTML_BODY_PROD is not defined!!!" << endl;exit(1);
241  } else {
242  strcpy(html_body_prod_template,gSystem->Getenv("CWB_HTML_BODY_PROD"));
243  }
244 
245  CWB::Toolbox::checkFile(html_index_template);
246  CWB::Toolbox::checkFile(html_header_template);
247  CWB::Toolbox::checkFile(html_body_prod_template);
248 /*
249  // ----------------------------------------------------------
250  // ch2 cuts
251  // ----------------------------------------------------------
252 
253  char ch2[2048]="";
254  if(cwb_lag_number==-1) {
255  sprintf(ch2,"netcc[%d]>%f&&lag[%d]>0",pp_inetcc,T_cor,nIFO);
256  } else {
257  sprintf(ch2,"netcc[%d]>%f&&lag[%d]==%d",pp_inetcc,T_cor,nIFO,cwb_lag_number);
258  }
259  if (T_vED>0) sprintf(ch2,"%s&&neted[0]/ecor<%f",ch2,T_vED);
260  if (T_pen>0) sprintf(ch2,"%s&&penalty>%f",ch2,penalty);
261  if (T_hrss>0) sprintf(ch2,"%s&&abs((TMath::Log10(hrss[%i])-TMath::Log10(hrss[%i])))<%f",ch2,i_hrss1,i_hrss2,T_hrss);
262 */
263  // ----------------------------------------------------------
264  // frequency cuts
265  // array of frequency cuts [lowFCUT,highFCUT]
266  // ----------------------------------------------------------
267  int nFCUT = 0; // number of frequency cuts
268  double lowFCUT[100]; // low frequency cut
269  double highFCUT[100]; // high frequency cut
270 
271  // ----------------------------------------------------------
272  // VETO cuts
273  // dq file list
274  // {ifo, dqcat_file, dqcat[0/1/2], shift[sec], inverse[false/true], 4columns[true/false]}
275  // ----------------------------------------------------------
276  int nVDQF=0;
277  dqfile VDQF[100];
278 
279  char veto_vetoed[1024] = "";
280  char veto_not_vetoed[1024] = "";
281 
282 }
int i_hrss2
double T_ifar
double T_pen
char mdc_inj_file[1024]
char html_body_prod_template[1024]
double T_sphr
dqfile VDQF[100]
TString("c")
double T_cor
char RunLabel[1024]
double T_hrss
float ratio_hrss
int cwb_lag_number
double hours
int pp_irho
double pp_hrss_min
int nVDQF
double pp_hrss_max
i drho i
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:3956
bool pp_job_status
double pp_drho
char net_file_name[1024]
char injectionList[1024]
double T_mchirp
char data_label[512]
Definition: test_config1.C:160
double T_acor
char input_dir[512]
Definition: test_config1.C:145
int cwb_slag_number
TString pp_label
int pp_jet_benckmark
char html_index_template[1024]
double pp_rho_min
int pp_inetcc
char netdir[1024]
bool pp_rho_log
double T_rms
char merge_dir[512]
Definition: test_config1.C:147
float pp_freq_offset
int pp_rho_bin
char title[1024]
int i_hrss1
int nFCUT
TObjArray * token
double e
vector< TString > pp_sreport
double pp_rho_max
char sim_file_name[1024]
int pp_mem_benckmark
char html_header_template[1024]
char subtitle[1024]
double T_win
double highFCUT[100]
TString cwb_merge_label
char pp_data_dir[1024]
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
char veto_not_vetoed[1024]
double T_cut
double T_efrac
int pp_max_nloudest_list
char liv_file_name[1024]
TString pp_pe
double T_out
double T_scc
double T_vED
simulation
Definition: cwb_eced.C:9
char mdc_file_name[1024]
TString user_pp_label
double lowFCUT[100]
TString pp_eff_vs_thr
exit(0)
char veto_vetoed[1024]