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> 62 const std::string s_safe =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# ";
64 const lat::Regexp
s_rxmeval (
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$");
65 const lat::Regexp s_rxmeqr1 (
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$");
66 const lat::Regexp s_rxmeqr2 (
"^st\\.(\\d+)\\.(.*)$");
67 const lat::Regexp s_rxtrace (
"(.*)\\((.*)\\+0x.*\\).*");
68 const lat::Regexp s_rxself (
"^[^()]*DQMStore::.*");
69 const lat::Regexp s_rxpbfile (
".*\\.pb$");
78 || (path.size() >= ofdir.size()
79 && path.compare(0, ofdir.size(), ofdir) == 0
80 && (path.size() == ofdir.size()
81 || path[ofdir.size()] ==
'/')));
90 size_t len = path.size();
91 for ( ; len > 0 && path[len-1] ==
'/'; --len)
94 if (len != path.size())
96 clean = path.substr(0, len);
104 size_t slash = path.rfind(
'/');
105 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);
127 {
return new T(qtname); }
132 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
138 fastString_ (
std::
move(_fastString)), matching_ (UseFull)
147 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality" 152 size_t starCount = 0;
157 if ((
size_t)pos == std::string::npos)
163 if ((
fastString_.find(
'"') != std::string::npos) ||
176 if (boost::algorithm::starts_with(
fastString_,
"*"))
194 if (boost::algorithm::starts_with(
fastString_,
"*") &&
208 if (input.size() < pattern.size())
214 auto rit_pattern = pattern.crbegin();
215 auto rit_input = input.crbegin();
217 for (; rit_pattern < pattern.rend(); ++rit_pattern, ++rit_input)
219 if (*rit_pattern != *rit_input)
229 if (input.size() < pattern.size())
235 auto rit_pattern = pattern.cbegin();
236 auto rit_input = input.cbegin();
238 for (; rit_pattern < pattern.end(); ++rit_pattern, ++rit_input)
240 if (*rit_pattern != *rit_input)
275 owner_->setCurrentFolder(fullpath);
283 return owner_->pwd();
287 owner_->tag(me, tag);
291 owner_->tagContents(path, myTag);
295 std::vector<MonitorElement*>
299 return owner_->getAllContents(path, run, lumi);
303 return owner_->get(path);
308 if (ptr ==
nullptr) {
309 std::stringstream
msg;
310 msg <<
"DQM object not found";
315 throw std::out_of_range(msg.str());
321 return owner_->getSubdirs();
325 return owner_->getMEs();
329 return owner_->containsAnyMonitorable(path);
333 return owner_->dirExists(path);
345 owner_->setCurrentFolder(fullpath);
357 if(
pset.getUntrackedParameter<
bool>(
"forceResetOnBeginRun",
false)) {
378 delete qtestspec.first;
397 std::cout <<
"DQMStore: histogram collation is enabled\n";
401 std::cout <<
"DQMStore: MultiThread option is enabled\n";
405 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
410 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
414 initQCriterion<Comp2RefChi2>(
qalgos_);
415 initQCriterion<Comp2Ref2DChi2>(
qalgos_);
416 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
417 initQCriterion<ContentsXRange>(
qalgos_);
418 initQCriterion<ContentsYRange>(
qalgos_);
419 initQCriterion<MeanWithinExpected>(
qalgos_);
420 initQCriterion<Comp2RefEqualH>(
qalgos_);
421 initQCriterion<DeadChannel>(
qalgos_);
422 initQCriterion<NoisyChannel>(
qalgos_);
423 initQCriterion<ContentSigma>(
qalgos_);
424 initQCriterion<ContentsWithinExpected>(
qalgos_);
425 initQCriterion<CompareToMedian>(
qalgos_);
426 initQCriterion<CompareLastFilledBin>(
qalgos_);
427 initQCriterion<CheckVariance>(
qalgos_);
431 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
450 stream_ = std::make_unique<std::ofstream>(
"histogramBookingBT.log");
459 size = backtrace (array, 10);
460 strings = backtrace_symbols (array, size);
465 if (!s_rxtrace.match(strings[level], 0, 0, &m))
continue;
466 demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(),
nullptr,
nullptr, &
r);
467 if (!demangled)
continue;
468 if (!s_rxself.match(demangled, 0, 0))
break;
473 if (demangled !=
nullptr) {
476 << (r ? m.matchString(strings[level], 2) :
demangled) <<
" " 477 << m.matchString(strings[level], 1) <<
"\n";
480 *
stream_ <<
"Skipping "<< dir <<
"/" << name
481 <<
" with stack size " << size <<
"\n";
486 if (
verbose_ > 4 || demangled ==
nullptr)
491 for (i = 0; i <
size; ++
i)
492 if (s_rxtrace.match(strings[i], 0, 0, &m))
494 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(),
nullptr,
nullptr, &
r);
495 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" " 496 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" " 497 << m.matchString(strings[i], 1) << std::endl;
531 cleanTrailingSlashes(subdir, clean, cleaned);
534 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
549 cleanTrailingSlashes(fullpath, clean, cleaned);
559 if (pos == std::string::npos)
574 prev.reserve(path.size());
575 subdir.reserve(path.size());
576 name.reserve(path.size());
584 subdir.append(path, 0, slash);
586 name.append(subdir, prevname, std::string::npos);
588 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'" 589 " which already exists as a monitor element",
592 if (!
dirs_.count(subdir))
593 dirs_.insert(subdir);
596 if (slash+1 >= path.size())
601 prevname = slash ? slash+1 :
slash;
603 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
611 {
return dirs_.count(path) > 0; }
616 template <
class HISTO,
class COLLATE>
619 const char *context,
int kind,
620 HISTO *
h, COLLATE collate)
622 assert(name.find(
'/') == std::string::npos);
626 mergePath(path, dir, name);
629 h->SetDirectory(
nullptr);
645 << context <<
": monitor element '" 646 << path <<
"' already exists, collating" << std::endl;
656 assert(
dirs_.count(dir));
664 if (
q.first->match(path))
672 refdir.reserve(s_referenceDirName.size() + dir.size() + 1);
673 refdir += s_referenceDirName;
683 me->reference_ = referenceME->
object_;
696 assert(name.find(
'/') == std::string::npos);
706 mergePath(path, dir, name);
709 << context <<
": monitor element '" 710 << path <<
"' already exists, resetting" << std::endl;
718 assert(
dirs_.count(dir));
738 return book_(dir, name,
"bookInt")
768 return book_(dir, name,
"bookFloat")
797 return book_(dir, name,
"bookString")
838 int nchX,
double lowX,
double highX)
840 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
846 int nchX,
double lowX,
double highX)
848 return book1D_(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
854 int nchX,
double lowX,
double highX)
856 return book1S_(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
862 int nchX,
double lowX,
double highX)
864 return book1S_(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
870 int nchX,
double lowX,
double highX)
872 return book1DD_(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
878 int nchX,
double lowX,
double highX)
880 return book1DD_(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
886 int nchX,
const float *xbinsize)
888 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
894 int nchX,
const float *xbinsize)
896 return book1D_(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
903 return book1D_(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
910 return book1D_(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
917 return book1S_(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
924 return book1S_(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
931 return book1DD_(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
938 return book1DD_(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
966 int nchX,
double lowX,
double highX,
967 int nchY,
double lowY,
double highY)
977 int nchX,
double lowX,
double highX,
978 int nchY,
double lowY,
double highY)
980 return book2D_(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
988 int nchX,
double lowX,
double highX,
989 int nchY,
double lowY,
double highY)
999 int nchX,
double lowX,
double highX,
1000 int nchY,
double lowY,
double highY)
1002 return book2S_(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1004 nchY, lowY, highY));
1010 int nchX,
double lowX,
double highX,
1011 int nchY,
double lowY,
double highY)
1015 nchY, lowY, highY));
1021 int nchX,
double lowX,
double highX,
1022 int nchY,
double lowY,
double highY)
1024 return book2DD_(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1026 nchY, lowY, highY));
1032 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1035 nchX, xbinsize, nchY, ybinsize));
1041 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1043 return book2D_(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1044 nchX, xbinsize, nchY, ybinsize));
1050 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1054 nchX, xbinsize, nchY, ybinsize));
1060 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1062 return book2S_(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1063 nchX, xbinsize, nchY, ybinsize));
1070 return book2D_(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1077 return book2D_(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1084 return book2S_(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1091 return book2S_(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1098 return book2DD_(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1105 return book2DD_(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1119 int nchX,
double lowX,
double highX,
1120 int nchY,
double lowY,
double highY,
1121 int nchZ,
double lowZ,
double highZ)
1126 nchZ, lowZ, highZ));
1132 int nchX,
double lowX,
double highX,
1133 int nchY,
double lowY,
double highY,
1134 int nchZ,
double lowZ,
double highZ)
1136 return book3D_(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1139 nchZ, lowZ, highZ));
1146 return book3D_(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1153 return book3D_(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1161 return book_(dir, name,
"bookProfile",
1171 int nchX,
double lowX,
double highX,
1172 int ,
double lowY,
double highY,
1186 int nchX,
double lowX,
double highX,
1187 int ,
double lowY,
double highY,
1201 int nchX,
double lowX,
double highX,
1202 double lowY,
double highY,
1216 int nchX,
double lowX,
double highX,
1217 double lowY,
double highY,
1231 int nchX,
const double *xbinsize,
1232 int ,
double lowY,
double highY,
1246 int nchX,
const double *xbinsize,
1247 int ,
double lowY,
double highY,
1261 int nchX,
const double *xbinsize,
1262 double lowY,
double highY,
1276 int nchX,
const double *xbinsize,
1277 double lowY,
double highY,
1290 return bookProfile_(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1297 return bookProfile_(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1305 return book_(dir, name,
"bookProfile2D",
1315 int nchX,
double lowX,
double highX,
1316 int nchY,
double lowY,
double highY,
1317 int ,
double lowZ,
double highZ,
1332 int nchX,
double lowX,
double highX,
1333 int nchY,
double lowY,
double highY,
1334 int ,
double lowZ,
double highZ,
1349 int nchX,
double lowX,
double highX,
1350 int nchY,
double lowY,
double highY,
1351 double lowZ,
double highZ,
1366 int nchX,
double lowX,
double highX,
1367 int nchY,
double lowY,
double highY,
1368 double lowZ,
double highZ,
1389 return bookProfile2D_(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1398 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1399 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1400 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1401 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1402 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1403 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1404 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1405 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1406 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1413 <<
"checkBinningMatches: different binning - cannot add object '" 1414 << h->GetName() <<
"' of type " 1415 << h->IsA()->GetName() <<
" to existing ME: '" 1499 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1502 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1503 " twice with multiple tags", me->
getFullname().c_str());
1515 splitPath(dir, name, path);
1520 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element" 1521 " '%s' with tag %u", path.c_str(), myTag);
1531 auto i =
data_.lower_bound(proto);
1532 for ( ;
i !=
e && path == *
i->data_.dirname; ++
i)
1533 tag(const_cast<MonitorElement *>(&*
i), myTag);
1543 cleanTrailingSlashes(path, clean, cleaned);
1548 auto i =
data_.lower_bound(proto);
1549 while (
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname))
1551 tag(const_cast<MonitorElement *>(&*
i), myTag);
1560 std::vector<std::string>
1563 std::vector<std::string>
result;
1575 while (++
i !=
e && isSubdirectory(
pwd_, *
i))
1576 if (
i->find(
'/',
pwd_.size()+1) == std::string::npos)
1577 result.push_back(*
i);
1583 std::vector<std::string>
1587 std::vector<std::string>
result;
1589 auto i =
data_.lower_bound(proto);
1590 for ( ;
i !=
e && isSubdirectory(
pwd_, *
i->data_.dirname); ++
i)
1591 if (
pwd_ == *
i->data_.dirname)
1592 result.push_back(
i->getName());
1604 auto i =
data_.lower_bound(proto);
1605 return (
i !=
e && isSubdirectory(path, *
i->data_.dirname));
1614 splitPath(dir, name, path);
1616 auto mepos =
data_.find(proto);
1617 return (mepos ==
data_.end() ?
nullptr 1622 std::vector<MonitorElement *>
1626 std::vector<MonitorElement *>
result;
1627 for (
auto const & me :
data_)
1630 result.push_back(const_cast<MonitorElement *>(&me));
1637 std::vector<MonitorElement *>
1642 cleanTrailingSlashes(path, clean, cleaned);
1645 std::vector<MonitorElement *>
result;
1647 auto i =
data_.lower_bound(proto);
1648 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i)
1649 if (*cleaned == *
i->data_.dirname)
1650 result.push_back(const_cast<MonitorElement *>(&*
i));
1656 std::vector<MonitorElement *>
1661 cleanTrailingSlashes(path, clean, cleaned);
1664 std::vector<MonitorElement *>
result;
1666 auto i =
data_.lower_bound(proto);
1667 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i)
1668 if (*cleaned == *
i->data_.dirname
1670 &&
i->data_.tag ==
tag)
1671 result.push_back(const_cast<MonitorElement *>(&*
i));
1684 into.reserve(
dirs_.size());
1686 auto me =
data_.end();
1687 for (
auto const& dir :
dirs_)
1690 auto mi =
data_.lower_bound(proto);
1692 size_t sz = dir.size() + 2;
1694 for ( ;
m != me && isSubdirectory(dir, *
m->data_.dirname); ++
m)
1695 if (dir == *
m->data_.dirname)
1697 sz +=
m->data_.objname.size() + 1;
1713 for (sz = 0; mi !=
m; ++mi)
1715 if (dir != *mi->data_.dirname)
1721 *istr += mi->data_.objname;
1727 istr->reserve(dir.size() + 2);
1739 const uint32_t
run ,
1740 const uint32_t
lumi ,
1741 const uint32_t moduleId )
const 1743 if (dir.find_first_not_of(s_safe) != std::string::npos)
1744 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1745 " unacceptable characters", dir.c_str());
1746 if (name.find_first_not_of(s_safe) != std::string::npos)
1747 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1748 " unacceptable characters", name.c_str());
1757 auto mepos =
data_.find(proto);
1758 return (mepos ==
data_.end() ?
nullptr 1764 std::vector<MonitorElement*>
1767 uint32_t
lumi )
const 1771 cleanTrailingSlashes(path, clean, cleaned);
1775 std::vector<MonitorElement *>
result;
1777 auto i =
data_.lower_bound(proto);
1778 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i) {
1780 if (
i->data_.run > run
1781 ||
i->data_.moduleId != 0)
1785 if (
i->data_.lumi > lumi
1786 ||
i->data_.moduleId != 0)
1789 if (run != 0
or lumi !=0) {
1790 assert(
i->data_.moduleId == 0);
1792 result.push_back(const_cast<MonitorElement *>(&*
i));
1799 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i) {
1800 if (
i->data_.run != 0
or i->data_.moduleId != 0)
1802 result.push_back(const_cast<MonitorElement *>(&*
i));
1811 std::vector<MonitorElement*>
1817 rx = lat::Regexp(pattern, 0, syntaxType);
1822 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
1823 pattern.c_str(), e.explain().c_str());
1827 std::vector<MonitorElement *>
result;
1828 for (
auto const& me :
data_)
1831 mergePath(path, *me.data_.dirname, me.data_.objname);
1833 result.push_back(const_cast<MonitorElement *>(&me));
1848 for (
auto const&
m :
data_)
1851 if (me.wasUpdated())
1870 for (
auto const&
m :
data_)
1896 uint32_t
run = lumiblock.run();
1902 auto i =
data_.lower_bound(begin);
1903 const auto e =
data_.lower_bound(end);
1928 std::cout <<
"DQMStore::cloneLumiHistograms - Preparing lumi histograms for run: " 1929 << run <<
", lumi: " << lumi <<
", module: " << moduleId << std::endl;
1941 for (;
i !=
e; ++
i) {
1949 clone.setLumi(lumi);
1950 clone.markToDelete();
1965 std::cout <<
"DQMStore::cloneRunHistograms - Preparing run histograms for run: " 1966 << run <<
", module: " << moduleId << std::endl;
1978 for (;
i !=
e; ++
i) {
1986 clone.markToDelete();
2012 auto i =
data_.lower_bound(proto);
2015 if (
i->data_.moduleId != 0)
2017 if (
i->data_.lumi != lumi)
2019 if (
i->data_.run != run)
2021 if (not
i->markedToDelete()) {
2027 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '" 2028 << *
i->data_.dirname <<
"/" <<
i->data_.objname <<
"'" 2029 <<
"flags " <<
i->data_.flags <<
"\n";
2047 if (
auto *
h = dynamic_cast<TProfile *>(obj))
2058 else if (
auto *
h = dynamic_cast<TProfile2D *>(obj))
2069 else if (
auto *
h = dynamic_cast<TH1F *>(obj))
2073 me =
book1D_(dir,
h->GetName(), (TH1F *)
h->Clone());
2080 else if (
auto *
h = dynamic_cast<TH1S *>(obj))
2084 me =
book1S_(dir,
h->GetName(), (TH1S *)
h->Clone());
2091 else if (
auto *
h = dynamic_cast<TH1D *>(obj))
2095 me =
book1DD_(dir,
h->GetName(), (TH1D *)
h->Clone());
2102 else if (
auto *
h = dynamic_cast<TH2F *>(obj))
2106 me =
book2D_(dir,
h->GetName(), (TH2F *)
h->Clone());
2113 else if (
auto *
h = dynamic_cast<TH2S *>(obj))
2117 me =
book2S_(dir,
h->GetName(), (TH2S *)
h->Clone());
2124 else if (
auto *
h = dynamic_cast<TH2D *>(obj))
2128 me =
book2DD_(dir,
h->GetName(), (TH2D *)
h->Clone());
2135 else if (
auto *
h = dynamic_cast<TH3F *>(obj))
2139 me =
book3D_(dir,
h->GetName(), (TH3F *)
h->Clone());
2146 else if (dynamic_cast<TObjString *>(obj))
2149 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2151 if (strstr(obj->GetName(),
"CMSSW"))
2154 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2157 else if (strstr(obj->GetName(),
"DQMPATCH"))
2160 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2165 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2166 << obj->GetName() <<
"' of type '" 2167 << obj->IsA()->GetName() <<
"'\n";
2179 if (! me || overwrite)
2181 if (! me) me =
bookInt_(dir, label);
2182 me->
Fill(atoll(value.c_str()));
2185 else if (kind ==
"f")
2188 if (! me || overwrite)
2191 me->
Fill(atof(value.c_str()));
2194 else if (kind ==
"s")
2202 else if (kind ==
"e")
2207 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2208 << label <<
"' in directory '" 2209 << dir <<
"' to be marked as efficiency plot.\n";
2214 else if (kind ==
"t")
2219 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2220 << label <<
"' in directory '" 2221 << dir <<
"' for a tag\n";
2225 char *endp =
nullptr;
2226 unsigned long val = strtoul(value.c_str(), &endp, 10);
2227 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2229 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '" 2230 << value <<
"' for monitor element '" 2231 << label <<
"' in directory '" 2232 << dir <<
"' - invalid value\n";
2237 else if (kind ==
"qr")
2240 if (! isSubdirectory(s_referenceDirName, dir))
2242 size_t dot = label.find(
'.');
2243 if (dot == std::string::npos)
2245 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2246 <<
"' is missing a '.' and cannot be extracted\n";
2251 std::string qrname (label, dot+1, std::string::npos);
2255 if (s_rxmeqr1.match(value, 0, 0, &m))
2257 qv.
code = atoi(m.matchString(value, 1).c_str());
2258 qv.
qtresult = strtod(m.matchString(value, 2).c_str(),
nullptr);
2259 qv.
message = m.matchString(value, 4);
2263 else if (s_rxmeqr2.match(value, 0, 0, &m))
2265 qv.
code = atoi(m.matchString(value, 1).c_str());
2267 qv.
message = m.matchString(value, 2);
2273 std::cout <<
"*** DQMStore: WARNING: quality test value '" 2274 << value <<
"' is incorrectly formatted\n";
2281 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2282 << mename <<
"' in directory '" 2283 << dir <<
"' for quality test '" 2293 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2294 << obj->GetName() <<
"' of type '" 2295 << obj->IsA()->GetName() <<
"'\n";
2299 else if (
auto *
n = dynamic_cast<TNamed *>(obj))
2303 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2304 s +=
'<'; s +=
n->GetName(); s +=
'>';
2306 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2307 TObjString os(s.c_str());
2312 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2313 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2314 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2321 if (refcheck && isSubdirectory(s_referenceDirName, dir))
2323 std::string mdir(dir, s_referenceDirName.size()+1, std::string::npos);
2345 assert(! path.empty());
2349 size_t end = path.find(
'/', start);
2350 if (end == std::string::npos)
2358 TObject *
o = gDirectory->Get(part.c_str());
2359 if (o && ! dynamic_cast<TDirectory *>(o))
2360 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2361 " fails because the part '%s' already exists and is not" 2362 " directory", path.c_str(), part.c_str());
2364 gDirectory->mkdir(part.c_str());
2366 if (! gDirectory->cd(part.c_str()))
2367 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2368 " fails because could not cd into subdirectory '%s'",
2369 path.c_str(), part.c_str());
2372 if (end+1 >= path.size())
2377 end = path.find(
'/', start);
2378 if (end == std::string::npos)
2392 TObjString(me.
tagString().c_str()).Write();
2398 if (not isSubdirectory(s_referenceDirName, *me.
data_.
dirname))
2423 MEMap::const_iterator
begin,
2424 MEMap::const_iterator
end,
2428 for (
auto const& me: boost::make_iterator_range(begin, end))
2430 if (not isSubdirectory(dir, *me.data_.dirname))
2435 <<
" run: " << me.run()
2436 <<
" lumi: " << me.lumi()
2437 <<
" lumiFlag: " << me.getLumiFlag()
2438 <<
" moduleId: " << me.moduleId()
2439 <<
" fullpathname: " << me.getFullname()
2440 <<
" flags: " << std::hex << me.data_.flags
2444 if (dir != *me.data_.dirname) {
2446 std::cout <<
"DQMStore::save: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2457 if (isSubdirectory(refpath, *me.data_.dirname))
2470 std::string mname(me.getFullname(), s_referenceDirName.size()+1, std::string::npos);
2473 for (
auto const& qreport : master->data_.qreports)
2474 status =
std::max(status, qreport.code);
2476 if (not master
or status < minStatus)
2479 std::cout <<
"DQMStore::save: skipping monitor element '" 2480 << me.data_.objname <<
"' while saving, status is " 2481 << status <<
", required minimum status is " 2482 << minStatus << std::endl;
2489 std::cout <<
"DQMStore::save: saving monitor element" << std::endl;
2506 const uint32_t
run ,
2507 const uint32_t
lumi ,
2517 class TFileNoSync :
public TFile
2520 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2521 Int_t SysSync(Int_t)
override {
return 0; }
2526 unsigned int nme = 0;
2530 std::cout <<
"DQMStore::save: Opening TFile '" << filename
2531 <<
"' with option '" << fileupdate <<
"'" 2535 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2537 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2541 std::unique_ptr<lat::Regexp> rxpat;
2542 if (not pattern.empty())
2543 rxpat = std::make_unique<lat::Regexp>(pattern);
2547 refpath.reserve(s_referenceDirName.size() + path.size() + 2);
2548 refpath += s_referenceDirName;
2549 if (not path.empty())
2556 for (
auto const& dir:
dirs_)
2560 if (not path.empty()
2561 and not isSubdirectory(refpath, dir)
2562 and not isSubdirectory(path, dir))
2566 std::cout <<
"DQMStore::save: DQM folder " << dir <<
"/" << std::endl;
2570 gDirectory->cd(
"/");
2572 cdInto(s_monitorDirName);
2573 else if (rxpat.get())
2576 cdInto(s_monitorDirName +
'/' + dir);
2590 auto end =
data_.lower_bound(proto);
2598 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2609 std::cout <<
"DQMStore::save: successfully wrote " << nme
2610 <<
" objects from path '" << path <<
"/" 2611 <<
"' into DQM file '" << filename <<
"'\n";
2621 TBufferFile
buffer(TBufferFile::kWrite);
2624 buffer.WriteObject(&
object);
2626 buffer.WriteObject(me.
object_);
2648 MEMap::const_iterator
begin,
2649 MEMap::const_iterator
end,
2653 for (
auto const& me: boost::make_iterator_range(begin, end))
2655 if (not isSubdirectory(dir, *me.data_.dirname))
2660 <<
" run: " << me.run()
2661 <<
" lumi: " << me.lumi()
2662 <<
" lumiFlag: " << me.getLumiFlag()
2663 <<
" moduleId: " << me.moduleId()
2664 <<
" fullpathname: " << me.getFullname()
2665 <<
" flags: " << std::hex << me.data_.flags
2669 if (dir != *me.data_.dirname) {
2671 std::cout <<
"DQMStore::savePB: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2680 std::cout <<
"DQMStore::savePB: saving monitor element" << std::endl;
2695 const uint32_t
run ,
2696 const uint32_t
lumi )
2698 using google::protobuf::io::FileOutputStream;
2699 using google::protobuf::io::GzipOutputStream;
2700 using google::protobuf::io::StringOutputStream;
2704 unsigned int nme = 0;
2707 std::cout <<
"DQMStore::savePB: Opening PBFile '" << filename <<
"'" 2713 for (
auto const& dir:
dirs_)
2717 if (not path.empty()
2718 and not isSubdirectory(path, dir))
2722 std::cout <<
"DQMStore::savePB: DQM folder " << dir <<
"/" << std::endl;
2737 auto end =
data_.lower_bound(proto);
2745 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2752 int filedescriptor =
::open(filename.c_str(),
2753 O_WRONLY | O_CREAT | O_TRUNC,
2757 FileOutputStream file_stream(filedescriptor);
2759 options.format = GzipOutputStream::GZIP;
2760 options.compression_level = 1;
2761 GzipOutputStream gzip_stream(&file_stream, options);
2762 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2765 gzip_stream.Close();
2766 file_stream.Close();
2767 ::close(filedescriptor);
2771 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2772 <<
" objects from path '" << path <<
"/" 2773 <<
"' into DQM file '" << filename <<
"'\n";
2788 unsigned int ntot = 0;
2789 unsigned int count = 0;
2791 if (! file->cd(curdir.c_str()))
2792 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while" 2793 " reading file '%s'", curdir.c_str(), file->GetName());
2798 if (dirpart.compare(0, s_monitorDirName.size(), s_monitorDirName) == 0)
2800 if (dirpart.size() == s_monitorDirName.size())
2802 else if (dirpart[s_monitorDirName.size()] ==
'/')
2803 dirpart.erase(0, s_monitorDirName.size()+1);
2807 bool skip = (! onlypath.empty() && ! isSubdirectory(onlypath, dirpart));
2809 if (prepend == s_collateDirName ||
2810 prepend == s_referenceDirName ||
2816 size_t slash = dirpart.find(
'/');
2817 size_t pos = dirpart.find(
"/Run summary");
2818 if (slash != std::string::npos && pos !=std::string::npos)
2820 dirpart.erase(pos,12);
2822 pos = dirpart.find(
"Run ");
2823 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2824 if (pos !=std::string::npos)
2825 dirpart.erase(pos,length);
2831 if (prepend == s_collateDirName ||
2832 prepend == s_referenceDirName)
2834 size_t slash = dirpart.find(
'/');
2836 if (slash == std::string::npos
2837 && slash+1+s_referenceDirName.size() == dirpart.size()
2838 && dirpart.compare(slash+1, s_referenceDirName.size(), s_referenceDirName) == 0)
2841 slash = dirpart.find(
'/');
2843 if (slash != std::string::npos
2844 && slash + 10 == dirpart.size()
2845 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2847 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2852 if (dirpart.empty())
2855 dirpart = prepend +
'/' + dirpart;
2857 else if (! prepend.empty())
2859 if (dirpart.empty())
2862 dirpart = prepend +
'/' + dirpart;
2870 TIter
next (gDirectory->GetListOfKeys());
2871 std::list<TObject *> delayed;
2872 while ((key = (TKey *)
next()))
2874 std::unique_ptr<TObject>
obj(key->ReadObj());
2875 if (dynamic_cast<TDirectory *>(
obj.get()))
2878 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2880 if (! curdir.empty())
2882 subdir +=
obj->GetName();
2884 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2888 else if (dynamic_cast<TObjString *>(
obj.get()))
2890 delayed.push_back(
obj.release());
2895 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2896 <<
"' of type '" <<
obj->IsA()->GetName()
2897 <<
"' from '" << file->GetName()
2898 <<
"' into '" << dirpart <<
"'\n";
2906 while (! delayed.empty())
2909 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2910 <<
"' of type '" << delayed.front()->IsA()->GetName()
2911 <<
"' from '" << file->GetName()
2912 <<
"' into '" << dirpart <<
"'\n";
2918 delete delayed.front();
2919 delayed.pop_front();
2923 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2924 <<
" objects from directory '" << dirpart <<
"'\n";
2926 return ntot +
count;
2941 bool fileMustExist )
2943 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2953 bool fileMustExist )
2955 bool overwrite =
true;
2959 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2961 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2963 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2966 if (!s_rxpbfile.match(filename, 0, 0))
2967 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2969 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2983 bool fileMustExist )
2987 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
2989 std::unique_ptr<TFile>
f;
2993 f.reset(TFile::Open(filename.c_str()));
2994 if (! f.get() || f->IsZombie())
2995 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3004 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3009 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3012 for (
auto const& me :
data_)
3017 std::cout <<
"DQMStore::open: successfully read " << n
3018 <<
" objects from file '" << filename <<
"'";
3019 if (! onlypath.empty())
3020 std::cout <<
" from directory '" << onlypath <<
"'";
3021 if (! prepend.empty())
3022 std::cout <<
" into directory '" << prepend <<
"'";
3032 if (buf.Length() == buf.BufferSize())
3035 void *ptr = buf.ReadObjectAny(
nullptr);
3036 return reinterpret_cast<TObject *
>(ptr);
3045 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3046 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3048 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3049 TBufferFile buf(TBufferFile::kRead, h.
size(),
3065 bool fileMustExist )
3067 using google::protobuf::io::FileInputStream;
3068 using google::protobuf::io::FileOutputStream;
3069 using google::protobuf::io::GzipInputStream;
3070 using google::protobuf::io::GzipOutputStream;
3071 using google::protobuf::io::CodedInputStream;
3072 using google::protobuf::io::ArrayInputStream;
3075 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3078 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3080 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3083 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3088 FileInputStream
fin(filedescriptor);
3089 GzipInputStream
input(&fin);
3090 CodedInputStream input_coded(&input);
3091 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3092 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3093 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3096 ::close(filedescriptor);
3102 TObject *
obj =
nullptr;
3120 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3122 if (me ==
nullptr) {
3145 cleanTrailingSlashes(path, clean, cleaned);
3149 auto i =
data_.lower_bound(proto);
3150 while (
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname))
3153 auto de =
dirs_.end();
3154 auto di =
dirs_.lower_bound(*cleaned);
3155 while (di != de && isSubdirectory(*cleaned, *di))
3165 auto i =
data_.lower_bound(proto);
3166 while (
i !=
e && isSubdirectory(dir, *
i->data_.dirname))
3167 if (dir == *
i->data_.dirname)
3198 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent" 3199 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3213 return (
i ==
e ?
nullptr :
i->second);
3223 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3228 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown" 3229 " algorithm '%s'", algoname.c_str());
3246 cleanTrailingSlashes(dir, clean, cleaned);
3249 if (cleaned->find_first_not_of(s_safe) != std::string::npos)
3251 " uses unacceptable characters", cleaned->c_str());
3263 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3275 for (
auto const& me :
data_)
3278 mergePath(path, *me.data_.dirname, me.data_.objname);
3279 if (fm->match(path))
3296 std::cout <<
"DQMStore: running runQTests() with reset = " 3297 << (
reset_ ?
"true" :
"false" ) << std::endl;
3300 for (
auto const& me :
data_)
3301 if (! isSubdirectory(s_referenceDirName, *me.data_.dirname))
3302 const_cast<MonitorElement &>(me).runQTests();
3315 cleanTrailingSlashes(path, clean, cleaned);
3318 for (
auto const& me :
data_)
3320 if (! cleaned->empty() && ! isSubdirectory(*cleaned, *me.data_.dirname))
3325 else if (me.hasWarning())
3328 && me.hasOtherReport())
3372 std::cout <<
" ------------------------------------------------------------\n" 3373 <<
" Directory structure: \n" 3374 <<
" ------------------------------------------------------------\n";
3376 std::copy(contents.begin(), contents.end(),
3377 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3379 std::cout <<
" ------------------------------------------------------------\n";
3397 {
return me && isSubdirectory(s_collateDirName, *me->
data_.
dirname); }
3416 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3419 factor = factor/(events*1.0);
3421 for (
auto const&
m :
data_)
3428 me.getTH1F()->Scale(factor);
3433 me.getTH1S()->Scale(factor);
3438 me.getTH1D()->Scale(factor);
3443 me.getTH2F()->Scale(factor);
3448 me.getTH2S()->Scale(factor);
3453 me.getTH2D()->Scale(factor);
3458 me.getTH3F()->Scale(factor);
3463 me.getTProfile()->Scale(factor);
3468 me.getTProfile2D()->Scale(factor);
3473 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 &)
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
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
std::string qualityTagString(const DQMNet::QValue &qv) const
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_
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
MonitorElement * bookFloat(const char *name)
Book float.
static std::string const input
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)
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)
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.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
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::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
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 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.
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)
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
void setCurrentFolder(const std::string &fullpath)
static const Regexp s_rxmeval("<(.*)>(i|f|s|qr)=(.*)</\\1>")
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()
std::unique_ptr< std::ostream > stream_
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
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
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.
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.
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,...)