19 if(cwb_setifar_options.Contains(
"--")) {
23 if(cwb_setifar_tsel==
"") {
26 if(cwb_setifar_tsel==
"") {
27 cout <<
"cwb_setifar.C : Error - (--tsel) or (--xtsel) is not defined !!!" << endl << endl;
36 cwb_setifar_tsel.ReplaceAll(
"&&",
" ");
37 cwb_setifar_tsel.ReplaceAll(
"||",
" ");
38 cwb_setifar_tsel.ReplaceAll(
"(",
" ");
39 cwb_setifar_tsel.ReplaceAll(
")",
" ");
40 cwb_setifar_tsel.ReplaceAll(
"!",
" ");
43 for(
int j=0;
j<token->GetEntries();
j++){
45 TObjString* tok = (TObjString*)token->At(
j);
46 TString stok = tok->GetString();
49 TGlobal *
global=(TGlobal*)gROOT->GetListOfGlobals()->FindObject(stok.Data());
51 cout <<
"cwb_setifar.C : Error - tsel \'" << stok <<
"\' -> wrong syntax or it is not defined " << endl;
52 cout <<
" must be included in the user_pparameters.C file" << endl << endl;
55 TCut *tsel = (TCut*)global->GetAddress();
56 if(
TString(tsel->GetName())!=stok) {
57 cout <<
"cwb_setifar.C : Error - tsel \'" << stok <<
"\' not correspond to global Tcut name" << endl;
58 cout <<
" must be included in the user_pparameters.C file" << endl << endl;
62 TSEL.ReplaceAll(stok,TString::Format(
"(%s)",tsel->GetTitle()));
65 cwb_setifar_tsel = TSEL;
66 cout <<
"cwb_setifar_tsel : " << cwb_setifar_tsel << endl;
71 if(cwb_setifar_file==
"") {
74 if(cwb_setifar_file==
"") {
75 cout <<
"cwb_setifar.C : Error - (--file) or (--xfile) is not defined !!!" << endl << endl;
83 int beg_bracket = cwb_setifar_file.Index(
"[");
84 int end_bracket = cwb_setifar_file.Index(
"]");
85 int len_bracket = end_bracket-beg_bracket+1;
87 if(end_bracket!=cwb_setifar_file.Sizeof()-2) is_bracket=
false;
88 if(len_bracket<=0) is_bracket=
false;
90 if(!sindx.IsDigit()) is_bracket=
false;
92 int indx = is_bracket ? sindx.Atoi() : -1;
95 TGlobal *
global=(TGlobal*)gROOT->GetListOfGlobals()->FindObject(cwb_setifar_file.Data());
97 cout <<
"cwb_setifar.C : Error - setifar_file \'" << cwb_setifar_file <<
"\' -> wrong syntax or is not defined " << endl;
98 cout <<
" must be included in the user_pparameters.C file" << endl << endl;
101 int adim = global->GetArrayDim();
103 cwb_setifar_file = *(
TString*)global->GetAddress();
106 int asize = global->GetMaxIndex(0);
107 if(indx<0 || indx>=asize) {
108 cout <<
"cwb_setifar.C : Error - setifar_file \'" << cwb_setifar_file <<
"\' input array index not declared or not allowed, max=" << asize-1 << endl;
109 cout <<
" check user_pparameters.C file" << endl << endl;
113 cwb_setifar_file = afile[indx];
116 cout <<
"cwb_setifar.C : Error - setifar_file \'" << cwb_setifar_file <<
"\' array dimension > 1 not allowed " << endl;
117 cout <<
" check user_pparameters.C file" << endl << endl;
120 cout <<
"cwb_setifar_file : " << cwb_setifar_file << endl;
125 if(cwb_setifar_mode==
"") {
126 cout <<
"cwb_setifar.C : Error - --mode is not defined !!!" << endl;
132 if(cwb_setifar_label==
"") {
133 cout <<
"cwb_setifar.C : Error - --label is not defined !!!" << endl;
140 cwb_setifar_mode.ToUpper();
141 if(cwb_setifar_mode.BeginsWith(
"I")) inclusive=
true;
142 if(cwb_setifar_mode.BeginsWith(
"E")) inclusive=
false;
145 if(cwb_setifar_label==
"") {
146 cout <<
"cwb_setifar.C : Error - ifar label not defined" << endl;
150 if(cwb_setifar_label.Contains(
".")) {
151 cout <<
"cwb_setifar.C : Error - cwb_setifar_label " << cwb_setifar_label
152 <<
" can not contains '.'" << endl << endl;
163 owfname.ReplaceAll(
".root",
TString(
".S_")+cwb_setifar_label+
".root");
167 cwb_setifar_file,
pp_irho,cwb_setifar_label,inclusive);
169 cout <<
"cwb_setifar.C : Warninig - Number of selected waveburst entries = " << nsel << endl << endl;
172 cout <<
"cwb_setifar.C : Number of selected waveburst entries = " << nsel << endl;
175 if(cwb_setifar_label==
"same") {
176 sprintf(cmd,
"/bin/mv %s %s/%s", owfname.Data(), mdir.Data(), iwfname);
187 olstfname.ReplaceAll(
"wave_",
"merge_");
188 olstfname.ReplaceAll(
".root",
".lst");
189 olstfname.Remove(0,olstfname.Last(
'/')+1);
190 cout << olstfname << endl;
191 estat = gSystem->GetPathInfo(mdir+
"/"+ilstfname,&
id,&size,&flags,&mt);
203 olfname.ReplaceAll(
"wave_",
"mdc_");
204 olfname.Remove(0,olfname.Last(
'/')+1);
205 cout << olfname << endl;
206 estat = gSystem->GetPathInfo(mdir+
"/"+ilfname,&
id,&size,&flags,&mt);
208 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),ilfname,olfname.Data());
219 olfname.ReplaceAll(
"wave_",
"live_");
220 olfname.Remove(0,olfname.Last(
'/')+1);
221 cout << olfname << endl;
222 estat = gSystem->GetPathInfo(mdir+
"/"+ilfname,&
id,&size,&flags,&mt);
224 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),ilfname,olfname.Data());
TString cwb_setifar_label
TString cwb_setifar_options
sprintf(ilstfname,"merge_%s.%s.lst", data_label, cwb_merge_label.Data())