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" 21 #include <boost/algorithm/string.hpp> 22 #include <boost/range/iterator_range_core.hpp> 60 static const std::string s_safe =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# ";
62 static const lat::Regexp
s_rxmeval (
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$");
63 static const lat::Regexp
s_rxmeqr1 (
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$");
64 static const lat::Regexp
s_rxmeqr2 (
"^st\\.(\\d+)\\.(.*)$");
65 static const lat::Regexp
s_rxtrace (
"(.*)\\((.*)\\+0x.*\\).*");
66 static const lat::Regexp
s_rxself (
"^[^()]*DQMStore::.*");
67 static const lat::Regexp
s_rxpbfile (
".*\\.pb$");
76 || (path.size() >= ofdir.size()
77 && path.compare(0, ofdir.size(), ofdir) == 0
78 && (path.size() == ofdir.size()
79 || path[ofdir.size()] ==
'/')));
88 size_t len = path.size();
89 for ( ; len > 0 && path[len-1] ==
'/'; --len)
92 if (len != path.size())
94 clean = path.substr(0, len);
102 size_t slash = path.rfind(
'/');
103 if (slash != std::string::npos)
105 dir.append(path, 0, slash);
106 name.append(path, slash+1, std::string::npos);
115 path.reserve(dir.size() + name.size() + 2);
125 {
return new T(qtname); }
130 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
135 fastString_ (
std::
move(_fastString)), matching_ (UseFull)
146 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality" 151 size_t starCount = 0;
156 if ((
size_t)pos == std::string::npos)
162 if ((
fastString_.find(
'"') != std::string::npos) ||
175 if (boost::algorithm::starts_with(
fastString_,
"*"))
193 if (boost::algorithm::starts_with(
fastString_,
"*") &&
213 if (input.size() < pattern.size())
219 std::string::const_reverse_iterator rit_pattern = pattern.rbegin();
220 std::string::const_reverse_iterator rit_input = input.rbegin();
222 for (; rit_pattern < pattern.rend(); rit_pattern++, rit_input++)
224 if (*rit_pattern != *rit_input)
234 if (input.size() < pattern.size())
240 std::string::const_iterator rit_pattern = pattern.begin();
241 std::string::const_iterator rit_input = input.begin();
243 for (; rit_pattern < pattern.end(); rit_pattern++, rit_input++)
245 if (*rit_pattern != *rit_input)
280 owner_->setCurrentFolder(fullpath);
288 return owner_->pwd();
292 owner_->tag(me, tag);
296 owner_->tagContents(path, myTag);
300 std::vector<MonitorElement*>
304 return owner_->getAllContents(path, run, lumi);
308 return owner_->get(path);
313 if (ptr ==
nullptr) {
314 std::stringstream
msg;
315 msg <<
"DQM object not found";
320 throw std::out_of_range(msg.str());
326 return owner_->getSubdirs();
330 return owner_->getMEs();
334 return owner_->containsAnyMonitorable(path);
338 return owner_->dirExists(path);
350 owner_->setCurrentFolder(fullpath);
358 collateHistograms_ (
false),
359 enableMultiThread_(
false),
360 forceResetOnBeginLumi_(
false),
361 readSelectedDirectory_ (
""),
417 delete qtestspec.first;
440 std::cout <<
"DQMStore: histogram collation is enabled\n";
444 std::cout <<
"DQMStore: MultiThread option is enabled\n";
448 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
453 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
457 initQCriterion<Comp2RefChi2>(
qalgos_);
458 initQCriterion<Comp2Ref2DChi2>(
qalgos_);
459 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
460 initQCriterion<ContentsXRange>(
qalgos_);
461 initQCriterion<ContentsYRange>(
qalgos_);
462 initQCriterion<MeanWithinExpected>(
qalgos_);
463 initQCriterion<Comp2RefEqualH>(
qalgos_);
464 initQCriterion<DeadChannel>(
qalgos_);
465 initQCriterion<NoisyChannel>(
qalgos_);
466 initQCriterion<ContentSigma>(
qalgos_);
467 initQCriterion<ContentsWithinExpected>(
qalgos_);
468 initQCriterion<CompareToMedian>(
qalgos_);
469 initQCriterion<CompareLastFilledBin>(
qalgos_);
470 initQCriterion<CheckVariance>(
qalgos_);
474 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
493 stream_ =
new std::ofstream(
"histogramBookingBT.log");
502 size = backtrace (array, 10);
503 strings = backtrace_symbols (array, size);
507 for (; level <
size; level++) {
508 if (!
s_rxtrace.match(strings[level], 0, 0, &m))
continue;
509 demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(),
nullptr,
nullptr, &
r);
510 if (!demangled)
continue;
511 if (!
s_rxself.match(demangled, 0, 0))
break;
516 if (demangled !=
nullptr) {
519 << (r ? m.matchString(strings[level], 2) :
demangled) <<
" " 520 << m.matchString(strings[level], 1) <<
"\n";
523 *
stream_ <<
"Skipping "<< dir <<
"/" << name
524 <<
" with stack size " << size <<
"\n";
529 if (
verbose_ > 4 || demangled ==
nullptr)
534 for (i = 0; i <
size; i++)
535 if (
s_rxtrace.match(strings[i], 0, 0, &m))
537 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(),
nullptr,
nullptr, &
r);
538 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" " 539 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" " 540 << m.matchString(strings[i], 1) << std::endl;
577 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
602 if (pos == std::string::npos)
617 prev.reserve(path.size());
618 subdir.reserve(path.size());
619 name.reserve(path.size());
627 subdir.append(path, 0, slash);
629 name.append(subdir, prevname, std::string::npos);
631 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'" 632 " which already exists as a monitor element",
635 if (!
dirs_.count(subdir))
636 dirs_.insert(subdir);
639 if (slash+1 >= path.size())
644 prevname = slash ? slash+1 :
slash;
646 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
654 {
return dirs_.count(path) > 0; }
659 template <
class HISTO,
class COLLATE>
662 const char *context,
int kind,
663 HISTO *
h, COLLATE collate)
665 assert(name.find(
'/') == std::string::npos);
672 h->SetDirectory(
nullptr);
688 << context <<
": monitor element '" 689 << path <<
"' already exists, collating" << std::endl;
699 assert(
dirs_.count(dir));
707 for ( ; qi != qe; ++qi)
709 if ( qi->first->match(path) )
710 me->addQReport(qi->second);
728 me->reference_ = referenceME->
object_;
741 assert(name.find(
'/') == std::string::npos);
754 << context <<
": monitor element '" 755 << path <<
"' already exists, resetting" << std::endl;
763 assert(
dirs_.count(dir));
783 return book_(dir, name,
"bookInt")
813 return book_(dir, name,
"bookFloat")
842 return book_(dir, name,
"bookString")
883 int nchX,
double lowX,
double highX)
885 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
891 int nchX,
double lowX,
double highX)
893 return book1D_(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
899 int nchX,
double lowX,
double highX)
901 return book1S_(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
907 int nchX,
double lowX,
double highX)
909 return book1S_(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
915 int nchX,
double lowX,
double highX)
917 return book1DD_(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
923 int nchX,
double lowX,
double highX)
925 return book1DD_(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
931 int nchX,
const float *xbinsize)
933 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
939 int nchX,
const float *xbinsize)
941 return book1D_(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
948 return book1D_(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
955 return book1D_(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
962 return book1S_(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
969 return book1S_(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
976 return book1DD_(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
983 return book1DD_(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1011 int nchX,
double lowX,
double highX,
1012 int nchY,
double lowY,
double highY)
1016 nchY, lowY, highY));
1022 int nchX,
double lowX,
double highX,
1023 int nchY,
double lowY,
double highY)
1025 return book2D_(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1027 nchY, lowY, highY));
1033 int nchX,
double lowX,
double highX,
1034 int nchY,
double lowY,
double highY)
1038 nchY, lowY, highY));
1044 int nchX,
double lowX,
double highX,
1045 int nchY,
double lowY,
double highY)
1047 return book2S_(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1049 nchY, lowY, highY));
1055 int nchX,
double lowX,
double highX,
1056 int nchY,
double lowY,
double highY)
1060 nchY, lowY, highY));
1066 int nchX,
double lowX,
double highX,
1067 int nchY,
double lowY,
double highY)
1069 return book2DD_(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1071 nchY, lowY, highY));
1077 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1080 nchX, xbinsize, nchY, ybinsize));
1086 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1088 return book2D_(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1089 nchX, xbinsize, nchY, ybinsize));
1095 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1099 nchX, xbinsize, nchY, ybinsize));
1105 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1107 return book2S_(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1108 nchX, xbinsize, nchY, ybinsize));
1115 return book2D_(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1122 return book2D_(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1129 return book2S_(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1136 return book2S_(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1143 return book2DD_(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1150 return book2DD_(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1164 int nchX,
double lowX,
double highX,
1165 int nchY,
double lowY,
double highY,
1166 int nchZ,
double lowZ,
double highZ)
1171 nchZ, lowZ, highZ));
1177 int nchX,
double lowX,
double highX,
1178 int nchY,
double lowY,
double highY,
1179 int nchZ,
double lowZ,
double highZ)
1181 return book3D_(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1184 nchZ, lowZ, highZ));
1191 return book3D_(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1198 return book3D_(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1206 return book_(dir, name,
"bookProfile",
1216 int nchX,
double lowX,
double highX,
1217 int ,
double lowY,
double highY,
1231 int nchX,
double lowX,
double highX,
1232 int ,
double lowY,
double highY,
1246 int nchX,
double lowX,
double highX,
1247 double lowY,
double highY,
1261 int nchX,
double lowX,
double highX,
1262 double lowY,
double highY,
1276 int nchX,
const double *xbinsize,
1277 int ,
double lowY,
double highY,
1291 int nchX,
const double *xbinsize,
1292 int ,
double lowY,
double highY,
1306 int nchX,
const double *xbinsize,
1307 double lowY,
double highY,
1321 int nchX,
const double *xbinsize,
1322 double lowY,
double highY,
1335 return bookProfile_(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1342 return bookProfile_(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1350 return book_(dir, name,
"bookProfile2D",
1360 int nchX,
double lowX,
double highX,
1361 int nchY,
double lowY,
double highY,
1362 int ,
double lowZ,
double highZ,
1377 int nchX,
double lowX,
double highX,
1378 int nchY,
double lowY,
double highY,
1379 int ,
double lowZ,
double highZ,
1394 int nchX,
double lowX,
double highX,
1395 int nchY,
double lowY,
double highY,
1396 double lowZ,
double highZ,
1411 int nchX,
double lowX,
double highX,
1412 int nchY,
double lowY,
double highY,
1413 double lowZ,
double highZ,
1434 return bookProfile2D_(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1443 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1444 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1445 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1446 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1447 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1448 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1449 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1450 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1451 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1458 <<
"checkBinningMatches: different binning - cannot add object '" 1459 << h->GetName() <<
"' of type " 1460 << h->IsA()->GetName() <<
" to existing ME: '" 1544 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1547 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1548 " twice with multiple tags", me->
getFullname().c_str());
1565 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element" 1566 " '%s' with tag %u", path.c_str(), myTag);
1576 auto i =
data_.lower_bound(proto);
1577 for ( ;
i !=
e && path == *
i->data_.dirname; ++
i)
1578 tag(const_cast<MonitorElement *>(&*
i), myTag);
1593 auto i =
data_.lower_bound(proto);
1596 tag(const_cast<MonitorElement *>(&*
i), myTag);
1605 std::vector<std::string>
1608 std::vector<std::string>
result;
1621 if (
i->find(
'/',
pwd_.size()+1) == std::string::npos)
1622 result.push_back(*
i);
1628 std::vector<std::string>
1632 std::vector<std::string>
result;
1634 auto i =
data_.lower_bound(proto);
1636 if (
pwd_ == *
i->data_.dirname)
1637 result.push_back(
i->getName());
1649 auto i =
data_.lower_bound(proto);
1661 auto mepos =
data_.find(proto);
1662 return (mepos ==
data_.end() ?
nullptr 1667 std::vector<MonitorElement *>
1671 std::vector<MonitorElement *>
result;
1672 for (
auto const & me :
data_)
1675 result.push_back(const_cast<MonitorElement *>(&me));
1682 std::vector<MonitorElement *>
1690 std::vector<MonitorElement *>
result;
1692 auto i =
data_.lower_bound(proto);
1694 if (*cleaned == *
i->data_.dirname)
1695 result.push_back(const_cast<MonitorElement *>(&*
i));
1701 std::vector<MonitorElement *>
1709 std::vector<MonitorElement *>
result;
1711 auto i =
data_.lower_bound(proto);
1713 if (*cleaned == *
i->data_.dirname
1715 &&
i->data_.tag ==
tag)
1716 result.push_back(const_cast<MonitorElement *>(&*
i));
1729 into.reserve(
dirs_.size());
1731 auto me =
data_.end();
1732 auto di =
dirs_.begin();
1733 auto de =
dirs_.end();
1734 for ( ; di != de; ++di)
1737 auto mi =
data_.lower_bound(proto);
1739 size_t sz = di->size() + 2;
1742 if (*di == *
m->data_.dirname)
1744 sz +=
m->data_.objname.size() + 1;
1760 for (sz = 0; mi !=
m; ++mi)
1762 if (*di != *mi->data_.dirname)
1768 *istr += mi->data_.objname;
1774 istr->reserve(di->size() + 2);
1786 const uint32_t
run ,
1787 const uint32_t
lumi ,
1788 const uint32_t moduleId )
const 1790 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1791 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1792 " unacceptable characters", dir.c_str());
1793 if (name.find_first_not_of(
s_safe) != std::string::npos)
1794 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1795 " unacceptable characters", name.c_str());
1804 auto mepos =
data_.find(proto);
1805 return (mepos ==
data_.end() ?
nullptr 1811 std::vector<MonitorElement*>
1814 uint32_t
lumi )
const 1822 std::vector<MonitorElement *>
result;
1824 auto i =
data_.lower_bound(proto);
1827 if (
i->data_.run > run
1828 ||
i->data_.moduleId != 0)
1832 if (
i->data_.lumi > lumi
1833 ||
i->data_.moduleId != 0)
1836 if (run != 0
or lumi !=0) {
1837 assert(
i->data_.moduleId == 0);
1839 result.push_back(const_cast<MonitorElement *>(&*
i));
1847 if (
i->data_.run != 0
or i->data_.moduleId != 0)
1849 result.push_back(const_cast<MonitorElement *>(&*
i));
1858 std::vector<MonitorElement*>
1864 rx = lat::Regexp(pattern, 0, syntaxType);
1869 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
1870 pattern.c_str(), e.explain().c_str());
1874 std::vector<MonitorElement *>
result;
1876 auto e =
data_.end();
1877 for ( ;
i !=
e; ++
i)
1880 mergePath(path, *
i->data_.dirname,
i->data_.objname);
1882 result.push_back(const_cast<MonitorElement *>(&*
i));
1897 auto mi =
data_.begin();
1898 auto me =
data_.end();
1899 for ( ; mi != me; ++mi)
1902 if (mi->wasUpdated())
1921 auto mi =
data_.begin();
1922 auto me =
data_.end();
1923 for ( ; mi != me; ++mi)
1949 uint32_t
run = lumiblock.run();
1955 auto i =
data_.lower_bound(begin);
1956 const auto e =
data_.lower_bound(end);
1981 std::cout <<
"DQMStore::cloneLumiHistograms - Preparing lumi histograms for run: " 1982 << run <<
", lumi: " << lumi <<
", module: " << moduleId << std::endl;
1994 for (;
i !=
e; ++
i) {
2002 clone.setLumi(lumi);
2003 clone.markToDelete();
2018 std::cout <<
"DQMStore::cloneRunHistograms - Preparing run histograms for run: " 2019 << run <<
", module: " << moduleId << std::endl;
2031 for (;
i !=
e; ++
i) {
2039 clone.markToDelete();
2065 auto i =
data_.lower_bound(proto);
2068 if (
i->data_.moduleId != 0)
2070 if (
i->data_.lumi != lumi)
2072 if (
i->data_.run != run)
2074 if (not
i->markedToDelete()) {
2080 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '" 2081 << *
i->data_.dirname <<
"/" <<
i->data_.objname <<
"'" 2082 <<
"flags " <<
i->data_.flags <<
"\n";
2100 if (
auto *
h = dynamic_cast<TProfile *>(obj))
2111 else if (
auto *
h = dynamic_cast<TProfile2D *>(obj))
2122 else if (
auto *
h = dynamic_cast<TH1F *>(obj))
2126 me =
book1D_(dir,
h->GetName(), (TH1F *)
h->Clone());
2133 else if (
auto *
h = dynamic_cast<TH1S *>(obj))
2137 me =
book1S_(dir,
h->GetName(), (TH1S *)
h->Clone());
2144 else if (
auto *
h = dynamic_cast<TH1D *>(obj))
2148 me =
book1DD_(dir,
h->GetName(), (TH1D *)
h->Clone());
2155 else if (
auto *
h = dynamic_cast<TH2F *>(obj))
2159 me =
book2D_(dir,
h->GetName(), (TH2F *)
h->Clone());
2166 else if (
auto *
h = dynamic_cast<TH2S *>(obj))
2170 me =
book2S_(dir,
h->GetName(), (TH2S *)
h->Clone());
2177 else if (
auto *
h = dynamic_cast<TH2D *>(obj))
2181 me =
book2DD_(dir,
h->GetName(), (TH2D *)
h->Clone());
2188 else if (
auto *
h = dynamic_cast<TH3F *>(obj))
2192 me =
book3D_(dir,
h->GetName(), (TH3F *)
h->Clone());
2199 else if (dynamic_cast<TObjString *>(obj))
2202 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2204 if (strstr(obj->GetName(),
"CMSSW"))
2207 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2210 else if (strstr(obj->GetName(),
"DQMPATCH"))
2213 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2218 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2219 << obj->GetName() <<
"' of type '" 2220 << obj->IsA()->GetName() <<
"'\n";
2232 if (! me || overwrite)
2234 if (! me) me =
bookInt_(dir, label);
2235 me->
Fill(atoll(value.c_str()));
2238 else if (kind ==
"f")
2241 if (! me || overwrite)
2244 me->
Fill(atof(value.c_str()));
2247 else if (kind ==
"s")
2255 else if (kind ==
"e")
2260 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2261 << label <<
"' in directory '" 2262 << dir <<
"' to be marked as efficiency plot.\n";
2267 else if (kind ==
"t")
2272 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2273 << label <<
"' in directory '" 2274 << dir <<
"' for a tag\n";
2278 char *endp =
nullptr;
2279 unsigned long val = strtoul(value.c_str(), &endp, 10);
2280 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2282 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '" 2283 << value <<
"' for monitor element '" 2284 << label <<
"' in directory '" 2285 << dir <<
"' - invalid value\n";
2290 else if (kind ==
"qr")
2295 size_t dot = label.find(
'.');
2296 if (dot == std::string::npos)
2298 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2299 <<
"' is missing a '.' and cannot be extracted\n";
2304 std::string qrname (label, dot+1, std::string::npos);
2310 qv.
code = atoi(m.matchString(value, 1).c_str());
2311 qv.
qtresult = strtod(m.matchString(value, 2).c_str(),
nullptr);
2312 qv.
message = m.matchString(value, 4);
2316 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2318 qv.
code = atoi(m.matchString(value, 1).c_str());
2320 qv.
message = m.matchString(value, 2);
2326 std::cout <<
"*** DQMStore: WARNING: quality test value '" 2327 << value <<
"' is incorrectly formatted\n";
2334 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2335 << mename <<
"' in directory '" 2336 << dir <<
"' for quality test '" 2346 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2347 << obj->GetName() <<
"' of type '" 2348 << obj->IsA()->GetName() <<
"'\n";
2352 else if (
auto *
n = dynamic_cast<TNamed *>(obj))
2356 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2357 s +=
'<'; s +=
n->GetName(); s +=
'>';
2359 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2360 TObjString os(s.c_str());
2365 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2366 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2367 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2398 assert(! path.empty());
2402 size_t end = path.find(
'/', start);
2403 if (end == std::string::npos)
2411 TObject *
o = gDirectory->Get(part.c_str());
2412 if (o && ! dynamic_cast<TDirectory *>(o))
2413 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2414 " fails because the part '%s' already exists and is not" 2415 " directory", path.c_str(), part.c_str());
2417 gDirectory->mkdir(part.c_str());
2419 if (! gDirectory->cd(part.c_str()))
2420 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2421 " fails because could not cd into subdirectory '%s'",
2422 path.c_str(), part.c_str());
2425 if (end+1 >= path.size())
2430 end = path.find(
'/', start);
2431 if (end == std::string::npos)
2445 TObjString(me.
tagString().c_str()).Write();
2476 MEMap::const_iterator
begin,
2477 MEMap::const_iterator
end,
2481 for (
auto const& me: boost::make_iterator_range(begin, end))
2488 <<
" run: " << me.run()
2489 <<
" lumi: " << me.lumi()
2490 <<
" lumiFlag: " << me.getLumiFlag()
2491 <<
" moduleId: " << me.moduleId()
2492 <<
" fullpathname: " << me.getFullname()
2493 <<
" flags: " << std::hex << me.data_.flags
2497 if (dir != *me.data_.dirname) {
2499 std::cout <<
"DQMStore::save: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2526 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2527 status =
std::max(status, master->data_.qreports[
i].code);
2529 if (not master
or status < minStatus)
2532 std::cout <<
"DQMStore::save: skipping monitor element '" 2533 << me.data_.objname <<
"' while saving, status is " 2534 << status <<
", required minimum status is " 2535 << minStatus << std::endl;
2542 std::cout <<
"DQMStore::save: saving monitor element" << std::endl;
2559 const uint32_t
run ,
2560 const uint32_t
lumi ,
2570 class TFileNoSync :
public TFile
2573 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2574 Int_t SysSync(Int_t)
override {
return 0; }
2579 unsigned int nme = 0;
2583 std::cout <<
"DQMStore::save: Opening TFile '" << filename
2584 <<
"' with option '" << fileupdate <<
"'" 2588 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2590 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2594 std::unique_ptr<lat::Regexp> rxpat;
2595 if (not pattern.empty())
2596 rxpat = std::make_unique<lat::Regexp>(pattern);
2602 if (not path.empty())
2613 if (not path.empty()
2619 std::cout <<
"DQMStore::save: DQM folder " <<
dir <<
"/" << std::endl;
2623 gDirectory->cd(
"/");
2626 else if (rxpat.get())
2643 auto end =
data_.lower_bound(proto);
2651 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2662 std::cout <<
"DQMStore::save: successfully wrote " << nme
2663 <<
" objects from path '" << path <<
"/" 2664 <<
"' into DQM file '" << filename <<
"'\n";
2674 TBufferFile
buffer(TBufferFile::kWrite);
2677 buffer.WriteObject(&
object);
2679 buffer.WriteObject(me.
object_);
2701 MEMap::const_iterator
begin,
2702 MEMap::const_iterator
end,
2706 for (
auto const& me: boost::make_iterator_range(begin, end))
2713 <<
" run: " << me.run()
2714 <<
" lumi: " << me.lumi()
2715 <<
" lumiFlag: " << me.getLumiFlag()
2716 <<
" moduleId: " << me.moduleId()
2717 <<
" fullpathname: " << me.getFullname()
2718 <<
" flags: " << std::hex << me.data_.flags
2722 if (dir != *me.data_.dirname) {
2724 std::cout <<
"DQMStore::savePB: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2733 std::cout <<
"DQMStore::savePB: saving monitor element" << std::endl;
2748 const uint32_t
run ,
2749 const uint32_t
lumi )
2751 using google::protobuf::io::FileOutputStream;
2752 using google::protobuf::io::GzipOutputStream;
2753 using google::protobuf::io::StringOutputStream;
2757 unsigned int nme = 0;
2760 std::cout <<
"DQMStore::savePB: Opening PBFile '" << filename <<
"'" 2770 if (not path.empty()
2775 std::cout <<
"DQMStore::savePB: DQM folder " <<
dir <<
"/" << std::endl;
2790 auto end =
data_.lower_bound(proto);
2798 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2805 int filedescriptor =
::open(filename.c_str(),
2806 O_WRONLY | O_CREAT | O_TRUNC,
2810 FileOutputStream file_stream(filedescriptor);
2812 options.format = GzipOutputStream::GZIP;
2813 options.compression_level = 1;
2814 GzipOutputStream gzip_stream(&file_stream, options);
2815 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2818 gzip_stream.Close();
2819 file_stream.Close();
2820 ::close(filedescriptor);
2824 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2825 <<
" objects from path '" << path <<
"/" 2826 <<
"' into DQM file '" << filename <<
"'\n";
2841 unsigned int ntot = 0;
2842 unsigned int count = 0;
2844 if (! file->cd(curdir.c_str()))
2845 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while" 2846 " reading file '%s'", curdir.c_str(), file->GetName());
2869 size_t slash = dirpart.find(
'/');
2870 size_t pos = dirpart.find(
"/Run summary");
2871 if (slash != std::string::npos && pos !=std::string::npos)
2873 dirpart.erase(pos,12);
2875 pos = dirpart.find(
"Run ");
2876 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2877 if (pos !=std::string::npos)
2878 dirpart.erase(pos,length);
2887 size_t slash = dirpart.find(
'/');
2889 if (slash == std::string::npos
2894 slash = dirpart.find(
'/');
2896 if (slash != std::string::npos
2897 && slash + 10 == dirpart.size()
2898 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2900 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2905 if (dirpart.empty())
2908 dirpart = prepend +
'/' + dirpart;
2910 else if (! prepend.empty())
2912 if (dirpart.empty())
2915 dirpart = prepend +
'/' + dirpart;
2923 TIter
next (gDirectory->GetListOfKeys());
2924 std::list<TObject *> delayed;
2925 while ((key = (TKey *)
next()))
2927 std::unique_ptr<TObject>
obj(key->ReadObj());
2928 if (dynamic_cast<TDirectory *>(
obj.get()))
2931 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2933 if (! curdir.empty())
2935 subdir +=
obj->GetName();
2937 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2941 else if (dynamic_cast<TObjString *>(
obj.get()))
2943 delayed.push_back(
obj.release());
2948 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2949 <<
"' of type '" <<
obj->IsA()->GetName()
2950 <<
"' from '" << file->GetName()
2951 <<
"' into '" << dirpart <<
"'\n";
2959 while (! delayed.empty())
2962 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2963 <<
"' of type '" << delayed.front()->IsA()->GetName()
2964 <<
"' from '" << file->GetName()
2965 <<
"' into '" << dirpart <<
"'\n";
2971 delete delayed.front();
2972 delayed.pop_front();
2976 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2977 <<
" objects from directory '" << dirpart <<
"'\n";
2979 return ntot +
count;
2994 bool fileMustExist )
2996 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
3006 bool fileMustExist )
3008 bool overwrite =
true;
3012 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
3014 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
3016 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
3020 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3022 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3036 bool fileMustExist )
3040 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3042 std::unique_ptr<TFile>
f;
3046 f.reset(TFile::Open(filename.c_str()));
3047 if (! f.get() || f->IsZombie())
3048 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3057 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3062 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3065 auto mi =
data_.begin();
3066 auto me =
data_.end();
3067 for ( ; mi != me; ++mi)
3068 const_cast<MonitorElement &>(*mi).updateQReportStats();
3072 std::cout <<
"DQMStore::open: successfully read " << n
3073 <<
" objects from file '" << filename <<
"'";
3074 if (! onlypath.empty())
3075 std::cout <<
" from directory '" << onlypath <<
"'";
3076 if (! prepend.empty())
3077 std::cout <<
" into directory '" << prepend <<
"'";
3087 if (buf.Length() == buf.BufferSize())
3090 void *ptr = buf.ReadObjectAny(
nullptr);
3091 return reinterpret_cast<TObject *
>(ptr);
3100 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3101 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3103 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3104 TBufferFile buf(TBufferFile::kRead, h.
size(),
3120 bool fileMustExist )
3122 using google::protobuf::io::FileInputStream;
3123 using google::protobuf::io::FileOutputStream;
3124 using google::protobuf::io::GzipInputStream;
3125 using google::protobuf::io::GzipOutputStream;
3126 using google::protobuf::io::CodedInputStream;
3127 using google::protobuf::io::ArrayInputStream;
3130 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3133 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3135 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3138 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3143 FileInputStream
fin(filedescriptor);
3144 GzipInputStream
input(&fin);
3145 CodedInputStream input_coded(&input);
3146 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3147 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3148 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3151 ::close(filedescriptor);
3157 TObject *
obj =
nullptr;
3175 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3177 if (me ==
nullptr) {
3204 auto i =
data_.lower_bound(proto);
3208 auto de =
dirs_.end();
3209 auto di =
dirs_.lower_bound(*cleaned);
3220 auto i =
data_.lower_bound(proto);
3222 if (dir == *
i->data_.dirname)
3253 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent" 3254 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3268 return (
i ==
e ?
nullptr :
i->second);
3278 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3283 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown" 3284 " algorithm '%s'", algoname.c_str());
3304 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3306 " uses unacceptable characters", cleaned->c_str());
3318 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3328 auto mi =
data_.begin();
3329 auto me =
data_.end();
3332 for ( ; mi != me; ++mi)
3335 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3336 if (fm->match(path))
3353 std::cout <<
"DQMStore: running runQTests() with reset = " 3354 << (
reset_ ?
"true" :
"false" ) << std::endl;
3357 auto mi =
data_.begin();
3358 auto me =
data_.end();
3359 for ( ; mi != me; ++mi)
3377 auto mi =
data_.begin();
3378 auto me =
data_.end();
3379 for ( ; mi != me; ++mi)
3381 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3386 else if (mi->hasWarning())
3389 && mi->hasOtherReport())
3433 std::cout <<
" ------------------------------------------------------------\n" 3434 <<
" Directory structure: \n" 3435 <<
" ------------------------------------------------------------\n";
3437 std::copy(contents.begin(), contents.end(),
3438 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3440 std::cout <<
" ------------------------------------------------------------\n";
3477 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3480 factor = factor/(events*1.0);
3482 auto mi =
data_.begin();
3483 auto me =
data_.end();
3484 for ( ; mi != me; ++mi)
3491 me.getTH1F()->Scale(factor);
3496 me.getTH1S()->Scale(factor);
3501 me.getTH1D()->Scale(factor);
3506 me.getTH2F()->Scale(factor);
3511 me.getTH2S()->Scale(factor);
3516 me.getTH2D()->Scale(factor);
3521 me.getTH3F()->Scale(factor);
3526 me.getTProfile()->Scale(factor);
3531 me.getTProfile2D()->Scale(factor);
3536 std::cout <<
" The DQM object '" << me.getFullname() <<
"' is not scalable object " << std::endl;
QCriterion * getQCriterion(const std::string &qtname) const
MonitorElement * getElement(const std::string &path)
bool compare_strings_reverse(std::string const &pattern, std::string const &input) const
TProfile * getTProfile() const
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
edm::ErrorSummaryEntry Error
Master< F > master(const F &f)
T getUntrackedParameter(std::string const &, T const &) const
DQMStore(const edm::ParameterSet &pset, edm::ActivityRegistry &)
static const lat::Regexp s_rxmeqr2("^st\\.(\\d+)\\.(.*)$")
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
bool containsAnyMonitorable(const std::string &path) const
::google::protobuf::uint32 size() const
int64_t getIntValue() const
bool isCollateME(MonitorElement *me) const
bool cdInto(const std::string &path) const
const ::std::string & full_pathname() const
int getStatus(const std::string &path="") const
const std::string & pwd() const
MonitorElement * initialise(Kind kind)
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
TProfile2D * getTProfile2D() const
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
bool match(std::string const &s) const
bool readFile(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
double getFloatValue() const
void setLumi(uint32_t ls)
MonitorElement * get(const std::string &path)
void postGlobalBeginLumi(const edm::GlobalContext &)
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
std::pair< fastmatch *, QCriterion * > QTestSpec
static const std::string s_safe
std::string qualityTagString(const DQMNet::QValue &qv) const
static void splitPath(std::string &dir, std::string &name, const std::string &path)
LuminosityBlockID const & luminosityBlockID() const
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
std::vector< MonitorElement * > getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
def replace(string, replacements)
static const uint32_t DQM_PROP_TAGGED
MatchingHeuristicEnum matching_
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
const std::string * dirname
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void initializeFrom(const edm::ParameterSet &)
void set_flags(::google::protobuf::uint32 value)
void disableSoftReset()
reverts action of softReset
const ::std::string & streamed_histo() const
void initQCriterion(std::map< std::string, QCriterion *(*)(const std::string &)> &m)
static const std::string s_collateDirName
static const std::string s_monitorDirName
name of global monitoring folder (containing all sources subdirectories)
MonitorElement * bookFloat(const char *name)
Book float.
static std::string const input
static const lat::Regexp s_rxtrace("(.*)\\((.*)\\+0x.*\\).*")
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Preallocate preallocateSignal_
signal is emitted before beginJob
void tag(MonitorElement *me, unsigned int myTag)
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
void disableSoftReset(MonitorElement *me)
unsigned int maxNumberOfStreams() const
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)
static const lat::Regexp s_rxmeval("^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$")
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
void saveMonitorElementToROOT(MonitorElement const &me, TFile &file)
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
static const uint32_t DQM_PROP_HAS_REFERENCE
void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi)
fastmatch(std::string _fastString)
void get_info(const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
MonitorElement * bookString(const char *name, const char *value)
Book string.
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
MonitorElement * bookString_(const std::string &dir, const std::string &name, const std::string &value)
Book string.
void removeElement(const std::string &name)
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
std::string tagString() const
void tag(MonitorElement *, unsigned int)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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)
MonitorElement * bookInt_(const std::string &dir, const std::string &name)
Book int.
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
static const lat::Regexp s_rxself("^[^()]*DQMStore::.*")
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
QCriterion * makeQCriterion(const std::string &qtname)
void setVerbose(unsigned level)
void softReset(MonitorElement *me)
TObject * extractNextObject(TBufferFile &) const
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void Reset()
reset ME (ie. contents, errors, etc)
std::vector< MonitorElement * > getContents(const std::string &path) const
std::string readSelectedDirectory_
std::vector< std::string > getSubdirs() const
const std::string getFullname() const
get full name of ME including Pathname
bool dirExists(const std::string &path) const
true if directory exists
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
void runQTests()
run all quality tests
bool dirExists(const std::string &path)
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
void saveMonitorElementToPB(MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
void tagAllContents(const std::string &path, unsigned int myTag)
void showDirStructure() const
void setCurrentFolder(const std::string &fullpath)
MonitorElement * initialise(MonitorElement *me, const std::string &path)
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
void cd()
go to top directory (ie. root)
bool containsAnyMonitorable(const std::string &path)
void tagContents(const std::string &, unsigned int)
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)
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
static const std::string s_referenceDirName
void print_trace(const std::string &dir, const std::string &name)
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
const std::string & pwd()
int useQTestByMatch(const std::string &pattern, const std::string &qtname)
attach quality test <qc> to monitor elements matching <pattern>.
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0)
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)
std::vector< std::string > getMEs() const
get list of (non-dir) MEs of current directory
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
static const lat::Regexp s_rxpbfile(".*\\.pb$")
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
void setCurrentFolder(const std::string &fullpath)
void set_full_pathname(const ::std::string &value)
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
void setVerbose(int verbose)
probability limits for warnings, errors
void removeContents()
erase all monitoring elements in current directory (not including subfolders);
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
bool forceResetOnBeginLumi_
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
::dqmstorepb::ROOTFilePB_Histo * add_histo()
void cloneRunHistograms(uint32_t run, uint32_t moduleId)
static std::atomic< unsigned int > counter
bool readFilePB(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
void cloneLumiHistograms(uint32_t run, uint32_t lumi, uint32_t moduleId)
void useQTest(const std::string &dir, const std::string &qtname)
std::vector< std::string > getSubdirs()
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
::google::protobuf::uint32 flags() const
static const int STATUS_OK
void setAccumulate(MonitorElement *me, bool flag)
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
void Reset(std::vector< TH2F > &depth)
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
void goUp()
equivalent to "cd .."
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0)
MonitorElement * bookFloat_(const std::string &dir, const std::string &name)
Book float.
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
std::vector< std::string > getMEs()
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.
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
static const lat::Regexp s_rxmeqr1("^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$")
void makeDirectory(const std::string &path)
Kind kind() const
Get the type of the monitor element.
bool compare_strings(std::string const &pattern, std::string const &input) const
void setCurrentFolder(const std::string &fullpath)
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
void set_streamed_histo(const ::std::string &value)
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
void raiseDQMError(const char *context, const char *fmt,...)