7 #include "classlib/utils/RegexpMatch.h" 8 #include "classlib/utils/Regexp.h" 9 #include "classlib/utils/StringOps.h" 10 #include <google/protobuf/io/coded_stream.h> 11 #include <google/protobuf/io/gzip_stream.h> 12 #include <google/protobuf/io/zero_copy_stream_impl.h> 18 #include "TBufferFile.h" 19 #include <boost/algorithm/string.hpp> 20 #include <boost/range/iterator_range_core.hpp> 62 std::string const s_safe{
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "};
64 lat::Regexp
const s_rxmeval{
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$"};
65 lat::Regexp
const s_rxmeqr1{
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$"};
66 lat::Regexp
const s_rxmeqr2{
"^st\\.(\\d+)\\.(.*)$"};
67 lat::Regexp
const s_rxtrace{
"(.*)\\((.*)\\+0x.*\\).*"};
68 lat::Regexp
const s_rxself{
"^[^()]*DQMStore::.*"};
69 lat::Regexp
const s_rxpbfile{
".*\\.pb$"};
80 || (path.size() >= ofdir.size()
81 && path.compare(0, ofdir.size(), ofdir) == 0
82 && (path.size() == ofdir.size()
83 || path[ofdir.size()] ==
'/')));
92 size_t len = path.size();
93 for ( ; len > 0 && path[len-1] ==
'/'; --len)
96 if (len != path.size()) {
97 clean = path.substr(0, len);
105 size_t slash = path.rfind(
'/');
106 if (slash != std::string::npos) {
107 dir.append(path, 0, slash);
108 name.append(path, slash+1, std::string::npos);
117 path.reserve(dir.size() + name.size() + 2);
128 return new T{qtname};
135 m[T::getAlgoName()] = &makeQCriterion<T>;
149 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality" 154 size_t starCount = 0;
158 if ((
size_t)pos == std::string::npos)
164 if ((
fastString_.find(
'"') != std::string::npos) ||
174 if (starCount == 1) {
175 if (boost::algorithm::starts_with(
fastString_,
"*")) {
181 if (boost::algorithm::ends_with(
fastString_,
"*")) {
189 if (starCount == 2) {
190 if (boost::algorithm::starts_with(
fastString_,
"*") &&
203 if (input.size() < pattern.size())
209 auto rit_pattern = pattern.crbegin();
210 auto rit_input = input.crbegin();
212 for (; rit_pattern < pattern.rend(); ++rit_pattern, ++rit_input) {
213 if (*rit_pattern != *rit_input)
223 if (input.size() < pattern.size())
229 auto rit_pattern = pattern.cbegin();
230 auto rit_input = input.cbegin();
232 for (; rit_pattern < pattern.end(); ++rit_pattern, ++rit_input) {
233 if (*rit_pattern != *rit_input)
270 owner_->setCurrentFolder(fullpath);
280 return owner_->pwd();
285 owner_->tag(me, tag);
290 owner_->tagContents(path, myTag);
294 std::vector<MonitorElement*>
297 uint32_t
const lumi )
299 return owner_->getAllContents(path, run, lumi);
305 return owner_->get(path);
312 if (ptr ==
nullptr) {
313 std::stringstream
msg;
314 msg <<
"DQM object not found";
319 throw std::out_of_range(msg.str());
324 std::vector<std::string>
327 return owner_->getSubdirs();
330 std::vector<std::string>
333 return owner_->getMEs();
339 return owner_->containsAnyMonitorable(path);
345 return owner_->dirExists(path);
363 owner_->setCurrentFolder(fullpath);
375 if(
pset.getUntrackedParameter<
bool>(
"forceResetOnBeginRun",
false)) {
396 delete qtestspec.first;
416 std::cout <<
"DQMStore: histogram collation is enabled\n";
420 std::cout <<
"DQMStore: MultiThread option is enabled\n";
424 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
428 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
432 initQCriterion<Comp2RefChi2>(
qalgos_);
433 initQCriterion<Comp2Ref2DChi2>(
qalgos_);
434 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
435 initQCriterion<ContentsXRange>(
qalgos_);
436 initQCriterion<ContentsYRange>(
qalgos_);
437 initQCriterion<MeanWithinExpected>(
qalgos_);
438 initQCriterion<Comp2RefEqualH>(
qalgos_);
439 initQCriterion<DeadChannel>(
qalgos_);
440 initQCriterion<NoisyChannel>(
qalgos_);
441 initQCriterion<ContentSigma>(
qalgos_);
442 initQCriterion<ContentsWithinExpected>(
qalgos_);
443 initQCriterion<CompareToMedian>(
qalgos_);
444 initQCriterion<CompareLastFilledBin>(
qalgos_);
445 initQCriterion<CheckVariance>(
qalgos_);
449 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
468 stream_ = std::make_unique<std::ofstream>(
"histogramBookingBT.log");
477 size = backtrace(array, 10);
478 strings = backtrace_symbols(array, size);
483 if (!s_rxtrace.match(strings[level], 0, 0, &m))
continue;
484 demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(),
nullptr,
nullptr, &
r);
485 if (!demangled)
continue;
486 if (!s_rxself.match(demangled, 0, 0))
break;
491 if (demangled !=
nullptr) {
494 << (r ? m.matchString(strings[level], 2) :
demangled) <<
" " 495 << m.matchString(strings[level], 1) <<
"\n";
498 *
stream_ <<
"Skipping "<< dir <<
"/" << name
499 <<
" with stack size " << size <<
"\n";
504 if (
verbose_ > 4 || demangled ==
nullptr) {
508 for (i = 0; i <
size; ++
i)
509 if (s_rxtrace.match(strings[i], 0, 0, &m)) {
510 char* demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(),
nullptr,
nullptr, &
r);
511 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" " 512 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" " 513 << m.matchString(strings[i], 1) << std::endl;
551 cleanTrailingSlashes(subdir, clean, cleaned);
554 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
569 cleanTrailingSlashes(fullpath, clean, cleaned);
579 if (pos == std::string::npos)
594 prev.reserve(path.size());
595 subdir.reserve(path.size());
596 name.reserve(path.size());
603 subdir.append(path, 0, slash);
605 name.append(subdir, prevname, std::string::npos);
606 if (! prev.empty() &&
findObject(0, 0, 0, prev, name))
607 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'" 608 " which already exists as a monitor element",
611 if (!
dirs_.count(subdir))
612 dirs_.insert(subdir);
615 if (slash+1 >= path.size())
620 prevname = slash ? slash+1 :
slash;
622 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
631 return dirs_.count(path) > 0;
896 template <
class HISTO,
class COLLATE>
905 assert(name.find(
'/') == std::string::npos);
909 mergePath(path, dir, name);
912 h->SetDirectory(
nullptr);
925 << context <<
": monitor element '" 926 << path <<
"' already exists, collating" << std::endl;
935 assert(
dirs_.count(dir));
942 if (
q.first->match(path))
950 refdir.reserve(s_referenceDirName.size() + dir.size() + 1);
951 refdir += s_referenceDirName;
961 me->reference_ = referenceME->
object_;
974 assert(name.find(
'/') == std::string::npos);
982 mergePath(path, dir, name);
985 << context <<
": monitor element '" 986 << path <<
"' already exists, resetting" << std::endl;
993 assert(
dirs_.count(dir));
1087 int const nchX,
double const lowX,
double const highX)
1089 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1095 int const nchX,
double const lowX,
double const highX)
1097 return book1S_(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1103 int const nchX,
double const lowX,
double const highX)
1105 return book1DD_(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1111 int const nchX,
const float* xbinsize)
1113 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1120 return book1D_(
pwd_, name, static_cast<TH1F*>(source->Clone(name)));
1127 return book1S_(
pwd_, name, static_cast<TH1S*>(source->Clone(name)));
1134 return book1DD_(
pwd_, name, static_cast<TH1D*>(source->Clone(name)));
1162 int const nchX,
double const lowX,
double const highX,
1163 int const nchY,
double const lowY,
double const highY)
1167 nchY, lowY, highY));
1173 int const nchX,
double const lowX,
double const highX,
1174 int const nchY,
double const lowY,
double const highY)
1178 nchY, lowY, highY));
1184 int const nchX,
double const lowX,
double const highX,
1185 int const nchY,
double const lowY,
double const highY)
1189 nchY, lowY, highY));
1195 int const nchX,
const float* xbinsize,
int const nchY,
const float* ybinsize)
1198 nchX, xbinsize, nchY, ybinsize));
1204 int const nchX,
const float* xbinsize,
int const nchY,
const float* ybinsize)
1207 nchX, xbinsize, nchY, ybinsize));
1214 return book2D_(
pwd_, name, static_cast<TH2F*>(source->Clone(name)));
1221 return book2S_(
pwd_, name, static_cast<TH2S*>(source->Clone(name)));
1228 return book2DD_(
pwd_, name, static_cast<TH2D*>(source->Clone(name)));
1242 int const nchX,
double const lowX,
double const highX,
1243 int const nchY,
double const lowY,
double const highY,
1244 int const nchZ,
double const lowZ,
double const highZ)
1249 nchZ, lowZ, highZ));
1256 return book3D_(
pwd_, name, static_cast<TH3F*>(source->Clone(name)));
1264 return book_(dir, name,
"bookProfile",
1274 int const nchX,
double const lowX,
double const highX,
1275 int ,
double const lowY,
double const highY,
1289 int const nchX,
double const lowX,
double const highX,
1290 double const lowY,
double const highY,
1304 int const nchX,
double const* xbinsize,
1305 int ,
double const lowY,
double const highY,
1319 int const nchX,
double const* xbinsize,
1320 double const lowY,
double const highY,
1333 return bookProfile_(
pwd_, name, static_cast<TProfile*>(source->Clone(name)));
1341 return book_(dir, name,
"bookProfile2D",
1351 int const nchX,
double const lowX,
double const highX,
1352 int const nchY,
double const lowY,
double const highY,
1353 int ,
double const lowZ,
double const highZ,
1368 int const nchX,
double const lowX,
double const highX,
1369 int const nchY,
double const lowY,
double const highY,
1370 double const lowZ,
double const highZ,
1393 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1394 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1395 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1396 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1397 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1398 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1399 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1400 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1401 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1407 <<
"checkBinningMatches: different binning - cannot add object '" 1408 << h->GetName() <<
"' of type " 1409 << h->IsA()->GetName() <<
" to existing ME: '" 1491 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1494 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1495 " twice with multiple tags", me->
getFullname().c_str());
1507 splitPath(dir, name, path);
1512 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element" 1513 " '%s' with tag %u", path.c_str(), myTag);
1523 auto i =
data_.lower_bound(proto);
1524 for ( ;
i !=
e && path == *
i->data_.dirname; ++
i)
1525 tag(const_cast<MonitorElement *>(&*
i), myTag);
1535 cleanTrailingSlashes(path, clean, cleaned);
1540 auto i =
data_.lower_bound(proto);
1541 while (
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname)) {
1542 tag(const_cast<MonitorElement*>(&*
i), myTag);
1551 std::vector<std::string>
1554 std::vector<std::string>
result;
1566 while (++
i !=
e && isSubdirectory(
pwd_, *
i))
1567 if (
i->find(
'/',
pwd_.size()+1) == std::string::npos)
1568 result.push_back(*
i);
1574 std::vector<std::string>
1578 std::vector<std::string>
result;
1580 auto i =
data_.lower_bound(proto);
1581 for ( ;
i !=
e && isSubdirectory(
pwd_, *
i->data_.dirname); ++
i)
1582 if (
pwd_ == *
i->data_.dirname)
1583 result.push_back(
i->getName());
1595 auto i =
data_.lower_bound(proto);
1596 return (
i !=
e && isSubdirectory(path, *
i->data_.dirname));
1605 splitPath(dir, name, path);
1607 auto mepos =
data_.find(proto);
1608 return (mepos ==
data_.end() ?
nullptr 1613 std::vector<MonitorElement*>
1617 std::vector<MonitorElement*>
result;
1618 for (
auto const& me :
data_) {
1620 result.push_back(const_cast<MonitorElement*>(&me));
1627 std::vector<MonitorElement*>
1632 cleanTrailingSlashes(path, clean, cleaned);
1635 std::vector<MonitorElement*>
result;
1637 auto i =
data_.lower_bound(proto);
1638 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i)
1639 if (*cleaned == *
i->data_.dirname)
1640 result.push_back(const_cast<MonitorElement *>(&*
i));
1646 std::vector<MonitorElement*>
1651 cleanTrailingSlashes(path, clean, cleaned);
1654 std::vector<MonitorElement*>
result;
1656 auto i =
data_.lower_bound(proto);
1657 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i)
1658 if (*cleaned == *
i->data_.dirname
1660 &&
i->data_.tag ==
tag)
1661 result.push_back(const_cast<MonitorElement *>(&*
i));
1674 into.reserve(
dirs_.size());
1676 auto me =
data_.end();
1677 for (
auto const& dir :
dirs_)
1680 auto mi =
data_.lower_bound(proto);
1682 size_t sz = dir.size() + 2;
1684 for ( ;
m != me && isSubdirectory(dir, *
m->data_.dirname); ++
m)
1685 if (dir == *
m->data_.dirname)
1687 sz +=
m->data_.objname.size() + 1;
1703 for (sz = 0; mi !=
m; ++mi)
1705 if (dir != *mi->data_.dirname)
1711 *istr += mi->data_.objname;
1717 istr->reserve(dir.size() + 2);
1728 uint32_t
const lumi,
1729 uint32_t
const moduleId,
1733 if (dir.find_first_not_of(s_safe) != std::string::npos)
1734 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1735 " unacceptable characters", dir.c_str());
1736 if (name.find_first_not_of(s_safe) != std::string::npos)
1737 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1738 " unacceptable characters", name.c_str());
1747 auto mepos =
data_.find(proto);
1748 return (mepos ==
data_.end() ?
nullptr 1754 std::vector<MonitorElement*>
1756 uint32_t
const run ,
1757 uint32_t
const lumi )
const 1761 cleanTrailingSlashes(path, clean, cleaned);
1765 std::vector<MonitorElement*>
result;
1767 auto i =
data_.lower_bound(proto);
1768 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i) {
1770 if (
i->data_.run > run
1771 ||
i->data_.moduleId != 0)
1775 if (
i->data_.lumi > lumi
1776 ||
i->data_.moduleId != 0)
1779 if (run != 0
or lumi !=0) {
1780 assert(
i->data_.moduleId == 0);
1782 result.push_back(const_cast<MonitorElement*>(&*
i));
1788 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i) {
1789 if (
i->data_.run != 0
or i->data_.moduleId != 0)
1791 result.push_back(const_cast<MonitorElement*>(&*
i));
1800 std::vector<MonitorElement*>
1805 rx = lat::Regexp(pattern, 0, syntaxType);
1809 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
1810 pattern.c_str(), e.explain().c_str());
1814 std::vector<MonitorElement *>
result;
1815 for (
auto const& me :
data_) {
1817 mergePath(path, *me.data_.dirname, me.data_.objname);
1819 result.push_back(const_cast<MonitorElement*>(&me));
1834 for (
auto const&
m :
data_) {
1836 if (me.wasUpdated()) {
1854 for (
auto const&
m :
data_) {
1879 uint32_t
run = lumiblock.run();
1885 auto i =
data_.lower_bound(begin);
1886 const auto e =
data_.lower_bound(end);
1911 std::cout <<
"DQMStore::cloneLumiHistograms - Preparing lumi histograms for run: " 1912 << run <<
", lumi: " << lumi <<
", module: " << moduleId << std::endl;
1924 for (;
i !=
e; ++
i) {
1932 clone.setLumi(lumi);
1933 clone.markToDelete();
1948 std::cout <<
"DQMStore::cloneRunHistograms - Preparing run histograms for run: " 1949 << run <<
", module: " << moduleId << std::endl;
1961 for (;
i !=
e; ++
i) {
1969 clone.markToDelete();
1995 auto i =
data_.lower_bound(proto);
1998 if (
i->data_.moduleId != 0)
2000 if (
i->data_.lumi != lumi)
2002 if (
i->data_.run != run)
2004 if (not
i->markedToDelete()) {
2010 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '" 2011 << *
i->data_.dirname <<
"/" <<
i->data_.objname <<
"'" 2012 <<
"flags " <<
i->data_.flags <<
"\n";
2027 bool const overwrite,
2032 if (
auto*
h = dynamic_cast<TProfile*>(obj)) {
2042 else if (
auto*
h = dynamic_cast<TProfile2D*>(obj)) {
2052 else if (
auto*
h = dynamic_cast<TH1F*>(obj)) {
2055 me =
book1D_(dir,
h->GetName(), (TH1F*)
h->Clone());
2062 else if (
auto*
h = dynamic_cast<TH1S*>(obj)) {
2065 me =
book1S_(dir,
h->GetName(), (TH1S*)
h->Clone());
2072 else if (
auto*
h = dynamic_cast<TH1D*>(obj)) {
2075 me =
book1DD_(dir,
h->GetName(), (TH1D*)
h->Clone());
2082 else if (
auto*
h = dynamic_cast<TH2F*>(obj)) {
2085 me =
book2D_(dir,
h->GetName(), (TH2F*)
h->Clone());
2092 else if (
auto*
h = dynamic_cast<TH2S*>(obj)) {
2095 me =
book2S_(dir,
h->GetName(), (TH2S*)
h->Clone());
2102 else if (
auto*
h = dynamic_cast<TH2D*>(obj)) {
2105 me =
book2DD_(dir,
h->GetName(), (TH2D*)
h->Clone());
2112 else if (
auto*
h = dynamic_cast<TH3F*>(obj)) {
2115 me =
book3D_(dir,
h->GetName(), (TH3F*)
h->Clone());
2122 else if (dynamic_cast<TObjString*>(obj)) {
2124 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m)) {
2125 if (strstr(obj->GetName(),
"CMSSW")) {
2127 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2130 else if (strstr(obj->GetName(),
"DQMPATCH")) {
2132 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2136 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2137 << obj->GetName() <<
"' of type '" 2138 << obj->IsA()->GetName() <<
"'\n";
2149 if (! me || overwrite) {
2150 if (! me) me =
bookInt_(dir, label);
2151 me->
Fill(atoll(value.c_str()));
2154 else if (kind ==
"f") {
2156 if (! me || overwrite) {
2158 me->
Fill(atof(value.c_str()));
2161 else if (kind ==
"s") {
2168 else if (kind ==
"e") {
2171 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2172 << label <<
"' in directory '" 2173 << dir <<
"' to be marked as efficiency plot.\n";
2178 else if (kind ==
"t") {
2181 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2182 << label <<
"' in directory '" 2183 << dir <<
"' for a tag\n";
2187 char* endp =
nullptr;
2188 unsigned long val = strtoul(value.c_str(), &endp, 10);
2189 if ((val == 0 && errno) || *endp || val > ~uint32_t(0)) {
2190 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '" 2191 << value <<
"' for monitor element '" 2192 << label <<
"' in directory '" 2193 << dir <<
"' - invalid value\n";
2198 else if (kind ==
"qr") {
2200 if (! isSubdirectory(s_referenceDirName, dir)) {
2201 size_t dot = label.find(
'.');
2202 if (dot == std::string::npos) {
2203 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2204 <<
"' is missing a '.' and cannot be extracted\n";
2209 std::string qrname (label, dot+1, std::string::npos);
2213 if (s_rxmeqr1.match(value, 0, 0, &m)) {
2214 qv.
code = atoi(m.matchString(value, 1).c_str());
2215 qv.
qtresult = strtod(m.matchString(value, 2).c_str(),
nullptr);
2216 qv.
message = m.matchString(value, 4);
2220 else if (s_rxmeqr2.match(value, 0, 0, &m)) {
2221 qv.
code = atoi(m.matchString(value, 1).c_str());
2223 qv.
message = m.matchString(value, 2);
2228 std::cout <<
"*** DQMStore: WARNING: quality test value '" 2229 << value <<
"' is incorrectly formatted\n";
2235 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2236 << mename <<
"' in directory '" 2237 << dir <<
"' for quality test '" 2246 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2247 << obj->GetName() <<
"' of type '" 2248 << obj->IsA()->GetName() <<
"'\n";
2252 else if (
auto*
n = dynamic_cast<TNamed*>(obj)) {
2255 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2256 s +=
'<'; s +=
n->GetName(); s +=
'>';
2258 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2259 TObjString os(s.c_str());
2263 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2264 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2265 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2272 if (refcheck && isSubdirectory(s_referenceDirName, dir)) {
2273 std::string mdir(dir, s_referenceDirName.size()+1, std::string::npos);
2294 assert(! path.empty());
2298 size_t end = path.find(
'/', start);
2299 if (end == std::string::npos)
2306 TObject*
o = gDirectory->Get(part.c_str());
2307 if (o && ! dynamic_cast<TDirectory*>(o))
2308 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2309 " fails because the part '%s' already exists and is not" 2310 " directory", path.c_str(), part.c_str());
2312 gDirectory->mkdir(part.c_str());
2314 if (! gDirectory->cd(part.c_str()))
2315 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2316 " fails because could not cd into subdirectory '%s'",
2317 path.c_str(), part.c_str());
2320 if (end+1 >= path.size())
2325 end = path.find(
'/', start);
2326 if (end == std::string::npos)
2339 TObjString(me.
tagString().c_str()).Write();
2345 if (not isSubdirectory(s_referenceDirName, *me.
data_.
dirname)) {
2367 unsigned int const run,
2368 MEMap::const_iterator
const begin,
2369 MEMap::const_iterator
const end,
2373 for (
auto const& me: boost::make_iterator_range(begin, end)) {
2374 if (not isSubdirectory(dir, *me.data_.dirname))
2379 <<
" run: " << me.run()
2380 <<
" lumi: " << me.lumi()
2381 <<
" lumiFlag: " << me.getLumiFlag()
2382 <<
" moduleId: " << me.moduleId()
2383 <<
" fullpathname: " << me.getFullname()
2384 <<
" flags: " << std::hex << me.data_.flags
2388 if (dir != *me.data_.dirname) {
2390 std::cout <<
"DQMStore::save: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2401 if (isSubdirectory(refpath, *me.data_.dirname)) {
2412 std::string mname(me.getFullname(), s_referenceDirName.size()+1, std::string::npos);
2415 for (
auto const& qreport : master->data_.qreports)
2416 status =
std::max(status, qreport.code);
2418 if (not master
or status < minStatus) {
2420 std::cout <<
"DQMStore::save: skipping monitor element '" 2421 << me.data_.objname <<
"' while saving, status is " 2422 << status <<
", required minimum status is " 2423 << minStatus << std::endl;
2430 std::cout <<
"DQMStore::save: saving monitor element" << std::endl;
2447 uint32_t
const run ,
2448 uint32_t
const lumi ,
2458 class TFileNoSync :
public TFile {
2460 TFileNoSync(
char const*
file,
char const* opt) : TFile{
file, opt} {}
2461 Int_t SysSync(Int_t)
override {
return 0; }
2466 unsigned int nme = 0;
2470 std::cout <<
"DQMStore::save: Opening TFile '" << filename
2471 <<
"' with option '" << fileupdate <<
"'" 2475 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2477 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2481 std::unique_ptr<lat::Regexp> rxpat;
2482 if (not pattern.empty())
2483 rxpat = std::make_unique<lat::Regexp>(pattern);
2487 refpath.reserve(s_referenceDirName.size() + path.size() + 2);
2488 refpath += s_referenceDirName;
2489 if (not path.empty()) {
2495 for (
auto const& dir:
dirs_) {
2498 if (not path.empty()
2499 and not isSubdirectory(refpath, dir)
2500 and not isSubdirectory(path, dir))
2504 std::cout <<
"DQMStore::save: DQM folder " << dir <<
"/" << std::endl;
2508 gDirectory->cd(
"/");
2510 cdInto(s_monitorDirName);
2511 else if (rxpat.get())
2514 cdInto(s_monitorDirName +
'/' + dir);
2528 auto end =
data_.lower_bound(proto);
2536 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2547 std::cout <<
"DQMStore::save: successfully wrote " << nme
2548 <<
" objects from path '" << path <<
"/" 2549 <<
"' into DQM file '" << filename <<
"'\n";
2558 TBufferFile
buffer(TBufferFile::kWrite);
2561 buffer.WriteObject(&
object);
2563 buffer.WriteObject(me.
object_);
2583 unsigned int const run,
2584 MEMap::const_iterator
const begin,
2585 MEMap::const_iterator
const end,
2589 for (
auto const& me: boost::make_iterator_range(begin, end)) {
2590 if (not isSubdirectory(dir, *me.data_.dirname))
2595 <<
" run: " << me.run()
2596 <<
" lumi: " << me.lumi()
2597 <<
" lumiFlag: " << me.getLumiFlag()
2598 <<
" moduleId: " << me.moduleId()
2599 <<
" fullpathname: " << me.getFullname()
2600 <<
" flags: " << std::hex << me.data_.flags
2604 if (dir != *me.data_.dirname) {
2606 std::cout <<
"DQMStore::savePB: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2615 std::cout <<
"DQMStore::savePB: saving monitor element" << std::endl;
2630 uint32_t
const run ,
2631 uint32_t
const lumi )
2633 using google::protobuf::io::FileOutputStream;
2634 using google::protobuf::io::GzipOutputStream;
2635 using google::protobuf::io::StringOutputStream;
2639 unsigned int nme = 0;
2642 std::cout <<
"DQMStore::savePB: Opening PBFile '" << filename <<
"'" 2648 for (
auto const& dir:
dirs_) {
2651 if (not path.empty()
2652 and not isSubdirectory(path, dir))
2656 std::cout <<
"DQMStore::savePB: DQM folder " << dir <<
"/" << std::endl;
2671 auto end =
data_.lower_bound(proto);
2679 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2686 int filedescriptor =
::open(filename.c_str(),
2687 O_WRONLY | O_CREAT | O_TRUNC,
2691 FileOutputStream file_stream(filedescriptor);
2693 options.format = GzipOutputStream::GZIP;
2694 options.compression_level = 1;
2695 GzipOutputStream gzip_stream(&file_stream, options);
2696 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2699 gzip_stream.Close();
2700 file_stream.Close();
2701 ::close(filedescriptor);
2705 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2706 <<
" objects from path '" << path <<
"/" 2707 <<
"' into DQM file '" << filename <<
"'\n";
2716 bool const overwrite,
2722 unsigned int ntot = 0;
2723 unsigned int count = 0;
2725 if (! file->cd(curdir.c_str()))
2726 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while" 2727 " reading file '%s'", curdir.c_str(), file->GetName());
2732 if (dirpart.compare(0, s_monitorDirName.size(), s_monitorDirName) == 0) {
2733 if (dirpart.size() == s_monitorDirName.size())
2735 else if (dirpart[s_monitorDirName.size()] ==
'/')
2736 dirpart.erase(0, s_monitorDirName.size()+1);
2740 bool skip = (! onlypath.empty() && ! isSubdirectory(onlypath, dirpart));
2742 if (prepend == s_collateDirName ||
2743 prepend == s_referenceDirName ||
2748 size_t slash = dirpart.find(
'/');
2749 size_t pos = dirpart.find(
"/Run summary");
2750 if (slash != std::string::npos && pos !=std::string::npos) {
2751 dirpart.erase(pos,12);
2753 pos = dirpart.find(
"Run ");
2754 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2755 if (pos !=std::string::npos)
2756 dirpart.erase(pos,length);
2762 if (prepend == s_collateDirName ||
2763 prepend == s_referenceDirName) {
2764 size_t slash = dirpart.find(
'/');
2766 if (slash == std::string::npos
2767 && slash+1+s_referenceDirName.size() == dirpart.size()
2768 && dirpart.compare(slash+1, s_referenceDirName.size(), s_referenceDirName) == 0)
2771 slash = dirpart.find(
'/');
2773 if (slash != std::string::npos
2774 && slash + 10 == dirpart.size()
2775 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2777 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2782 if (dirpart.empty())
2785 dirpart = prepend +
'/' + dirpart;
2787 else if (! prepend.empty()) {
2788 if (dirpart.empty())
2791 dirpart = prepend +
'/' + dirpart;
2799 TIter
next (gDirectory->GetListOfKeys());
2800 std::list<TObject*> delayed;
2801 while ((key = (TKey*)
next()))
2803 std::unique_ptr<TObject>
obj(key->ReadObj());
2804 if (dynamic_cast<TDirectory*>(
obj.get())) {
2806 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2808 if (! curdir.empty())
2810 subdir +=
obj->GetName();
2812 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2816 else if (dynamic_cast<TObjString*>(
obj.get())) {
2817 delayed.push_back(
obj.release());
2821 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2822 <<
"' of type '" <<
obj->IsA()->GetName()
2823 <<
"' from '" << file->GetName()
2824 <<
"' into '" << dirpart <<
"'\n";
2832 while (! delayed.empty()) {
2834 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2835 <<
"' of type '" << delayed.front()->IsA()->GetName()
2836 <<
"' from '" << file->GetName()
2837 <<
"' into '" << dirpart <<
"'\n";
2843 delete delayed.front();
2844 delayed.pop_front();
2848 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2849 <<
" objects from directory '" << dirpart <<
"'\n";
2851 return ntot +
count;
2862 bool const overwrite ,
2866 bool const fileMustExist )
2868 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2878 bool const fileMustExist )
2880 bool overwrite =
true;
2884 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2886 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2888 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2891 if (!s_rxpbfile.match(filename, 0, 0))
2892 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2894 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2904 bool const overwrite ,
2908 bool const fileMustExist )
2912 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
2914 std::unique_ptr<TFile>
f;
2917 f.reset(TFile::Open(filename.c_str()));
2918 if (! f.get() || f->IsZombie())
2919 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
2926 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
2931 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
2934 for (
auto const& me :
data_)
2938 std::cout <<
"DQMStore::open: successfully read " << n
2939 <<
" objects from file '" << filename <<
"'";
2940 if (! onlypath.empty())
2941 std::cout <<
" from directory '" << onlypath <<
"'";
2942 if (! prepend.empty())
2943 std::cout <<
" into directory '" << prepend <<
"'";
2954 if (buf.Length() == buf.BufferSize())
2957 void* ptr = buf.ReadObjectAny(
nullptr);
2958 return reinterpret_cast<TObject*
>(ptr);
2967 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
2968 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
2970 objname.assign(h.
full_pathname(), namepos, std::string::npos);
2971 TBufferFile buf(TBufferFile::kRead, h.
size(),
2983 bool const overwrite ,
2987 bool const fileMustExist )
2989 using google::protobuf::io::FileInputStream;
2990 using google::protobuf::io::FileOutputStream;
2991 using google::protobuf::io::GzipInputStream;
2992 using google::protobuf::io::GzipOutputStream;
2993 using google::protobuf::io::CodedInputStream;
2994 using google::protobuf::io::ArrayInputStream;
2997 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3000 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3002 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3005 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3010 FileInputStream
fin(filedescriptor);
3011 GzipInputStream
input(&fin);
3012 CodedInputStream input_coded(&input);
3013 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3014 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3015 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3018 ::close(filedescriptor);
3024 TObject*
obj =
nullptr;
3041 extract(static_cast<TObject*>(obj), path, overwrite, collate);
3043 if (me ==
nullptr) {
3066 cleanTrailingSlashes(path, clean, cleaned);
3070 auto i =
data_.lower_bound(proto);
3071 while (
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname))
3074 auto de =
dirs_.end();
3075 auto di =
dirs_.lower_bound(*cleaned);
3076 while (di != de && isSubdirectory(*cleaned, *di))
3086 auto i =
data_.lower_bound(proto);
3087 while (
i !=
e && isSubdirectory(dir, *
i->data_.dirname))
3088 if (dir == *
i->data_.dirname)
3119 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent" 3120 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3134 return (
i ==
e ?
nullptr :
i->second);
3144 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3149 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown" 3150 " algorithm '%s'", algoname.c_str());
3167 cleanTrailingSlashes(dir, clean, cleaned);
3170 if (cleaned->find_first_not_of(s_safe) != std::string::npos)
3172 " uses unacceptable characters", cleaned->c_str());
3184 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3196 for (
auto const& me :
data_) {
3198 mergePath(path, *me.data_.dirname, me.data_.objname);
3199 if (fm->match(path)) {
3215 std::cout <<
"DQMStore: running runQTests() with reset = " 3216 << (
reset_ ?
"true" :
"false" ) << std::endl;
3219 for (
auto const& me :
data_)
3220 if (! isSubdirectory(s_referenceDirName, *me.data_.dirname))
3221 const_cast<MonitorElement &>(me).runQTests();
3234 cleanTrailingSlashes(path, clean, cleaned);
3237 for (
auto const& me :
data_) {
3238 if (! cleaned->empty() && ! isSubdirectory(*cleaned, *me.data_.dirname))
3243 else if (me.hasWarning())
3246 && me.hasOtherReport())
3290 std::cout <<
" ------------------------------------------------------------\n" 3291 <<
" Directory structure: \n" 3292 <<
" ------------------------------------------------------------\n";
3294 std::copy(contents.begin(), contents.end(),
3295 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3297 std::cout <<
" ------------------------------------------------------------\n";
3316 return me && isSubdirectory(s_collateDirName, *me->
data_.
dirname);
3337 MonitorElement* event_me =
get(
"Info/EventInfo/processedEvents");
3340 factor = factor/(events*1.0);
3342 for (
auto const&
m :
data_) {
3344 switch (me.kind()) {
3347 me.getTH1F()->Scale(factor);
3352 me.getTH1S()->Scale(factor);
3357 me.getTH1D()->Scale(factor);
3362 me.getTH2F()->Scale(factor);
3367 me.getTH2S()->Scale(factor);
3372 me.getTH2D()->Scale(factor);
3377 me.getTH3F()->Scale(factor);
3382 me.getTProfile()->Scale(factor);
3387 me.getTProfile2D()->Scale(factor);
3392 std::cout <<
" The DQM object '" << me.getFullname() <<
"' is not scalable object " << std::endl;
bool compare_strings_reverse(std::string const &pattern, std::string const &input) const
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * bookProfile2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s")
TProfile * getTProfile() const
edm::ErrorSummaryEntry Error
Master< F > master(const F &f)
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book2DD_(std::string const &dir, std::string const &name, TH2D *h)
Book 2D histogram based on TH2D.
void rmdir(std::string const &fullpath)
::google::protobuf::uint32 size() const
int64_t getIntValue() const
bool isCollateME(MonitorElement *me) const
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
const ::std::string & full_pathname() const
std::vector< MonitorElement * > getAllContents(std::string const &path, uint32_t runNumber=0, uint32_t lumi=0)
std::vector< MonitorElement * > getContents(std::string const &path) const
MonitorElement * initialise(Kind kind)
TProfile2D * getTProfile2D() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void savePB(std::string const &filename, std::string const &path="", uint32_t run=0, uint32_t lumi=0)
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
bool match(std::string const &s) const
void removeElement(std::string const &name)
MonitorElement * bookString_(std::string const &dir, std::string const &name, std::string const &value)
Book string.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
double getFloatValue() const
void setLumi(uint32_t ls)
void postGlobalBeginLumi(const edm::GlobalContext &)
std::vector< MonitorElement * > getMatchingContents(std::string const &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
void tagContents(std::string const &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
std::string qualityTagString(const DQMNet::QValue &qv) const
LuminosityBlockID const & luminosityBlockID() const
MonitorElement * book1DD(char_string const &name, char_string const &title, int nchX, double lowX, double highX)
Book 1S histogram.
void makeDirectory(std::string const &path)
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
def replace(string, replacements)
void setCurrentFolder(std::string const &fullpath)
static const uint32_t DQM_PROP_TAGGED
MatchingHeuristicEnum matching_
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
const std::string * dirname
MonitorElement * book1D_(std::string const &dir, std::string const &name, TH1F *h)
Book 1D histogram based on TH1F.
bool extract(TObject *obj, std::string const &dir, bool overwrite, bool collateHistograms)
void initializeFrom(const edm::ParameterSet &)
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
MonitorElement * bookInt(char_string const &name)
Book int.
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
void set_flags(::google::protobuf::uint32 value)
void disableSoftReset()
reverts action of softReset
void get_info(dqmstorepb::ROOTFilePB_Histo const &, std::string &dirname, std::string &objname, TObject **obj)
const ::std::string & streamed_histo() const
bool cdInto(std::string const &path) const
fastmatch(std::string fastString)
MonitorElement * bookFloat(char_string const &name)
Book float.
DQMStore(edm::ParameterSet const &pset, edm::ActivityRegistry &)
static std::string const input
void tag(MonitorElement *me, unsigned int myTag)
void disableSoftReset(MonitorElement *me)
unsigned int maxNumberOfStreams() const
void useQTest(std::string const &dir, std::string const &qtname)
void saveMonitorElementRangeToROOT(std::string const &dir, std::string const &refpath, SaveReferenceTag ref, int minStatus, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, TFile &file, unsigned int &counter)
MonitorElement * book2DD(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
std::pair< fastmatch *, QCriterion * > QTestSpec
void saveMonitorElementToROOT(MonitorElement const &me, TFile &file)
MonitorElement * getElement(std::string const &path)
static const uint32_t DQM_PROP_HAS_REFERENCE
void print_trace(std::string const &dir, std::string const &name)
void setCurrentFolder(std::string const &fullpath)
void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi)
MonitorElement * book2D_(std::string const &dir, std::string const &name, TH2F *h)
Book 2D histogram based on TH2F.
bool dirExists(std::string const &path) const
true if directory exists
MonitorElement * book1DD_(std::string const &dir, std::string const &name, TH1D *h)
Book 1D histogram based on TH1D.
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
std::string tagString() const
MonitorElement * book3D_(std::string const &dir, std::string const &name, TH3F *h)
Book 3D histogram based on TH3F.
void tag(MonitorElement *, unsigned int)
std::vector< std::shared_ptr< fireworks::OptionNode > > Options
void saveMonitorElementRangeToPB(std::string const &dir, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, dqmstorepb::ROOTFilePB &file, unsigned int &counter)
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
void setVerbose(unsigned level)
void softReset(MonitorElement *me)
TObject * extractNextObject(TBufferFile &) const
void Reset()
reset ME (ie. contents, errors, etc)
QCriterion * getQCriterion(std::string const &qtname) const
bool containsAnyMonitorable(std::string const &path)
unsigned int readDirectory(TFile *file, bool overwrite, std::string const &path, std::string const &prepend, std::string const &curdir, OpenRunDirs stripdirs)
std::vector< std::string > getSubdirs() const
MonitorElement * bookString(char_string const &name, char_string const &value)
Book string.
MonitorElement * get(std::string const &path)
int getStatus(std::string const &path="") const
std::string const & pwd() const
const std::string getFullname() const
get full name of ME including Pathname
MonitorElement * book2S(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
MonitorElement * book1S_(std::string const &dir, std::string const &name, TH1S *h)
Book 1D histogram based on TH1S.
void saveMonitorElementToPB(MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
void setCurrentFolder(std::string const &fullpath)
MonitorElement * bookProfile(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
void showDirStructure() const
void cd()
go to top directory (ie. root)
QCriterion * createQTest(std::string const &algoname, std::string const &qtname)
std::string effLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
void set_size(::google::protobuf::uint32 value)
std::string const & pwd()
MonitorElement * book2S_(std::string const &dir, std::string const &name, TH2S *h)
Book 2D histogram based on TH2S.
std::string tagLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
bool dirExists(std::string const &path)
std::vector< std::string > getMEs() const
get list of (non-dir) MEs of current directory
MonitorElement * bookFloat_(std::string const &dir, std::string const &name)
Book float.
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
bool readFilePB(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
static const Regexp s_rxmeval("<(.*)>(i|f|s|qr)=(.*)</\\1>")
void set_full_pathname(const ::std::string &value)
void setVerbose(int verbose)
probability limits for warnings, errors
void removeContents()
erase all monitoring elements in current directory (not including subfolders);
bool forceResetOnBeginLumi_
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
::dqmstorepb::ROOTFilePB_Histo * add_histo()
void cloneRunHistograms(uint32_t run, uint32_t moduleId)
static std::atomic< unsigned int > counter
void cloneLumiHistograms(uint32_t run, uint32_t lumi, uint32_t moduleId)
bool readFile(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
MonitorElement * book1S(char_string const &name, char_string const &title, int nchX, double lowX, double highX)
Book 1S histogram.
std::vector< std::string > getSubdirs()
std::unique_ptr< std::ostream > stream_
::google::protobuf::uint32 flags() const
static const int STATUS_OK
void tagContents(std::string const &, unsigned int)
MonitorElement * book3D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
void setAccumulate(MonitorElement *me, bool flag)
MonitorElement * bookInt_(std::string const &dir, std::string const &name)
Book int.
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
void Reset(std::vector< TH2F > &depth)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
void goUp()
equivalent to "cd .."
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
bool load(std::string const &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
std::vector< std::string > getMEs()
MonitorElement * initialise(MonitorElement *me, std::string const &path)
std::set< std::string > dirs_
static const uint32_t DQM_PROP_LUMI
static std::string const source
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
Kind kind() const
Get the type of the monitor element.
bool compare_strings(std::string const &pattern, std::string const &input) const
int useQTestByMatch(std::string const &pattern, std::string const &qtname)
attach quality test <qc> to monitor elements matching <pattern>.
std::vector< MonitorElement * > getAllContents(std::string const &path, uint32_t runNumber=0, uint32_t lumi=0) const
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
bool containsAnyMonitorable(std::string const &path) const
std::unique_ptr< lat::Regexp > regexp_
void set_streamed_histo(const ::std::string &value)
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
void tagAllContents(std::string const &path, unsigned int myTag)
void raiseDQMError(const char *context, const char *fmt,...)