24 TB.
checkFile(gSystem->Getenv(
"CWB_ROOTLOGON_FILE"));
27 if(gSystem->Getenv(
"CWB_DUMP_HIST_FILE_NAME")==NULL) {
28 cout <<
"Error : environment CWB_DUMP_HIST_FILE_NAME is not defined!!!" << endl;
exit(1);
30 cwb_dump_hist_file_name=
TString(gSystem->Getenv(
"CWB_DUMP_HIST_FILE_NAME"));
32 if(cwb_dump_hist_file_name.Contains(
".root")==0) {
33 cout <<
"Error : " << cwb_dump_hist_file_name.Data() <<
" is not a root file!!!" << endl;
exit(1);
37 if(gSystem->Getenv(
"CWB_DUMP_HIST_MODE")!=NULL) {
38 cwb_dump_hist_mode=
TString(gSystem->Getenv(
"CWB_DUMP_HIST_MODE"));
41 TFile *
ifile = TFile::Open(cwb_dump_hist_file_name);
42 if(ifile==NULL) {cout <<
"Failed to open " << cwb_dump_hist_file_name.Data() << endl;
exit(-1);}
46 cout <<
"Error : history is not present!!!" << endl;
exit(1);
54 for(
int i=0;
i<stageList->GetSize();
i++) {
55 TObjString* stageObjString = (TObjString*)stageList->At(
i);
56 TString stageName = stageObjString->GetString();
58 bool isProcessingStage=
false;
62 if(!isProcessingStage)
continue;
63 char* stage =
const_cast<char*
>(stageName.Data());
67 config_md5 = ihistory->
GetHistory(stage,const_cast<char*>(
"PARAMETERS_MD5"));
72 if((cwb_dump_hist_mode==
"view")||(cwb_dump_hist_mode==
"dump")) {
74 TString label = (cwb_dump_hist_mode==
"dump") ?
"config" :
"view";
80 sprintf(configFile,
"%s/%s_%s",odir.Data(),label.Data(),
81 TString(((TObjString*)token->At(token->GetEntries()-1))->GetString()).
ReplaceAll(
".root",
".C").Data());
85 if (!out.good()) {cout <<
"Error Opening File : " << configFile << endl;
exit(1);}
89 if(cwb_dump_hist_mode==
"view") {
91 sprintf(cmd,
"vim %s",configFile);
94 sprintf(cmd,
"rm %s",configFile);
98 cout <<
"Write : " << configFile << endl;
102 cout << endl <<
"Config MD5 : " << config_md5.Data() << endl << endl;
static TString GetStageString(CWB_STAGE jstage)
TString cwb_dump_hist_mode
static int GetStageSize()
condor_log_dir ReplaceAll("X_HOME", uhome.Data())
TString cwb_dump_hist_file_name
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
char * GetHistory(char *StageName, char *Type)