8 TB.
checkFile(gSystem->Getenv(
"CWB_ROOTLOGON_FILE"));
9 TB.
checkFile(gSystem->Getenv(
"CWB_PARAMETERS_FILE"));
10 TB.
checkFile(gSystem->Getenv(
"CWB_UPARAMETERS_FILE"));
13 if(gSystem->Getenv(
"CWB_MERGE_LABEL")==NULL) {
14 cout <<
"Error : environment CWB_MERGE_LABEL is not defined!!!" << endl;
exit(1);
16 cwb_merge_label=
TString(gSystem->Getenv(
"CWB_MERGE_LABEL"));
23 cout <<
"Error : cwb_fix_slag_missed.C must be applied only to production files !!!" << endl;
exit(1);
27 cout << net_file_name << endl;
28 cout << liv_file_name << endl;
36 TFile *fwave = TFile::Open(net_file_name);
37 if(fwave==NULL) {cout <<
"Error opening file " << net_file_name << endl;
exit(1);}
38 TTree* twave = (TTree *) gROOT->FindObject(
"waveburst");
39 if(twave==NULL) {cout <<
"Error opening tree wave" << endl;
exit(1);}
44 TIter
next(twave->GetListOfBranches());
45 while ((branch=(TBranch*)
next())) {
46 if (
TString(
"slag").CompareTo(branch->GetName())==0) net_slag=
true;
51 TFile *
flive = TFile::Open(liv_file_name);
52 if(flive==NULL) {cout <<
"Error opening file " << liv_file_name << endl;
exit(1);}
53 TTree*
tlive = (TTree *) gROOT->FindObject(
"liveTime");
54 if(tlive==NULL) {cout <<
"Error opening tree livetime" << endl;
exit(1);}
59 TIter
next(tlive->GetListOfBranches());
60 while ((branch=(TBranch*)
next())) {
61 if (
TString(
"slag").CompareTo(branch->GetName())==0) liv_slag=
true;
64 if(liv_slag&&net_slag) {
65 cout <<
"Files " << endl;
66 cout << liv_file_name << endl;
67 cout << net_file_name << endl;
68 cout <<
"already contains slag leaf, exit" << endl;
72 if(!liv_slag&&net_slag) {
73 cout <<
"File " << net_file_name <<
" aleady contains slag leaf" << endl;
74 cout <<
"only " << liv_file_name <<
" needs to be fixed" << endl;
75 cout <<
"apply cwb_fix_live_slag_missed.C " << endl;
79 if(liv_slag&&!net_slag) {
80 cout <<
"File " << liv_file_name <<
" aleady contains slag leaf" << endl;
81 cout <<
"only " << net_file_name <<
" needs to be fixed" << endl;
82 cout <<
"something wrong during production, please check" << endl;
93 cout <<
"File " << net_file_name <<
" do not contains slag leaf" << endl;
94 cout <<
"File " << liv_file_name <<
" do not contains slag leaf" << endl;
95 cout <<
"Do you want to fix them ? (y/n) ";
98 }
while ((strcmp(answer,
"y")!=0)&&(strcmp(answer,
"n")!=0));
99 if (strcmp(answer,
"y")==0) fixit=
true;
112 if (flive_fix->IsZombie()) {
113 cout <<
"CWB::Toolbox::setVeto - Error opening file " <<
fix_liv_file_name.Data() << endl;
116 TTree *tlive_fix = (TTree*)tlive->CloneTree(0);
117 tlive_fix->SetMaxTreeSize(5000000000);
120 tlive_fix->Branch(
"slag",xslag,
"slag[6]/F");
124 tlive->SetBranchAddress(
"run",&xrun);
127 if(
i%100000==0) cout <<
i <<
"/" << ntrg_live << endl;
129 for (
int n=0;
n<
nIFO;
n++) xslag[
n] = 0.;
131 for (
int n=nIFO+1;
n<6;
n++) xslag[
n] = -1;
148 if (fwave_fix->IsZombie()) {
149 cout <<
"CWB::Toolbox::setVeto - Error opening file " <<
fix_net_file_name.Data() << endl;
152 TTree *twave_fix = (TTree*)twave->CloneTree(0);
153 twave_fix->SetMaxTreeSize(5000000000);
156 twave_fix->Branch(
"slag",xslag,
"slag[6]/F");
161 if(
i%100000==0) cout <<
i <<
"/" << ntrg_wave << endl;
163 for (
int n=0;
n<
nIFO;
n++) xslag[
n] = 0.;
165 for (
int n=nIFO+1;
n<6;
n++) xslag[
n] = -1;
179 olstfname.ReplaceAll(
"wave_",
"merge_");
180 olstfname.ReplaceAll(
".root",
".lst");
181 olstfname.Remove(0,olstfname.Last(
'/')+1);
182 cout << olstfname << endl;
185 estat = gSystem->GetPathInfo(
TString(
merge_dir)+
"/"+ilstfname,&
id,&size,&flags,&mt);
sprintf(liv_file_name,"%s/live_%s.%s.root", merge_dir, data_label, cwb_merge_label.Data())
TString fix_liv_file_name(liv_file_name)
TIter next(twave->GetListOfBranches())
TString fix_net_file_name(net_file_name)
strcpy(RunLabel, RUN_LABEL)