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)
380 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
381 if (me !=
data_.end()) {
383 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
388 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
390 list.Add(i->getTH1());
391 if( -1 == me->getTH1()->Merge(&list)) {
392 std::cout <<
"mergeAndResetMEsRunSummaryCache: Failed to merge DQM element "<<me->getFullname();
396 me->getTH1()->Add(i->getTH1());
400 std::cout <<
"No global Object found. " << std::endl;
401 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
419 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
420 << run <<
" lumi: " << lumi
421 <<
", stream: " << streamId
422 <<
" module: " << moduleId << std::endl;
424 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
425 std::set<MonitorElement>::const_iterator
e =
data_.end();
426 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
429 if (i->data_.run != run
430 || i->data_.streamId != streamId
431 || i->data_.moduleId != moduleId)
446 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
447 if (me !=
data_.end()) {
449 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
454 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
456 list.Add(i->getTH1());
457 if( -1 == me->getTH1()->Merge(&list)) {
458 std::cout <<
"mergeAndResetMEsLuminositySummaryCache: Failed to merge DQM element "<<me->getFullname();
462 me->getTH1()->Add(i->getTH1());
466 std::cout <<
"No global Object found. " << std::endl;
467 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
472 actual_global_me.
setLumi(lumi);
483 std::set<MonitorElement>::const_iterator i_lumi =
data_.lower_bound(global_me);
484 while (i_lumi->data_.lumi != lumi) {
485 auto temp = i_lumi++;
486 if (i_lumi->getName() == i->getName() && i_lumi->getPathname() == i->getPathname() && i_lumi->markedToDelete())
535 collateHistograms_ (
false),
536 enableMultiThread_(
false),
537 readSelectedDirectory_ (
""),
582 std::cout <<
"DQMStore: histogram collation is enabled\n";
586 std::cout <<
"DQMStore: MultiThread option is enabled\n";
590 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
595 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
599 initQCriterion<Comp2RefChi2>(
qalgos_);
600 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
601 initQCriterion<ContentsXRange>(
qalgos_);
602 initQCriterion<ContentsYRange>(
qalgos_);
603 initQCriterion<MeanWithinExpected>(
qalgos_);
604 initQCriterion<Comp2RefEqualH>(
qalgos_);
605 initQCriterion<DeadChannel>(
qalgos_);
606 initQCriterion<NoisyChannel>(
qalgos_);
607 initQCriterion<ContentsWithinExpected>(
qalgos_);
608 initQCriterion<CompareToMedian>(
qalgos_);
609 initQCriterion<CompareLastFilledBin>(
qalgos_);
610 initQCriterion<CheckVariance>(
qalgos_);
614 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
633 stream_ =
new std::ofstream(
"histogramBookingBT.log");
642 size = backtrace (array, 10);
643 strings = backtrace_symbols (array, size);
648 char * demangled = abi::__cxa_demangle(m.matchString(strings[4], 2).c_str(), 0, 0, &
r);
651 << (r ? m.matchString(strings[4], 2) : demangled) <<
" "
652 << m.matchString(strings[4], 1) <<
"\n";
656 *
stream_ <<
"Skipping "<< dir <<
"/" << name
657 <<
" with stack size " << size <<
"\n";
665 for (i = 0; i <
size; i++)
666 if (
s_rxtrace.match(strings[i], 0, 0, &m))
668 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
669 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" "
670 << (r ? m.matchString(strings[i], 2) : demangled) <<
" "
671 << m.matchString(strings[i], 1) << std::endl;
708 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
732 size_t pos =
pwd_.rfind(
'/');
733 if (pos == std::string::npos)
748 prev.reserve(path.size());
749 subdir.reserve(path.size());
750 name.reserve(path.size());
758 subdir.append(path, 0, slash);
760 name.append(subdir, prevname, std::string::npos);
762 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
763 " which already exists as a monitor element",
766 if (!
dirs_.count(subdir))
767 dirs_.insert(subdir);
770 if (slash+1 >= path.size())
775 prevname = slash ? slash+1 :
slash;
777 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
785 {
return dirs_.count(path) > 0; }
790 template <
class HISTO,
class COLLATE>
793 const char *context,
int kind,
794 HISTO *
h, COLLATE collate)
796 assert(name.find(
'/') == std::string::npos);
819 << context <<
": monitor element '"
820 << path <<
"' already exists, collating" << std::endl;
838 for ( ; qi != qe; ++qi)
840 if ( qi->first->match(path) )
841 me->addQReport(qi->second);
865 assert(name.find(
'/') == std::string::npos);
878 << context <<
": monitor element '"
879 << path <<
"' already exists, resetting" << std::endl;
907 return book(dir, name,
"bookInt")
937 return book(dir, name,
"bookFloat")
966 return book(dir, name,
"bookString")
1007 int nchX,
double lowX,
double highX)
1009 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1015 int nchX,
double lowX,
double highX)
1017 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
1023 int nchX,
double lowX,
double highX)
1025 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1031 int nchX,
double lowX,
double highX)
1033 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1039 int nchX,
double lowX,
double highX)
1041 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1047 int nchX,
double lowX,
double highX)
1049 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1055 int nchX,
const float *xbinsize)
1057 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1063 int nchX,
const float *xbinsize)
1065 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1072 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1079 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1086 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1093 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1100 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1107 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1135 int nchX,
double lowX,
double highX,
1136 int nchY,
double lowY,
double highY)
1138 return book2D(
pwd_, name,
new TH2F(name, title,
1140 nchY, lowY, highY));
1146 int nchX,
double lowX,
double highX,
1147 int nchY,
double lowY,
double highY)
1149 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1151 nchY, lowY, highY));
1157 int nchX,
double lowX,
double highX,
1158 int nchY,
double lowY,
double highY)
1160 return book2S(
pwd_, name,
new TH2S(name, title,
1162 nchY, lowY, highY));
1168 int nchX,
double lowX,
double highX,
1169 int nchY,
double lowY,
double highY)
1171 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1173 nchY, lowY, highY));
1179 int nchX,
double lowX,
double highX,
1180 int nchY,
double lowY,
double highY)
1184 nchY, lowY, highY));
1190 int nchX,
double lowX,
double highX,
1191 int nchY,
double lowY,
double highY)
1193 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1195 nchY, lowY, highY));
1201 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1203 return book2D(
pwd_, name,
new TH2F(name, title,
1204 nchX, xbinsize, nchY, ybinsize));
1210 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1212 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1213 nchX, xbinsize, nchY, ybinsize));
1220 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1227 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1234 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1241 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1248 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1255 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1269 int nchX,
double lowX,
double highX,
1270 int nchY,
double lowY,
double highY,
1271 int nchZ,
double lowZ,
double highZ)
1273 return book3D(
pwd_, name,
new TH3F(name, title,
1276 nchZ, lowZ, highZ));
1282 int nchX,
double lowX,
double highX,
1283 int nchY,
double lowY,
double highY,
1284 int nchZ,
double lowZ,
double highZ)
1286 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1289 nchZ, lowZ, highZ));
1296 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1303 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1311 return book(dir, name,
"bookProfile",
1321 int nchX,
double lowX,
double highX,
1322 int ,
double lowY,
double highY,
1323 const char *option )
1336 int nchX,
double lowX,
double highX,
1337 int ,
double lowY,
double highY,
1338 const char *option )
1340 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1351 int nchX,
double lowX,
double highX,
1352 double lowY,
double highY,
1353 const char *option )
1366 int nchX,
double lowX,
double highX,
1367 double lowY,
double highY,
1368 const char *option )
1370 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1381 int nchX,
const double *xbinsize,
1382 int ,
double lowY,
double highY,
1383 const char *option )
1396 int nchX,
const double *xbinsize,
1397 int ,
double lowY,
double highY,
1398 const char *option )
1400 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1411 int nchX,
const double *xbinsize,
1412 double lowY,
double highY,
1413 const char *option )
1426 int nchX,
const double *xbinsize,
1427 double lowY,
double highY,
1428 const char *option )
1430 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1440 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1447 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1455 return book(dir, name,
"bookProfile2D",
1465 int nchX,
double lowX,
double highX,
1466 int nchY,
double lowY,
double highY,
1467 int ,
double lowZ,
double highZ,
1468 const char *option )
1482 int nchX,
double lowX,
double highX,
1483 int nchY,
double lowY,
double highY,
1484 int ,
double lowZ,
double highZ,
1485 const char *option )
1499 int nchX,
double lowX,
double highX,
1500 int nchY,
double lowY,
double highY,
1501 double lowZ,
double highZ,
1502 const char *option )
1516 int nchX,
double lowX,
double highX,
1517 int nchY,
double lowY,
double highY,
1518 double lowZ,
double highZ,
1519 const char *option )
1532 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1539 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1548 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1549 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1550 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1551 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1552 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1553 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1554 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1555 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1556 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1563 <<
"checkBinningMatches: different binning - cannot add object '"
1564 << h->GetName() <<
"' of type "
1565 << h->IsA()->GetName() <<
" to existing ME: '"
1649 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1652 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1653 " twice with multiple tags", me->
getFullname().c_str());
1670 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1671 " '%s' with tag %u", path.c_str(), myTag);
1680 MEMap::iterator
e =
data_.end();
1681 MEMap::iterator
i =
data_.lower_bound(proto);
1682 for ( ; i != e && path == *i->data_.dirname; ++
i)
1683 tag(const_cast<MonitorElement *>(&*i), myTag);
1697 MEMap::iterator
e =
data_.end();
1698 MEMap::iterator
i =
data_.lower_bound(proto);
1701 tag(const_cast<MonitorElement *>(&*i), myTag);
1710 std::vector<std::string>
1713 std::vector<std::string>
result;
1714 std::set<std::string>::const_iterator
e =
dirs_.end();
1715 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1726 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1727 result.push_back(*i);
1733 std::vector<std::string>
1737 std::vector<std::string>
result;
1738 MEMap::const_iterator
e =
data_.end();
1739 MEMap::const_iterator
i =
data_.lower_bound(proto);
1741 if (
pwd_ == *i->data_.dirname)
1742 result.push_back(i->getName());
1753 MEMap::const_iterator
e =
data_.end();
1754 MEMap::const_iterator
i =
data_.lower_bound(proto);
1766 MEMap::const_iterator mepos =
data_.find(proto);
1767 return (mepos ==
data_.end() ? 0
1772 std::vector<MonitorElement *>
1776 std::vector<MonitorElement *>
result;
1777 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1781 result.push_back(const_cast<MonitorElement *>(&me));
1788 std::vector<MonitorElement *>
1796 std::vector<MonitorElement *>
result;
1797 MEMap::const_iterator
e =
data_.end();
1798 MEMap::const_iterator
i =
data_.lower_bound(proto);
1800 if (*cleaned == *i->data_.dirname)
1801 result.push_back(const_cast<MonitorElement *>(&*i));
1807 std::vector<MonitorElement *>
1815 std::vector<MonitorElement *>
result;
1816 MEMap::const_iterator
e =
data_.end();
1817 MEMap::const_iterator
i =
data_.lower_bound(proto);
1819 if (*cleaned == *i->data_.dirname
1821 && i->data_.tag ==
tag)
1822 result.push_back(const_cast<MonitorElement *>(&*i));
1835 into.reserve(
dirs_.size());
1837 MEMap::const_iterator me =
data_.end();
1838 std::set<std::string>::const_iterator di =
dirs_.begin();
1839 std::set<std::string>::const_iterator de =
dirs_.end();
1840 for ( ; di != de; ++di)
1843 MEMap::const_iterator mi =
data_.lower_bound(proto);
1844 MEMap::const_iterator
m = mi;
1845 size_t sz = di->size() + 2;
1848 if (*di == *m->data_.dirname)
1850 sz += m->data_.objname.size() + 1;
1857 std::vector<std::string>::iterator istr
1866 for (sz = 0; mi !=
m; ++mi)
1868 if (*di != *mi->data_.dirname)
1874 *istr += mi->data_.objname;
1880 istr->reserve(di->size() + 2);
1892 const uint32_t
run ,
1893 const uint32_t
lumi ,
1894 const uint32_t streamId ,
1895 const uint32_t moduleId )
const
1897 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1898 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1899 " unacceptable characters", dir.c_str());
1900 if (name.find_first_not_of(
s_safe) != std::string::npos)
1901 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1902 " unacceptable characters", name.c_str());
1912 MEMap::const_iterator mepos =
data_.find(proto);
1913 return (mepos ==
data_.end() ? 0
1923 into.reserve(
dirs_.size());
1925 MEMap::const_iterator me =
data_.end();
1926 std::set<std::string>::const_iterator di =
dirs_.begin();
1927 std::set<std::string>::const_iterator de =
dirs_.end();
1930 for ( ; di != de; ++di)
1933 MEMap::const_iterator mi =
data_.lower_bound(proto);
1934 MEMap::const_iterator
m = mi;
1935 size_t sz = di->size() + 2;
1941 sz += 1 + m->data_.objname.size() + 11;
1948 std::vector<std::string>::iterator istr
1955 for (sz = 0; mi !=
m; ++mi)
1959 sprintf(tagbuf,
"/%u", mi->data_.tag);
1962 *istr += m->data_.objname;
1972 std::vector<MonitorElement*>
1975 uint32_t
lumi )
const
1983 std::vector<MonitorElement *>
result;
1984 MEMap::const_iterator
e =
data_.end();
1985 MEMap::const_iterator
i =
data_.lower_bound(proto);
1987 if (runNumber != 0) {
1988 if (i->data_.run > runNumber
1989 || i->data_.streamId != 0
1990 || i->data_.moduleId != 0)
1994 if (i->data_.lumi > lumi
1995 || i->data_.streamId != 0
1996 || i->data_.moduleId != 0)
1999 if (runNumber != 0
or lumi !=0) {
2000 assert(i->data_.streamId == 0);
2001 assert(i->data_.moduleId == 0);
2003 result.push_back(const_cast<MonitorElement *>(&*i));
2011 if (i->data_.run != 0 || i->data_.streamId != 0 || i->data_.moduleId != 0)
break;
2012 result.push_back(const_cast<MonitorElement *>(&*i));
2021 std::vector<MonitorElement*>
2027 rx = lat::Regexp(pattern, 0, syntaxType);
2030 catch (lat::Error &
e)
2032 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
2033 pattern.c_str(), e.explain().c_str());
2037 std::vector<MonitorElement *>
result;
2038 MEMap::const_iterator
i =
data_.begin();
2039 MEMap::const_iterator e =
data_.end();
2040 for ( ; i !=
e; ++
i)
2043 mergePath(path, *i->data_.dirname, i->data_.objname);
2045 result.push_back(const_cast<MonitorElement *>(&*i));
2060 MEMap::iterator mi =
data_.begin();
2061 MEMap::iterator me =
data_.end();
2062 for ( ; mi != me; ++mi)
2065 if (mi->wasUpdated())
2084 MEMap::iterator mi =
data_.begin();
2085 MEMap::iterator me =
data_.end();
2086 for ( ; mi != me; ++mi)
2112 std::set<MonitorElement>::const_iterator
e =
data_.end();
2113 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2116 if (i->data_.streamId != 0 ||
2117 i->data_.moduleId != 0)
2121 if (i->data_.run != run)
2127 std::cout <<
"DQMStore::markForDeletion: marked monitor element '"
2128 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2129 <<
"flags " << i->data_.flags <<
"\n";
2147 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2151 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2158 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2169 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2173 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2180 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2184 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2191 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2195 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2202 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2206 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2213 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2217 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2224 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2228 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2235 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2239 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2246 else if (dynamic_cast<TObjString *>(obj))
2249 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2251 if (strstr(obj->GetName(),
"CMSSW"))
2254 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2257 else if (strstr(obj->GetName(),
"DQMPATCH"))
2260 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2265 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2266 << obj->GetName() <<
"' of type '"
2267 << obj->IsA()->GetName() <<
"'\n";
2279 if (! me || overwrite)
2281 if (! me) me =
bookInt(dir, label);
2282 me->
Fill(atoll(value.c_str()));
2285 else if (kind ==
"f")
2288 if (! me || overwrite)
2291 me->
Fill(atof(value.c_str()));
2294 else if (kind ==
"s")
2302 else if (kind ==
"e")
2307 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2308 << label <<
"' in directory '"
2309 << dir <<
"' to be marked as efficiency plot.\n";
2314 else if (kind ==
"t")
2319 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2320 << label <<
"' in directory '"
2321 << dir <<
"' for a tag\n";
2326 unsigned long val = strtoul(value.c_str(), &endp, 10);
2327 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2329 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2330 << value <<
"' for monitor element '"
2331 << label <<
"' in directory '"
2332 << dir <<
"' - invalid value\n";
2337 else if (kind ==
"qr")
2342 size_t dot = label.find(
'.');
2343 if (dot == std::string::npos)
2345 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2346 <<
"' is missing a '.' and cannot be extracted\n";
2351 std::string qrname (label, dot+1, std::string::npos);
2357 qv.
code = atoi(m.matchString(value, 1).c_str());
2358 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2359 qv.
message = m.matchString(value, 4);
2363 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2365 qv.
code = atoi(m.matchString(value, 1).c_str());
2367 qv.
message = m.matchString(value, 2);
2373 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2374 << value <<
"' is incorrectly formatted\n";
2381 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2382 << mename <<
"' in directory '"
2383 << dir <<
"' for quality test '"
2393 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2394 << obj->GetName() <<
"' of type '"
2395 << obj->IsA()->GetName() <<
"'\n";
2399 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2403 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2404 s +=
'<'; s +=
n->GetName(); s +=
'>';
2406 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2407 TObjString os(s.c_str());
2412 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2413 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2414 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2444 size_t end = path.find(
'/', start);
2445 if (end == std::string::npos)
2453 TObject *
o = gDirectory->Get(part.c_str());
2454 if (o && ! dynamic_cast<TDirectory *>(o))
2455 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2456 " fails because the part '%s' already exists and is not"
2457 " directory", path.c_str(), part.c_str());
2459 gDirectory->mkdir(part.c_str());
2461 if (! gDirectory->cd(part.c_str()))
2462 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2463 " fails because could not cd into subdirectory '%s'",
2464 path.c_str(), part.c_str());
2467 if (end+1 >= path.size())
2472 end = path.find(
'/', start);
2473 if (end == std::string::npos)
2482 const uint32_t
run ,
2483 const uint32_t
lumi ,
2484 const bool resetMEsAfterWriting )
2486 using google::protobuf::io::FileOutputStream;
2487 using google::protobuf::io::GzipOutputStream;
2488 using google::protobuf::io::StringOutputStream;
2490 std::set<std::string>::iterator di, de;
2491 MEMap::iterator mi, me =
data_.end();
2496 std::cout <<
"\n DQMStore: Opening PBFile '"
2497 << filename <<
"'"<< std::endl;
2500 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2513 mi =
data_.lower_bound(proto);
2514 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2518 <<
" Lumi: " << (*mi).lumi()
2519 <<
" LumiFlag: " << (*mi).getLumiFlag()
2520 <<
" streamId: " << (*mi).streamId()
2521 <<
" moduleId: " << (*mi).moduleId()
2522 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2529 if (*di != *mi->data_.dirname)
2538 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2542 std::cout <<
"DQMStore::savePB: saving monitor element '"
2543 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2544 <<
"flags " << mi->data_.flags <<
"\n";
2551 TObject *toWrite =
nullptr;
2555 toWrite =
new TObjString(mi->tagString().c_str());
2556 deleteObject =
true;
2558 toWrite = mi->object_;
2561 TBufferFile buffer(TBufferFile::kWrite);
2562 buffer.WriteObject(toWrite);
2572 if (resetMEsAfterWriting)
2577 int filedescriptor =
::open(filename.c_str(),
2578 O_WRONLY | O_CREAT | O_TRUNC,
2582 FileOutputStream file_stream(filedescriptor);
2584 options.format = GzipOutputStream::GZIP;
2585 options.compression_level = 6;
2586 GzipOutputStream gzip_stream(&file_stream,
2588 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2591 gzip_stream.Close();
2592 file_stream.Close();
2593 ::close(filedescriptor);
2597 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2598 <<
" objects from path '" << path
2599 <<
"' into DQM file '" << filename <<
"'\n";
2612 const uint32_t
run ,
2613 const uint32_t
lumi ,
2617 const bool resetMEsAfterWriting )
2619 std::set<std::string>::iterator di, de;
2620 MEMap::iterator mi, me =
data_.end();
2621 DQMNet::QReports::const_iterator qi, qe;
2629 class TFileNoSync :
public TFile
2632 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2633 virtual Int_t SysSync(Int_t)
override {
return 0; }
2638 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2639 <<
"' with option '" << fileupdate <<
"'\n";
2641 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2643 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2647 std::auto_ptr<lat::Regexp> rxpat;
2648 if (! pattern.empty())
2649 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2662 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2676 mi =
data_.lower_bound(proto);
2677 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2680 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2681 <<
" Lumi: " << (*mi).lumi()
2682 <<
" LumiFlag: " << (*mi).getLumiFlag()
2683 <<
" streamId: " << (*mi).streamId()
2684 <<
" moduleId: " << (*mi).moduleId()
2685 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2692 if (*di != *mi->data_.dirname) {
2694 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2704 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2730 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2731 status =
std::max(status, master->data_.qreports[
i].code);
2733 if (! master || status < minStatus)
2736 std::cout <<
"DQMStore::save: skipping monitor element '"
2737 << mi->data_.objname <<
"' while saving, status is "
2738 << status <<
", required minimum status is "
2739 << minStatus << std::endl;
2746 std::cout <<
"DQMStore::save: saving monitor element '"
2747 << mi->data_.objname <<
"'\n";
2751 gDirectory->cd(
"/");
2754 else if (rxpat.get())
2765 TObjString(mi->tagString().c_str()).Write();
2769 mi->object_->Write();
2776 qi = mi->data_.qreports.begin();
2777 qe = mi->data_.qreports.end();
2778 for ( ; qi != qe; ++qi)
2779 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2784 TObjString(mi->effLabelString().c_str()).Write();
2788 TObjString(mi->tagLabelString().c_str()).Write();
2791 if (resetMEsAfterWriting)
2800 std::cout <<
"DQMStore::save: successfully wrote " << nme
2801 <<
" objects from path '" << path
2802 <<
"' into DQM file '" << filename <<
"'\n";
2815 unsigned int ntot = 0;
2816 unsigned int count = 0;
2818 if (! file->cd(curdir.c_str()))
2819 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2820 " reading file '%s'", curdir.c_str(), file->GetName());
2843 size_t slash = dirpart.find(
'/');
2844 size_t pos = dirpart.find(
"/Run summary");
2845 if (slash != std::string::npos && pos !=std::string::npos)
2847 dirpart.erase(pos,12);
2849 pos = dirpart.find(
"Run ");
2850 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2851 if (pos !=std::string::npos)
2852 dirpart.erase(pos,length);
2861 size_t slash = dirpart.find(
'/');
2863 if (slash == std::string::npos
2868 slash = dirpart.find(
'/');
2870 if (slash != std::string::npos
2871 && slash + 10 == dirpart.size()
2872 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2874 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2879 if (dirpart.empty())
2882 dirpart = prepend +
'/' + dirpart;
2884 else if (! prepend.empty())
2886 if (dirpart.empty())
2889 dirpart = prepend +
'/' + dirpart;
2897 TIter
next (gDirectory->GetListOfKeys());
2898 std::list<TObject *> delayed;
2899 while ((key = (TKey *)
next()))
2901 std::auto_ptr<TObject>
obj(key->ReadObj());
2902 if (dynamic_cast<TDirectory *>(
obj.get()))
2905 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2907 if (! curdir.empty())
2909 subdir +=
obj->GetName();
2911 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2915 else if (dynamic_cast<TObjString *>(
obj.get()))
2917 delayed.push_back(
obj.release());
2922 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2923 <<
"' of type '" <<
obj->IsA()->GetName()
2924 <<
"' from '" << file->GetName()
2925 <<
"' into '" << dirpart <<
"'\n";
2933 while (! delayed.empty())
2936 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2937 <<
"' of type '" << delayed.front()->IsA()->GetName()
2938 <<
"' from '" << file->GetName()
2939 <<
"' into '" << dirpart <<
"'\n";
2945 delete delayed.front();
2946 delayed.pop_front();
2950 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2951 <<
" objects from directory '" << dirpart <<
"'\n";
2953 return ntot +
count;
2968 bool fileMustExist )
2970 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2980 bool fileMustExist )
2982 bool overwrite =
true;
2986 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2988 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2990 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2994 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2996 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3010 bool fileMustExist )
3014 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3016 std::auto_ptr<TFile>
f;
3020 f.reset(TFile::Open(filename.c_str()));
3021 if (! f.get() || f->IsZombie())
3022 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3031 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3036 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3039 MEMap::iterator mi =
data_.begin();
3040 MEMap::iterator me =
data_.end();
3041 for ( ; mi != me; ++mi)
3042 const_cast<MonitorElement &>(*mi).updateQReportStats();
3046 std::cout <<
"DQMStore::open: successfully read " << n
3047 <<
" objects from file '" << filename <<
"'";
3048 if (! onlypath.empty())
3049 std::cout <<
" from directory '" << onlypath <<
"'";
3050 if (! prepend.empty())
3051 std::cout <<
" into directory '" << prepend <<
"'";
3061 if (buf.Length() == buf.BufferSize())
3064 void *ptr = buf.ReadObjectAny(0);
3065 return reinterpret_cast<TObject *
>(ptr);
3074 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3075 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3077 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3078 TBufferFile buf(TBufferFile::kRead, h.
size(),
3094 bool fileMustExist )
3096 using google::protobuf::io::FileInputStream;
3097 using google::protobuf::io::FileOutputStream;
3098 using google::protobuf::io::GzipInputStream;
3099 using google::protobuf::io::GzipOutputStream;
3100 using google::protobuf::io::CodedInputStream;
3101 using google::protobuf::io::ArrayInputStream;
3104 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3107 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3109 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3112 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3117 FileInputStream
fin(filedescriptor);
3118 GzipInputStream
input(&fin);
3119 CodedInputStream input_coded(&input);
3120 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3121 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3122 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3125 ::close(filedescriptor);
3149 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3151 if (me ==
nullptr) {
3177 MEMap::iterator
e =
data_.end();
3178 MEMap::iterator
i =
data_.lower_bound(proto);
3182 std::set<std::string>::iterator de =
dirs_.end();
3183 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3193 MEMap::iterator
e =
data_.end();
3194 MEMap::iterator
i =
data_.lower_bound(proto);
3196 if (dir == *i->data_.dirname)
3223 MEMap::iterator pos =
data_.find(proto);
3224 if (pos !=
data_.end())
3227 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3228 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3239 QCMap::const_iterator
i =
qtests_.find(qtname);
3240 QCMap::const_iterator
e =
qtests_.end();
3241 return (i == e ? 0 : i->second);
3251 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3254 QAMap::iterator
i =
qalgos_.find(algoname);
3256 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3257 " algorithm '%s'", algoname.c_str());
3277 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3279 " uses unacceptable characters", cleaned->c_str());
3291 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3301 MEMap::iterator mi =
data_.begin();
3302 MEMap::iterator me =
data_.end();
3305 for ( ; mi != me; ++mi)
3308 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3309 if (fm->match(path))
3326 std::cout <<
"DQMStore: running runQTests() with reset = "
3327 << (
reset_ ?
"true" :
"false" ) << std::endl;
3330 MEMap::iterator mi =
data_.begin();
3331 MEMap::iterator me =
data_.end();
3332 for ( ; mi != me; ++mi)
3350 MEMap::const_iterator mi =
data_.begin();
3351 MEMap::const_iterator me =
data_.end();
3352 for ( ; mi != me; ++mi)
3354 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3359 else if (mi->hasWarning())
3362 && mi->hasOtherReport())
3406 std::cout <<
" ------------------------------------------------------------\n"
3407 <<
" Directory structure: \n"
3408 <<
" ------------------------------------------------------------\n";
3410 std::copy(contents.begin(), contents.end(),
3411 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3413 std::cout <<
" ------------------------------------------------------------\n";
3450 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3453 factor = factor/(events*1.0);
3455 MEMap::iterator mi =
data_.begin();
3456 MEMap::iterator me =
data_.end();
3457 for ( ; mi != me; ++mi)
3509 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)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
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,...)