CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 48 of file check_runcomplete.cc.

References gpuVertexFinder::printf(), and read_runflag().

Referenced by main().

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

Definition at line 72 of file check_runcomplete.cc.

References fileCollector::dqmfile, submitPVResolutionJobs::key, GetRecoTauVFromDQM_MC_cff::next, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by check_runcomplete().

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