37 if(cwb_setifar_options.Contains(
"--")) {
41 if(cwb_setifar_tsel==
"") {
44 if(cwb_setifar_tsel==
"") {
45 cout <<
"cwb_setifar.C : Error - (--tsel) or (--xtsel) is not defined !!!" << endl << endl;
54 cwb_setifar_tsel.ReplaceAll(
"&&",
" ");
55 cwb_setifar_tsel.ReplaceAll(
"||",
" ");
56 cwb_setifar_tsel.ReplaceAll(
"(",
" ");
57 cwb_setifar_tsel.ReplaceAll(
")",
" ");
58 cwb_setifar_tsel.ReplaceAll(
"!",
" ");
61 for(
int j=0;
j<token->GetEntries();
j++){
63 TObjString* tok = (TObjString*)token->At(
j);
64 TString stok = tok->GetString();
67 TGlobal *
global=(TGlobal*)gROOT->GetListOfGlobals()->FindObject(stok.Data());
69 cout <<
"cwb_setifar.C : Error - tsel \'" << stok <<
"\' -> wrong syntax or it is not defined " << endl;
70 cout <<
" must be included in the user_pparameters.C file" << endl << endl;
73 TCut *tsel = (TCut*)global->GetAddress();
74 if(
TString(tsel->GetName())!=stok) {
75 cout <<
"cwb_setifar.C : Error - tsel \'" << stok <<
"\' not correspond to global Tcut name" << endl;
76 cout <<
" must be included in the user_pparameters.C file" << endl << endl;
80 TSEL.ReplaceAll(stok,TString::Format(
"(%s)",tsel->GetTitle()));
83 cwb_setifar_tsel = TSEL;
84 cout <<
"cwb_setifar_tsel : " << cwb_setifar_tsel << endl;
89 if(cwb_setifar_file==
"") {
92 if(cwb_setifar_file==
"") {
93 cout <<
"cwb_setifar.C : Error - (--file) or (--xfile) is not defined !!!" << endl << endl;
101 int beg_bracket = cwb_setifar_file.Index(
"[");
102 int end_bracket = cwb_setifar_file.Index(
"]");
103 int len_bracket = end_bracket-beg_bracket+1;
104 bool is_bracket=
true;
105 if(end_bracket!=cwb_setifar_file.Sizeof()-2) is_bracket=
false;
106 if(len_bracket<=0) is_bracket=
false;
108 if(!sindx.IsDigit()) is_bracket=
false;
110 int indx = is_bracket ? sindx.Atoi() : -1;
113 TGlobal *
global=(TGlobal*)gROOT->GetListOfGlobals()->FindObject(cwb_setifar_file.Data());
115 cout <<
"cwb_setifar.C : Error - setifar_file \'" << cwb_setifar_file <<
"\' -> wrong syntax or is not defined " << endl;
116 cout <<
" must be included in the user_pparameters.C file" << endl << endl;
119 int adim = global->GetArrayDim();
121 cwb_setifar_file = *(
TString*)global->GetAddress();
124 int asize = global->GetMaxIndex(0);
125 if(indx<0 || indx>=asize) {
126 cout <<
"cwb_setifar.C : Error - setifar_file \'" << cwb_setifar_file <<
"\' input array index not declared or not allowed, max=" << asize-1 << endl;
127 cout <<
" check user_pparameters.C file" << endl << endl;
131 cwb_setifar_file = afile[indx];
134 cout <<
"cwb_setifar.C : Error - setifar_file \'" << cwb_setifar_file <<
"\' array dimension > 1 not allowed " << endl;
135 cout <<
" check user_pparameters.C file" << endl << endl;
138 cout <<
"cwb_setifar_file : " << cwb_setifar_file << endl;
143 if(cwb_setifar_mode==
"") {
144 cout <<
"cwb_setifar.C : Error - --mode is not defined !!!" << endl;
150 if(cwb_setifar_label==
"") {
151 cout <<
"cwb_setifar.C : Error - --label is not defined !!!" << endl;
158 cwb_setifar_mode.ToUpper();
159 if(cwb_setifar_mode.BeginsWith(
"I")) inclusive=
true;
160 if(cwb_setifar_mode.BeginsWith(
"E")) inclusive=
false;
163 if(cwb_setifar_label==
"") {
164 cout <<
"cwb_setifar.C : Error - ifar label not defined" << endl;
168 if(cwb_setifar_label.Contains(
".")) {
169 cout <<
"cwb_setifar.C : Error - cwb_setifar_label " << cwb_setifar_label
170 <<
" can not contains '.'" << endl << endl;
181 owfname.ReplaceAll(
".root",
TString(
".S_")+cwb_setifar_label+
".root");
185 cwb_setifar_file,
pp_irho,cwb_setifar_label,inclusive);
187 cout <<
"cwb_setifar.C : Warninig - Number of selected waveburst entries = " << nsel << endl << endl;
190 cout <<
"cwb_setifar.C : Number of selected waveburst entries = " << nsel << endl;
193 if(cwb_setifar_label==
"same") {
194 sprintf(cmd,
"/bin/mv %s %s/%s", owfname.Data(), mdir.Data(), iwfname);
205 olstfname.ReplaceAll(
"wave_",
"merge_");
206 olstfname.ReplaceAll(
".root",
".lst");
207 olstfname.Remove(0,olstfname.Last(
'/')+1);
208 cout << olstfname << endl;
209 estat = gSystem->GetPathInfo(mdir+
"/"+ilstfname,&
id,&size,&flags,&mt);
221 olfname.ReplaceAll(
"wave_",
"mdc_");
222 olfname.Remove(0,olfname.Last(
'/')+1);
223 cout << olfname << endl;
224 estat = gSystem->GetPathInfo(mdir+
"/"+ilfname,&
id,&size,&flags,&mt);
226 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),ilfname,olfname.Data());
237 olfname.ReplaceAll(
"wave_",
"live_");
238 olfname.Remove(0,olfname.Last(
'/')+1);
239 cout << olfname << endl;
240 estat = gSystem->GetPathInfo(mdir+
"/"+ilfname,&
id,&size,&flags,&mt);
242 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())