51 if(cwb_combine_options.Contains(
"--")) {
54 cwb_combine_sfthr = TB.
getParameter(cwb_combine_options,
"--fthr");
56 cwb_combine_sifarthr = TB.
getParameter(cwb_combine_options,
"--ifarthr");
58 cwb_combine_search = TB.
getParameter(cwb_combine_options,
"--search");
60 cwb_combine_wdir = TB.
getParameter(cwb_combine_options,
"--wdir");
62 cwb_combine_mlabel = TB.
getParameter(cwb_combine_options,
"--mlabel");
64 cwb_combine_ulabel = TB.
getParameter(cwb_combine_options,
"--ulabel");
67 if(lag_str.IsDigit()) cwb_combine_lag=lag_str.Atoi();
70 if(slag_str.IsDigit()) cwb_combine_slag=slag_str.Atoi();
72 cwb_combine_check = TB.
getParameter(cwb_combine_options,
"--check");
73 cwb_combine_check.ToUpper();
74 if(cwb_combine_check==
"") cwb_combine_check =
"FALSE";
79 if(cwb_combine_check!=
"FALSE" && cwb_combine_check!=
"TRUE") {
80 cout << endl <<
"cwb_combine_cbc : Error - check available values are : true/false!!!" << endl << endl;
84 if(cwb_combine_lag<0 || cwb_combine_slag<0) {
85 cout <<
"cwb_combine_cbc.C : Error - lag,slag must be >= 0 : --lag " 86 << cwb_combine_lag <<
" --slag " << cwb_combine_slag << endl << endl;
91 if(cwb_combine_sfthr.IsDigit()) {
92 cwb_combine_fthr = cwb_combine_sfthr.Atoi();
94 cout <<
"cwb_combine_cbc.C : Error - fthr is not an interger number: --fthr " << cwb_combine_sfthr << endl << endl;
99 if(cwb_combine_sifarthr.IsFloat()) {
100 cwb_combine_ifarthr = cwb_combine_sifarthr.Atof();
101 if(cwb_combine_ifarthr<0) {
102 cout <<
"cwb_combine_cbc.C : Error - ifarthr must be>=0: --ifarthr " << cwb_combine_sifarthr << endl << endl;
105 }
else if(cwb_combine_sifarthr!=
"") {
106 cout <<
"cwb_combine_cbc.C : Error - ifarthr is not a float number: --ifarthr " << cwb_combine_sifarthr << endl << endl;
111 cout <<
"cwb_combine_cbc.C : Error - _merge label not contains the unique events tag '.C_U': merge label = " <<
cwb_merge_label << endl << endl;
115 if(cwb_combine_search!=
"IMBHB" && cwb_combine_search!=
"BBH") {
116 cout <<
"cwb_combine_cbc.C : Error - search not defined, valid values are: IMBHB,BBH" << endl << endl;
120 if(cwb_combine_wdir==
"") {
121 cout <<
"cwb_combine_cbc.C : Error - wdir not defined" << endl << endl;
125 if(cwb_combine_mlabel==
"") {
126 cout <<
"cwb_combine_cbc.C : Error - mlabel not defined" << endl << endl;
131 cout <<
"cwb_combine_cbc.C : Error - mlabel not contains the unique events tag '.C_U': --mlabel " << cwb_combine_mlabel << endl << endl;
135 if(cwb_combine_ulabel!=
"" && !cwb_combine_ulabel.IsAlnum()) {
136 cout <<
"cwb_combine_cbc.C : Error - ulabel is not alphanumeric: --ulabel " << cwb_combine_ulabel << endl << endl;
140 vector<TString>
ifwave(2);
144 gSystem->BaseName(cwb_combine_wdir),cwb_combine_mlabel.Data());
145 ifwave[0] = (cwb_combine_search==
"BBH") ? ifile1 : ifile2;
146 ifwave[1] = (cwb_combine_search==
"BBH") ? ifile2 : ifile1;
150 vector<TString> ifmdc;
151 vector<TString> iflive;
154 ifmdc[0] = ifwave[0]; ifmdc[0].ReplaceAll(
"wave_",
"mdc_");
155 ifmdc[1] = ifwave[1]; ifmdc[1].ReplaceAll(
"wave_",
"mdc_");
161 cout <<
"Check livetimes zero lag IMBHB vs BBH ..." << endl << endl;
163 iflive[0] = ifwave[0]; iflive[0].ReplaceAll(
"wave_",
"live_");
164 iflive[1] = ifwave[1]; iflive[1].ReplaceAll(
"wave_",
"live_");
168 TChain live1(
"liveTime");
169 live1.Add(iflive[0]);
170 TChain live2(
"liveTime");
171 live2.Add(iflive[1]);
172 double livetime1,livetime2;
173 if(cwb_combine_lag==0 && cwb_combine_slag==0) {
185 cout <<
"-----------------------------------------------------------------------------------" << endl;
186 cout <<
"cwb_combine_cbc.C : zero lag livetime of IMBHB " 187 << livetime1 <<
" (sec) " << livetime1/(24*3600) <<
" (days) " << endl;
188 cout <<
"cwb_combine_cbc.C : zero lag livetime of BBH " 189 << livetime2 <<
" (sec) " << livetime2/(24*3600) <<
" (days) " << endl;
190 cout <<
"-----------------------------------------------------------------------------------" << endl;
197 cout <<
"Input IMBHB files : " << endl;
198 cout << ifwave[0] << endl;
201 cout <<
"Input BBH files : " << endl;
202 cout << ifwave[1] << endl;
209 if(!
simulation) cwb_combine_tag = cwb_combine_tag+TString::Format(
"_lag%d_slag%d",cwb_combine_lag,cwb_combine_slag);
211 ofwave.ReplaceAll(
".root",TString::Format(
".%s.root",cwb_combine_tag.Data()));
214 ofmdc.ReplaceAll(
"wave_",
"mdc_");
217 TString msearch = (cwb_combine_search==
"BBH") ?
"IMBHB" :
"BBH";
218 TString infos =
"("+cwb_combine_tag+
") - ( "+cwb_combine_options+
" )";
219 int err = TB.
CombineCBC(ifwave, ifmdc, ofwave, ofmdc,
nIFO, cwb_combine_fthr,
220 msearch, infos, cwb_combine_lag, cwb_combine_slag, cwb_combine_ifarthr);
222 cout <<
"cwb_combine_cbc.C : Warning - no events selected, create a symbolic link to wave file" << endl << endl;
224 int estat = gSystem->GetPathInfo(ifile1,&
id,&size,&flags,&mt);
226 char cmd[1024];
sprintf(cmd,
"ln -sf ../%s %s",ifile1.Data(),ofwave.Data());
234 ofmerge.ReplaceAll(
"wave_",
"merge_");
235 ofmerge.ReplaceAll(
".root",
".lst");
244 iflive.ReplaceAll(
"wave_",
"live_");
245 iflive.Remove(0,iflive.Last(
'/')+1);
247 oflive.ReplaceAll(
"wave_",
"live_");
248 oflive.Remove(0,oflive.Last(
'/')+1);
251 int estat = gSystem->GetPathInfo(mdir+
"/"+iflive,&
id,&size,&flags,&mt);
253 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),iflive.Data(),oflive.Data());
261 cout <<
"Output Combined files : " << endl;
262 cout << ofwave << endl;
264 else cout << mdir+
"/"+oflive << endl;
265 cout << ofmerge << endl;
TString cwb_combine_check
TString cwb_combine_mlabel
wavearray< double > Trun(500000)
float cwb_combine_ifarthr
TString cwb_combine_options
TString cwb_combine_sfthr
sprintf(cmd,"touch %s", ofmerge.Data())
TString cwb_combine_ulabel
TString cwb_combine_search
wavearray< double > Tdlag
TString cwb_combine_sifarthr
wavearray< double > Wlag[NIFO_MAX+1]
wavearray< double > Wslag[NIFO_MAX+1]