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 owner_->tagContents(path, myTag);
295 std::vector<MonitorElement*>
299 return owner_->getAllContents(path, runNumber, lumi);
303 return owner_->get(path);
307 return owner_->getSubdirs();
311 return owner_->getMEs();
315 return owner_->containsAnyMonitorable(path);
319 return owner_->dirExists(path);
331 owner_->setCurrentFolder(fullpath);
347 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: "
349 <<
", stream: " << streamId
350 <<
" module: " << moduleId << std::endl;
357 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
358 std::set<MonitorElement>::const_iterator
e =
data_.end();
359 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
361 if (i->data_.run != run
362 || i->data_.streamId != streamId
363 || i->data_.moduleId != moduleId)
377 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
378 if (me !=
data_.end()) {
380 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
384 me->getTH1()->Add(i->getTH1());
388 std::cout <<
"No global Object found. " << std::endl;
389 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
390 gme =
data_.insert(global_me);
403 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
404 << run <<
" lumi: " << lumi
405 <<
", stream: " << streamId
406 <<
" module: " << moduleId << std::endl;
408 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
409 std::set<MonitorElement>::const_iterator
e =
data_.end();
410 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
413 if (i->data_.run != run
414 || i->data_.streamId != streamId
415 || i->data_.moduleId != moduleId)
430 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
431 if (me !=
data_.end()) {
433 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
437 me->getTH1()->Add(i->getTH1());
440 std::cout <<
"No global Object found. " << std::endl;
441 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
442 gme =
data_.insert(global_me);
452 std::set<MonitorElement>::const_iterator i_lumi =
data_.lower_bound(global_me);
453 while (i_lumi->data_.lumi != lumi) {
454 auto temp = i_lumi++;
455 if (i_lumi->getFullname() == i->getFullname() && i_lumi->markedToDelete())
504 collateHistograms_ (
false),
505 enableMultiThread_(
false),
506 readSelectedDirectory_ (
""),
551 std::cout <<
"DQMStore: histogram collation is enabled\n";
555 std::cout <<
"DQMStore: MultiThread option is enabled\n";
559 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
564 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
568 initQCriterion<Comp2RefChi2>(
qalgos_);
569 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
570 initQCriterion<ContentsXRange>(
qalgos_);
571 initQCriterion<ContentsYRange>(
qalgos_);
572 initQCriterion<MeanWithinExpected>(
qalgos_);
573 initQCriterion<Comp2RefEqualH>(
qalgos_);
574 initQCriterion<DeadChannel>(
qalgos_);
575 initQCriterion<NoisyChannel>(
qalgos_);
576 initQCriterion<ContentsWithinExpected>(
qalgos_);
577 initQCriterion<CompareToMedian>(
qalgos_);
578 initQCriterion<CompareLastFilledBin>(
qalgos_);
579 initQCriterion<CheckVariance>(
qalgos_);
583 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
602 stream_ =
new std::ofstream(
"histogramBookingBT.log");
611 size = backtrace (array, 10);
612 strings = backtrace_symbols (array, size);
617 char * demangled = abi::__cxa_demangle(m.matchString(strings[4], 2).c_str(), 0, 0, &
r);
620 << (r ? m.matchString(strings[4], 2) : demangled) <<
" "
621 << m.matchString(strings[4], 1) <<
"\n";
625 *
stream_ <<
"Skipping "<< dir <<
"/" << name
626 <<
" with stack size " << size <<
"\n";
634 for (i = 0; i <
size; i++)
635 if (
s_rxtrace.match(strings[i], 0, 0, &m))
637 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
638 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" "
639 << (r ? m.matchString(strings[i], 2) : demangled) <<
" "
640 << m.matchString(strings[i], 1) << std::endl;
677 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
701 size_t pos =
pwd_.rfind(
'/');
702 if (pos == std::string::npos)
717 prev.reserve(path.size());
718 subdir.reserve(path.size());
719 name.reserve(path.size());
727 subdir.append(path, 0, slash);
729 name.append(subdir, prevname, std::string::npos);
731 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
732 " which already exists as a monitor element",
735 if (!
dirs_.count(subdir))
736 dirs_.insert(subdir);
739 if (slash+1 >= path.size())
744 prevname = slash ? slash+1 :
slash;
746 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
754 {
return dirs_.count(path) > 0; }
759 template <
class HISTO,
class COLLATE>
762 const char *context,
int kind,
763 HISTO *
h, COLLATE collate)
765 assert(name.find(
'/') == std::string::npos);
788 << context <<
": monitor element '"
789 << path <<
"' already exists, collating" << std::endl;
807 for ( ; qi != qe; ++qi)
809 if ( qi->first->match(path) )
810 me->addQReport(qi->second);
834 assert(name.find(
'/') == std::string::npos);
847 << context <<
": monitor element '"
848 << path <<
"' already exists, resetting" << std::endl;
876 return book(dir, name,
"bookInt")
906 return book(dir, name,
"bookFloat")
935 return book(dir, name,
"bookString")
976 int nchX,
double lowX,
double highX)
978 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
984 int nchX,
double lowX,
double highX)
986 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
992 int nchX,
double lowX,
double highX)
994 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1000 int nchX,
double lowX,
double highX)
1002 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1008 int nchX,
double lowX,
double highX)
1010 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1016 int nchX,
double lowX,
double highX)
1018 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1024 int nchX,
const float *xbinsize)
1026 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1032 int nchX,
const float *xbinsize)
1034 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1041 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1048 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1055 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1062 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1069 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1076 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1104 int nchX,
double lowX,
double highX,
1105 int nchY,
double lowY,
double highY)
1107 return book2D(
pwd_, name,
new TH2F(name, title,
1109 nchY, lowY, highY));
1115 int nchX,
double lowX,
double highX,
1116 int nchY,
double lowY,
double highY)
1118 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1120 nchY, lowY, highY));
1126 int nchX,
double lowX,
double highX,
1127 int nchY,
double lowY,
double highY)
1129 return book2S(
pwd_, name,
new TH2S(name, title,
1131 nchY, lowY, highY));
1137 int nchX,
double lowX,
double highX,
1138 int nchY,
double lowY,
double highY)
1140 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1142 nchY, lowY, highY));
1148 int nchX,
double lowX,
double highX,
1149 int nchY,
double lowY,
double highY)
1153 nchY, lowY, highY));
1159 int nchX,
double lowX,
double highX,
1160 int nchY,
double lowY,
double highY)
1162 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1164 nchY, lowY, highY));
1170 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1172 return book2D(
pwd_, name,
new TH2F(name, title,
1173 nchX, xbinsize, nchY, ybinsize));
1179 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1181 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1182 nchX, xbinsize, nchY, ybinsize));
1189 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1196 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1203 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1210 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1217 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1224 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1238 int nchX,
double lowX,
double highX,
1239 int nchY,
double lowY,
double highY,
1240 int nchZ,
double lowZ,
double highZ)
1242 return book3D(
pwd_, name,
new TH3F(name, title,
1245 nchZ, lowZ, highZ));
1251 int nchX,
double lowX,
double highX,
1252 int nchY,
double lowY,
double highY,
1253 int nchZ,
double lowZ,
double highZ)
1255 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1258 nchZ, lowZ, highZ));
1265 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1272 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1280 return book(dir, name,
"bookProfile",
1290 int nchX,
double lowX,
double highX,
1291 int ,
double lowY,
double highY,
1292 const char *option )
1305 int nchX,
double lowX,
double highX,
1306 int ,
double lowY,
double highY,
1307 const char *option )
1309 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1320 int nchX,
double lowX,
double highX,
1321 double lowY,
double highY,
1322 const char *option )
1335 int nchX,
double lowX,
double highX,
1336 double lowY,
double highY,
1337 const char *option )
1339 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1350 int nchX,
const double *xbinsize,
1351 int ,
double lowY,
double highY,
1352 const char *option )
1365 int nchX,
const double *xbinsize,
1366 int ,
double lowY,
double highY,
1367 const char *option )
1369 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1380 int nchX,
const double *xbinsize,
1381 double lowY,
double highY,
1382 const char *option )
1395 int nchX,
const double *xbinsize,
1396 double lowY,
double highY,
1397 const char *option )
1399 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1409 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1416 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1424 return book(dir, name,
"bookProfile2D",
1434 int nchX,
double lowX,
double highX,
1435 int nchY,
double lowY,
double highY,
1436 int ,
double lowZ,
double highZ,
1437 const char *option )
1451 int nchX,
double lowX,
double highX,
1452 int nchY,
double lowY,
double highY,
1453 int ,
double lowZ,
double highZ,
1454 const char *option )
1468 int nchX,
double lowX,
double highX,
1469 int nchY,
double lowY,
double highY,
1470 double lowZ,
double highZ,
1471 const char *option )
1485 int nchX,
double lowX,
double highX,
1486 int nchY,
double lowY,
double highY,
1487 double lowZ,
double highZ,
1488 const char *option )
1501 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1508 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1517 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1518 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1519 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1520 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1521 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1522 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1523 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1524 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1525 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1532 <<
"checkBinningMatches: different binning - cannot add object '"
1533 << h->GetName() <<
"' of type "
1534 << h->IsA()->GetName() <<
" to existing ME: '"
1618 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1621 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1622 " twice with multiple tags", me->
getFullname().c_str());
1639 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1640 " '%s' with tag %u", path.c_str(), myTag);
1649 MEMap::iterator
e =
data_.end();
1650 MEMap::iterator
i =
data_.lower_bound(proto);
1651 for ( ; i != e && path == *i->data_.dirname; ++
i)
1652 tag(const_cast<MonitorElement *>(&*i), myTag);
1666 MEMap::iterator
e =
data_.end();
1667 MEMap::iterator
i =
data_.lower_bound(proto);
1670 tag(const_cast<MonitorElement *>(&*i), myTag);
1679 std::vector<std::string>
1682 std::vector<std::string>
result;
1683 std::set<std::string>::const_iterator
e =
dirs_.end();
1684 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1695 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1696 result.push_back(*i);
1702 std::vector<std::string>
1706 std::vector<std::string>
result;
1707 MEMap::const_iterator
e =
data_.end();
1708 MEMap::const_iterator
i =
data_.lower_bound(proto);
1710 if (
pwd_ == *i->data_.dirname)
1711 result.push_back(i->getName());
1722 MEMap::const_iterator
e =
data_.end();
1723 MEMap::const_iterator
i =
data_.lower_bound(proto);
1735 MEMap::const_iterator mepos =
data_.find(proto);
1736 return (mepos ==
data_.end() ? 0
1741 std::vector<MonitorElement *>
1745 std::vector<MonitorElement *>
result;
1746 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1750 result.push_back(const_cast<MonitorElement *>(&me));
1757 std::vector<MonitorElement *>
1765 std::vector<MonitorElement *>
result;
1766 MEMap::const_iterator
e =
data_.end();
1767 MEMap::const_iterator
i =
data_.lower_bound(proto);
1769 if (*cleaned == *i->data_.dirname)
1770 result.push_back(const_cast<MonitorElement *>(&*i));
1776 std::vector<MonitorElement *>
1784 std::vector<MonitorElement *>
result;
1785 MEMap::const_iterator
e =
data_.end();
1786 MEMap::const_iterator
i =
data_.lower_bound(proto);
1788 if (*cleaned == *i->data_.dirname
1790 && i->data_.tag ==
tag)
1791 result.push_back(const_cast<MonitorElement *>(&*i));
1804 into.reserve(
dirs_.size());
1806 MEMap::const_iterator me =
data_.end();
1807 std::set<std::string>::const_iterator di =
dirs_.begin();
1808 std::set<std::string>::const_iterator de =
dirs_.end();
1809 for ( ; di != de; ++di)
1812 MEMap::const_iterator mi =
data_.lower_bound(proto);
1813 MEMap::const_iterator
m = mi;
1814 size_t sz = di->size() + 2;
1817 if (*di == *m->data_.dirname)
1819 sz += m->data_.objname.size() + 1;
1826 std::vector<std::string>::iterator istr
1835 for (sz = 0; mi !=
m; ++mi)
1837 if (*di != *mi->data_.dirname)
1843 *istr += mi->data_.objname;
1849 istr->reserve(di->size() + 2);
1861 const uint32_t
run ,
1862 const uint32_t
lumi ,
1863 const uint32_t streamId ,
1864 const uint32_t moduleId )
const
1866 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1867 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1868 " unacceptable characters", dir.c_str());
1869 if (name.find_first_not_of(
s_safe) != std::string::npos)
1870 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1871 " unacceptable characters", name.c_str());
1881 MEMap::const_iterator mepos =
data_.find(proto);
1882 return (mepos ==
data_.end() ? 0
1892 into.reserve(
dirs_.size());
1894 MEMap::const_iterator me =
data_.end();
1895 std::set<std::string>::const_iterator di =
dirs_.begin();
1896 std::set<std::string>::const_iterator de =
dirs_.end();
1899 for ( ; di != de; ++di)
1902 MEMap::const_iterator mi =
data_.lower_bound(proto);
1903 MEMap::const_iterator
m = mi;
1904 size_t sz = di->size() + 2;
1910 sz += 1 + m->data_.objname.size() + 11;
1917 std::vector<std::string>::iterator istr
1924 for (sz = 0; mi !=
m; ++mi)
1928 sprintf(tagbuf,
"/%u", mi->data_.tag);
1931 *istr += m->data_.objname;
1941 std::vector<MonitorElement*>
1944 uint32_t
lumi )
const
1952 std::vector<MonitorElement *>
result;
1953 MEMap::const_iterator
e =
data_.end();
1954 MEMap::const_iterator
i =
data_.lower_bound(proto);
1956 if (runNumber != 0) {
1957 if (i->data_.run > runNumber
1958 || i->data_.streamId != 0
1959 || i->data_.moduleId != 0)
1963 if (i->data_.lumi > lumi
1964 || i->data_.streamId != 0
1965 || i->data_.moduleId != 0)
1968 if (runNumber != 0
or lumi !=0) {
1969 assert(i->data_.streamId == 0);
1970 assert(i->data_.moduleId == 0);
1972 result.push_back(const_cast<MonitorElement *>(&*i));
1979 std::vector<MonitorElement*>
1985 rx = lat::Regexp(pattern, 0, syntaxType);
1988 catch (lat::Error &
e)
1990 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
1991 pattern.c_str(), e.explain().c_str());
1995 std::vector<MonitorElement *>
result;
1996 MEMap::const_iterator
i =
data_.begin();
1997 MEMap::const_iterator e =
data_.end();
1998 for ( ; i !=
e; ++
i)
2001 mergePath(path, *i->data_.dirname, i->data_.objname);
2003 result.push_back(const_cast<MonitorElement *>(&*i));
2018 MEMap::iterator mi =
data_.begin();
2019 MEMap::iterator me =
data_.end();
2020 for ( ; mi != me; ++mi)
2023 if (mi->wasUpdated())
2042 MEMap::iterator mi =
data_.begin();
2043 MEMap::iterator me =
data_.end();
2044 for ( ; mi != me; ++mi)
2070 std::set<MonitorElement>::const_iterator
e =
data_.end();
2071 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2074 if (i->data_.streamId != 0 ||
2075 i->data_.moduleId != 0)
2079 if (i->data_.run != run)
2085 std::cout <<
"DQMStore::markForDeletion: marked monitor element '"
2086 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2087 <<
"flags " << i->data_.flags <<
"\n";
2105 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2109 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2116 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2127 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2131 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2138 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2142 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2149 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2153 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2160 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2164 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2171 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2175 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2182 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2186 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2193 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2197 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2204 else if (dynamic_cast<TObjString *>(obj))
2207 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2209 if (strstr(obj->GetName(),
"CMSSW"))
2212 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2215 else if (strstr(obj->GetName(),
"DQMPATCH"))
2218 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2223 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2224 << obj->GetName() <<
"' of type '"
2225 << obj->IsA()->GetName() <<
"'\n";
2237 if (! me || overwrite)
2239 if (! me) me =
bookInt(dir, label);
2240 me->
Fill(atoll(value.c_str()));
2243 else if (kind ==
"f")
2246 if (! me || overwrite)
2249 me->
Fill(atof(value.c_str()));
2252 else if (kind ==
"s")
2260 else if (kind ==
"e")
2265 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2266 << label <<
"' in directory '"
2267 << dir <<
"' to be marked as efficiency plot.\n";
2272 else if (kind ==
"t")
2277 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2278 << label <<
"' in directory '"
2279 << dir <<
"' for a tag\n";
2284 unsigned long val = strtoul(value.c_str(), &endp, 10);
2285 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2287 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2288 << value <<
"' for monitor element '"
2289 << label <<
"' in directory '"
2290 << dir <<
"' - invalid value\n";
2295 else if (kind ==
"qr")
2300 size_t dot = label.find(
'.');
2301 if (dot == std::string::npos)
2303 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2304 <<
"' is missing a '.' and cannot be extracted\n";
2309 std::string qrname (label, dot+1, std::string::npos);
2315 qv.
code = atoi(m.matchString(value, 1).c_str());
2316 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2317 qv.
message = m.matchString(value, 4);
2321 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2323 qv.
code = atoi(m.matchString(value, 1).c_str());
2325 qv.
message = m.matchString(value, 2);
2331 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2332 << value <<
"' is incorrectly formatted\n";
2339 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2340 << mename <<
"' in directory '"
2341 << dir <<
"' for quality test '"
2351 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2352 << obj->GetName() <<
"' of type '"
2353 << obj->IsA()->GetName() <<
"'\n";
2357 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2361 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2362 s +=
'<'; s +=
n->GetName(); s +=
'>';
2364 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2365 TObjString os(s.c_str());
2370 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2371 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2372 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2402 size_t end = path.find(
'/', start);
2403 if (end == std::string::npos)
2411 TObject *
o = gDirectory->Get(part.c_str());
2412 if (o && ! dynamic_cast<TDirectory *>(o))
2413 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2414 " fails because the part '%s' already exists and is not"
2415 " directory", path.c_str(), part.c_str());
2417 gDirectory->mkdir(part.c_str());
2419 if (! gDirectory->cd(part.c_str()))
2420 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2421 " fails because could not cd into subdirectory '%s'",
2422 path.c_str(), part.c_str());
2425 if (end+1 >= path.size())
2430 end = path.find(
'/', start);
2431 if (end == std::string::npos)
2440 const uint32_t
run ,
2441 const uint32_t
lumi ,
2442 const bool resetMEsAfterWriting )
2444 using google::protobuf::io::FileOutputStream;
2445 using google::protobuf::io::GzipOutputStream;
2446 using google::protobuf::io::StringOutputStream;
2448 std::set<std::string>::iterator di, de;
2449 MEMap::iterator mi, me =
data_.end();
2454 std::cout <<
"\n DQMStore: Opening PBFile '"
2455 << filename <<
"'"<< std::endl;
2458 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2471 mi =
data_.lower_bound(proto);
2472 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2476 <<
" Lumi: " << (*mi).lumi()
2477 <<
" LumiFlag: " << (*mi).getLumiFlag()
2478 <<
" streamId: " << (*mi).streamId()
2479 <<
" moduleId: " << (*mi).moduleId()
2480 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2487 if (*di != *mi->data_.dirname)
2496 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2500 std::cout <<
"DQMStore::savePB: saving monitor element '"
2501 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2502 <<
"flags " << mi->data_.flags <<
"\n";
2509 TObject *toWrite =
nullptr;
2513 toWrite =
new TObjString(mi->tagString().c_str());
2514 deleteObject =
true;
2516 toWrite = mi->object_;
2519 TBufferFile buffer(TBufferFile::kWrite);
2520 buffer.WriteObject(toWrite);
2530 if (resetMEsAfterWriting)
2535 int filedescriptor =
::open(filename.c_str(),
2536 O_WRONLY | O_CREAT | O_TRUNC,
2540 FileOutputStream file_stream(filedescriptor);
2542 options.format = GzipOutputStream::GZIP;
2543 options.compression_level = 6;
2544 GzipOutputStream gzip_stream(&file_stream,
2546 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2549 gzip_stream.Close();
2550 file_stream.Close();
2551 ::close(filedescriptor);
2555 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2556 <<
" objects from path '" << path
2557 <<
"' into DQM file '" << filename <<
"'\n";
2570 const uint32_t
run ,
2571 const uint32_t
lumi ,
2575 const bool resetMEsAfterWriting )
2577 std::set<std::string>::iterator di, de;
2578 MEMap::iterator mi, me =
data_.end();
2579 DQMNet::QReports::const_iterator qi, qe;
2587 class TFileNoSync :
public TFile
2590 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2591 virtual Int_t SysSync(Int_t)
override {
return 0; }
2596 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2597 <<
"' with option '" << fileupdate <<
"'\n";
2599 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2601 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2605 std::auto_ptr<lat::Regexp> rxpat;
2606 if (! pattern.empty())
2607 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2620 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2634 mi =
data_.lower_bound(proto);
2635 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2638 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2639 <<
" Lumi: " << (*mi).lumi()
2640 <<
" LumiFlag: " << (*mi).getLumiFlag()
2641 <<
" streamId: " << (*mi).streamId()
2642 <<
" moduleId: " << (*mi).moduleId()
2643 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2650 if (*di != *mi->data_.dirname) {
2652 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2662 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2688 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2689 status =
std::max(status, master->data_.qreports[
i].code);
2691 if (! master || status < minStatus)
2694 std::cout <<
"DQMStore::save: skipping monitor element '"
2695 << mi->data_.objname <<
"' while saving, status is "
2696 << status <<
", required minimum status is "
2697 << minStatus << std::endl;
2704 std::cout <<
"DQMStore::save: saving monitor element '"
2705 << mi->data_.objname <<
"'\n";
2709 gDirectory->cd(
"/");
2712 else if (rxpat.get())
2723 TObjString(mi->tagString().c_str()).Write();
2727 mi->object_->Write();
2734 qi = mi->data_.qreports.begin();
2735 qe = mi->data_.qreports.end();
2736 for ( ; qi != qe; ++qi)
2737 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2742 TObjString(mi->effLabelString().c_str()).Write();
2746 TObjString(mi->tagLabelString().c_str()).Write();
2749 if (resetMEsAfterWriting)
2758 std::cout <<
"DQMStore::save: successfully wrote " << nme
2759 <<
" objects from path '" << path
2760 <<
"' into DQM file '" << filename <<
"'\n";
2773 unsigned int ntot = 0;
2774 unsigned int count = 0;
2776 if (! file->cd(curdir.c_str()))
2777 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2778 " reading file '%s'", curdir.c_str(), file->GetName());
2801 size_t slash = dirpart.find(
'/');
2802 size_t pos = dirpart.find(
"/Run summary");
2803 if (slash != std::string::npos && pos !=std::string::npos)
2805 dirpart.erase(pos,12);
2807 pos = dirpart.find(
"Run ");
2808 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2809 if (pos !=std::string::npos)
2810 dirpart.erase(pos,length);
2819 size_t slash = dirpart.find(
'/');
2821 if (slash == std::string::npos
2826 slash = dirpart.find(
'/');
2828 if (slash != std::string::npos
2829 && slash + 10 == dirpart.size()
2830 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2832 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2837 if (dirpart.empty())
2840 dirpart = prepend +
'/' + dirpart;
2842 else if (! prepend.empty())
2844 if (dirpart.empty())
2847 dirpart = prepend +
'/' + dirpart;
2855 TIter
next (gDirectory->GetListOfKeys());
2856 std::list<TObject *> delayed;
2857 while ((key = (TKey *)
next()))
2859 std::auto_ptr<TObject>
obj(key->ReadObj());
2860 if (dynamic_cast<TDirectory *>(
obj.get()))
2863 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2865 if (! curdir.empty())
2867 subdir +=
obj->GetName();
2869 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2873 else if (dynamic_cast<TObjString *>(
obj.get()))
2875 delayed.push_back(
obj.release());
2880 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2881 <<
"' of type '" <<
obj->IsA()->GetName()
2882 <<
"' from '" << file->GetName()
2883 <<
"' into '" << dirpart <<
"'\n";
2891 while (! delayed.empty())
2894 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2895 <<
"' of type '" << delayed.front()->IsA()->GetName()
2896 <<
"' from '" << file->GetName()
2897 <<
"' into '" << dirpart <<
"'\n";
2903 delete delayed.front();
2904 delayed.pop_front();
2908 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2909 <<
" objects from directory '" << dirpart <<
"'\n";
2911 return ntot +
count;
2926 bool fileMustExist )
2928 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2938 bool fileMustExist )
2940 bool overwrite =
true;
2944 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2946 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2948 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2952 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2954 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2968 bool fileMustExist )
2972 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
2974 std::auto_ptr<TFile>
f;
2978 f.reset(TFile::Open(filename.c_str()));
2979 if (! f.get() || f->IsZombie())
2980 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
2989 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
2994 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
2997 MEMap::iterator mi =
data_.begin();
2998 MEMap::iterator me =
data_.end();
2999 for ( ; mi != me; ++mi)
3000 const_cast<MonitorElement &>(*mi).updateQReportStats();
3004 std::cout <<
"DQMStore::open: successfully read " << n
3005 <<
" objects from file '" << filename <<
"'";
3006 if (! onlypath.empty())
3007 std::cout <<
" from directory '" << onlypath <<
"'";
3008 if (! prepend.empty())
3009 std::cout <<
" into directory '" << prepend <<
"'";
3019 if (buf.Length() == buf.BufferSize())
3022 void *ptr = buf.ReadObjectAny(0);
3023 return reinterpret_cast<TObject *
>(ptr);
3032 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3033 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3035 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3036 TBufferFile buf(TBufferFile::kRead, h.
size(),
3052 bool fileMustExist )
3054 using google::protobuf::io::FileInputStream;
3055 using google::protobuf::io::FileOutputStream;
3056 using google::protobuf::io::GzipInputStream;
3057 using google::protobuf::io::GzipOutputStream;
3058 using google::protobuf::io::CodedInputStream;
3059 using google::protobuf::io::ArrayInputStream;
3062 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3065 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3067 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3070 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3075 FileInputStream
fin(filedescriptor);
3076 GzipInputStream
input(&fin);
3077 CodedInputStream input_coded(&input);
3078 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3079 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3080 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3083 ::close(filedescriptor);
3107 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3109 if (me ==
nullptr) {
3135 MEMap::iterator
e =
data_.end();
3136 MEMap::iterator
i =
data_.lower_bound(proto);
3140 std::set<std::string>::iterator de =
dirs_.end();
3141 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3151 MEMap::iterator
e =
data_.end();
3152 MEMap::iterator
i =
data_.lower_bound(proto);
3154 if (dir == *i->data_.dirname)
3181 MEMap::iterator pos =
data_.find(proto);
3182 if (pos ==
data_.end() && warning)
3183 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3184 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3197 QCMap::const_iterator
i =
qtests_.find(qtname);
3198 QCMap::const_iterator
e =
qtests_.end();
3199 return (i == e ? 0 : i->second);
3209 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3212 QAMap::iterator
i =
qalgos_.find(algoname);
3214 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3215 " algorithm '%s'", algoname.c_str());
3235 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3237 " uses unacceptable characters", cleaned->c_str());
3249 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3259 MEMap::iterator mi =
data_.begin();
3260 MEMap::iterator me =
data_.end();
3263 for ( ; mi != me; ++mi)
3266 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3267 if (fm->match(path))
3284 std::cout <<
"DQMStore: running runQTests() with reset = "
3285 << (
reset_ ?
"true" :
"false" ) << std::endl;
3288 MEMap::iterator mi =
data_.begin();
3289 MEMap::iterator me =
data_.end();
3290 for ( ; mi != me; ++mi)
3308 MEMap::const_iterator mi =
data_.begin();
3309 MEMap::const_iterator me =
data_.end();
3310 for ( ; mi != me; ++mi)
3312 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3317 else if (mi->hasWarning())
3320 && mi->hasOtherReport())
3364 std::cout <<
" ------------------------------------------------------------\n"
3365 <<
" Directory structure: \n"
3366 <<
" ------------------------------------------------------------\n";
3368 std::copy(contents.begin(), contents.end(),
3369 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3371 std::cout <<
" ------------------------------------------------------------\n";
3408 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3411 factor = factor/(events*1.0);
3413 MEMap::iterator mi =
data_.begin();
3414 MEMap::iterator me =
data_.end();
3415 for ( ; mi != me; ++mi)
3467 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)
void tagContents(const std::string &, unsigned int)
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,...)