CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
check_runcomplete.h File Reference
#include <string>

Go to the source code of this file.

Functions

int check_runcomplete (std::string)
 
int read_runflag (std::string)
 

Function Documentation

int check_runcomplete ( std::string  )

Definition at line 47 of file check_runcomplete.cc.

References read_runflag().

Referenced by main().

48 {
49  int runflag = read_runflag ( filename );
50  if ( runflag == 1 )
51  {
52  printf("************************************\n");
53  printf("**\n");
54  printf("** W A R N I N G: the DQM file %s does not exist" , filename.c_str() );
55  printf("**\n");
56  printf("************************************\n");
57  }
58  else if ( runflag == 2 )
59  {
60  printf("************************************\n");
61  printf("**\n");
62  printf("** W A R N I N G: the DQM file %s is incomplete" , filename.c_str() );
63  printf("**\n");
64  printf("************************************\n");
65  }
66  else if ( runflag != 0 )
67  {
68  printf("************************************\n");
69  printf("**\n");
70  printf("** W A R N I N G: problems found in the DQM file %s" , filename.c_str() );
71  printf("**\n");
72  printf("************************************\n");
73  }
74  return runflag;
75 }
int read_runflag(std::string filename)
tuple filename
Definition: lut2db_cfg.py:20
int read_runflag ( std::string  )

Definition at line 77 of file check_runcomplete.cc.

References combine::key, and GetRecoTauVFromDQM_MC_cff::next.

Referenced by check_runcomplete().

78 {
79  std::string nrun = filename.substr ( filename.find( "_R000" ) + 5 , 6 );
80 
81  TFile *dqmfile = TFile::Open ( filename.c_str() , "READ" );
82 
83  if(dqmfile==0) return 1;
84 
85  std::string infodir = "DQMData/Run " + nrun + "/Info/Run summary/ProvInfo";
86  gDirectory->cd(infodir.c_str());
87 
88  TIter next ( gDirectory->GetListOfKeys() );
89  TKey *key;
90 
91  int isruncomplete = -1;
92 
93  while ( ( key = dynamic_cast<TKey*> ( next() ) ) )
94  {
95  std::string svar = key->GetName();
96  if ( svar.size() == 0 ) continue;
97 
98  if ( svar.find( "runIsComplete" ) != std::string::npos )
99  {
100  std::string statusflag = svar.substr ( svar.rfind ( "<" ) -1 , 1 );
101  isruncomplete = atoi ( statusflag.c_str() );
102  }
103  }
104 
105  dqmfile->Close();
106 
107  if(isruncomplete == -1) return 3;
108  if(isruncomplete == 0) return 2;
109  if(isruncomplete == 1) return 0;
110 
111  return -8;
112 }
list key
Definition: combine.py:13
tuple filename
Definition: lut2db_cfg.py:20