7 TB.
checkFile(gSystem->Getenv(
"CWB_ROOTLOGON_FILE"));
8 TB.
checkFile(gSystem->Getenv(
"CWB_PARAMETERS_FILE"));
9 TB.
checkFile(gSystem->Getenv(
"CWB_UPARAMETERS_FILE"));
12 if(gSystem->Getenv(
"CWB_MERGE_LABEL")==NULL) {
13 cout <<
"Error : environment CWB_MERGE_LABEL is not defined!!!" << endl;
exit(1);
15 cwb_merge_label=
TString(gSystem->Getenv(
"CWB_MERGE_LABEL"));
19 if(cwb_merge_label[0]!=
'M') {
20 cout <<
"Error : label " << cwb_merge_label.Data() <<
" has bad format (M#)" << endl;
exit(1);
24 if(!lcheck.IsDigit()) {
25 cout <<
"Error : label " << cwb_merge_label.Data() <<
" has bad format (M#)" << endl;
exit(1);
27 cwb_merge_number=lcheck.Atoi();
39 if(cwb_merge_opts!=
"") {
44 cwb_bpsm = (option==
"TRUE") ?
true :
false;
48 cwb_brms = (option==
"TRUE") ?
true :
false;
52 cwb_bvar = (option==
"TRUE") ?
true :
false;
56 if(!option.IsDigit()) {
57 cout << endl <<
"cwb_merge.C : Error - --nthread argument '"
58 << option <<
"' is not a number" << endl << endl;
61 cwb_nthreads = option.Atoi();
69 if(option!=
"") cwb_utag = option;
78 if(cwb_utag!=
"") mtag = TString::Format(
".%s.U_%s.root",cwb_merge_label.Data(),cwb_utag.Data());
79 else mtag = TString::Format(
".%s.root",cwb_merge_label.Data());
80 if(cwb_merge_label.CompareTo(
"M0")!=0) {
82 for(
int i=0;
i<fileList.size();
i++) {
83 if(fileList[
i].Contains(mtag)) {
84 cout <<
"Ecwb_merge.C : Error - merge label " << cwb_merge_label <<
" already exist" << endl << endl;
91 int ipos = (cwb_utag==
"") ? 2 : 3;
92 for(
int i=0;
i<fileList.size();
i++) {
93 cout <<
i <<
" " << fileList[
i].Data() << endl;
94 if(cwb_utag!=
"")
if(!fileList[
i].Contains(TString::Format(
".U_%s",cwb_utag.Data())))
continue;
95 if(fileList[
i].Contains(
".root")) {
97 TString srescueID = ((TObjString*)token->At(token->GetEntries()-
ipos))->GetString();
99 srescueID.ReplaceAll(
"M",
"");
100 if(srescueID.IsDigit()) {
102 int rescueID = srescueID.Atoi();
103 if(iversion<rescueID) iversion=rescueID;
109 if(cwb_merge_number==0 || cwb_merge_number>=iversion) {
112 cout << endl <<
"cwb_merge.C : Error - the input merge version (M" << cwb_merge_number
113 <<
") must be greater of the most recent merge version (M" << iversion-1 <<
")" << endl << endl;
119 char cmd[128];
sprintf(cmd,
"iversion = %d",iversion);
122 gROOT->Macro(gSystem->ExpandPathName(
"$CWB_MACROS/cwb_merge_log.C"));
127 cout <<
"Start merging to file : " << new_data_label << endl << endl;
128 vector<TString> mergeList;
129 if(cwb_nthreads<=1) {
148 int estat = gSystem->GetPathInfo(condor_dag_file,&
id,&size,&
flags,&mt);
152 int ncondor_jobs = jobList.size();
153 cout << endl <<
"Merged files : " << mergeList.size() <<
"/" <<
nfactor*ncondor_jobs << endl << endl;
161 if(cwb_utag!=
"") gSystem->Exit(0);
163 char wave_name[1024];
sprintf(wave_name,
"%s/wave_%s.root",
merge_dir,new_data_label);
164 TFile *
ifile = TFile::Open(wave_name);
165 if(ifile==NULL) {cout <<
"Failed to open " << wave_name << endl;
exit(1);}
169 cout <<
"Error : history is not present!!!" << endl;
exit(1);
177 for(
int i=0;
i<stageList->GetSize();
i++) {
178 TObjString* stageObjString = (TObjString*)stageList->At(
i);
179 TString stageName = stageObjString->GetString();
181 bool isProcessingStage=
false;
185 if(!isProcessingStage)
continue;
186 char* stage =
const_cast<char*
>(stageName.Data());
198 if (!out.good()) {cout <<
"Error Opening File : " << configFile << endl;
exit(1);}
199 out << config.Data();
char merge_list_file[256]
cout<< "skymap size : "<< L<< endl;for(int l=0;l< L;l++) sm.set(l, l);sm > const_cast< char * >("skymap.dat")
char condor_dag_file[256]
static TString GetStageString(CWB_STAGE jstage)
static int GetStageSize()
sprintf(tag,"wave_%s", data_label)
#define EXPORT(TYPE, VAR, CMD)
strcpy(RunLabel, RUN_LABEL)
vector< TString > fileList
char * GetHistory(char *StageName, char *Type)
char full_condor_dir[512]