8 #include "classlib/utils/RegexpMatch.h"
9 #include "classlib/utils/Regexp.h"
10 #include "classlib/utils/StringOps.h"
11 #include <google/protobuf/io/coded_stream.h>
12 #include <google/protobuf/io/gzip_stream.h>
13 #include <google/protobuf/io/zero_copy_stream_impl.h>
19 #include "TBufferFile.h"
22 #include <boost/algorithm/string.hpp>
56 static const std::string s_safe =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# ";
58 static const lat::Regexp
s_rxmeval (
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$");
59 static const lat::Regexp
s_rxmeqr1 (
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$");
60 static const lat::Regexp
s_rxmeqr2 (
"^st\\.(\\d+)\\.(.*)$");
61 static const lat::Regexp
s_rxtrace (
"(.*)\\((.*)\\+0x.*\\).*");
62 static const lat::Regexp
s_rxpbfile (
".*\\.pb$");
71 || (path.size() >= ofdir.size()
72 && path.compare(0, ofdir.size(), ofdir) == 0
73 && (path.size() == ofdir.size()
74 || path[ofdir.size()] ==
'/')));
83 size_t len = path.size();
84 for ( ; len > 0 && path[len-1] ==
'/'; --len)
87 if (len != path.size())
89 clean = path.substr(0, len);
97 size_t slash = path.rfind(
'/');
98 if (slash != std::string::npos)
100 dir.append(path, 0, slash);
101 name.append(path, slash+1, std::string::npos);
110 path.reserve(dir.size() + name.size() + 2);
120 {
return new T(qtname); }
125 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
130 fastString_ (_fastString), matching_ (UseFull)
138 catch (lat::Error &
e)
141 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality"
146 size_t starCount = 0;
151 if ((
size_t)pos == std::string::npos)
157 if ((
fastString_.find(
'"') != std::string::npos) ||
170 if (boost::algorithm::starts_with(
fastString_,
"*"))
188 if (boost::algorithm::starts_with(
fastString_,
"*") &&
208 if (input.size() < pattern.size())
214 std::string::const_reverse_iterator rit_pattern = pattern.rbegin();
215 std::string::const_reverse_iterator rit_input = input.rbegin();
217 for (; rit_pattern < pattern.rend(); rit_pattern++, rit_input++)
219 if (*rit_pattern != *rit_input)
229 if (input.size() < pattern.size())
235 std::string::const_iterator rit_pattern = pattern.begin();
236 std::string::const_iterator rit_input = input.begin();
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);
292 return owner_->get(path);
296 return owner_->getSubdirs();
300 return owner_->getMEs();
304 return owner_->containsAnyMonitorable(path);
308 return owner_->dirExists(path);
320 owner_->setCurrentFolder(fullpath);
336 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: "
338 <<
", stream: " << streamId
339 <<
" module: " << moduleId << std::endl;
346 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
347 std::set<MonitorElement>::const_iterator
e =
data_.end();
348 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
350 if (i->data_.run != run
351 || i->data_.streamId != streamId
352 || i->data_.moduleId != moduleId)
366 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
367 if (me !=
data_.end()) {
369 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
373 me->getTH1()->Add(i->getTH1());
377 std::cout <<
"No global Object found. " << std::endl;
378 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
379 gme =
data_.insert(global_me);
392 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
393 << run <<
" lumi: " << lumi
394 <<
", stream: " << streamId
395 <<
" module: " << moduleId << std::endl;
397 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
398 std::set<MonitorElement>::const_iterator
e =
data_.end();
399 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
402 if (i->data_.run != run
403 || i->data_.streamId != streamId
404 || i->data_.moduleId != moduleId)
419 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
420 if (me !=
data_.end()) {
422 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
426 me->getTH1()->Add(i->getTH1());
429 std::cout <<
"No global Object found. " << std::endl;
430 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
431 gme =
data_.insert(global_me);
480 collateHistograms_ (
false),
481 enableMultiThread_(
false),
482 readSelectedDirectory_ (
""),
523 std::cout <<
"DQMStore: histogram collation is enabled\n";
527 std::cout <<
"DQMStore: MultiThread option is enabled\n";
531 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
536 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
540 initQCriterion<Comp2RefChi2>(
qalgos_);
541 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
542 initQCriterion<ContentsXRange>(
qalgos_);
543 initQCriterion<ContentsYRange>(
qalgos_);
544 initQCriterion<MeanWithinExpected>(
qalgos_);
545 initQCriterion<Comp2RefEqualH>(
qalgos_);
546 initQCriterion<DeadChannel>(
qalgos_);
547 initQCriterion<NoisyChannel>(
qalgos_);
548 initQCriterion<ContentsWithinExpected>(
qalgos_);
549 initQCriterion<CompareToMedian>(
qalgos_);
550 initQCriterion<CompareLastFilledBin>(
qalgos_);
551 initQCriterion<CheckVariance>(
qalgos_);
555 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
570 static std::ofstream
stream(
"histogramBookingBT.log");
578 size = backtrace (array, 10);
579 strings = backtrace_symbols (array, size);
584 char * demangled = abi::__cxa_demangle(m.matchString(strings[4], 2).c_str(), 0, 0, &
r);
585 stream <<
"\"" << dir <<
"/"
587 << (r ? m.matchString(strings[4], 2) : demangled) <<
" "
588 << m.matchString(strings[4], 1) <<
"\n";
592 stream <<
"Skipping "<< dir <<
"/" << name
593 <<
" with stack size " << size <<
"\n";
601 for (i = 0; i <
size; i++)
602 if (
s_rxtrace.match(strings[i], 0, 0, &m))
604 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
605 stream <<
"\t\t" << i <<
"/" << size <<
" "
606 << (r ? m.matchString(strings[i], 2) : demangled) <<
" "
607 << m.matchString(strings[i], 1) << std::endl;
644 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
668 size_t pos =
pwd_.rfind(
'/');
669 if (pos == std::string::npos)
684 prev.reserve(path.size());
685 subdir.reserve(path.size());
686 name.reserve(path.size());
694 subdir.append(path, 0, slash);
696 name.append(subdir, prevname, std::string::npos);
698 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
699 " which already exists as a monitor element",
702 if (!
dirs_.count(subdir))
703 dirs_.insert(subdir);
706 if (slash+1 >= path.size())
711 prevname = slash ? slash+1 :
slash;
713 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
721 {
return dirs_.count(path) > 0; }
726 template <
class HISTO,
class COLLATE>
729 const char *context,
int kind,
730 HISTO *
h, COLLATE collate)
732 assert(name.find(
'/') == std::string::npos);
755 << context <<
": monitor element '"
756 << path <<
"' already exists, collating" << std::endl;
766 assert(
dirs_.count(dir));
774 for ( ; qi != qe; ++qi)
776 if ( qi->first->match(path) )
777 me->addQReport(qi->second);
801 assert(name.find(
'/') == std::string::npos);
814 << context <<
": monitor element '"
815 << path <<
"' already exists, resetting" << std::endl;
823 assert(
dirs_.count(dir));
843 return book(dir, name,
"bookInt")
873 return book(dir, name,
"bookFloat")
902 return book(dir, name,
"bookString")
943 int nchX,
double lowX,
double highX)
945 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
951 int nchX,
double lowX,
double highX)
953 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
959 int nchX,
double lowX,
double highX)
961 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
967 int nchX,
double lowX,
double highX)
969 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
975 int nchX,
double lowX,
double highX)
977 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
983 int nchX,
double lowX,
double highX)
985 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
991 int nchX,
float *xbinsize)
993 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
999 int nchX,
float *xbinsize)
1001 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1008 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1015 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1022 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1029 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1036 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1043 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1071 int nchX,
double lowX,
double highX,
1072 int nchY,
double lowY,
double highY)
1074 return book2D(
pwd_, name,
new TH2F(name, title,
1076 nchY, lowY, highY));
1082 int nchX,
double lowX,
double highX,
1083 int nchY,
double lowY,
double highY)
1085 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1087 nchY, lowY, highY));
1093 int nchX,
double lowX,
double highX,
1094 int nchY,
double lowY,
double highY)
1096 return book2S(
pwd_, name,
new TH2S(name, title,
1098 nchY, lowY, highY));
1104 int nchX,
double lowX,
double highX,
1105 int nchY,
double lowY,
double highY)
1107 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1109 nchY, lowY, highY));
1115 int nchX,
double lowX,
double highX,
1116 int nchY,
double lowY,
double highY)
1120 nchY, lowY, highY));
1126 int nchX,
double lowX,
double highX,
1127 int nchY,
double lowY,
double highY)
1129 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1131 nchY, lowY, highY));
1137 int nchX,
float *xbinsize,
int nchY,
float *ybinsize)
1139 return book2D(
pwd_, name,
new TH2F(name, title,
1140 nchX, xbinsize, nchY, ybinsize));
1146 int nchX,
float *xbinsize,
int nchY,
float *ybinsize)
1148 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1149 nchX, xbinsize, nchY, ybinsize));
1156 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1163 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1170 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1177 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1184 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1191 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1205 int nchX,
double lowX,
double highX,
1206 int nchY,
double lowY,
double highY,
1207 int nchZ,
double lowZ,
double highZ)
1209 return book3D(
pwd_, name,
new TH3F(name, title,
1212 nchZ, lowZ, highZ));
1218 int nchX,
double lowX,
double highX,
1219 int nchY,
double lowY,
double highY,
1220 int nchZ,
double lowZ,
double highZ)
1222 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1225 nchZ, lowZ, highZ));
1232 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1239 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1247 return book(dir, name,
"bookProfile",
1257 int nchX,
double lowX,
double highX,
1258 int ,
double lowY,
double highY,
1259 const char *option )
1272 int nchX,
double lowX,
double highX,
1273 int ,
double lowY,
double highY,
1274 const char *option )
1276 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1287 int nchX,
double lowX,
double highX,
1288 double lowY,
double highY,
1289 const char *option )
1302 int nchX,
double lowX,
double highX,
1303 double lowY,
double highY,
1304 const char *option )
1306 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1317 int nchX,
double *xbinsize,
1318 int ,
double lowY,
double highY,
1319 const char *option )
1332 int nchX,
double *xbinsize,
1333 int ,
double lowY,
double highY,
1334 const char *option )
1336 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1347 int nchX,
double *xbinsize,
1348 double lowY,
double highY,
1349 const char *option )
1362 int nchX,
double *xbinsize,
1363 double lowY,
double highY,
1364 const char *option )
1366 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1376 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1383 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1391 return book(dir, name,
"bookProfile2D",
1401 int nchX,
double lowX,
double highX,
1402 int nchY,
double lowY,
double highY,
1403 int ,
double lowZ,
double highZ,
1404 const char *option )
1418 int nchX,
double lowX,
double highX,
1419 int nchY,
double lowY,
double highY,
1420 int ,
double lowZ,
double highZ,
1421 const char *option )
1435 int nchX,
double lowX,
double highX,
1436 int nchY,
double lowY,
double highY,
1437 double lowZ,
double highZ,
1438 const char *option )
1452 int nchX,
double lowX,
double highX,
1453 int nchY,
double lowY,
double highY,
1454 double lowZ,
double highZ,
1455 const char *option )
1468 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1475 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1484 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1485 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1486 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1487 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1488 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1489 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1490 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1491 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1492 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1499 <<
"checkBinningMatches: different binning - cannot add object '"
1500 << h->GetName() <<
"' of type "
1501 << h->IsA()->GetName() <<
" to existing ME: '"
1585 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1588 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1589 " twice with multiple tags", me->
getFullname().c_str());
1606 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1607 " '%s' with tag %u", path.c_str(), myTag);
1616 MEMap::iterator
e =
data_.end();
1617 MEMap::iterator
i =
data_.lower_bound(proto);
1618 for ( ; i != e && path == *i->data_.dirname; ++
i)
1619 tag(const_cast<MonitorElement *>(&*i), myTag);
1633 MEMap::iterator
e =
data_.end();
1634 MEMap::iterator
i =
data_.lower_bound(proto);
1637 tag(const_cast<MonitorElement *>(&*i), myTag);
1646 std::vector<std::string>
1649 std::vector<std::string>
result;
1650 std::set<std::string>::const_iterator
e =
dirs_.end();
1651 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1662 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1663 result.push_back(*i);
1669 std::vector<std::string>
1673 std::vector<std::string>
result;
1674 MEMap::const_iterator
e =
data_.end();
1675 MEMap::const_iterator
i =
data_.lower_bound(proto);
1677 if (
pwd_ == *i->data_.dirname)
1678 result.push_back(i->getName());
1689 MEMap::const_iterator
e =
data_.end();
1690 MEMap::const_iterator
i =
data_.lower_bound(proto);
1702 MEMap::const_iterator mepos =
data_.find(proto);
1703 return (mepos ==
data_.end() ? 0
1708 std::vector<MonitorElement *>
1712 std::vector<MonitorElement *>
result;
1713 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1717 result.push_back(const_cast<MonitorElement *>(&me));
1724 std::vector<MonitorElement *>
1732 std::vector<MonitorElement *>
result;
1733 MEMap::const_iterator
e =
data_.end();
1734 MEMap::const_iterator
i =
data_.lower_bound(proto);
1736 if (*cleaned == *i->data_.dirname)
1737 result.push_back(const_cast<MonitorElement *>(&*i));
1743 std::vector<MonitorElement *>
1751 std::vector<MonitorElement *>
result;
1752 MEMap::const_iterator
e =
data_.end();
1753 MEMap::const_iterator
i =
data_.lower_bound(proto);
1755 if (*cleaned == *i->data_.dirname
1757 && i->data_.tag ==
tag)
1758 result.push_back(const_cast<MonitorElement *>(&*i));
1771 into.reserve(
dirs_.size());
1773 MEMap::const_iterator me =
data_.end();
1774 std::set<std::string>::const_iterator di =
dirs_.begin();
1775 std::set<std::string>::const_iterator de =
dirs_.end();
1776 for ( ; di != de; ++di)
1779 MEMap::const_iterator mi =
data_.lower_bound(proto);
1780 MEMap::const_iterator
m = mi;
1781 size_t sz = di->size() + 2;
1784 if (*di == *m->data_.dirname)
1786 sz += m->data_.objname.size() + 1;
1793 std::vector<std::string>::iterator istr
1802 for (sz = 0; mi !=
m; ++mi)
1804 if (*di != *mi->data_.dirname)
1810 *istr += mi->data_.objname;
1816 istr->reserve(di->size() + 2);
1828 const uint32_t
run ,
1829 const uint32_t
lumi ,
1830 const uint32_t streamId ,
1831 const uint32_t moduleId )
const
1833 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1834 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1835 " unacceptable characters", dir.c_str());
1836 if (name.find_first_not_of(
s_safe) != std::string::npos)
1837 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1838 " unacceptable characters", name.c_str());
1848 MEMap::const_iterator mepos =
data_.find(proto);
1849 return (mepos ==
data_.end() ? 0
1859 into.reserve(
dirs_.size());
1861 MEMap::const_iterator me =
data_.end();
1862 std::set<std::string>::const_iterator di =
dirs_.begin();
1863 std::set<std::string>::const_iterator de =
dirs_.end();
1866 for ( ; di != de; ++di)
1869 MEMap::const_iterator mi =
data_.lower_bound(proto);
1870 MEMap::const_iterator
m = mi;
1871 size_t sz = di->size() + 2;
1877 sz += 1 + m->data_.objname.size() + 11;
1884 std::vector<std::string>::iterator istr
1891 for (sz = 0; mi !=
m; ++mi)
1895 sprintf(tagbuf,
"/%u", mi->data_.tag);
1898 *istr += m->data_.objname;
1908 std::vector<MonitorElement*>
1911 uint32_t
lumi )
const
1919 std::vector<MonitorElement *>
result;
1920 MEMap::const_iterator
e =
data_.end();
1921 MEMap::const_iterator
i =
data_.lower_bound(proto);
1923 if (runNumber != 0) {
1924 if (i->data_.run > runNumber
1925 || i->data_.streamId != 0
1926 || i->data_.moduleId != 0)
1930 if (i->data_.lumi > lumi
1931 || i->data_.streamId != 0
1932 || i->data_.moduleId != 0)
1935 if (runNumber != 0
or lumi !=0) {
1936 assert(i->data_.streamId == 0);
1937 assert(i->data_.moduleId == 0);
1939 result.push_back(const_cast<MonitorElement *>(&*i));
1946 std::vector<MonitorElement*>
1952 rx = lat::Regexp(pattern, 0, syntaxType);
1955 catch (lat::Error &
e)
1957 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
1958 pattern.c_str(), e.explain().c_str());
1962 std::vector<MonitorElement *>
result;
1963 MEMap::const_iterator
i =
data_.begin();
1964 MEMap::const_iterator e =
data_.end();
1965 for ( ; i !=
e; ++
i)
1968 mergePath(path, *i->data_.dirname, i->data_.objname);
1970 result.push_back(const_cast<MonitorElement *>(&*i));
1985 MEMap::iterator mi =
data_.begin();
1986 MEMap::iterator me =
data_.end();
1987 for ( ; mi != me; ++mi)
1990 if (mi->wasUpdated())
2009 MEMap::iterator mi =
data_.begin();
2010 MEMap::iterator me =
data_.end();
2011 for ( ; mi != me; ++mi)
2034 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2038 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2045 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2056 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2060 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2067 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2071 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2078 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2082 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2089 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2093 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2100 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2104 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2111 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2115 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2122 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2126 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2133 else if (dynamic_cast<TObjString *>(obj))
2136 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2138 if (strstr(obj->GetName(),
"CMSSW"))
2141 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2144 else if (strstr(obj->GetName(),
"DQMPATCH"))
2147 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2152 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2153 << obj->GetName() <<
"' of type '"
2154 << obj->IsA()->GetName() <<
"'\n";
2160 std::string kind = m.matchString(obj->GetName(), 2);
2166 if (! me || overwrite)
2168 if (! me) me =
bookInt(dir, label);
2169 me->
Fill(atoll(value.c_str()));
2172 else if (kind ==
"f")
2175 if (! me || overwrite)
2178 me->
Fill(atof(value.c_str()));
2181 else if (kind ==
"s")
2189 else if (kind ==
"e")
2194 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2195 << label <<
"' in directory '"
2196 << dir <<
"' to be marked as efficiency plot.\n";
2201 else if (kind ==
"t")
2206 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2207 << label <<
"' in directory '"
2208 << dir <<
"' for a tag\n";
2213 unsigned long val = strtoul(value.c_str(), &endp, 10);
2214 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2216 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2217 << value <<
"' for monitor element '"
2218 << label <<
"' in directory '"
2219 << dir <<
"' - invalid value\n";
2224 else if (kind ==
"qr")
2229 size_t dot = label.find(
'.');
2230 if (dot == std::string::npos)
2232 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2233 <<
"' is missing a '.' and cannot be extracted\n";
2238 std::string qrname (label, dot+1, std::string::npos);
2244 qv.
code = atoi(m.matchString(value, 1).c_str());
2245 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2246 qv.
message = m.matchString(value, 4);
2250 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2252 qv.
code = atoi(m.matchString(value, 1).c_str());
2254 qv.
message = m.matchString(value, 2);
2260 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2261 << value <<
"' is incorrectly formatted\n";
2268 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2269 << mename <<
"' in directory '"
2270 << dir <<
"' for quality test '"
2280 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2281 << obj->GetName() <<
"' of type '"
2282 << obj->IsA()->GetName() <<
"'\n";
2286 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2290 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2291 s +=
'<'; s +=
n->GetName(); s +=
'>';
2293 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2294 TObjString os(s.c_str());
2299 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2300 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2301 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2327 assert(! path.empty());
2331 size_t end = path.find(
'/', start);
2332 if (end == std::string::npos)
2340 TObject *
o = gDirectory->Get(part.c_str());
2341 if (o && ! dynamic_cast<TDirectory *>(o))
2342 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2343 " fails because the part '%s' already exists and is not"
2344 " directory", path.c_str(), part.c_str());
2346 gDirectory->mkdir(part.c_str());
2348 if (! gDirectory->cd(part.c_str()))
2349 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2350 " fails because could not cd into subdirectory '%s'",
2351 path.c_str(), part.c_str());
2354 if (end+1 >= path.size())
2359 end = path.find(
'/', start);
2360 if (end == std::string::npos)
2369 const uint32_t
run ,
2370 const uint32_t
lumi ,
2371 const bool deleteMEsAfterWriting )
2373 using google::protobuf::io::FileOutputStream;
2374 using google::protobuf::io::GzipOutputStream;
2375 using google::protobuf::io::StringOutputStream;
2377 std::set<std::string>::iterator di, de;
2378 MEMap::iterator mi, me =
data_.end();
2383 std::cout <<
"\n DQMStore: Opening PBFile '"
2384 << filename <<
"'"<< std::endl;
2387 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2400 mi =
data_.lower_bound(proto);
2401 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2405 <<
" Lumi: " << (*mi).lumi()
2406 <<
" LumiFlag: " << (*mi).getLumiFlag()
2407 <<
" streamId: " << (*mi).streamId()
2408 <<
" moduleId: " << (*mi).moduleId()
2409 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2416 if (*di != *mi->data_.dirname)
2425 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2429 std::cout <<
"DQMStore::savePB: saving monitor element '"
2430 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2431 <<
"flags " << mi->data_.flags <<
"\n";
2438 TObject *toWrite =
nullptr;
2442 toWrite =
new TObjString(mi->tagString().c_str());
2443 deleteObject =
true;
2445 toWrite = mi->object_;
2448 TBufferFile buffer(TBufferFile::kWrite);
2449 buffer.WriteObject(toWrite);
2464 int filedescriptor =
::open(filename.c_str(),
2465 O_WRONLY | O_CREAT | O_TRUNC,
2469 FileOutputStream file_stream(filedescriptor);
2471 options.format = GzipOutputStream::GZIP;
2472 options.compression_level = 6;
2473 GzipOutputStream gzip_stream(&file_stream,
2475 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2479 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2480 <<
" objects from path '" << path
2481 <<
"' into DQM file '" << filename <<
"'\n";
2494 const uint32_t
run ,
2495 const uint32_t
lumi ,
2499 const bool deleteMEsAfterWriting )
2501 std::set<std::string>::iterator di, de;
2502 MEMap::iterator mi, me =
data_.end();
2503 DQMNet::QReports::const_iterator qi, qe;
2511 class TFileNoSync :
public TFile
2514 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2515 virtual Int_t SysSync(Int_t)
override {
return 0; }
2520 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2521 <<
"' with option '" << fileupdate <<
"'\n";
2523 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2525 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2529 std::auto_ptr<lat::Regexp> rxpat;
2530 if (! pattern.empty())
2531 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2544 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2558 mi =
data_.lower_bound(proto);
2559 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2562 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2563 <<
" Lumi: " << (*mi).lumi()
2564 <<
" LumiFlag: " << (*mi).getLumiFlag()
2565 <<
" streamId: " << (*mi).streamId()
2566 <<
" moduleId: " << (*mi).moduleId()
2567 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2574 if (*di != *mi->data_.dirname) {
2576 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2586 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2612 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2613 status =
std::max(status, master->data_.qreports[
i].code);
2615 if (! master || status < minStatus)
2618 std::cout <<
"DQMStore::save: skipping monitor element '"
2619 << mi->data_.objname <<
"' while saving, status is "
2620 << status <<
", required minimum status is "
2621 << minStatus << std::endl;
2628 std::cout <<
"DQMStore::save: saving monitor element '"
2629 << mi->data_.objname <<
"'\n";
2633 gDirectory->cd(
"/");
2636 else if (rxpat.get())
2647 TObjString(mi->tagString().c_str()).Write();
2651 mi->object_->Write();
2658 qi = mi->data_.qreports.begin();
2659 qe = mi->data_.qreports.end();
2660 for ( ; qi != qe; ++qi)
2661 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2666 TObjString(mi->effLabelString().c_str()).Write();
2670 TObjString(mi->tagLabelString().c_str()).Write();
2682 std::cout <<
"DQMStore::save: successfully wrote " << nme
2683 <<
" objects from path '" << path
2684 <<
"' into DQM file '" << filename <<
"'\n";
2697 unsigned int ntot = 0;
2698 unsigned int count = 0;
2700 if (! file->cd(curdir.c_str()))
2701 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2702 " reading file '%s'", curdir.c_str(), file->GetName());
2725 size_t slash = dirpart.find(
'/');
2726 size_t pos = dirpart.find(
"/Run summary");
2727 if (slash != std::string::npos && pos !=std::string::npos)
2729 dirpart.erase(pos,12);
2731 pos = dirpart.find(
"Run ");
2732 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2733 if (pos !=std::string::npos)
2734 dirpart.erase(pos,length);
2743 size_t slash = dirpart.find(
'/');
2745 if (slash == std::string::npos
2750 slash = dirpart.find(
'/');
2752 if (slash != std::string::npos
2753 && slash + 10 == dirpart.size()
2754 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2756 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2761 if (dirpart.empty())
2764 dirpart = prepend +
'/' + dirpart;
2766 else if (! prepend.empty())
2768 if (dirpart.empty())
2771 dirpart = prepend +
'/' + dirpart;
2779 TIter
next (gDirectory->GetListOfKeys());
2780 std::list<TObject *> delayed;
2781 while ((key = (TKey *)
next()))
2783 std::auto_ptr<TObject>
obj(key->ReadObj());
2784 if (dynamic_cast<TDirectory *>(
obj.get()))
2787 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2789 if (! curdir.empty())
2791 subdir +=
obj->GetName();
2793 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2797 else if (dynamic_cast<TObjString *>(
obj.get()))
2799 delayed.push_back(
obj.release());
2804 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2805 <<
"' of type '" <<
obj->IsA()->GetName()
2806 <<
"' from '" << file->GetName()
2807 <<
"' into '" << dirpart <<
"'\n";
2815 while (! delayed.empty())
2818 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2819 <<
"' of type '" << delayed.front()->IsA()->GetName()
2820 <<
"' from '" << file->GetName()
2821 <<
"' into '" << dirpart <<
"'\n";
2827 delete delayed.front();
2828 delayed.pop_front();
2832 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2833 <<
" objects from directory '" << dirpart <<
"'\n";
2835 return ntot +
count;
2850 bool fileMustExist )
2852 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2862 bool fileMustExist )
2864 bool overwrite =
true;
2868 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2870 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2872 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2876 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2878 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2892 bool fileMustExist )
2896 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
2898 std::auto_ptr<TFile>
f;
2902 f.reset(TFile::Open(filename.c_str()));
2903 if (! f.get() || f->IsZombie())
2904 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
2913 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
2918 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
2921 MEMap::iterator mi =
data_.begin();
2922 MEMap::iterator me =
data_.end();
2923 for ( ; mi != me; ++mi)
2924 const_cast<MonitorElement &>(*mi).updateQReportStats();
2928 std::cout <<
"DQMStore::open: successfully read " << n
2929 <<
" objects from file '" << filename <<
"'";
2930 if (! onlypath.empty())
2931 std::cout <<
" from directory '" << onlypath <<
"'";
2932 if (! prepend.empty())
2933 std::cout <<
" into directory '" << prepend <<
"'";
2943 if (buf.Length() == buf.BufferSize())
2946 void *ptr = buf.ReadObjectAny(0);
2947 return reinterpret_cast<TObject *
>(ptr);
2956 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
2957 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
2959 objname.assign(h.
full_pathname(), namepos, std::string::npos);
2960 TBufferFile buf(TBufferFile::kRead, h.
size(),
2976 bool fileMustExist )
2978 using google::protobuf::io::FileInputStream;
2979 using google::protobuf::io::FileOutputStream;
2980 using google::protobuf::io::GzipInputStream;
2981 using google::protobuf::io::GzipOutputStream;
2982 using google::protobuf::io::CodedInputStream;
2983 using google::protobuf::io::ArrayInputStream;
2986 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
2989 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
2991 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
2994 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
2999 FileInputStream
fin(filedescriptor);
3000 GzipInputStream
input(&fin);
3001 CodedInputStream input_coded(&input);
3002 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3003 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3004 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3030 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3032 if (me ==
nullptr) {
3058 MEMap::iterator
e =
data_.end();
3059 MEMap::iterator
i =
data_.lower_bound(proto);
3063 std::set<std::string>::iterator de =
dirs_.end();
3064 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3074 MEMap::iterator
e =
data_.end();
3075 MEMap::iterator
i =
data_.lower_bound(proto);
3077 if (dir == *i->data_.dirname)
3104 MEMap::iterator pos =
data_.find(proto);
3105 if (pos ==
data_.end() && warning)
3106 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3107 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3120 QCMap::const_iterator
i =
qtests_.find(qtname);
3121 QCMap::const_iterator
e =
qtests_.end();
3122 return (i == e ? 0 : i->second);
3132 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3135 QAMap::iterator
i =
qalgos_.find(algoname);
3137 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3138 " algorithm '%s'", algoname.c_str());
3158 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3160 " uses unacceptable characters", cleaned->c_str());
3172 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3182 MEMap::iterator mi =
data_.begin();
3183 MEMap::iterator me =
data_.end();
3186 for ( ; mi != me; ++mi)
3189 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3190 if (fm->match(path))
3207 std::cout <<
"DQMStore: running runQTests() with reset = "
3208 << (
reset_ ?
"true" :
"false" ) << std::endl;
3211 MEMap::iterator mi =
data_.begin();
3212 MEMap::iterator me =
data_.end();
3213 for ( ; mi != me; ++mi)
3231 MEMap::const_iterator mi =
data_.begin();
3232 MEMap::const_iterator me =
data_.end();
3233 for ( ; mi != me; ++mi)
3235 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3240 else if (mi->hasWarning())
3243 && mi->hasOtherReport())
3287 std::cout <<
" ------------------------------------------------------------\n"
3288 <<
" Directory structure: \n"
3289 <<
" ------------------------------------------------------------\n";
3291 std::copy(contents.begin(), contents.end(),
3292 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3294 std::cout <<
" ------------------------------------------------------------\n";
3331 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3334 factor = factor/(events*1.0);
3336 MEMap::iterator mi =
data_.begin();
3337 MEMap::iterator me =
data_.end();
3338 for ( ; mi != me; ++mi)
3390 std::cout <<
" The DQM object '" << me.
getFullname() <<
"' is not scalable object " << std::endl;
static void collateProfile2D(MonitorElement *me, TProfile2D *h)
QCriterion * getQCriterion(const std::string &qtname) const
bool compare_strings_reverse(std::string const &pattern, std::string const &input) const
std::pair< fastmatch *, QCriterion * > QTestSpec
TH2S * getTH2S(void) const
TH1S * getTH1S(void) const
T getUntrackedParameter(std::string const &, T const &) const
DQMStore(const edm::ParameterSet &pset, edm::ActivityRegistry &)
static const lat::Regexp s_rxmeqr2("^st\\.(\\d+)\\.(.*)$")
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
bool containsAnyMonitorable(const std::string &path) const
inline::google::protobuf::uint32 size() const
bool isCollateME(MonitorElement *me) const
void resetUpdate(void)
reset "was updated" flag
tuple start
Check for commandline option errors.
bool cdInto(const std::string &path) const
const ::std::string & full_pathname() const
int getStatus(const std::string &path="") const
MonitorElement * initialise(Kind kind)
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
std::vector< std::string > getSubdirs(void) const
TProfile2D * getTProfile2D(void) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void rmdir(const std::string &fullpath)
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)
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
static void collate3D(MonitorElement *me, TH3F *h)
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.
static void collate1D(MonitorElement *me, TH1F *h)
void setLumi(uint32_t ls)
void cd(void)
go to top directory (ie. root)
MonitorElement * get(const std::string &path)
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
static void collate1DD(MonitorElement *me, TH1D *h)
static const std::string s_safe
static void splitPath(std::string &dir, std::string &name, const std::string &path)
const std::string & pwd(void)
void disableSoftReset(void)
reverts action of softReset
std::vector< MonitorElement * > getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
TH3F * getTH3F(void) const
static const uint32_t DQM_PROP_TAGGED
TH1D * getTH1D(void) const
MatchingHeuristicEnum matching_
void runQTests(void)
run all quality tests
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
TH2D * getTH2D(void) const
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)
const ::std::string & streamed_histo() const
void initQCriterion(std::map< std::string, QCriterion *(*)(const std::string &)> &m)
static const std::string s_collateDirName
MonitorElement * book(const std::string &dir, const std::string &name, const char *context)
static const std::string s_monitorDirName
name of global monitoring folder (containing all sources subdirectories)
MonitorElement * bookFloat(const char *name)
Book float.
static std::string const input
static const lat::Regexp s_rxtrace("(.*)\\((.*)\\+0x.*\\).*")
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Preallocate preallocateSignal_
signal is emitted before beginJob
void tag(MonitorElement *me, unsigned int myTag)
void disableSoftReset(MonitorElement *me)
static void collateProfile(MonitorElement *me, TProfile *h)
unsigned int maxNumberOfStreams() const
static const lat::Regexp s_rxmeval("^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$")
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
fastmatch(std::string const &_fastString)
static const uint32_t DQM_PROP_HAS_REFERENCE
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
tuple path
else: Piece not in the list, fine.
const T & max(const T &a, const T &b)
void get_info(const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
MonitorElement * bookString(const char *name, const char *value)
Book string.
static void collate1S(MonitorElement *me, TH1S *h)
bool isCollate(void) const
void removeElement(const std::string &name)
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static bool checkBinningMatches(MonitorElement *me, TH1 *h)
double getFloatValue(void) const
void tag(MonitorElement *, unsigned int)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
QCriterion * makeQCriterion(const std::string &qtname)
void setVerbose(unsigned level)
void softReset(MonitorElement *me)
Kind kind(void) const
Get the type of the monitor element.
TObject * extractNextObject(TBufferFile &) const
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
const std::string getFullname(void) const
get full name of ME including Pathname
std::vector< MonitorElement * > getContents(const std::string &path) const
std::string readSelectedDirectory_
std::vector< std::string > getMEs(void)
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
bool dirExists(const std::string &path) const
true if directory exists
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0, const bool resetMEsAfterWriting=false)
void getAllTags(std::vector< std::string > &into) const
bool dirExists(const std::string &path)
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
void tagAllContents(const std::string &path, unsigned int myTag)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * initialise(MonitorElement *me, const std::string &path)
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
bool containsAnyMonitorable(const std::string &path)
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
void set_size(::google::protobuf::uint32 value)
static void collate2S(MonitorElement *me, TH2S *h)
int64_t getIntValue(void) const
static void collate2D(MonitorElement *me, TH2F *h)
static const std::string s_referenceDirName
void print_trace(const std::string &dir, const std::string &name)
int useQTestByMatch(const std::string &pattern, const std::string &qtname)
attach quality test <qc> to monitor elements matching <pattern>.
TH1F * getTH1F(void) const
static const lat::Regexp s_rxpbfile(".*\\.pb$")
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
bool resetMe(void) const
true if ME should be reset at end of monitoring cycle
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
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
bool forceResetOnBeginLumi_
static void collate2DD(MonitorElement *me, TH2D *h)
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::vector< boost::shared_ptr< fireworks::OptionNode > > Options
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
inline::dqmstorepb::ROOTFilePB_Histo * add_histo()
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", const bool resetMEsAfterWriting=false)
bool readFilePB(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
TProfile * getTProfile(void) const
void useQTest(const std::string &dir, const std::string &qtname)
void goUp(void)
equivalent to "cd .."
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
inline::google::protobuf::uint32 flags() const
static const int STATUS_OK
void setAccumulate(MonitorElement *me, bool flag)
void setEfficiencyFlag(void)
void Reset(std::vector< TH2F > &depth)
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
volatile std::atomic< bool > shutdown_flag false
void showDirStructure(void) const
bool deleteObject(T *fObject, const std::string &fInput, const std::string &fInputTag, HcalDbTool::IOVRun fInputRun, bool fVerbose)
TH2F * getTH2F(void) const
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.
for(const auto &isodef:isoDefs)
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
std::set< std::string > dirs_
void Reset(void)
reset ME (ie. contents, errors, etc)
static const uint32_t DQM_PROP_LUMI
static std::string const source
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
tuple size
Write out results.
static const lat::Regexp s_rxmeqr1("^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$")
void makeDirectory(const std::string &path)
bool compare_strings(std::string const &pattern, std::string const &input) const
void setCurrentFolder(const std::string &fullpath)
const std::string & pwd(void) const
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,...)