25 if(cwb_setcuts_options.Contains(
"--")) {
28 cwb_tcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--tcuts");
30 cwb_wcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--wcuts");
32 cwb_jcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--jcuts");
34 cwb_mcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--mcuts");
36 cwb_lcuts_tree = TB.
getParameter(cwb_setcuts_options,
"--lcuts");
38 cwb_cuts_label = TB.
getParameter(cwb_setcuts_options,
"--label");
40 cwb_unique_evt = TB.
getParameter(cwb_setcuts_options,
"--unique");
43 if(cwb_tcuts_tree!=
"") {
45 TGlobal *
global=(TGlobal*)gROOT->GetListOfGlobals()->FindObject(cwb_tcuts_tree.Data());
47 cout <<
"cwb_setcuts.C : Error - tcut " << cwb_tcuts_tree <<
" is not defined " << endl;
48 cout <<
" must be included in the user_pparameters.C file" << endl;
51 TCut *tcut = (TCut*)global->GetAddress();
52 if(
TString(tcut->GetName())!=cwb_tcuts_tree) {
53 cout <<
"cwb_setcuts.C : Error - tcut " << cwb_tcuts_tree <<
" not correspond to global Tcut name" << endl;
54 cout <<
" must be included in the user_pparameters.C file" << endl;
57 cwb_tcuts_tree = tcut->GetTitle();
58 cout <<
"cwb_tcuts_tree : " << cwb_tcuts_tree << endl;
59 if(cwb_wcuts_tree==
"") {
63 cwb_wcuts =
TString(
"(")+cwb_wcuts_tree+
")&&("+cwb_tcuts_tree+
")";
64 cwb_wcuts_tree = cwb_wcuts;
66 cout <<
"cwb_wcuts_tree : " << cwb_wcuts_tree << endl;
70 cout <<
"cwb_setcuts.C : Error - unique option can be applied only to simulated data" << endl;
74 if((cwb_wcuts_tree!=
"")&&(cwb_cuts_label==
"")) {
75 cout <<
"cwb_setcuts.C : Error - cuts label not defined" << endl;
79 if(cwb_cuts_label.Contains(
".")) {
80 cout <<
"cwb_setcuts.C : Error - cwb_cuts_label " << cwb_cuts_label
81 <<
" can not contains '.'" << endl << endl;
85 if(cwb_wcuts_tree.Contains(
"run")) {
86 cout <<
"cwb_setcuts.C : Error - cwb_wcuts_tree " << cwb_jcuts_tree
87 <<
" can not contains leaf : run" << endl << endl;
91 if(cwb_wcuts_tree.Contains(
"slag")) {
92 cout <<
"cwb_setcuts.C : Error - cwb_wcuts_tree " << cwb_jcuts_tree
93 <<
" can not contains leaf : slag" << endl << endl;
97 if(cwb_wcuts_tree.Contains(
"lag")) {
98 cout <<
"cwb_setcuts.C : Error - cwb_wcuts_tree " << cwb_jcuts_tree
99 <<
" can not contains leaf : lag" << endl << endl;
102 if(cwb_wcuts_tree==
"") cwb_wcuts_tree=
"run>0";
103 if(cwb_jcuts_tree==
"") cwb_jcuts_tree=
"run>0";
107 cwb_wcuts =
TString(
"(")+cwb_wcuts_tree+
")&&("+cwb_jcuts_tree+
")";
108 if(cwb_lcuts_tree!=
"") cwb_wcuts =
TString(
"(")+cwb_wcuts+
")&&("+cwb_lcuts_tree+
")";
113 cwb_mcuts =
TString(
"(")+cwb_mcuts_tree+
")&&("+cwb_jcuts_tree+
")";
122 TString uwfname = mdir+
"/"+iwfname;
123 uwfname.ReplaceAll(
".root",
TString(
".C_U.root"));
127 if(cwb_unique_evt==
"true") {
133 omfname.ReplaceAll(
"wave_",
"mdc_");
134 omfname.Remove(0,omfname.Last(
'/')+1);
135 cout << omfname << endl;
136 estat = gSystem->GetPathInfo(mdir+
"/"+imfname,&
id,&size,&flags,&mt);
138 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),imfname,omfname.Data());
146 olstfname.ReplaceAll(
"wave_",
"merge_");
147 olstfname.ReplaceAll(
".root",
".lst");
148 olstfname.Remove(0,olstfname.Last(
'/')+1);
149 cout << olstfname << endl;
150 estat = gSystem->GetPathInfo(mdir+
"/"+ilstfname,&
id,&size,&flags,&mt);
157 if((cwb_wcuts_tree=
"")&&(cwb_cuts_label==
""))
exit(0);
159 if(cwb_unique_evt==
"true") {
166 owfname.ReplaceAll(
".root",
TString(
".C_")+cwb_cuts_label+
".root");
173 olstfname.ReplaceAll(
"wave_",
"merge_");
174 olstfname.ReplaceAll(
".root",
".lst");
175 olstfname.Remove(0,olstfname.Last(
'/')+1);
176 cout << olstfname << endl;
177 if(cwb_jcuts_tree==
"") {
178 estat = gSystem->GetPathInfo(mdir+
"/"+ilstfname,&
id,&size,&flags,&mt);
186 vector<TString> jobFileList;
188 cout <<
"Number of jobs in the merged lists : " << jobList.size() << endl;
190 TTree jtree(
"jtree",
"jtree");
191 int run; jtree.Branch(
"run",&run,
"run/I");
193 jtree.Branch(
"jfname", &jfname);
195 for(
int i=0;
i<jobList.size();
i++) {run=jobList[
i]; *jfname=jobFileList[
i]; jtree.Fill();}
197 TTreeFormula
formula(
"trCuts", cwb_jcuts_tree.Data(), &jtree);
198 int err =
formula.Compile(cwb_jcuts_tree.Data());
200 cout <<
"cwb_setcuts.C - wrong input cuts " << cwb_jcuts_tree << endl << endl;
204 jtree.Draw(
"Entry$",cwb_jcuts_tree.Data(),
"goff");
205 int jsel = jtree.GetSelectedRows();
210 jtree.GetEntry(entry[
i]);
212 jobList.push_back(run);
213 jobFileList.push_back(jfname->Data());
221 cout <<
"cwb_setcuts.C : Error - Number of selected waveburst entries = " << nsel << endl << endl;
224 cout <<
"cwb_setcuts.C : Number of selected waveburst entries = " << nsel << endl;
231 cout <<
"cwb_setcuts.C : Number of selected mdc entries = " << nsel << endl << endl;
234 omfname.ReplaceAll(
"wave_",
"mdc_");
235 omfname.Remove(0,omfname.Last(
'/')+1);
236 cout << omfname << endl;
237 estat = gSystem->GetPathInfo(mdir+
"/"+imfname,&
id,&size,&flags,&mt);
239 sprintf(cmd,
"cd %s;ln -sf %s %s",mdir.Data(),imfname,omfname.Data());
251 if(cwb_lcuts_tree!=
"") cwb_live_cuts =
TString(
"(")+cwb_live_cuts+
")&&("+cwb_lcuts_tree+
")";
253 if(cwb_live_cuts!=
"run>0") {
255 cout <<
"cwb_setcuts.C : Number of selected live entries = " << nsel << endl;
259 olfname.ReplaceAll(
"wave_",
"live_");
260 olfname.Remove(0,olfname.Last(
'/')+1);
261 cout << olfname << endl;
262 estat = gSystem->GetPathInfo(mdir+
"/"+ilfname,&
id,&size,&flags,&mt);
264 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