7 #include "classlib/utils/RegexpMatch.h" 8 #include "classlib/utils/Regexp.h" 9 #include "classlib/utils/StringOps.h" 10 #include <google/protobuf/io/coded_stream.h> 11 #include <google/protobuf/io/gzip_stream.h> 12 #include <google/protobuf/io/zero_copy_stream_impl.h> 18 #include "TBufferFile.h" 19 #include <boost/algorithm/string.hpp> 20 #include <boost/range/iterator_range_core.hpp> 62 std::string const s_safe{
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "};
64 lat::Regexp
const s_rxmeval{
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$"};
65 lat::Regexp
const s_rxmeqr1{
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$"};
66 lat::Regexp
const s_rxmeqr2{
"^st\\.(\\d+)\\.(.*)$"};
67 lat::Regexp
const s_rxtrace{
"(.*)\\((.*)\\+0x.*\\).*"};
68 lat::Regexp
const s_rxself{
"^[^()]*DQMStore::.*"};
69 lat::Regexp
const s_rxpbfile{
".*\\.pb$"};
80 || (path.size() >= ofdir.size()
81 && path.compare(0, ofdir.size(), ofdir) == 0
82 && (path.size() == ofdir.size()
83 || path[ofdir.size()] ==
'/')));
92 size_t len = path.size();
93 for ( ; len > 0 && path[len-1] ==
'/'; --len)
96 if (len != path.size()) {
97 clean = path.substr(0, len);
105 size_t slash = path.rfind(
'/');
106 if (slash != std::string::npos) {
107 dir.append(path, 0, slash);
108 name.append(path, slash+1, std::string::npos);
117 path.reserve(dir.size() + name.size() + 2);
128 return new T{qtname};
135 m[T::getAlgoName()] = &makeQCriterion<T>;
149 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality" 154 size_t starCount = 0;
158 if ((
size_t)pos == std::string::npos)
164 if ((
fastString_.find(
'"') != std::string::npos) ||
174 if (starCount == 1) {
175 if (boost::algorithm::starts_with(
fastString_,
"*")) {
181 if (boost::algorithm::ends_with(
fastString_,
"*")) {
189 if (starCount == 2) {
190 if (boost::algorithm::starts_with(
fastString_,
"*") &&
203 if (input.size() < pattern.size())
209 auto rit_pattern = pattern.crbegin();
210 auto rit_input = input.crbegin();
212 for (; rit_pattern < pattern.rend(); ++rit_pattern, ++rit_input) {
213 if (*rit_pattern != *rit_input)
223 if (input.size() < pattern.size())
229 auto rit_pattern = pattern.cbegin();
230 auto rit_input = input.cbegin();
232 for (; rit_pattern < pattern.end(); ++rit_pattern, ++rit_input) {
233 if (*rit_pattern != *rit_input)
270 owner_->setCurrentFolder(fullpath);
280 return owner_->pwd();
285 owner_->tag(me, tag);
290 owner_->tagContents(path, myTag);
294 std::vector<MonitorElement*>
297 uint32_t
const lumi )
299 return owner_->getAllContents(path, run, lumi);
305 return owner_->get(path);
312 if (ptr ==
nullptr) {
313 std::stringstream
msg;
314 msg <<
"DQM object not found";
319 throw std::out_of_range(msg.str());
324 std::vector<std::string>
327 return owner_->getSubdirs();
330 std::vector<std::string>
333 return owner_->getMEs();
339 return owner_->containsAnyMonitorable(path);
345 return owner_->dirExists(path);
363 owner_->setCurrentFolder(fullpath);
375 if(
pset.getUntrackedParameter<
bool>(
"forceResetOnBeginRun",
false)) {
379 #if !WITHOUT_CMS_FRAMEWORK 398 delete qtestspec.first;
418 std::cout <<
"DQMStore: histogram collation is enabled\n";
422 std::cout <<
"DQMStore: MultiThread option is enabled\n";
426 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
430 std::cout <<
"DQMStore: saveByLumi option is enabled\n";
434 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
438 initQCriterion<Comp2RefChi2>(
qalgos_);
439 initQCriterion<Comp2Ref2DChi2>(
qalgos_);
440 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
441 initQCriterion<ContentsXRange>(
qalgos_);
442 initQCriterion<ContentsYRange>(
qalgos_);
443 initQCriterion<MeanWithinExpected>(
qalgos_);
444 initQCriterion<Comp2RefEqualH>(
qalgos_);
445 initQCriterion<DeadChannel>(
qalgos_);
446 initQCriterion<NoisyChannel>(
qalgos_);
447 initQCriterion<ContentSigma>(
qalgos_);
448 initQCriterion<ContentsWithinExpected>(
qalgos_);
449 initQCriterion<CompareToMedian>(
qalgos_);
450 initQCriterion<CompareLastFilledBin>(
qalgos_);
451 initQCriterion<CheckVariance>(
qalgos_);
455 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
474 stream_ = std::make_unique<std::ofstream>(
"histogramBookingBT.log");
483 size = backtrace(array, 10);
484 strings = backtrace_symbols(array, size);
489 if (!s_rxtrace.match(strings[level], 0, 0, &m))
continue;
490 demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(),
nullptr,
nullptr, &
r);
491 if (!demangled)
continue;
492 if (!s_rxself.match(demangled, 0, 0))
break;
497 if (demangled !=
nullptr) {
500 << (r ? m.matchString(strings[level], 2) :
demangled) <<
" " 501 << m.matchString(strings[level], 1) <<
"\n";
504 *
stream_ <<
"Skipping "<< dir <<
"/" << name
505 <<
" with stack size " << size <<
"\n";
510 if (
verbose_ > 4 || demangled ==
nullptr) {
514 for (i = 0; i <
size; ++
i)
515 if (s_rxtrace.match(strings[i], 0, 0, &m)) {
516 char* demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(),
nullptr,
nullptr, &
r);
517 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" " 518 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" " 519 << m.matchString(strings[i], 1) << std::endl;
557 cleanTrailingSlashes(subdir, clean, cleaned);
560 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
575 cleanTrailingSlashes(fullpath, clean, cleaned);
585 if (pos == std::string::npos)
600 prev.reserve(path.size());
601 subdir.reserve(path.size());
602 name.reserve(path.size());
609 subdir.append(path, 0, slash);
611 name.append(subdir, prevname, std::string::npos);
612 if (! prev.empty() &&
findObject(0, 0, 0, prev, name))
613 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'" 614 " which already exists as a monitor element",
617 if (!
dirs_.count(subdir))
618 dirs_.insert(subdir);
621 if (slash+1 >= path.size())
626 prevname = slash ? slash+1 :
slash;
628 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
637 return dirs_.count(path) > 0;
902 template <
class HISTO,
class COLLATE>
911 assert(name.find(
'/') == std::string::npos);
915 mergePath(path, dir, name);
918 h->SetDirectory(
nullptr);
931 << context <<
": monitor element '" 932 << path <<
"' already exists, collating" << std::endl;
941 assert(
dirs_.count(dir));
952 if (
q.first->match(path))
960 refdir.reserve(s_referenceDirName.size() + dir.size() + 1);
961 refdir += s_referenceDirName;
984 assert(name.find(
'/') == std::string::npos);
992 mergePath(path, dir, name);
995 << context <<
": monitor element '" 996 << path <<
"' already exists, resetting" << std::endl;
1003 assert(
dirs_.count(dir));
1099 int const nchX,
double const lowX,
double const highX)
1101 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1107 int const nchX,
double const lowX,
double const highX)
1109 return book1S_(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1115 int const nchX,
double const lowX,
double const highX)
1117 return book1DD_(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1123 int const nchX,
const float* xbinsize)
1125 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1132 return book1D_(
pwd_, name, static_cast<TH1F*>(source->Clone(name)));
1139 return book1S_(
pwd_, name, static_cast<TH1S*>(source->Clone(name)));
1146 return book1DD_(
pwd_, name, static_cast<TH1D*>(source->Clone(name)));
1174 int const nchX,
double const lowX,
double const highX,
1175 int const nchY,
double const lowY,
double const highY)
1179 nchY, lowY, highY));
1185 int const nchX,
double const lowX,
double const highX,
1186 int const nchY,
double const lowY,
double const highY)
1190 nchY, lowY, highY));
1196 int const nchX,
double const lowX,
double const highX,
1197 int const nchY,
double const lowY,
double const highY)
1201 nchY, lowY, highY));
1207 int const nchX,
const float* xbinsize,
int const nchY,
const float* ybinsize)
1210 nchX, xbinsize, nchY, ybinsize));
1216 int const nchX,
const float* xbinsize,
int const nchY,
const float* ybinsize)
1219 nchX, xbinsize, nchY, ybinsize));
1226 return book2D_(
pwd_, name, static_cast<TH2F*>(source->Clone(name)));
1233 return book2S_(
pwd_, name, static_cast<TH2S*>(source->Clone(name)));
1240 return book2DD_(
pwd_, name, static_cast<TH2D*>(source->Clone(name)));
1254 int const nchX,
double const lowX,
double const highX,
1255 int const nchY,
double const lowY,
double const highY,
1256 int const nchZ,
double const lowZ,
double const highZ)
1261 nchZ, lowZ, highZ));
1268 return book3D_(
pwd_, name, static_cast<TH3F*>(source->Clone(name)));
1276 return book_(dir, name,
"bookProfile",
1286 int const nchX,
double const lowX,
double const highX,
1287 int ,
double const lowY,
double const highY,
1301 int const nchX,
double const lowX,
double const highX,
1302 double const lowY,
double const highY,
1316 int const nchX,
double const* xbinsize,
1317 int ,
double const lowY,
double const highY,
1331 int const nchX,
double const* xbinsize,
1332 double const lowY,
double const highY,
1345 return bookProfile_(
pwd_, name, static_cast<TProfile*>(source->Clone(name)));
1353 return book_(dir, name,
"bookProfile2D",
1363 int const nchX,
double const lowX,
double const highX,
1364 int const nchY,
double const lowY,
double const highY,
1365 int ,
double const lowZ,
double const highZ,
1380 int const nchX,
double const lowX,
double const highX,
1381 int const nchY,
double const lowY,
double const highY,
1382 double const lowZ,
double const highZ,
1405 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1406 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1407 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1408 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1409 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1410 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1411 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1412 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1413 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1419 <<
"checkBinningMatches: different binning - cannot add object '" 1420 << h->GetName() <<
"' of type " 1421 << h->IsA()->GetName() <<
" to existing ME: '" 1503 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1506 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1507 " twice with multiple tags", me->
getFullname().c_str());
1519 splitPath(dir, name, path);
1524 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element" 1525 " '%s' with tag %u", path.c_str(), myTag);
1535 auto i =
data_.lower_bound(proto);
1536 for ( ;
i !=
e && path == *
i->data_.dirname; ++
i)
1537 tag(const_cast<MonitorElement *>(&*
i), myTag);
1547 cleanTrailingSlashes(path, clean, cleaned);
1552 auto i =
data_.lower_bound(proto);
1553 while (
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname)) {
1554 tag(const_cast<MonitorElement*>(&*
i), myTag);
1563 std::vector<std::string>
1566 std::vector<std::string>
result;
1578 while (++
i !=
e && isSubdirectory(
pwd_, *
i))
1579 if (
i->find(
'/',
pwd_.size()+1) == std::string::npos)
1580 result.push_back(*
i);
1586 std::vector<std::string>
1590 std::vector<std::string>
result;
1592 auto i =
data_.lower_bound(proto);
1593 for ( ;
i !=
e && isSubdirectory(
pwd_, *
i->data_.dirname); ++
i)
1594 if (
pwd_ == *
i->data_.dirname)
1595 result.push_back(
i->getName());
1607 auto i =
data_.lower_bound(proto);
1608 return (
i !=
e && isSubdirectory(path, *
i->data_.dirname));
1617 splitPath(dir, name, path);
1619 auto mepos =
data_.find(proto);
1620 return (mepos ==
data_.end() ?
nullptr 1625 std::vector<MonitorElement*>
1629 std::vector<MonitorElement*>
result;
1630 for (
auto const& me :
data_) {
1632 result.push_back(const_cast<MonitorElement*>(&me));
1639 std::vector<MonitorElement*>
1644 cleanTrailingSlashes(path, clean, cleaned);
1647 std::vector<MonitorElement*>
result;
1649 auto i =
data_.lower_bound(proto);
1650 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i)
1651 if (*cleaned == *
i->data_.dirname)
1652 result.push_back(const_cast<MonitorElement *>(&*
i));
1658 std::vector<MonitorElement*>
1663 cleanTrailingSlashes(path, clean, cleaned);
1666 std::vector<MonitorElement*>
result;
1668 auto i =
data_.lower_bound(proto);
1669 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i)
1670 if (*cleaned == *
i->data_.dirname
1672 &&
i->data_.tag ==
tag)
1673 result.push_back(const_cast<MonitorElement *>(&*
i));
1686 into.reserve(
dirs_.size());
1688 auto me =
data_.end();
1689 for (
auto const& dir :
dirs_)
1692 auto mi =
data_.lower_bound(proto);
1694 size_t sz = dir.size() + 2;
1696 for ( ;
m != me && isSubdirectory(dir, *
m->data_.dirname); ++
m)
1697 if (dir == *
m->data_.dirname)
1699 sz +=
m->data_.objname.size() + 1;
1715 for (sz = 0; mi !=
m; ++mi)
1717 if (dir != *mi->data_.dirname)
1723 *istr += mi->data_.objname;
1729 istr->reserve(dir.size() + 2);
1740 uint32_t
const lumi,
1741 uint32_t
const moduleId,
1745 if (dir.find_first_not_of(s_safe) != std::string::npos)
1746 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1747 " unacceptable characters", dir.c_str());
1748 if (name.find_first_not_of(s_safe) != std::string::npos)
1749 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1750 " unacceptable characters", name.c_str());
1759 auto mepos =
data_.find(proto);
1760 return (mepos ==
data_.end() ?
nullptr 1766 std::vector<MonitorElement*>
1768 uint32_t
const run ,
1769 uint32_t
const lumi )
const 1773 cleanTrailingSlashes(path, clean, cleaned);
1777 std::vector<MonitorElement*>
result;
1779 auto i =
data_.lower_bound(proto);
1780 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i) {
1782 if (
i->data_.run > run
1783 ||
i->data_.moduleId != 0)
1787 if (
i->data_.lumi > lumi
1788 ||
i->data_.moduleId != 0)
1791 if (run != 0
or lumi !=0) {
1792 assert(
i->data_.moduleId == 0);
1794 result.push_back(const_cast<MonitorElement*>(&*
i));
1800 for ( ;
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname); ++
i) {
1801 if (
i->data_.run != 0
or i->data_.moduleId != 0)
1803 result.push_back(const_cast<MonitorElement*>(&*
i));
1812 std::vector<MonitorElement*>
1817 rx = lat::Regexp(pattern, 0, syntaxType);
1821 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
1822 pattern.c_str(), e.explain().c_str());
1826 std::vector<MonitorElement *>
result;
1827 for (
auto const& me :
data_) {
1829 mergePath(path, *me.data_.dirname, me.data_.objname);
1831 result.push_back(const_cast<MonitorElement*>(&me));
1846 for (
auto const&
m :
data_) {
1848 if (me.wasUpdated()) {
1866 for (
auto const&
m :
data_) {
1891 uint32_t
run = lumiblock.run();
1897 auto i =
data_.lower_bound(begin);
1898 const auto e =
data_.lower_bound(end);
1923 std::cout <<
"DQMStore::cloneLumiHistograms - Preparing lumi histograms for run: " 1924 << run <<
", lumi: " << lumi <<
", module: " << moduleId << std::endl;
1937 auto tobehandled = std::vector<MonitorElement const*>();
1938 for (;
i !=
e; ++
i) {
1939 tobehandled.push_back(&*
i);
1941 for (
auto i : tobehandled) {
1949 clone.setLumi(lumi);
1950 clone.markToDelete();
1965 std::cout <<
"DQMStore::cloneRunHistograms - Preparing run histograms for run: " 1966 << run <<
", module: " << moduleId << std::endl;
1979 auto tobehandled = std::vector<MonitorElement const*>();
1980 for (;
i !=
e; ++
i) {
1981 tobehandled.push_back(&*
i);
1983 for (
auto i : tobehandled) {
1991 clone.markToDelete();
2017 auto i =
data_.lower_bound(proto);
2020 if (
i->data_.moduleId != 0)
2022 if (
i->data_.lumi != lumi)
2024 if (
i->data_.run != run)
2026 if (not
i->markedToDelete()) {
2032 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '" 2033 << *
i->data_.dirname <<
"/" <<
i->data_.objname <<
"'" 2034 <<
"flags " <<
i->data_.flags <<
"\n";
2049 bool const overwrite,
2054 if (
auto*
h = dynamic_cast<TProfile*>(obj)) {
2064 else if (
auto*
h = dynamic_cast<TProfile2D*>(obj)) {
2074 else if (
auto*
h = dynamic_cast<TH1F*>(obj)) {
2077 me =
book1D_(dir,
h->GetName(), (TH1F*)
h->Clone());
2084 else if (
auto*
h = dynamic_cast<TH1S*>(obj)) {
2087 me =
book1S_(dir,
h->GetName(), (TH1S*)
h->Clone());
2094 else if (
auto*
h = dynamic_cast<TH1D*>(obj)) {
2097 me =
book1DD_(dir,
h->GetName(), (TH1D*)
h->Clone());
2104 else if (
auto*
h = dynamic_cast<TH2F*>(obj)) {
2107 me =
book2D_(dir,
h->GetName(), (TH2F*)
h->Clone());
2114 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)) {
2127 me =
book2DD_(dir,
h->GetName(), (TH2D*)
h->Clone());
2134 else if (
auto*
h = dynamic_cast<TH3F*>(obj)) {
2137 me =
book3D_(dir,
h->GetName(), (TH3F*)
h->Clone());
2144 else if (dynamic_cast<TObjString*>(obj)) {
2146 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m)) {
2147 if (strstr(obj->GetName(),
"CMSSW")) {
2149 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2152 else if (strstr(obj->GetName(),
"DQMPATCH")) {
2154 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2158 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2159 << obj->GetName() <<
"' of type '" 2160 << obj->IsA()->GetName() <<
"'\n";
2171 if (! me || overwrite) {
2172 if (! me) me =
bookInt_(dir, label);
2173 me->
Fill(atoll(value.c_str()));
2176 else if (kind ==
"f") {
2178 if (! me || overwrite) {
2180 me->
Fill(atof(value.c_str()));
2183 else if (kind ==
"s") {
2190 else if (kind ==
"e") {
2193 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2194 << label <<
"' in directory '" 2195 << dir <<
"' to be marked as efficiency plot.\n";
2200 else if (kind ==
"t") {
2203 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2204 << label <<
"' in directory '" 2205 << dir <<
"' for a tag\n";
2209 char* endp =
nullptr;
2210 unsigned long val = strtoul(value.c_str(), &endp, 10);
2211 if ((val == 0 && errno) || *endp || val > ~uint32_t(0)) {
2212 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '" 2213 << value <<
"' for monitor element '" 2214 << label <<
"' in directory '" 2215 << dir <<
"' - invalid value\n";
2220 else if (kind ==
"qr") {
2222 if (! isSubdirectory(s_referenceDirName, dir)) {
2223 size_t dot = label.find(
'.');
2224 if (dot == std::string::npos) {
2225 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2226 <<
"' is missing a '.' and cannot be extracted\n";
2231 std::string qrname (label, dot+1, std::string::npos);
2235 if (s_rxmeqr1.match(value, 0, 0, &m)) {
2236 qv.
code = atoi(m.matchString(value, 1).c_str());
2237 qv.
qtresult = strtod(m.matchString(value, 2).c_str(),
nullptr);
2238 qv.
message = m.matchString(value, 4);
2242 else if (s_rxmeqr2.match(value, 0, 0, &m)) {
2243 qv.
code = atoi(m.matchString(value, 1).c_str());
2245 qv.
message = m.matchString(value, 2);
2250 std::cout <<
"*** DQMStore: WARNING: quality test value '" 2251 << value <<
"' is incorrectly formatted\n";
2257 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2258 << mename <<
"' in directory '" 2259 << dir <<
"' for quality test '" 2268 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2269 << obj->GetName() <<
"' of type '" 2270 << obj->IsA()->GetName() <<
"'\n";
2274 else if (
auto*
n = dynamic_cast<TNamed*>(obj)) {
2277 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2278 s +=
'<'; s +=
n->GetName(); s +=
'>';
2280 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2281 TObjString os(s.c_str());
2285 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2286 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2287 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2294 if (refcheck && isSubdirectory(s_referenceDirName, dir)) {
2295 std::string mdir(dir, s_referenceDirName.size()+1, std::string::npos);
2316 assert(! path.empty());
2320 size_t end = path.find(
'/', start);
2321 if (end == std::string::npos)
2328 TObject*
o = gDirectory->Get(part.c_str());
2329 if (o && ! dynamic_cast<TDirectory*>(o))
2330 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2331 " fails because the part '%s' already exists and is not" 2332 " directory", path.c_str(), part.c_str());
2334 gDirectory->mkdir(part.c_str());
2336 if (! gDirectory->cd(part.c_str()))
2337 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2338 " fails because could not cd into subdirectory '%s'",
2339 path.c_str(), part.c_str());
2342 if (end+1 >= path.size())
2347 end = path.find(
'/', start);
2348 if (end == std::string::npos)
2361 TObjString(me.
tagString().c_str()).Write();
2367 if (not isSubdirectory(s_referenceDirName, *me.
data_.
dirname)) {
2388 int const minStatus,
2389 unsigned int const run,
2390 MEMap::const_iterator
const begin,
2391 MEMap::const_iterator
const end,
2395 for (
auto const& me: boost::make_iterator_range(begin, end)) {
2396 if (not isSubdirectory(dir, *me.data_.dirname))
2401 <<
" run: " << me.run()
2402 <<
" lumi: " << me.lumi()
2403 <<
" lumiFlag: " << me.getLumiFlag()
2404 <<
" moduleId: " << me.moduleId()
2405 <<
" fullpathname: " << me.getFullname()
2406 <<
" flags: " << std::hex << me.data_.flags
2410 if (dir != *me.data_.dirname) {
2412 std::cout <<
"DQMStore::save: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2423 if (isSubdirectory(refpath, *me.data_.dirname)) {
2434 std::string mname(me.getFullname(), s_referenceDirName.size()+1, std::string::npos);
2437 for (
auto const& qreport : master->data_.qreports)
2438 status =
std::max(status, qreport.code);
2440 if (not master
or status < minStatus) {
2442 std::cout <<
"DQMStore::save: skipping monitor element '" 2443 << me.data_.objname <<
"' while saving, status is " 2444 << status <<
", required minimum status is " 2445 << minStatus << std::endl;
2452 std::cout <<
"DQMStore::save: saving monitor element" << std::endl;
2469 uint32_t
const run ,
2470 uint32_t
const lumi ,
2472 int const minStatus ,
2480 class TFileNoSync :
public TFile {
2482 TFileNoSync(
char const*
file,
char const* opt) : TFile{
file, opt} {}
2483 Int_t SysSync(Int_t)
override {
return 0; }
2488 unsigned int nme = 0;
2492 std::cout <<
"DQMStore::save: Opening TFile '" << filename
2493 <<
"' with option '" << fileupdate <<
"'" 2497 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2499 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2503 std::unique_ptr<lat::Regexp> rxpat;
2504 if (not pattern.empty())
2505 rxpat = std::make_unique<lat::Regexp>(pattern);
2509 refpath.reserve(s_referenceDirName.size() + path.size() + 2);
2510 refpath += s_referenceDirName;
2511 if (not path.empty()) {
2517 for (
auto const& dir:
dirs_) {
2520 if (not path.empty()
2521 and not isSubdirectory(refpath, dir)
2522 and not isSubdirectory(path, dir))
2526 std::cout <<
"DQMStore::save: DQM folder " << dir <<
"/" << std::endl;
2530 gDirectory->cd(
"/");
2532 cdInto(s_monitorDirName);
2533 else if (rxpat.get())
2536 cdInto(s_monitorDirName +
'/' + dir);
2550 auto end =
data_.lower_bound(proto);
2558 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2569 std::cout <<
"DQMStore::save: successfully wrote " << nme
2570 <<
" objects from path '" << path <<
"/" 2571 <<
"' into DQM file '" << filename <<
"'\n";
2580 TBufferFile
buffer(TBufferFile::kWrite);
2583 buffer.WriteObject(&
object);
2585 buffer.WriteObject(me.
object_);
2605 unsigned int const run,
2606 MEMap::const_iterator
const begin,
2607 MEMap::const_iterator
const end,
2611 for (
auto const& me: boost::make_iterator_range(begin, end)) {
2612 if (not isSubdirectory(dir, *me.data_.dirname))
2617 <<
" run: " << me.run()
2618 <<
" lumi: " << me.lumi()
2619 <<
" lumiFlag: " << me.getLumiFlag()
2620 <<
" moduleId: " << me.moduleId()
2621 <<
" fullpathname: " << me.getFullname()
2622 <<
" flags: " << std::hex << me.data_.flags
2626 if (dir != *me.data_.dirname) {
2628 std::cout <<
"DQMStore::savePB: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2637 std::cout <<
"DQMStore::savePB: saving monitor element" << std::endl;
2652 uint32_t
const run ,
2653 uint32_t
const lumi )
2655 using google::protobuf::io::FileOutputStream;
2656 using google::protobuf::io::GzipOutputStream;
2657 using google::protobuf::io::StringOutputStream;
2661 unsigned int nme = 0;
2664 std::cout <<
"DQMStore::savePB: Opening PBFile '" << filename <<
"'" 2670 for (
auto const& dir:
dirs_) {
2673 if (not path.empty()
2674 and not isSubdirectory(path, dir))
2678 std::cout <<
"DQMStore::savePB: DQM folder " << dir <<
"/" << std::endl;
2693 auto end =
data_.lower_bound(proto);
2701 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2708 int filedescriptor =
::open(filename.c_str(),
2709 O_WRONLY | O_CREAT | O_TRUNC,
2713 FileOutputStream file_stream(filedescriptor);
2715 options.format = GzipOutputStream::GZIP;
2716 options.compression_level = 1;
2717 GzipOutputStream gzip_stream(&file_stream, options);
2718 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2721 gzip_stream.Close();
2722 file_stream.Close();
2723 ::close(filedescriptor);
2727 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2728 <<
" objects from path '" << path <<
"/" 2729 <<
"' into DQM file '" << filename <<
"'\n";
2738 bool const overwrite,
2744 unsigned int ntot = 0;
2745 unsigned int count = 0;
2747 if (! file->cd(curdir.c_str()))
2748 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while" 2749 " reading file '%s'", curdir.c_str(), file->GetName());
2754 if (dirpart.compare(0, s_monitorDirName.size(), s_monitorDirName) == 0) {
2755 if (dirpart.size() == s_monitorDirName.size())
2757 else if (dirpart[s_monitorDirName.size()] ==
'/')
2758 dirpart.erase(0, s_monitorDirName.size()+1);
2762 bool skip = (! onlypath.empty() && ! isSubdirectory(onlypath, dirpart));
2764 if (prepend == s_collateDirName ||
2765 prepend == s_referenceDirName ||
2770 size_t slash = dirpart.find(
'/');
2771 size_t pos = dirpart.find(
"/Run summary");
2772 if (slash != std::string::npos && pos !=std::string::npos) {
2773 dirpart.erase(pos,12);
2775 pos = dirpart.find(
"Run ");
2776 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2777 if (pos !=std::string::npos)
2778 dirpart.erase(pos,length);
2784 if (prepend == s_collateDirName ||
2785 prepend == s_referenceDirName) {
2786 size_t slash = dirpart.find(
'/');
2788 if (slash == std::string::npos
2789 && slash+1+s_referenceDirName.size() == dirpart.size()
2790 && dirpart.compare(slash+1, s_referenceDirName.size(), s_referenceDirName) == 0)
2793 slash = dirpart.find(
'/');
2795 if (slash != std::string::npos
2796 && slash + 10 == dirpart.size()
2797 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2799 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2804 if (dirpart.empty())
2807 dirpart = prepend +
'/' + dirpart;
2809 else if (! prepend.empty()) {
2810 if (dirpart.empty())
2813 dirpart = prepend +
'/' + dirpart;
2821 TIter
next (gDirectory->GetListOfKeys());
2822 std::list<TObject*> delayed;
2823 while ((key = (TKey*)
next()))
2825 std::unique_ptr<TObject>
obj(key->ReadObj());
2826 if (dynamic_cast<TDirectory*>(
obj.get())) {
2828 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2830 if (! curdir.empty())
2832 subdir +=
obj->GetName();
2834 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2838 else if (dynamic_cast<TObjString*>(
obj.get())) {
2839 delayed.push_back(
obj.release());
2843 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2844 <<
"' of type '" <<
obj->IsA()->GetName()
2845 <<
"' from '" << file->GetName()
2846 <<
"' into '" << dirpart <<
"'\n";
2854 while (! delayed.empty()) {
2856 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2857 <<
"' of type '" << delayed.front()->IsA()->GetName()
2858 <<
"' from '" << file->GetName()
2859 <<
"' into '" << dirpart <<
"'\n";
2865 delete delayed.front();
2866 delayed.pop_front();
2870 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2871 <<
" objects from directory '" << dirpart <<
"'\n";
2873 return ntot +
count;
2884 bool const overwrite ,
2888 bool const fileMustExist )
2890 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2900 bool const fileMustExist )
2902 bool overwrite =
true;
2906 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2908 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2910 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2913 if (!s_rxpbfile.match(filename, 0, 0))
2914 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2916 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2926 bool const overwrite ,
2930 bool const fileMustExist )
2934 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
2936 std::unique_ptr<TFile>
f;
2939 f.reset(TFile::Open(filename.c_str()));
2940 if (! f.get() || f->IsZombie())
2941 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
2948 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
2953 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
2956 for (
auto const& me :
data_)
2960 std::cout <<
"DQMStore::open: successfully read " << n
2961 <<
" objects from file '" << filename <<
"'";
2962 if (! onlypath.empty())
2963 std::cout <<
" from directory '" << onlypath <<
"'";
2964 if (! prepend.empty())
2965 std::cout <<
" into directory '" << prepend <<
"'";
2976 if (buf.Length() == buf.BufferSize())
2979 void* ptr = buf.ReadObjectAny(
nullptr);
2980 return reinterpret_cast<TObject*
>(ptr);
2989 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
2990 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
2992 objname.assign(h.
full_pathname(), namepos, std::string::npos);
2993 TBufferFile buf(TBufferFile::kRead, h.
size(),
3005 bool const overwrite ,
3009 bool const fileMustExist )
3011 using google::protobuf::io::FileInputStream;
3012 using google::protobuf::io::FileOutputStream;
3013 using google::protobuf::io::GzipInputStream;
3014 using google::protobuf::io::GzipOutputStream;
3015 using google::protobuf::io::CodedInputStream;
3016 using google::protobuf::io::ArrayInputStream;
3019 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3022 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3024 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3027 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3032 FileInputStream
fin(filedescriptor);
3033 GzipInputStream
input(&fin);
3034 CodedInputStream input_coded(&input);
3035 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3036 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3037 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3040 ::close(filedescriptor);
3046 TObject*
obj =
nullptr;
3063 extract(static_cast<TObject*>(obj), path, overwrite, collate);
3065 if (me ==
nullptr) {
3088 cleanTrailingSlashes(path, clean, cleaned);
3092 auto i =
data_.lower_bound(proto);
3093 while (
i !=
e && isSubdirectory(*cleaned, *
i->data_.dirname))
3096 auto de =
dirs_.end();
3097 auto di =
dirs_.lower_bound(*cleaned);
3098 while (di != de && isSubdirectory(*cleaned, *di))
3108 auto i =
data_.lower_bound(proto);
3109 while (
i !=
e && isSubdirectory(dir, *
i->data_.dirname))
3110 if (dir == *
i->data_.dirname)
3141 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent" 3142 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3156 return (
i ==
e ?
nullptr :
i->second);
3166 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3171 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown" 3172 " algorithm '%s'", algoname.c_str());
3189 cleanTrailingSlashes(dir, clean, cleaned);
3192 if (cleaned->find_first_not_of(s_safe) != std::string::npos)
3194 " uses unacceptable characters", cleaned->c_str());
3206 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3218 for (
auto const& me :
data_) {
3220 mergePath(path, *me.data_.dirname, me.data_.objname);
3221 if (fm->match(path)) {
3237 std::cout <<
"DQMStore: running runQTests() with reset = " 3238 << (
reset_ ?
"true" :
"false" ) << std::endl;
3241 for (
auto const& me :
data_)
3242 if (! isSubdirectory(s_referenceDirName, *me.data_.dirname))
3243 const_cast<MonitorElement &>(me).runQTests();
3256 cleanTrailingSlashes(path, clean, cleaned);
3259 for (
auto const& me :
data_) {
3260 if (! cleaned->empty() && ! isSubdirectory(*cleaned, *me.data_.dirname))
3265 else if (me.hasWarning())
3268 && me.hasOtherReport())
3312 std::cout <<
" ------------------------------------------------------------\n" 3313 <<
" Directory structure: \n" 3314 <<
" ------------------------------------------------------------\n";
3316 std::copy(contents.begin(), contents.end(),
3317 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3319 std::cout <<
" ------------------------------------------------------------\n";
3338 return me && isSubdirectory(s_collateDirName, *me->
data_.
dirname);
3359 MonitorElement* event_me =
get(
"Info/EventInfo/processedEvents");
3362 factor = factor/(events*1.0);
3364 for (
auto const&
m :
data_) {
3366 switch (me.kind()) {
3369 me.getTH1F()->Scale(factor);
3374 me.getTH1S()->Scale(factor);
3379 me.getTH1D()->Scale(factor);
3384 me.getTH2F()->Scale(factor);
3389 me.getTH2S()->Scale(factor);
3394 me.getTH2D()->Scale(factor);
3399 me.getTH3F()->Scale(factor);
3404 me.getTProfile()->Scale(factor);
3409 me.getTProfile2D()->Scale(factor);
3414 std::cout <<
" The DQM object '" << me.getFullname() <<
"' is not scalable object " << std::endl;
bool compare_strings_reverse(std::string const &pattern, std::string const &input) const
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * bookProfile2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s")
TProfile * getTProfile() const
edm::ErrorSummaryEntry Error
Master< F > master(const F &f)
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book2DD_(std::string const &dir, std::string const &name, TH2D *h)
Book 2D histogram based on TH2D.
void rmdir(std::string const &fullpath)
::google::protobuf::uint32 size() const
int64_t getIntValue() const
bool isCollateME(MonitorElement *me) const
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
const ::std::string & full_pathname() const
std::vector< MonitorElement * > getAllContents(std::string const &path, uint32_t runNumber=0, uint32_t lumi=0)
std::vector< MonitorElement * > getContents(std::string const &path) const
MonitorElement * initialise(Kind kind)
TProfile2D * getTProfile2D() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void savePB(std::string const &filename, std::string const &path="", uint32_t run=0, uint32_t lumi=0)
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
bool match(std::string const &s) const
void removeElement(std::string const &name)
MonitorElement * bookString_(std::string const &dir, std::string const &name, std::string const &value)
Book string.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
double getFloatValue() const
void setLumi(uint32_t ls)
void postGlobalBeginLumi(const edm::GlobalContext &)
std::vector< MonitorElement * > getMatchingContents(std::string const &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
void tagContents(std::string const &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
std::string qualityTagString(const DQMNet::QValue &qv) const
LuminosityBlockID const & luminosityBlockID() const
MonitorElement * book1DD(char_string const &name, char_string const &title, int nchX, double lowX, double highX)
Book 1S histogram.
void makeDirectory(std::string const &path)
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
def replace(string, replacements)
void setCurrentFolder(std::string const &fullpath)
static const uint32_t DQM_PROP_TAGGED
MatchingHeuristicEnum matching_
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
const std::string * dirname
MonitorElement * book1D_(std::string const &dir, std::string const &name, TH1F *h)
Book 1D histogram based on TH1F.
bool extract(TObject *obj, std::string const &dir, bool overwrite, bool collateHistograms)
void initializeFrom(const edm::ParameterSet &)
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
MonitorElement * bookInt(char_string const &name)
Book int.
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
void set_flags(::google::protobuf::uint32 value)
void disableSoftReset()
reverts action of softReset
void get_info(dqmstorepb::ROOTFilePB_Histo const &, std::string &dirname, std::string &objname, TObject **obj)
const ::std::string & streamed_histo() const
bool cdInto(std::string const &path) const
fastmatch(std::string fastString)
MonitorElement * bookFloat(char_string const &name)
Book float.
DQMStore(edm::ParameterSet const &pset, edm::ActivityRegistry &)
static std::string const input
void tag(MonitorElement *me, unsigned int myTag)
void disableSoftReset(MonitorElement *me)
unsigned int maxNumberOfStreams() const
void useQTest(std::string const &dir, std::string const &qtname)
void saveMonitorElementRangeToROOT(std::string const &dir, std::string const &refpath, SaveReferenceTag ref, int minStatus, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, TFile &file, unsigned int &counter)
MonitorElement * book2DD(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
std::pair< fastmatch *, QCriterion * > QTestSpec
void saveMonitorElementToROOT(MonitorElement const &me, TFile &file)
MonitorElement * getElement(std::string const &path)
static const uint32_t DQM_PROP_HAS_REFERENCE
void print_trace(std::string const &dir, std::string const &name)
void setLumiFlag()
this ME is meant to be stored for each luminosity section
void setCurrentFolder(std::string const &fullpath)
void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi)
MonitorElement * book2D_(std::string const &dir, std::string const &name, TH2F *h)
Book 2D histogram based on TH2F.
bool dirExists(std::string const &path) const
true if directory exists
MonitorElement * book1DD_(std::string const &dir, std::string const &name, TH1D *h)
Book 1D histogram based on TH1D.
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
std::string tagString() const
MonitorElement * book3D_(std::string const &dir, std::string const &name, TH3F *h)
Book 3D histogram based on TH3F.
void tag(MonitorElement *, unsigned int)
std::vector< std::shared_ptr< fireworks::OptionNode > > Options
void saveMonitorElementRangeToPB(std::string const &dir, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, dqmstorepb::ROOTFilePB &file, unsigned int &counter)
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
void setVerbose(unsigned level)
void softReset(MonitorElement *me)
TObject * extractNextObject(TBufferFile &) const
void Reset()
reset ME (ie. contents, errors, etc)
QCriterion * getQCriterion(std::string const &qtname) const
bool containsAnyMonitorable(std::string const &path)
unsigned int readDirectory(TFile *file, bool overwrite, std::string const &path, std::string const &prepend, std::string const &curdir, OpenRunDirs stripdirs)
std::vector< std::string > getSubdirs() const
MonitorElement * bookString(char_string const &name, char_string const &value)
Book string.
MonitorElement * get(std::string const &path)
int getStatus(std::string const &path="") const
std::string const & pwd() const
const std::string getFullname() const
get full name of ME including Pathname
MonitorElement * book2S(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
MonitorElement * book1S_(std::string const &dir, std::string const &name, TH1S *h)
Book 1D histogram based on TH1S.
void saveMonitorElementToPB(MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
void setCurrentFolder(std::string const &fullpath)
MonitorElement * bookProfile(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
void showDirStructure() const
void cd()
go to top directory (ie. root)
QCriterion * createQTest(std::string const &algoname, std::string const &qtname)
std::string effLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
void set_size(::google::protobuf::uint32 value)
std::string const & pwd()
MonitorElement * book2S_(std::string const &dir, std::string const &name, TH2S *h)
Book 2D histogram based on TH2S.
std::string tagLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
bool dirExists(std::string const &path)
std::vector< std::string > getMEs() const
get list of (non-dir) MEs of current directory
MonitorElement * bookFloat_(std::string const &dir, std::string const &name)
Book float.
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
bool readFilePB(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
static const Regexp s_rxmeval("<(.*)>(i|f|s|qr)=(.*)</\\1>")
void set_full_pathname(const ::std::string &value)
void setVerbose(int verbose)
probability limits for warnings, errors
void removeContents()
erase all monitoring elements in current directory (not including subfolders);
bool forceResetOnBeginLumi_
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
::dqmstorepb::ROOTFilePB_Histo * add_histo()
void cloneRunHistograms(uint32_t run, uint32_t moduleId)
static std::atomic< unsigned int > counter
void cloneLumiHistograms(uint32_t run, uint32_t lumi, uint32_t moduleId)
bool readFile(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
MonitorElement * book1S(char_string const &name, char_string const &title, int nchX, double lowX, double highX)
Book 1S histogram.
std::vector< std::string > getSubdirs()
std::unique_ptr< std::ostream > stream_
::google::protobuf::uint32 flags() const
static const int STATUS_OK
void tagContents(std::string const &, unsigned int)
MonitorElement * book3D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
void setAccumulate(MonitorElement *me, bool flag)
MonitorElement * bookInt_(std::string const &dir, std::string const &name)
Book int.
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
void Reset(std::vector< TH2F > &depth)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
void goUp()
equivalent to "cd .."
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
bool load(std::string const &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
std::vector< std::string > getMEs()
MonitorElement * initialise(MonitorElement *me, std::string const &path)
std::set< std::string > dirs_
static const uint32_t DQM_PROP_LUMI
static std::string const source
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
Kind kind() const
Get the type of the monitor element.
bool compare_strings(std::string const &pattern, std::string const &input) const
int useQTestByMatch(std::string const &pattern, std::string const &qtname)
attach quality test <qc> to monitor elements matching <pattern>.
std::vector< MonitorElement * > getAllContents(std::string const &path, uint32_t runNumber=0, uint32_t lumi=0) const
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
bool containsAnyMonitorable(std::string const &path) const
std::unique_ptr< lat::Regexp > regexp_
void set_streamed_histo(const ::std::string &value)
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
void tagAllContents(std::string const &path, unsigned int myTag)
void raiseDQMError(const char *context, const char *fmt,...)