Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb2G_parameters.C
Go to the documentation of this file.
1 // main cwb configuration file for the 2G pipeline
2 // parameters can be redefined/added in user_parameters.C
3 // for reference contact
4 // S.Klimenko, University of Florida. klimenko@phys.ufl.edu
5 // G.Vedovato, University of Padova, vedovato@lnl.infn.it
6 {
7 #ifndef CWB_PARAMETER_FILE
8 #define CWB_PARAMETER_FILE
9 
10  #include "xroot.hh" // defines macro to manage ROOT5 vs ROOT6
11 
12  /****** search ******/
13 
14  char analysis[8]="2G"; // 2G pipeline
15  CheckAnalysis(); // check consistency with the environment CWB_ANALYSIS
16  bool online=false; // true/false -> online/offline
17  SEARCH(char) = 'r'; // see description below
18  bool optim=false; // true -> optimal resolution likelihood analysis
19  double fLow = 64.; // low frequency of the search
20  double fHigh = 2048.; // high frequency of the search
21 
22  /****** network configuration ******/
23 
24  char ifo[NIFO_MAX][8];
25  if(NIFO_MAX>0) strcpy(ifo[0],"L1"); // LIGO Livingston
26  if(NIFO_MAX>1) strcpy(ifo[1],"H1"); // LIGO Hanford
27  if(NIFO_MAX>2) strcpy(ifo[2],"V1"); // Virgo
28  if(NIFO_MAX>3) strcpy(ifo[3],"I1"); // LIGO India
29  if(NIFO_MAX>4) strcpy(ifo[4],"J1"); // KAGRA Japan
30  if(NIFO_MAX>5) strcpy(ifo[5],"G1"); // GEO-600 Hannover
31  for(int i=6;i<NIFO_MAX;i++) strcpy(ifo[i],""); // ifo[] can be redefined by user
32 
33  int nIFO = 3; // size of network starting with first detector ifo[]
34  char refIFO[4] = "L1"; // reference IFO
35  detectorParams detParms[NIFO_MAX]; // user defined detectors
36  detectorParams _detParms = {"",0.,0.,0.,0,0.,0.,0.};
37  for(int i=0;i<NIFO_MAX;i++) detParms[i] = _detParms;
38 
39  /****** cWB production thresholds & regulators ******/
40 
41  double bpp = 0.001; // probability for black pixel selection (netpixel)
42  double subnet = 0.7; // [0,0.7] sub network threshold (supercluster)
43  double subcut = 0.33; // [0,1] sub network threshold in the skyloop (supercluster)
44  double netRHO = 4; // [>4.0] coherent network SNR (supercluster, likelihood)
45  double netCC = 0.5; // network correlation (supercluster, likelihood)
46  double Acore = sqrt(2); // threshold of core pixels (supercluster, likelihood)
47  double Tgap = 3.0; // defragmentation time gap between clusters (sec)
48  double Fgap = 130.; // defragmentation frequency gap between clusters (Hz)
49  double TFgap = 6.; // threshold on the time-frequency separation between two pixels
50 
51  // regulators
52  double delta = 0.5; // [-1:1] regulate 2 Detector sky locations
53  // delta=0 : regulator is disabled, delta<0 : select Lo as skystat instead of Lr
54  GAMMA(double) = 0.5; // [-1:1] regulate |fx|<<|f+| and |f+|<<1 sky locations
55  // gamma=0 : regulator is disabled, gamma<0 : sky prior is applied
56 
57  /****** run configuration ******/
58 
59  int runID = 0; // run number, set in the production job
60  size_t inRate= 16384; // data sampling rate
61  size_t fResample = 0; // if>0 the inRate is resampled to fResample
62 
63  // time-frequency transformation settings
64  int l_low = 3; // low frequency resolution level (2^l_low Hz)
65  int l_high = 8; // high frequency resolution level (2^l_high Hz)
66  int levelR = 2; // resampling level : inRate[fResample]/(2^levelR) Hz
67 
68  // job segments
69  double segLen = 600.; // Segment length [sec]
70  double segMLS = 300.; // Minimum Segment Length after DQ_CAT1 [sec]
71  double segTHR = 30.; // Minimum Segment Length after DQ_CAT2 [sec] (to disable put segTHR=0)
72  double segEdge = 8.; // wavelet boundary offset [sec]
73  double segOverlap = 0.; // overlap between job segments [sec]
74 
75  // time shift analysis lags
76  size_t lagSize = 1; // number of lags (simulation=1)
77  double lagStep = 1.; // [sec] time interval between lags
78  size_t lagOff = 0; // first lag id (lagOff=0 - include zero lag )
79  size_t lagMax = 150; // 0/>0 - standard/extended lags
80  char* lagFile = NULL; // lag file list
81  char lagMode[] = "w"; // w/r - write/read lag list
82  size_t* lagSite = NULL; // site index starting with 0
83 
84  // time shift analysis super lags
85  int slagSize = 0; // number of super lags (simulation=1) - if slagSize=0 -> Standard Segments
86  int slagMin = 0; // select the minimum available slag distance : slagMin must be <= slagMax
87  int slagMax = 0; // select the maximum available slag distance
88  int slagOff = 0; // first slag id (slagOff=0 - include zero slag )
89  size_t* slagSite = NULL; // site index starting with 0
90  char* slagFile = NULL; // slag file list
91 
92  // whitening parameters
93  double whiteWindow = 60.; // [sec] time window dT. if = 0 - dT=T, where T is segment duration
94  double whiteStride = 20.; // [sec] noise sampling time stride
95 
96  // Skymap probability to be saved in the final output root file (saved if !=0 : see nSky)
97  int Psave = 0;
98 
99  // DC corrections
100  double dcCal[NIFO_MAX];
101  for(int i=0;i<NIFO_MAX;i++) dcCal[i] = 1.0;
102 
103  // simulation parameters
104  int simulation = 0; // 1/2/3/4 for simulation(hrss/snr/tshift/multi), 0 for production
105  int nfactor=0; // number of simulation factors
106  double factors[FACTORS_MAX]; // array of simulation factors (when sim=4 factors[0] is used as offset [must be int])
107  for(int i=0;i<FACTORS_MAX;i++) factors[i]=0.;
108  double iwindow = 5.; // injection time window (Tinj +/- iwindow/2)
109 
110  // noise shift data
111  double dataShift[NIFO_MAX];
112  for(int i=0;i<NIFO_MAX;i++) dataShift[i] = 0.;
113 
114  // use this parameter to shift in time the injections (sec)
115  // use {0,0,0} to set mdc_shift to 0
116  // if {-1,0,0} the shift is automatically selected
117  // {startMDC, stopMDC, offset}
118  // see description in the method CWB::Toolbox::getMDCShift
119  mdcshift mdc_shift = {0, 0, 0};
120 
121  // delay filter
122  // catalog of WDM cross-talk coefficients
123  char wdmXTalk[1024] = "wdmXTalk/OverlapCatalog_Lev_8_16_32_64_128_256_iNu_4_Prec_10.bin";
124  size_t upTDF = 4; // upsample factor to obtain rate of TD filter : TDRate = (inRate>>levelR)*upTDF
125  size_t TDSize = 12; // time-delay filter size (max 20)
126 
127  // coherence stage settings
128  // select pixel pattern used to produce the energy max maps for pixel's selection
129  // patterns: "/" - ring-up, "\" - ring-down, "|" - delta, "-" line, "*" - single
130  //
131  // pattern = 0 - "*" 1-pixel standard search
132  // pattern = 1 - "3|" 3-pixels vertical packet (delta)
133  // pattern = 2 - "3-" 3-pixels horizontal packet (line)
134  // pattern = 3 - "3/" 3-pixels diagonal packet (ring-up)
135  // pattern = 4 - "3\" 3-pixels anti-diagonal packet (ring-down)
136  // pattern = 5 - "5/" 5-pixels diagonal packet (ring-up)
137  // pattern = 6 - "5\" 5-pixels anti-diagonal packet (ring-down)
138  // pattern = 7 - "3+" 5-pixels plus packet (plus)
139  // pattern = 8 - "3x" 5-pixels cross packet (cross)
140  // pattern = 9 - "9p" 9-pixels square packet (box)
141  // pattern = else - "*" 1-pixel packet (single)
142  //
143  // ------------------------------------------------------------------------------------
144  // pattern==0 Standard Search : std-pixel selection + likelihood2G
145  // pattern!=0 && pattern<0 Mixed Search : packet-pixel selection + likelihood2G
146  // pattern!=0 && pattern>0 Packed Search : packet-pixel selection + likelihoodWP
147 
148  int pattern = 0;
149 
150  // supercluster stage settings
151 
152  int BATCH = 10000; // max number of pixel to process in one loadTDamp batch
153  int LOUD = 200; // number of pixel per cluster to load TD amplitudes
154 
155  // sky settings
156 
157  bool EFEC = true; // Earth Fixed / Selestial coordinates
158  size_t mode = 0; // sky search mode
159  double angle = 0.4; // angular resolution
160  double Theta1 = 0.; // start theta
161  double Theta2 = 180.; // end theta
162  double Phi1 = 0.; // start theta
163  double Phi2 = 360.; // end theta
164  size_t healpix= 7; // if not 0 use healpix sky map (number of sky pixels = 12*pow(4,healpix))
165 
166  double precision = GetPrecision(0,0); // set parameters for big clusters events management
167  // par1 (csize) : cluster size threshold
168  // par2 (order) : order of healpix resampled skymap (<healpix)
169  // default (0,0) = disabled
170  // if enabled the skyloop of the events with volume>=csize
171  // is downsampled to skymap(order)
172 
173  // file dump mode
174 
176  CWB_OUTF_OPTIONS outfOptions = CWB_OUTF_SAVE_DISABLE; // output root file options
177 
178  bool dumpHistory = true; // dump history into output root file
179  bool dump = false; // dump triggers into ascii file
180  bool savemode = true; // temporary save clusters on disc
181  bool cedDump = false; // dump ced plots with rho>cedRHO
182  double cedRHO = 4.0;
183  long nSky = 0; // if nSky>0 -> # of skymap prob pixels dumped to ascii
184  // if nSky=0 -> (#pixels==1000 || cum prob > 0.99)
185  // if nSky<0 -> nSky=-XYZ... save all pixels with prob < 0.XYZ...
186 
187  //****** directories, file names ******//
188 
189  char filter_dir[1024];
190  if(gSystem->Getenv("HOME_WAT_FILTERS")==NULL) {
191  cout << "Error : environment HOME_WAT_FILTERS is not defined!!!" << endl;exit(1);
192  } else {
193  strcpy(filter_dir,TString(gSystem->Getenv("HOME_WAT_FILTERS")).Data());
194  }
195 
196  char injectionList[1024]="";
197  char skyMaskFile[1024]="";
198  char skyMaskCCFile[1024]="";
201  for(int i=0;i<NIFO_MAX;i++) strcpy(channelNamesRaw[i],"");
202  for(int i=0;i<NIFO_MAX;i++) strcpy(channelNamesMDC[i],"");
203 
204  // working dir
205  char work_dir[1024];
206  sprintf(work_dir,"%s",gSystem->WorkingDirectory());
207 
208  char config_dir[1024] = "config";
209  char input_dir[1024] = "input";
210  char output_dir[1024] = "output";
211  char merge_dir[1024] = "merge";
212  char condor_dir[1024] = "condor";
213  char report_dir[1024] = "report";
214  char macro_dir[1024] = "macro";
215  char log_dir[1024] = "log";
216  char data_dir[1024] = "data";
217  char tmp_dir[1024] = "tmp";
218  char ced_dir[1024] = "report/ced";
219  char pp_dir[1024] = "report/postprod";
220  char dump_dir[1024] = "report/dump";
221  char www_dir[1024];
222 
223  UserGroup_t* uinfo = gSystem->GetUserInfo();
224  TString uname = uinfo->fUser;
225  TString uhome = TString(gSystem->Getenv("HOME")).Data();
226 
227  // set public dir
228  if(gSystem->Getenv("WWW_PUBLIC_DIR")!=NULL) {
229  // read from env
230  TString www_public_dir = TString(gSystem->Getenv("WWW_PUBLIC_DIR"));
231  www_public_dir.ReplaceAll("X_HOME",uhome.Data());
232  www_public_dir.ReplaceAll("X_USER_NAME",uname.Data());
233  www_public_dir.ReplaceAll("X_HOST_NAME",gSystem->HostName());
234  sprintf(www_dir,"%s",www_public_dir.Data());
235  } else {
236  cout << "cwb_parameters.C : Error env WWW_PUBLIC_DIR not defined !!!" << endl;
237  cout << "www_public_dir can not be defined" << endl;
238  exit(1);
239  }
240  cout << "www_dir : " << www_dir << endl;
241 
242  // data label
243  char data_label[1024];
244  sprintf(data_label,"%s",gSystem->BaseName(work_dir));
245  cout << "data_label : " << data_label << endl;
246 
247  // condor declarations
248  char condor_log[1024];
249  if(gSystem->Getenv("CONDOR_LOG_DIR")!=NULL) {
250  // get host name & strip string after the first '.'
251  // strip is necessary to get the correct condor path
252  // condor log dir is in the local header nodes
253  // used in ATLAS cluster to fix issue with HSM
254  TString host_name = gSystem->HostName();
255  if(host_name.First(".")>=0) host_name.Resize(host_name.First("."));
256  // read from env
257  TString condor_log_dir = TString(gSystem->Getenv("CONDOR_LOG_DIR"));
258  condor_log_dir.ReplaceAll("X_HOME",uhome.Data());
259  condor_log_dir.ReplaceAll("X_USER_NAME",uname.Data());
260  condor_log_dir.ReplaceAll("X_HOST_NAME",host_name);
261  sprintf(condor_log,"%s",condor_log_dir.Data());
262  } else {
263  cout << "cwb_parameters.C : Error env CONDOR_LOG_DIR not defined !!!" << endl;
264  cout << "condor_log can not be defined" << endl;
265  exit(1);
266  }
267  cout << "condor_log : " << condor_log << endl;
268 
269  // Define a Unique Tag for Condor Jobs
270  // See the following link:
271  // https://ldas-gridmon.ligo.caltech.edu/accounting/condor_groups/determine_condor_account_group.html
272  // Ex : ligo.dev.o1.burst.allsky.cwboffline, ligo.prod.o1.burst.allsky.cwboffline
273  char condor_tag[1024] = "";
274 
275  // frame files list : [0:nIFO-1]/[nIFO:2*nIFO-1] contains strain/mdc file names
276  // If all mdc channels are in a single frame file -> mdc must be declared in the nIFO position
277  char frFiles[2*NIFO_MAX][1024];
278  for(int i=0;i<2*NIFO_MAX;i++) strcpy(frFiles[i],"");
279  // frame reading retry time (sec) : 0 -> disable
280  // retry time = frRetryTime*(num of trials) : max trials = 3
281  int frRetryTime=60;
282 
283  // dq file list
284  // {ifo, dqcat_file, dqcat[0/1/2], shift[sec], inverse[false/true], 4columns[true/false]}
285  int nDQF = 0;
286  dqfile DQF[DQF_MAX];
287 
288  // read and dump data on local disk (nodedir)
289  char nodedir[1024] = "";
290  if(gSystem->Getenv("NODE_DATA_DIR")!=NULL) {
291  // read from env
292  TString node_data_dir = TString(gSystem->Getenv("NODE_DATA_DIR"));
293  node_data_dir.ReplaceAll("X_HOME",uhome.Data());
294  node_data_dir.ReplaceAll("X_USER_NAME",uname.Data());
295  node_data_dir.ReplaceAll("X_HOST_NAME",gSystem->HostName());
296  sprintf(nodedir,"%s",node_data_dir.Data());
297  } else {
298  cout << "cwb_parameters.C : Error env NODE_DATA_DIR not defined !!!" << endl;
299  cout << "nodir can not be defined" << endl;
300  exit(1);
301  }
302  if(gSystem->Getenv("_USE_PEGASUS")!=NULL) strcpy(nodedir,".");
303  cout << "nodename : " << gSystem->HostName() << endl;
304  cout << "nodedir : " << nodedir << endl;
305 
306  // get CWB_CONFIG
307  char cwb_config_env[1024] = "";
308  if(gSystem->Getenv("CWB_CONFIG")!=NULL) {
309  strcpy(cwb_config_env,TString(gSystem->Getenv("CWB_CONFIG")).Data());
310  }
311 
312  // get SITE_CLUSTER
313  char site_cluster_env[1024] = "";
314  if(gSystem->Getenv("SITE_CLUSTER")!=NULL) {
315  strcpy(site_cluster_env,TString(gSystem->Getenv("SITE_CLUSTER")).Data());
316  }
317 
318  // Plugin
319 
320  TMacro plugin; // Macro source
321  TMacro configPlugin; // Macro config
322  plugin.SetName("");
323  configPlugin.SetName("");
324  char parPlugin[1024] = ""; // user defined parameters (used in the plugin)
325  bool dataPlugin = false; // if dataPlugin=true disable read data from frames
326  bool mdcPlugin = false; // if dataPlugin=true disable read mdc from frames
327  bool dcPlugin = false; // if dcPlugin=true disable built-in data conditioning (only 2G)
328  bool cohPlugin = false; // if cohPlugin=true disable built-in coherence stage (only 2G)
329  bool scPlugin = false; // if scPlugin=true disable built-in supercluster function (only 2G)
330  bool outPlugin = false; // if outPlugin=true disable built-in output wave file (only 2G)
331 
332  char comment[1024] = ""; // user defined comment
333 
334  // 2G search modes
335  // r - un-modeled
336  // i - iota - wave: no,partial dispersion correction
337  // p - Psi - wave (no dispersion correction)
338  // l,s - linear, loose linear
339  // c,g - circular. loose circular
340  // e,b - elliptical (no dispersion correction), b=p for now
341  //
342  // low/upper case search (like 'i'/'I') & optim=false - standard MRA
343  // low case search (like 'i') & optim=true - extract PCs from a single resolution
344  // upper case (like 'I') & optim=true - standard single resolution analysis
345 
346  // ----------------------------------------------
347  // obsolete parameters
348  // ----------------------------------------------
349 
350  double &gap = iwindow; // alias of iwindow
351  int levelF = 0; // 1G parameter
352  int levelD = 0; // 1G parameter
353  int mlagStep = 0; // 1G parameter
354  bool eDisbalance = false; // 1G parameter
355  double mask = 0.00; // 1G parameter
356  double Tlpr = 0.; // 1G parameter
357  double x2or = 0.; // 1G parameter
358  double shift[NIFO_MAX]; // 1G parameter
359  char filter[1024] = ""; // 1G parameter
360 
361 #endif
362 }
char skyMaskFile[1024]
char wdmXTalk[1024]
double segMLS
Definition: test_config1.C:47
int slagSize
Definition: test_config1.C:65
SEARCH(char)
char site_cluster_env[1024]
bool online
char filter_dir[1024]
double lagStep
Definition: test_config1.C:53
size_t * slagSite
Definition: test_config1.C:69
int slagOff
Definition: test_config1.C:68
mdcshift mdc_shift
Definition: test_config1.C:93
TString condor_log_dir
size_t TDSize
char channelNamesMDC[NIFO_MAX][50]
double fHigh
double delta
CWB_OUTF_OPTIONS outfOptions
char parPlugin[1024]
CWB_JOBF_OPTIONS
Definition: config.hh:55
char channelNamesRaw[NIFO_MAX][50]
size_t * lagSite
Definition: test_config1.C:58
double angle
bool scPlugin
TString("c")
char comment[1024]
char www_dir[512]
Definition: test_config1.C:157
char skyMaskCCFile[1024]
const int DQF_MAX
Definition: config.hh:87
double x2or
double bpp
Definition: test_config1.C:22
bool optim
char frFiles[NIFO_MAX+1][256]
Definition: test_config1.C:166
int slagMax
Definition: test_config1.C:67
CWB_JOBF_OPTIONS jobfOptions
size_t lagOff
Definition: test_config1.C:54
double & gap
double Theta2
char refIFO[4]
Definition: test_config1.C:14
char macro_dir[512]
Definition: test_config1.C:150
double segEdge
Definition: test_config1.C:49
char report_dir[512]
Definition: test_config1.C:149
i drho i
int l_low
Definition: test_config1.C:40
double whiteWindow
Definition: test_config1.C:72
CWB_OUTF_OPTIONS
Definition: config.hh:79
double netCC
Definition: test_config1.C:33
char ifo[NIFO_MAX][8]
double Theta1
double Tgap
Definition: test_config1.C:23
double fResample
Definition: test_config1.C:27
char ced_dir[512]
Definition: test_config1.C:154
nDQF
Definition: cwb_eced.C:109
char injectionList[1024]
int Psave
Definition: test_config1.C:75
double Acore
Definition: test_config1.C:28
double segTHR
Definition: test_config1.C:48
size_t mode
#define nIFO
bool mdcPlugin
char data_label[512]
Definition: test_config1.C:160
char input_dir[512]
Definition: test_config1.C:145
int BATCH
const int FACTORS_MAX
Definition: config.hh:86
int levelD
char tmp_dir[512]
Definition: test_config1.C:153
char lagMode[2]
Definition: test_config1.C:57
int pattern
double GetPrecision(int cluster_size_threshold=0, int healpix_order=0)
Definition: Toolfun.hh:948
size_t upTDF
const int NIFO_MAX
Definition: wat.hh:22
dqfile DQF[12]
Definition: test_config1.C:171
double dataShift[NIFO_MAX]
Definition: test_config1.C:87
bool EFEC
int mlagStep
segLen
Definition: cwb_eced.C:24
double precision
char merge_dir[512]
Definition: test_config1.C:147
bool dumpHistory
double cedRHO
bool eDisbalance
char data_dir[512]
Definition: test_config1.C:152
UserGroup_t * uinfo
Definition: cwb_frdisplay.C:91
char log_dir[512]
Definition: test_config1.C:151
char config_dir[512]
Definition: test_config1.C:144
double Phi1
bool outPlugin
double dcCal[NIFO_MAX]
Definition: test_config1.C:78
char filter[1024]
bool cohPlugin
double Fgap
Definition: test_config1.C:24
double fLow
int LOUD
double whiteStride
Definition: test_config1.C:73
char dump_dir[512]
Definition: test_config1.C:156
char pp_dir[512]
Definition: test_config1.C:155
char * lagFile
Definition: test_config1.C:56
strcpy(RunLabel, RUN_LABEL)
int nfactor
Definition: test_config1.C:83
double mask
double netRHO
Definition: test_config1.C:32
CheckAnalysis()
Definition: Toolfun.hh:303
sprintf(condor_log,"%s", condor_log_dir.Data())
char condor_log[512]
Definition: test_config1.C:163
TMacro plugin
bool dump
bool savemode
int l_high
Definition: test_config1.C:41
slagFile
Definition: cwb_tune_slag.C:25
char nodedir[1024]
Definition: test_config1.C:187
char condor_dir[512]
Definition: test_config1.C:148
double Phi2
char work_dir[512]
Definition: test_config1.C:143
TMacro configPlugin
long nSky
int levelR
Definition: test_config1.C:37
int slagMin
Definition: test_config1.C:66
simulation
Definition: cwb_eced.C:26
double Tlpr
detectorParams detParms[4]
double shift[NIFO_MAX]
factors[0]
Definition: cwb_eced.C:27
char output_dir[512]
Definition: test_config1.C:146
bool dcPlugin
bool dataPlugin
size_t lagMax
Definition: test_config1.C:55
int levelF
bool cedDump
exit(0)
#define GAMMA(TYPE)
Definition: xroot.hh:5
size_t healpix
size_t lagSize
Definition: test_config1.C:52