test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
DQMStore.cc File Reference
#include "DQMServices/Core/interface/Standalone.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/QReport.h"
#include "DQMServices/Core/interface/QTest.h"
#include "DQMServices/Core/src/ROOTFilePB.pb.h"
#include "DQMServices/Core/src/DQMError.h"
#include "classlib/utils/RegexpMatch.h"
#include "classlib/utils/Regexp.h"
#include "classlib/utils/StringOps.h"
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/gzip_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include "TFile.h"
#include "TROOT.h"
#include "TKey.h"
#include "TClass.h"
#include "TSystem.h"
#include "TBufferFile.h"
#include <iterator>
#include <cerrno>
#include <boost/algorithm/string.hpp>
#include <fstream>
#include <sstream>
#include <exception>

Go to the source code of this file.

Functions

static void cleanTrailingSlashes (const std::string &path, std::string &clean, const std::string *&cleaned)
 
template<class T >
void initQCriterion (std::map< std::string, QCriterion *(*)(const std::string &)> &m)
 
static bool isSubdirectory (const std::string &ofdir, const std::string &path)
 
template<class T >
QCriterionmakeQCriterion (const std::string &qtname)
 
static void mergePath (std::string &path, const std::string &dir, const std::string &name)
 
static const lat::Regexp s_rxmeqr1 ("^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$")
 
static const lat::Regexp s_rxmeqr2 ("^st\\.(\\d+)\\.(.*)$")
 
static const lat::Regexp s_rxmeval ("^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$")
 
static const lat::Regexp s_rxpbfile (".*\\.pb$")
 
static const lat::Regexp s_rxself ("^[^()]*DQMStore::.*")
 
static const lat::Regexp s_rxtrace ("(.*)\\((.*)\\+0x.*\\).*")
 
static void splitPath (std::string &dir, std::string &name, const std::string &path)
 

Variables

static const std::string s_collateDirName = "Collate"
 
static const std::string s_monitorDirName = "DQMData"
 name of global monitoring folder (containing all sources subdirectories) More...
 
static const std::string s_referenceDirName = "Reference"
 
static const std::string s_safe = "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "
 

Function Documentation

static void cleanTrailingSlashes ( const std::string &  path,
std::string &  clean,
const std::string *&  cleaned 
)
static

Definition at line 81 of file DQMStore.cc.

References clean, and fed_dqm_sourceclient-live_cfg::path.

Referenced by DQMStore::cd(), DQMStore::getAllContents(), DQMStore::getContents(), DQMStore::getStatus(), DQMStore::rmdir(), DQMStore::setCurrentFolder(), DQMStore::tagAllContents(), and DQMStore::useQTest().

82 {
83  clean.clear();
84  cleaned = &path;
85 
86  size_t len = path.size();
87  for ( ; len > 0 && path[len-1] == '/'; --len)
88  ;
89 
90  if (len != path.size())
91  {
92  clean = path.substr(0, len);
93  cleaned = &clean;
94  }
95 }
std::vector< T * > clean
Definition: MVATrainer.cc:156
template<class T >
void initQCriterion ( std::map< std::string, QCriterion *(*)(const std::string &)> &  m)

Definition at line 127 of file DQMStore.cc.

References visualization-live-secondInstance_cfg::m.

128 { m[T::getAlgoName()] = &makeQCriterion<T>; }
static bool isSubdirectory ( const std::string &  ofdir,
const std::string &  path 
)
static

Check whether the path is a subdirectory of ofdir. Returns true both for an exact match and any nested subdirectory.

Definition at line 71 of file DQMStore.cc.

Referenced by DQMStore::containsAnyMonitorable(), DQMStore::extract(), DQMStore::getAllContents(), DQMStore::getAllTags(), DQMStore::getContents(), DQMStore::getMEs(), DQMStore::getStatus(), DQMStore::getSubdirs(), DQMStore::isCollateME(), DQMStore::readDirectory(), DQMStore::removeContents(), DQMStore::rmdir(), DQMStore::runQTests(), DQMStore::save(), DQMStore::savePB(), and DQMStore::tagAllContents().

72 {
73  return (ofdir.empty()
74  || (path.size() >= ofdir.size()
75  && path.compare(0, ofdir.size(), ofdir) == 0
76  && (path.size() == ofdir.size()
77  || path[ofdir.size()] == '/')));
78 }
template<class T >
QCriterion* makeQCriterion ( const std::string &  qtname)

Definition at line 122 of file DQMStore.cc.

123 { return new T(qtname); }
long double T
static void mergePath ( std::string &  path,
const std::string &  dir,
const std::string &  name 
)
static

Definition at line 111 of file DQMStore.cc.

References dir, and mergeVDriftHistosByStation::name.

Referenced by DQMStore::book(), DQMStore::getMatchingContents(), and DQMStore::useQTestByMatch().

112 {
113  path.reserve(dir.size() + name.size() + 2);
114  path += dir;
115  if (! path.empty())
116  path += '/';
117  path += name;
118 }
dbl *** dir
Definition: mlp_gen.cc:35
static const lat::Regexp s_rxmeqr1 ( "^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$"  )
static

Referenced by DQMStore::extract().

static const lat::Regexp s_rxmeqr2 ( "^st\\.(\\d+)\\.(.*)$"  )
static

Referenced by DQMStore::extract().

static const lat::Regexp s_rxmeval ( )
static

Referenced by DQMStore::extract().

static const lat::Regexp s_rxpbfile ( ".*\\.pb$"  )
static

Referenced by DQMStore::load().

static const lat::Regexp s_rxself ( "^*DQMStore::.*"  [^()])
static

Referenced by DQMStore::print_trace().

static const lat::Regexp s_rxtrace ( "(.*)\\((.*)\\+0x.*\\).*"  )
static

Referenced by DQMStore::print_trace().

static void splitPath ( std::string &  dir,
std::string &  name,
const std::string &  path 
)
static

Definition at line 98 of file DQMStore.cc.

References fed_dqm_sourceclient-live_cfg::path, and pickleFileParser::slash.

Referenced by DQMStore::get(), and DQMStore::tag().

99 {
100  size_t slash = path.rfind('/');
101  if (slash != std::string::npos)
102  {
103  dir.append(path, 0, slash);
104  name.append(path, slash+1, std::string::npos);
105  }
106  else
107  name = path;
108 }
dbl *** dir
Definition: mlp_gen.cc:35

Variable Documentation

const std::string s_collateDirName = "Collate"
static

Definition at line 57 of file DQMStore.cc.

Referenced by DQMStore::isCollateME(), and DQMStore::readDirectory().

const std::string s_monitorDirName = "DQMData"
static

name of global monitoring folder (containing all sources subdirectories)

Definition at line 55 of file DQMStore.cc.

Referenced by DQMStore::readDirectory(), and DQMStore::save().

const std::string s_referenceDirName = "Reference"
static
const std::string s_safe = "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "
static

Definition at line 58 of file DQMStore.cc.

Referenced by DQMStore::findObject(), and DQMStore::useQTest().