2 #include <TDirectory.h> 12 #include <TPaveStats.h> 31 char* cfile = argv[1];
33 std::cout <<
"ready to check file " << cfile << std::endl;
36 if(returncode==0)
std::cout <<
"DQM file is ok" << std::endl;
41 else {
std::cout <<
"Too few arguments: " << argc << std::endl;
return -1; }
52 printf(
"************************************\n");
54 printf(
"** W A R N I N G: the DQM file %s does not exist" , filename.c_str() );
56 printf(
"************************************\n");
58 else if ( runflag == 2 )
60 printf(
"************************************\n");
62 printf(
"** W A R N I N G: the DQM file %s is incomplete" , filename.c_str() );
64 printf(
"************************************\n");
66 else if ( runflag != 0 )
68 printf(
"************************************\n");
70 printf(
"** W A R N I N G: problems found in the DQM file %s" , filename.c_str() );
72 printf(
"************************************\n");
79 std::string nrun = filename.substr ( filename.find(
"_R000" ) + 5 , 6 );
81 TFile *dqmfile = TFile::Open ( filename.c_str() ,
"READ" );
83 if(dqmfile==0)
return 1;
85 std::string infodir =
"DQMData/Run " + nrun +
"/Info/Run summary/ProvInfo";
86 gDirectory->cd(infodir.c_str());
88 TIter
next ( gDirectory->GetListOfKeys() );
91 int isruncomplete = -1;
93 while ( ( key = dynamic_cast<TKey*> (
next() ) ) )
96 if ( svar.size() == 0 )
continue;
98 if ( svar.find(
"runIsComplete" ) != std::string::npos )
100 std::string statusflag = svar.substr ( svar.rfind (
"<" ) -1 , 1 );
101 isruncomplete = atoi ( statusflag.c_str() );
107 if(isruncomplete == -1)
return 3;
108 if(isruncomplete == 0)
return 2;
109 if(isruncomplete == 1)
return 0;
int check_runcomplete(std::string filename)
int read_runflag(std::string filename)
int main(int argc, char *argv[])