43 if(cwb_setcuts_options.Contains(
"--")) {
46 cwb_tcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--tcuts");
48 cwb_wcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--wcuts");
50 cwb_jcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--jcuts");
52 cwb_mcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--mcuts");
54 cwb_lcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--lcuts");
56 cwb_cuts_label = TB.
getParameter(cwb_setcuts_options,
"--label");
58 cwb_unique_evt = TB.
getParameter(cwb_setcuts_options,
"--unique");
61 if(cwb_tcuts_tree!=
"") {
63 TGlobal *
global=(TGlobal*)gROOT->GetListOfGlobals()->FindObject(cwb_tcuts_tree.Data());
65 cout <<
"cwb_setcuts.C : Error - tcut " << cwb_tcuts_tree <<
" is not defined " << endl;
66 cout <<
" must be included in the user_pparameters.C file" << endl;
69 TCut *tcut = (TCut*)global->GetAddress();
70 if(
TString(tcut->GetName())!=cwb_tcuts_tree) {
71 cout <<
"cwb_setcuts.C : Error - tcut " << cwb_tcuts_tree <<
" not correspond to global Tcut name" << endl;
72 cout <<
" must be included in the user_pparameters.C file" << endl;
75 cwb_tcuts_tree = tcut->GetTitle();
76 cout <<
"cwb_tcuts_tree : " << cwb_tcuts_tree << endl;
77 if(cwb_wcuts_tree==
"") {
81 cwb_wcuts =
TString(
"(")+cwb_wcuts_tree+
")&&("+cwb_tcuts_tree+
")";
82 cwb_wcuts_tree = cwb_wcuts;
84 cout <<
"cwb_wcuts_tree : " << cwb_wcuts_tree << endl;
88 cout <<
"cwb_setcuts.C : Error - unique option can be applied only to simulated data" << endl;
92 if((cwb_wcuts_tree!=
"")&&(cwb_cuts_label==
"")) {
93 cout <<
"cwb_setcuts.C : Error - cuts label not defined" << endl;
97 if(cwb_cuts_label.Contains(
".")) {
98 cout <<
"cwb_setcuts.C : Error - cwb_cuts_label " << cwb_cuts_label
99 <<
" can not contains '.'" << endl << endl;
103 if(cwb_wcuts_tree.Contains(
"run")) {
104 cout <<
"cwb_setcuts.C : Error - cwb_wcuts_tree " << cwb_jcuts_tree
105 <<
" can not contains leaf : run" << endl << endl;
109 if(cwb_wcuts_tree.Contains(
"slag")) {
110 cout <<
"cwb_setcuts.C : Error - cwb_wcuts_tree " << cwb_jcuts_tree
111 <<
" can not contains leaf : slag" << endl << endl;
115 if(cwb_wcuts_tree.Contains(
"lag")) {
116 cout <<
"cwb_setcuts.C : Error - cwb_wcuts_tree " << cwb_jcuts_tree
117 <<
" can not contains leaf : lag" << endl << endl;
120 if(cwb_wcuts_tree==
"") cwb_wcuts_tree=
"run>0";
121 if(cwb_jcuts_tree==
"") cwb_jcuts_tree=
"run>0";
125 cwb_wcuts =
TString(
"(")+cwb_wcuts_tree+
")&&("+cwb_jcuts_tree+
")";
126 if(cwb_lcuts_tree!=
"") cwb_wcuts =
TString(
"(")+cwb_wcuts+
")&&("+cwb_lcuts_tree+
")";
131 cwb_mcuts =
TString(
"(")+cwb_mcuts_tree+
")&&("+cwb_jcuts_tree+
")";
140 TString uwfname = mdir+
"/"+iwfname;
141 uwfname.ReplaceAll(
".root",
TString(
".C_U.root"));
145 if(cwb_unique_evt==
"true") {
151 omfname.ReplaceAll(
"wave_",
"mdc_");
152 omfname.Remove(0,omfname.Last(
'/')+1);
153 cout << omfname << endl;
154 estat = gSystem->GetPathInfo(mdir+
"/"+imfname,&
id,&size,&flags,&mt);
156 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),imfname,omfname.Data());
164 olstfname.ReplaceAll(
"wave_",
"merge_");
165 olstfname.ReplaceAll(
".root",
".lst");
166 olstfname.Remove(0,olstfname.Last(
'/')+1);
167 cout << olstfname << endl;
168 estat = gSystem->GetPathInfo(mdir+
"/"+ilstfname,&
id,&size,&flags,&mt);
175 if((cwb_wcuts_tree=
"")&&(cwb_cuts_label==
""))
exit(0);
177 if(cwb_unique_evt==
"true") {
184 owfname.ReplaceAll(
".root",
TString(
".C_")+cwb_cuts_label+
".root");
191 olstfname.ReplaceAll(
"wave_",
"merge_");
192 olstfname.ReplaceAll(
".root",
".lst");
193 olstfname.Remove(0,olstfname.Last(
'/')+1);
194 cout << olstfname << endl;
195 if(cwb_jcuts_tree==
"") {
196 estat = gSystem->GetPathInfo(mdir+
"/"+ilstfname,&
id,&size,&flags,&mt);
204 vector<TString> jobFileList;
206 cout <<
"Number of jobs in the merged lists : " << jobList.size() << endl;
208 TTree jtree(
"jtree",
"jtree");
209 int run; jtree.Branch(
"run",&run,
"run/I");
211 jtree.Branch(
"jfname", &jfname);
213 for(
int i=0;
i<jobList.size();
i++) {run=jobList[
i]; *jfname=jobFileList[
i]; jtree.Fill();}
215 TTreeFormula
formula(
"trCuts", cwb_jcuts_tree.Data(), &jtree);
216 int err =
formula.Compile(cwb_jcuts_tree.Data());
218 cout <<
"cwb_setcuts.C - wrong input cuts " << cwb_jcuts_tree << endl << endl;
222 jtree.Draw(
"Entry$",cwb_jcuts_tree.Data(),
"goff");
223 int jsel = jtree.GetSelectedRows();
228 jtree.GetEntry(entry[
i]);
230 jobList.push_back(run);
231 jobFileList.push_back(jfname->Data());
239 cout <<
"cwb_setcuts.C : Error - Number of selected waveburst entries = " << nsel << endl << endl;
242 cout <<
"cwb_setcuts.C : Number of selected waveburst entries = " << nsel << endl;
249 cout <<
"cwb_setcuts.C : Number of selected mdc entries = " << nsel << endl << endl;
252 omfname.ReplaceAll(
"wave_",
"mdc_");
253 omfname.Remove(0,omfname.Last(
'/')+1);
254 cout << omfname << endl;
255 estat = gSystem->GetPathInfo(mdir+
"/"+imfname,&
id,&size,&flags,&mt);
257 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),imfname,omfname.Data());
269 if(cwb_lcuts_tree!=
"") cwb_live_cuts =
TString(
"(")+cwb_live_cuts+
")&&("+cwb_lcuts_tree+
")";
271 if(cwb_live_cuts!=
"run>0") {
273 cout <<
"cwb_setcuts.C : Number of selected live entries = " << nsel << endl;
277 olfname.ReplaceAll(
"wave_",
"live_");
278 olfname.Remove(0,olfname.Last(
'/')+1);
279 cout << olfname << endl;
280 estat = gSystem->GetPathInfo(mdir+
"/"+ilfname,&
id,&size,&flags,&mt);
282 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),ilfname,olfname.Data());
sprintf(ilstfname,"merge_%s.%s.lst", data_label, cwb_merge_label.Data())
TString cwb_setcuts_options