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);
291 std::vector<MonitorElement*>
295 return owner_->getAllContents(path, runNumber, lumi);
299 return owner_->get(path);
303 return owner_->getSubdirs();
307 return owner_->getMEs();
311 return owner_->containsAnyMonitorable(path);
315 return owner_->dirExists(path);
327 owner_->setCurrentFolder(fullpath);
343 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: "
345 <<
", stream: " << streamId
346 <<
" module: " << moduleId << std::endl;
353 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
354 std::set<MonitorElement>::const_iterator
e =
data_.end();
355 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
357 if (i->data_.run != run
358 || i->data_.streamId != streamId
359 || i->data_.moduleId != moduleId)
373 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
374 if (me !=
data_.end()) {
376 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
380 me->getTH1()->Add(i->getTH1());
384 std::cout <<
"No global Object found. " << std::endl;
385 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
386 gme =
data_.insert(global_me);
399 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
400 << run <<
" lumi: " << lumi
401 <<
", stream: " << streamId
402 <<
" module: " << moduleId << std::endl;
404 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
405 std::set<MonitorElement>::const_iterator
e =
data_.end();
406 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
409 if (i->data_.run != run
410 || i->data_.streamId != streamId
411 || i->data_.moduleId != moduleId)
426 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
427 if (me !=
data_.end()) {
429 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
433 me->getTH1()->Add(i->getTH1());
436 std::cout <<
"No global Object found. " << std::endl;
437 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
438 gme =
data_.insert(global_me);
448 std::set<MonitorElement>::const_iterator i_lumi =
data_.lower_bound(global_me);
449 while (i_lumi->data_.lumi != lumi) {
450 auto temp = i_lumi++;
451 if (i_lumi->getFullname() == i->getFullname() && i_lumi->markedToDelete())
500 collateHistograms_ (
false),
501 enableMultiThread_(
false),
502 readSelectedDirectory_ (
""),
547 std::cout <<
"DQMStore: histogram collation is enabled\n";
551 std::cout <<
"DQMStore: MultiThread option is enabled\n";
555 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
560 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
564 initQCriterion<Comp2RefChi2>(
qalgos_);
565 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
566 initQCriterion<ContentsXRange>(
qalgos_);
567 initQCriterion<ContentsYRange>(
qalgos_);
568 initQCriterion<MeanWithinExpected>(
qalgos_);
569 initQCriterion<Comp2RefEqualH>(
qalgos_);
570 initQCriterion<DeadChannel>(
qalgos_);
571 initQCriterion<NoisyChannel>(
qalgos_);
572 initQCriterion<ContentsWithinExpected>(
qalgos_);
573 initQCriterion<CompareToMedian>(
qalgos_);
574 initQCriterion<CompareLastFilledBin>(
qalgos_);
575 initQCriterion<CheckVariance>(
qalgos_);
579 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
598 stream_ =
new ofstream(
"histogramBookingBT.log");
607 size = backtrace (array, 10);
608 strings = backtrace_symbols (array, size);
613 char * demangled = abi::__cxa_demangle(m.matchString(strings[4], 2).c_str(), 0, 0, &
r);
616 << (r ? m.matchString(strings[4], 2) : demangled) <<
" "
617 << m.matchString(strings[4], 1) <<
"\n";
621 *
stream_ <<
"Skipping "<< dir <<
"/" << name
622 <<
" with stack size " << size <<
"\n";
630 for (i = 0; i <
size; i++)
631 if (
s_rxtrace.match(strings[i], 0, 0, &m))
633 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
634 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" "
635 << (r ? m.matchString(strings[i], 2) : demangled) <<
" "
636 << m.matchString(strings[i], 1) << std::endl;
673 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
697 size_t pos =
pwd_.rfind(
'/');
698 if (pos == std::string::npos)
713 prev.reserve(path.size());
714 subdir.reserve(path.size());
715 name.reserve(path.size());
723 subdir.append(path, 0, slash);
725 name.append(subdir, prevname, std::string::npos);
727 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
728 " which already exists as a monitor element",
731 if (!
dirs_.count(subdir))
732 dirs_.insert(subdir);
735 if (slash+1 >= path.size())
740 prevname = slash ? slash+1 :
slash;
742 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
750 {
return dirs_.count(path) > 0; }
755 template <
class HISTO,
class COLLATE>
758 const char *context,
int kind,
759 HISTO *
h, COLLATE collate)
761 assert(name.find(
'/') == std::string::npos);
784 << context <<
": monitor element '"
785 << path <<
"' already exists, collating" << std::endl;
795 assert(
dirs_.count(dir));
803 for ( ; qi != qe; ++qi)
805 if ( qi->first->match(path) )
806 me->addQReport(qi->second);
830 assert(name.find(
'/') == std::string::npos);
843 << context <<
": monitor element '"
844 << path <<
"' already exists, resetting" << std::endl;
852 assert(
dirs_.count(dir));
872 return book(dir, name,
"bookInt")
902 return book(dir, name,
"bookFloat")
931 return book(dir, name,
"bookString")
972 int nchX,
double lowX,
double highX)
974 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
980 int nchX,
double lowX,
double highX)
982 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
988 int nchX,
double lowX,
double highX)
990 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
996 int nchX,
double lowX,
double highX)
998 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1004 int nchX,
double lowX,
double highX)
1006 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1012 int nchX,
double lowX,
double highX)
1014 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1020 int nchX,
const float *xbinsize)
1022 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1028 int nchX,
const float *xbinsize)
1030 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1037 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1044 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1051 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1058 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1065 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1072 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1100 int nchX,
double lowX,
double highX,
1101 int nchY,
double lowY,
double highY)
1103 return book2D(
pwd_, name,
new TH2F(name, title,
1105 nchY, lowY, highY));
1111 int nchX,
double lowX,
double highX,
1112 int nchY,
double lowY,
double highY)
1114 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1116 nchY, lowY, highY));
1122 int nchX,
double lowX,
double highX,
1123 int nchY,
double lowY,
double highY)
1125 return book2S(
pwd_, name,
new TH2S(name, title,
1127 nchY, lowY, highY));
1133 int nchX,
double lowX,
double highX,
1134 int nchY,
double lowY,
double highY)
1136 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1138 nchY, lowY, highY));
1144 int nchX,
double lowX,
double highX,
1145 int nchY,
double lowY,
double highY)
1149 nchY, lowY, highY));
1155 int nchX,
double lowX,
double highX,
1156 int nchY,
double lowY,
double highY)
1158 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1160 nchY, lowY, highY));
1166 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1168 return book2D(
pwd_, name,
new TH2F(name, title,
1169 nchX, xbinsize, nchY, ybinsize));
1175 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1177 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1178 nchX, xbinsize, nchY, ybinsize));
1185 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1192 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1199 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1206 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1213 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1220 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1234 int nchX,
double lowX,
double highX,
1235 int nchY,
double lowY,
double highY,
1236 int nchZ,
double lowZ,
double highZ)
1238 return book3D(
pwd_, name,
new TH3F(name, title,
1241 nchZ, lowZ, highZ));
1247 int nchX,
double lowX,
double highX,
1248 int nchY,
double lowY,
double highY,
1249 int nchZ,
double lowZ,
double highZ)
1251 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1254 nchZ, lowZ, highZ));
1261 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1268 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1276 return book(dir, name,
"bookProfile",
1286 int nchX,
double lowX,
double highX,
1287 int ,
double lowY,
double highY,
1288 const char *option )
1301 int nchX,
double lowX,
double highX,
1302 int ,
double lowY,
double highY,
1303 const char *option )
1305 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1316 int nchX,
double lowX,
double highX,
1317 double lowY,
double highY,
1318 const char *option )
1331 int nchX,
double lowX,
double highX,
1332 double lowY,
double highY,
1333 const char *option )
1335 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1346 int nchX,
const double *xbinsize,
1347 int ,
double lowY,
double highY,
1348 const char *option )
1361 int nchX,
const double *xbinsize,
1362 int ,
double lowY,
double highY,
1363 const char *option )
1365 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1376 int nchX,
const double *xbinsize,
1377 double lowY,
double highY,
1378 const char *option )
1391 int nchX,
const double *xbinsize,
1392 double lowY,
double highY,
1393 const char *option )
1395 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1405 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1412 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1420 return book(dir, name,
"bookProfile2D",
1430 int nchX,
double lowX,
double highX,
1431 int nchY,
double lowY,
double highY,
1432 int ,
double lowZ,
double highZ,
1433 const char *option )
1447 int nchX,
double lowX,
double highX,
1448 int nchY,
double lowY,
double highY,
1449 int ,
double lowZ,
double highZ,
1450 const char *option )
1464 int nchX,
double lowX,
double highX,
1465 int nchY,
double lowY,
double highY,
1466 double lowZ,
double highZ,
1467 const char *option )
1481 int nchX,
double lowX,
double highX,
1482 int nchY,
double lowY,
double highY,
1483 double lowZ,
double highZ,
1484 const char *option )
1497 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1504 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1513 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1514 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1515 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1516 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1517 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1518 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1519 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1520 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1521 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1528 <<
"checkBinningMatches: different binning - cannot add object '"
1529 << h->GetName() <<
"' of type "
1530 << h->IsA()->GetName() <<
" to existing ME: '"
1614 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1617 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1618 " twice with multiple tags", me->
getFullname().c_str());
1635 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1636 " '%s' with tag %u", path.c_str(), myTag);
1645 MEMap::iterator
e =
data_.end();
1646 MEMap::iterator
i =
data_.lower_bound(proto);
1647 for ( ; i != e && path == *i->data_.dirname; ++
i)
1648 tag(const_cast<MonitorElement *>(&*i), myTag);
1662 MEMap::iterator
e =
data_.end();
1663 MEMap::iterator
i =
data_.lower_bound(proto);
1666 tag(const_cast<MonitorElement *>(&*i), myTag);
1675 std::vector<std::string>
1678 std::vector<std::string>
result;
1679 std::set<std::string>::const_iterator
e =
dirs_.end();
1680 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1691 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1692 result.push_back(*i);
1698 std::vector<std::string>
1702 std::vector<std::string>
result;
1703 MEMap::const_iterator
e =
data_.end();
1704 MEMap::const_iterator
i =
data_.lower_bound(proto);
1706 if (
pwd_ == *i->data_.dirname)
1707 result.push_back(i->getName());
1718 MEMap::const_iterator
e =
data_.end();
1719 MEMap::const_iterator
i =
data_.lower_bound(proto);
1731 MEMap::const_iterator mepos =
data_.find(proto);
1732 return (mepos ==
data_.end() ? 0
1737 std::vector<MonitorElement *>
1741 std::vector<MonitorElement *>
result;
1742 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1746 result.push_back(const_cast<MonitorElement *>(&me));
1753 std::vector<MonitorElement *>
1761 std::vector<MonitorElement *>
result;
1762 MEMap::const_iterator
e =
data_.end();
1763 MEMap::const_iterator
i =
data_.lower_bound(proto);
1765 if (*cleaned == *i->data_.dirname)
1766 result.push_back(const_cast<MonitorElement *>(&*i));
1772 std::vector<MonitorElement *>
1780 std::vector<MonitorElement *>
result;
1781 MEMap::const_iterator
e =
data_.end();
1782 MEMap::const_iterator
i =
data_.lower_bound(proto);
1784 if (*cleaned == *i->data_.dirname
1786 && i->data_.tag ==
tag)
1787 result.push_back(const_cast<MonitorElement *>(&*i));
1800 into.reserve(
dirs_.size());
1802 MEMap::const_iterator me =
data_.end();
1803 std::set<std::string>::const_iterator di =
dirs_.begin();
1804 std::set<std::string>::const_iterator de =
dirs_.end();
1805 for ( ; di != de; ++di)
1808 MEMap::const_iterator mi =
data_.lower_bound(proto);
1809 MEMap::const_iterator
m = mi;
1810 size_t sz = di->size() + 2;
1813 if (*di == *m->data_.dirname)
1815 sz += m->data_.objname.size() + 1;
1822 std::vector<std::string>::iterator istr
1831 for (sz = 0; mi !=
m; ++mi)
1833 if (*di != *mi->data_.dirname)
1839 *istr += mi->data_.objname;
1845 istr->reserve(di->size() + 2);
1857 const uint32_t
run ,
1858 const uint32_t
lumi ,
1859 const uint32_t streamId ,
1860 const uint32_t moduleId )
const
1862 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1863 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1864 " unacceptable characters", dir.c_str());
1865 if (name.find_first_not_of(
s_safe) != std::string::npos)
1866 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1867 " unacceptable characters", name.c_str());
1877 MEMap::const_iterator mepos =
data_.find(proto);
1878 return (mepos ==
data_.end() ? 0
1888 into.reserve(
dirs_.size());
1890 MEMap::const_iterator me =
data_.end();
1891 std::set<std::string>::const_iterator di =
dirs_.begin();
1892 std::set<std::string>::const_iterator de =
dirs_.end();
1895 for ( ; di != de; ++di)
1898 MEMap::const_iterator mi =
data_.lower_bound(proto);
1899 MEMap::const_iterator
m = mi;
1900 size_t sz = di->size() + 2;
1906 sz += 1 + m->data_.objname.size() + 11;
1913 std::vector<std::string>::iterator istr
1920 for (sz = 0; mi !=
m; ++mi)
1924 sprintf(tagbuf,
"/%u", mi->data_.tag);
1927 *istr += m->data_.objname;
1937 std::vector<MonitorElement*>
1940 uint32_t
lumi )
const
1948 std::vector<MonitorElement *>
result;
1949 MEMap::const_iterator
e =
data_.end();
1950 MEMap::const_iterator
i =
data_.lower_bound(proto);
1952 if (runNumber != 0) {
1953 if (i->data_.run > runNumber
1954 || i->data_.streamId != 0
1955 || i->data_.moduleId != 0)
1959 if (i->data_.lumi > lumi
1960 || i->data_.streamId != 0
1961 || i->data_.moduleId != 0)
1964 if (runNumber != 0
or lumi !=0) {
1965 assert(i->data_.streamId == 0);
1966 assert(i->data_.moduleId == 0);
1968 result.push_back(const_cast<MonitorElement *>(&*i));
1975 std::vector<MonitorElement*>
1981 rx = lat::Regexp(pattern, 0, syntaxType);
1984 catch (lat::Error &
e)
1986 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
1987 pattern.c_str(), e.explain().c_str());
1991 std::vector<MonitorElement *>
result;
1992 MEMap::const_iterator
i =
data_.begin();
1993 MEMap::const_iterator e =
data_.end();
1994 for ( ; i !=
e; ++
i)
1997 mergePath(path, *i->data_.dirname, i->data_.objname);
1999 result.push_back(const_cast<MonitorElement *>(&*i));
2014 MEMap::iterator mi =
data_.begin();
2015 MEMap::iterator me =
data_.end();
2016 for ( ; mi != me; ++mi)
2019 if (mi->wasUpdated())
2038 MEMap::iterator mi =
data_.begin();
2039 MEMap::iterator me =
data_.end();
2040 for ( ; mi != me; ++mi)
2066 std::set<MonitorElement>::const_iterator
e =
data_.end();
2067 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2070 if (i->data_.streamId != 0 ||
2071 i->data_.moduleId != 0)
2075 if (i->data_.run != run)
2081 std::cout <<
"DQMStore::markForDeletion: marked monitor element '"
2082 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2083 <<
"flags " << i->data_.flags <<
"\n";
2101 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2105 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2112 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2123 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2127 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2134 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2138 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2145 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2149 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2156 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2160 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2167 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2171 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2178 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2182 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2189 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2193 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2200 else if (dynamic_cast<TObjString *>(obj))
2203 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2205 if (strstr(obj->GetName(),
"CMSSW"))
2208 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2211 else if (strstr(obj->GetName(),
"DQMPATCH"))
2214 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2219 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2220 << obj->GetName() <<
"' of type '"
2221 << obj->IsA()->GetName() <<
"'\n";
2227 std::string kind = m.matchString(obj->GetName(), 2);
2233 if (! me || overwrite)
2235 if (! me) me =
bookInt(dir, label);
2236 me->
Fill(atoll(value.c_str()));
2239 else if (kind ==
"f")
2242 if (! me || overwrite)
2245 me->
Fill(atof(value.c_str()));
2248 else if (kind ==
"s")
2256 else if (kind ==
"e")
2261 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2262 << label <<
"' in directory '"
2263 << dir <<
"' to be marked as efficiency plot.\n";
2268 else if (kind ==
"t")
2273 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2274 << label <<
"' in directory '"
2275 << dir <<
"' for a tag\n";
2280 unsigned long val = strtoul(value.c_str(), &endp, 10);
2281 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2283 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2284 << value <<
"' for monitor element '"
2285 << label <<
"' in directory '"
2286 << dir <<
"' - invalid value\n";
2291 else if (kind ==
"qr")
2296 size_t dot = label.find(
'.');
2297 if (dot == std::string::npos)
2299 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2300 <<
"' is missing a '.' and cannot be extracted\n";
2305 std::string qrname (label, dot+1, std::string::npos);
2311 qv.
code = atoi(m.matchString(value, 1).c_str());
2312 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2313 qv.
message = m.matchString(value, 4);
2317 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2319 qv.
code = atoi(m.matchString(value, 1).c_str());
2321 qv.
message = m.matchString(value, 2);
2327 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2328 << value <<
"' is incorrectly formatted\n";
2335 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2336 << mename <<
"' in directory '"
2337 << dir <<
"' for quality test '"
2347 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2348 << obj->GetName() <<
"' of type '"
2349 << obj->IsA()->GetName() <<
"'\n";
2353 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2357 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2358 s +=
'<'; s +=
n->GetName(); s +=
'>';
2360 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2361 TObjString os(s.c_str());
2366 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2367 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2368 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2394 assert(! path.empty());
2398 size_t end = path.find(
'/', start);
2399 if (end == std::string::npos)
2407 TObject *
o = gDirectory->Get(part.c_str());
2408 if (o && ! dynamic_cast<TDirectory *>(o))
2409 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2410 " fails because the part '%s' already exists and is not"
2411 " directory", path.c_str(), part.c_str());
2413 gDirectory->mkdir(part.c_str());
2415 if (! gDirectory->cd(part.c_str()))
2416 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2417 " fails because could not cd into subdirectory '%s'",
2418 path.c_str(), part.c_str());
2421 if (end+1 >= path.size())
2426 end = path.find(
'/', start);
2427 if (end == std::string::npos)
2436 const uint32_t
run ,
2437 const uint32_t
lumi ,
2438 const bool resetMEsAfterWriting )
2440 using google::protobuf::io::FileOutputStream;
2441 using google::protobuf::io::GzipOutputStream;
2442 using google::protobuf::io::StringOutputStream;
2444 std::set<std::string>::iterator di, de;
2445 MEMap::iterator mi, me =
data_.end();
2450 std::cout <<
"\n DQMStore: Opening PBFile '"
2451 << filename <<
"'"<< std::endl;
2454 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2467 mi =
data_.lower_bound(proto);
2468 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2472 <<
" Lumi: " << (*mi).lumi()
2473 <<
" LumiFlag: " << (*mi).getLumiFlag()
2474 <<
" streamId: " << (*mi).streamId()
2475 <<
" moduleId: " << (*mi).moduleId()
2476 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2483 if (*di != *mi->data_.dirname)
2492 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2496 std::cout <<
"DQMStore::savePB: saving monitor element '"
2497 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2498 <<
"flags " << mi->data_.flags <<
"\n";
2505 TObject *toWrite =
nullptr;
2509 toWrite =
new TObjString(mi->tagString().c_str());
2510 deleteObject =
true;
2512 toWrite = mi->object_;
2515 TBufferFile buffer(TBufferFile::kWrite);
2516 buffer.WriteObject(toWrite);
2526 if (resetMEsAfterWriting)
2531 int filedescriptor =
::open(filename.c_str(),
2532 O_WRONLY | O_CREAT | O_TRUNC,
2536 FileOutputStream file_stream(filedescriptor);
2538 options.format = GzipOutputStream::GZIP;
2539 options.compression_level = 6;
2540 GzipOutputStream gzip_stream(&file_stream,
2542 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2545 gzip_stream.Close();
2546 file_stream.Close();
2547 ::close(filedescriptor);
2551 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2552 <<
" objects from path '" << path
2553 <<
"' into DQM file '" << filename <<
"'\n";
2566 const uint32_t
run ,
2567 const uint32_t
lumi ,
2571 const bool resetMEsAfterWriting )
2573 std::set<std::string>::iterator di, de;
2574 MEMap::iterator mi, me =
data_.end();
2575 DQMNet::QReports::const_iterator qi, qe;
2583 class TFileNoSync :
public TFile
2586 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2587 virtual Int_t SysSync(Int_t)
override {
return 0; }
2592 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2593 <<
"' with option '" << fileupdate <<
"'\n";
2595 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2597 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2601 std::auto_ptr<lat::Regexp> rxpat;
2602 if (! pattern.empty())
2603 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2616 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2630 mi =
data_.lower_bound(proto);
2631 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2634 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2635 <<
" Lumi: " << (*mi).lumi()
2636 <<
" LumiFlag: " << (*mi).getLumiFlag()
2637 <<
" streamId: " << (*mi).streamId()
2638 <<
" moduleId: " << (*mi).moduleId()
2639 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2646 if (*di != *mi->data_.dirname) {
2648 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2658 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2684 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2685 status =
std::max(status, master->data_.qreports[
i].code);
2687 if (! master || status < minStatus)
2690 std::cout <<
"DQMStore::save: skipping monitor element '"
2691 << mi->data_.objname <<
"' while saving, status is "
2692 << status <<
", required minimum status is "
2693 << minStatus << std::endl;
2700 std::cout <<
"DQMStore::save: saving monitor element '"
2701 << mi->data_.objname <<
"'\n";
2705 gDirectory->cd(
"/");
2708 else if (rxpat.get())
2719 TObjString(mi->tagString().c_str()).Write();
2723 mi->object_->Write();
2730 qi = mi->data_.qreports.begin();
2731 qe = mi->data_.qreports.end();
2732 for ( ; qi != qe; ++qi)
2733 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2738 TObjString(mi->effLabelString().c_str()).Write();
2742 TObjString(mi->tagLabelString().c_str()).Write();
2745 if (resetMEsAfterWriting)
2754 std::cout <<
"DQMStore::save: successfully wrote " << nme
2755 <<
" objects from path '" << path
2756 <<
"' into DQM file '" << filename <<
"'\n";
2769 unsigned int ntot = 0;
2770 unsigned int count = 0;
2772 if (! file->cd(curdir.c_str()))
2773 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2774 " reading file '%s'", curdir.c_str(), file->GetName());
2797 size_t slash = dirpart.find(
'/');
2798 size_t pos = dirpart.find(
"/Run summary");
2799 if (slash != std::string::npos && pos !=std::string::npos)
2801 dirpart.erase(pos,12);
2803 pos = dirpart.find(
"Run ");
2804 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2805 if (pos !=std::string::npos)
2806 dirpart.erase(pos,length);
2815 size_t slash = dirpart.find(
'/');
2817 if (slash == std::string::npos
2822 slash = dirpart.find(
'/');
2824 if (slash != std::string::npos
2825 && slash + 10 == dirpart.size()
2826 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2828 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2833 if (dirpart.empty())
2836 dirpart = prepend +
'/' + dirpart;
2838 else if (! prepend.empty())
2840 if (dirpart.empty())
2843 dirpart = prepend +
'/' + dirpart;
2851 TIter
next (gDirectory->GetListOfKeys());
2852 std::list<TObject *> delayed;
2853 while ((key = (TKey *)
next()))
2855 std::auto_ptr<TObject>
obj(key->ReadObj());
2856 if (dynamic_cast<TDirectory *>(
obj.get()))
2859 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2861 if (! curdir.empty())
2863 subdir +=
obj->GetName();
2865 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2869 else if (dynamic_cast<TObjString *>(
obj.get()))
2871 delayed.push_back(
obj.release());
2876 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2877 <<
"' of type '" <<
obj->IsA()->GetName()
2878 <<
"' from '" << file->GetName()
2879 <<
"' into '" << dirpart <<
"'\n";
2887 while (! delayed.empty())
2890 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2891 <<
"' of type '" << delayed.front()->IsA()->GetName()
2892 <<
"' from '" << file->GetName()
2893 <<
"' into '" << dirpart <<
"'\n";
2899 delete delayed.front();
2900 delayed.pop_front();
2904 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2905 <<
" objects from directory '" << dirpart <<
"'\n";
2907 return ntot +
count;
2922 bool fileMustExist )
2924 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2934 bool fileMustExist )
2936 bool overwrite =
true;
2940 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2942 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2944 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2948 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2950 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2964 bool fileMustExist )
2968 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
2970 std::auto_ptr<TFile>
f;
2974 f.reset(TFile::Open(filename.c_str()));
2975 if (! f.get() || f->IsZombie())
2976 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
2985 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
2990 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
2993 MEMap::iterator mi =
data_.begin();
2994 MEMap::iterator me =
data_.end();
2995 for ( ; mi != me; ++mi)
2996 const_cast<MonitorElement &>(*mi).updateQReportStats();
3000 std::cout <<
"DQMStore::open: successfully read " << n
3001 <<
" objects from file '" << filename <<
"'";
3002 if (! onlypath.empty())
3003 std::cout <<
" from directory '" << onlypath <<
"'";
3004 if (! prepend.empty())
3005 std::cout <<
" into directory '" << prepend <<
"'";
3015 if (buf.Length() == buf.BufferSize())
3018 void *ptr = buf.ReadObjectAny(0);
3019 return reinterpret_cast<TObject *
>(ptr);
3028 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3029 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3031 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3032 TBufferFile buf(TBufferFile::kRead, h.
size(),
3048 bool fileMustExist )
3050 using google::protobuf::io::FileInputStream;
3051 using google::protobuf::io::FileOutputStream;
3052 using google::protobuf::io::GzipInputStream;
3053 using google::protobuf::io::GzipOutputStream;
3054 using google::protobuf::io::CodedInputStream;
3055 using google::protobuf::io::ArrayInputStream;
3058 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3061 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3063 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3066 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3071 FileInputStream
fin(filedescriptor);
3072 GzipInputStream
input(&fin);
3073 CodedInputStream input_coded(&input);
3074 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3075 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3076 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3079 ::close(filedescriptor);
3103 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3105 if (me ==
nullptr) {
3131 MEMap::iterator
e =
data_.end();
3132 MEMap::iterator
i =
data_.lower_bound(proto);
3136 std::set<std::string>::iterator de =
dirs_.end();
3137 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3147 MEMap::iterator
e =
data_.end();
3148 MEMap::iterator
i =
data_.lower_bound(proto);
3150 if (dir == *i->data_.dirname)
3177 MEMap::iterator pos =
data_.find(proto);
3178 if (pos ==
data_.end() && warning)
3179 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3180 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3193 QCMap::const_iterator
i =
qtests_.find(qtname);
3194 QCMap::const_iterator
e =
qtests_.end();
3195 return (i == e ? 0 : i->second);
3205 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3208 QAMap::iterator
i =
qalgos_.find(algoname);
3210 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3211 " algorithm '%s'", algoname.c_str());
3231 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3233 " uses unacceptable characters", cleaned->c_str());
3245 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3255 MEMap::iterator mi =
data_.begin();
3256 MEMap::iterator me =
data_.end();
3259 for ( ; mi != me; ++mi)
3262 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3263 if (fm->match(path))
3280 std::cout <<
"DQMStore: running runQTests() with reset = "
3281 << (
reset_ ?
"true" :
"false" ) << std::endl;
3284 MEMap::iterator mi =
data_.begin();
3285 MEMap::iterator me =
data_.end();
3286 for ( ; mi != me; ++mi)
3304 MEMap::const_iterator mi =
data_.begin();
3305 MEMap::const_iterator me =
data_.end();
3306 for ( ; mi != me; ++mi)
3308 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3313 else if (mi->hasWarning())
3316 && mi->hasOtherReport())
3360 std::cout <<
" ------------------------------------------------------------\n"
3361 <<
" Directory structure: \n"
3362 <<
" ------------------------------------------------------------\n";
3364 std::copy(contents.begin(), contents.end(),
3365 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3367 std::cout <<
" ------------------------------------------------------------\n";
3404 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3407 factor = factor/(events*1.0);
3409 MEMap::iterator mi =
data_.begin();
3410 MEMap::iterator me =
data_.end();
3411 for ( ; mi != me; ++mi)
3463 std::cout <<
" The DQM object '" << me.
getFullname() <<
"' is not scalable object " << std::endl;
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)
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
bool match(std::string const &s) const
bool readFile(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
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 collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
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.
void markForDeletion(uint32_t run, uint32_t lumi)
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
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
std::vector< MonitorElement * > getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
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)
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.
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.
bool isCollate(void) const
void removeElement(const std::string &name)
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
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)
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
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)
int64_t getIntValue(void) const
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>.
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0)
TH1F * getTH1F(void) const
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
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_
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)
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
void Reset(std::vector< TH2F > &depth)
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
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
if(conf.exists("allCellsPositionCalc"))
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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)
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
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,...)