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;
49 if(!net_slag) {cout <<
"File " << net_file_name <<
" not contains slag leaf, apply cwb_fix_slag_missed.C " << endl;
exit(1);}
52 TFile *
flive = TFile::Open(liv_file_name);
53 if(flive==NULL) {cout <<
"Error opening file " << liv_file_name << endl;
exit(1);}
54 TTree*
tlive = (TTree *) gROOT->FindObject(
"liveTime");
55 if(tlive==NULL) {cout <<
"Error opening tree livetime" << endl;
exit(1);}
60 TIter
next(tlive->GetListOfBranches());
61 while ((branch=(TBranch*)
next())) {
62 if (
TString(
"slag").CompareTo(branch->GetName())==0) liv_slag=
true;
71 cout <<
"File " << liv_file_name <<
" do not contains slag leaf" << endl;
72 cout <<
"Do you want to fix it ? (y/n) ";
74 cout <<
"File " << liv_file_name <<
" already contains slag leaf" << endl;
75 cout <<
"Do you want to fix it anyway ? (y/n) ";
79 }
while ((strcmp(answer,
"y")!=0)&&(strcmp(answer,
"n")!=0));
80 if (strcmp(answer,
"y")==0) fixit=
true;
87 int nIFO = slagList[0].segId.size();
89 int*
ind =
new int[slagList.size()+1];
90 for(
int j=0;
j<slagList.size();
j++) {
94 ind[slagList[
j].jobId] =
j;
107 if (flive_fix->IsZombie()) {
108 cout <<
"CWB::Toolbox::setVeto - Error opening file " <<
fix_liv_file_name.Data() << endl;
111 TTree *tlive_fix = (TTree*)tlive->CloneTree(0);
112 tlive_fix->SetMaxTreeSize(5000000000);
116 tlive_fix->Branch(
"slag",xslag,
"slag[6]/F");
119 tlive_fix->SetBranchAddress(
"slag",xslag);
123 tlive->SetBranchAddress(
"run",&xrun);
124 int ntrg = tlive->GetEntries();
126 if(
i%100000==0) cout <<
i <<
"/" << ntrg << endl;
129 for (
int n=0;
n<
nIFO;
n++) xslag[
n] =
segLen*(slagList[j].segId[
n]-slagList[j].segId[0]);
130 xslag[
nIFO] = slagList[
j].slagId[0];
131 for (
int n=nIFO+1;
n<6;
n++) xslag[
n] = -1;
TString fix_net_file_name(net_file_name)
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())
cout<< endl<< endl;}while((strcmp(answer,"y")!=0)&&(strcmp(answer,"n")!=0));if(strcmp(answer,"y")==0) fixit=true;if(!fixit) exit(0);vector< waveSegment > cat1List