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;
406 gme =
data_.insert(std::move(actual_global_me));
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);
473 gme =
data_.insert(std::move(actual_global_me));
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->getFullname() == i->getFullname() && 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));
2010 std::vector<MonitorElement*>
2016 rx = lat::Regexp(pattern, 0, syntaxType);
2019 catch (lat::Error &
e)
2021 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
2022 pattern.c_str(), e.explain().c_str());
2026 std::vector<MonitorElement *>
result;
2027 MEMap::const_iterator
i =
data_.begin();
2028 MEMap::const_iterator e =
data_.end();
2029 for ( ; i !=
e; ++
i)
2032 mergePath(path, *i->data_.dirname, i->data_.objname);
2034 result.push_back(const_cast<MonitorElement *>(&*i));
2049 MEMap::iterator mi =
data_.begin();
2050 MEMap::iterator me =
data_.end();
2051 for ( ; mi != me; ++mi)
2054 if (mi->wasUpdated())
2073 MEMap::iterator mi =
data_.begin();
2074 MEMap::iterator me =
data_.end();
2075 for ( ; mi != me; ++mi)
2101 std::set<MonitorElement>::const_iterator
e =
data_.end();
2102 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2105 if (i->data_.streamId != 0 ||
2106 i->data_.moduleId != 0)
2110 if (i->data_.run != run)
2116 std::cout <<
"DQMStore::markForDeletion: marked monitor element '"
2117 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2118 <<
"flags " << i->data_.flags <<
"\n";
2136 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2140 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2147 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2158 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2162 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2169 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2173 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2180 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2184 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2191 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2195 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2202 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2206 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2213 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2217 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2224 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2228 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2235 else if (dynamic_cast<TObjString *>(obj))
2238 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2240 if (strstr(obj->GetName(),
"CMSSW"))
2243 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2246 else if (strstr(obj->GetName(),
"DQMPATCH"))
2249 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2254 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2255 << obj->GetName() <<
"' of type '"
2256 << obj->IsA()->GetName() <<
"'\n";
2268 if (! me || overwrite)
2270 if (! me) me =
bookInt(dir, label);
2271 me->
Fill(atoll(value.c_str()));
2274 else if (kind ==
"f")
2277 if (! me || overwrite)
2280 me->
Fill(atof(value.c_str()));
2283 else if (kind ==
"s")
2291 else if (kind ==
"e")
2296 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2297 << label <<
"' in directory '"
2298 << dir <<
"' to be marked as efficiency plot.\n";
2303 else if (kind ==
"t")
2308 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2309 << label <<
"' in directory '"
2310 << dir <<
"' for a tag\n";
2315 unsigned long val = strtoul(value.c_str(), &endp, 10);
2316 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2318 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2319 << value <<
"' for monitor element '"
2320 << label <<
"' in directory '"
2321 << dir <<
"' - invalid value\n";
2326 else if (kind ==
"qr")
2331 size_t dot = label.find(
'.');
2332 if (dot == std::string::npos)
2334 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2335 <<
"' is missing a '.' and cannot be extracted\n";
2340 std::string qrname (label, dot+1, std::string::npos);
2346 qv.
code = atoi(m.matchString(value, 1).c_str());
2347 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2348 qv.
message = m.matchString(value, 4);
2352 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2354 qv.
code = atoi(m.matchString(value, 1).c_str());
2356 qv.
message = m.matchString(value, 2);
2362 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2363 << value <<
"' is incorrectly formatted\n";
2370 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2371 << mename <<
"' in directory '"
2372 << dir <<
"' for quality test '"
2382 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2383 << obj->GetName() <<
"' of type '"
2384 << obj->IsA()->GetName() <<
"'\n";
2388 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2392 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2393 s +=
'<'; s +=
n->GetName(); s +=
'>';
2395 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2396 TObjString os(s.c_str());
2401 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2402 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2403 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2433 size_t end = path.find(
'/', start);
2434 if (end == std::string::npos)
2442 TObject *
o = gDirectory->Get(part.c_str());
2443 if (o && ! dynamic_cast<TDirectory *>(o))
2444 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2445 " fails because the part '%s' already exists and is not"
2446 " directory", path.c_str(), part.c_str());
2448 gDirectory->mkdir(part.c_str());
2450 if (! gDirectory->cd(part.c_str()))
2451 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2452 " fails because could not cd into subdirectory '%s'",
2453 path.c_str(), part.c_str());
2456 if (end+1 >= path.size())
2461 end = path.find(
'/', start);
2462 if (end == std::string::npos)
2471 const uint32_t
run ,
2472 const uint32_t
lumi ,
2473 const bool resetMEsAfterWriting )
2475 using google::protobuf::io::FileOutputStream;
2476 using google::protobuf::io::GzipOutputStream;
2477 using google::protobuf::io::StringOutputStream;
2479 std::set<std::string>::iterator di, de;
2480 MEMap::iterator mi, me =
data_.end();
2485 std::cout <<
"\n DQMStore: Opening PBFile '"
2486 << filename <<
"'"<< std::endl;
2489 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2502 mi =
data_.lower_bound(proto);
2503 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2507 <<
" Lumi: " << (*mi).lumi()
2508 <<
" LumiFlag: " << (*mi).getLumiFlag()
2509 <<
" streamId: " << (*mi).streamId()
2510 <<
" moduleId: " << (*mi).moduleId()
2511 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2518 if (*di != *mi->data_.dirname)
2527 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2531 std::cout <<
"DQMStore::savePB: saving monitor element '"
2532 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2533 <<
"flags " << mi->data_.flags <<
"\n";
2540 TObject *toWrite =
nullptr;
2544 toWrite =
new TObjString(mi->tagString().c_str());
2545 deleteObject =
true;
2547 toWrite = mi->object_;
2550 TBufferFile buffer(TBufferFile::kWrite);
2551 buffer.WriteObject(toWrite);
2561 if (resetMEsAfterWriting)
2566 int filedescriptor =
::open(filename.c_str(),
2567 O_WRONLY | O_CREAT | O_TRUNC,
2571 FileOutputStream file_stream(filedescriptor);
2573 options.format = GzipOutputStream::GZIP;
2574 options.compression_level = 6;
2575 GzipOutputStream gzip_stream(&file_stream,
2577 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2580 gzip_stream.Close();
2581 file_stream.Close();
2582 ::close(filedescriptor);
2586 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2587 <<
" objects from path '" << path
2588 <<
"' into DQM file '" << filename <<
"'\n";
2601 const uint32_t
run ,
2602 const uint32_t
lumi ,
2606 const bool resetMEsAfterWriting )
2608 std::set<std::string>::iterator di, de;
2609 MEMap::iterator mi, me =
data_.end();
2610 DQMNet::QReports::const_iterator qi, qe;
2618 class TFileNoSync :
public TFile
2621 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2622 virtual Int_t SysSync(Int_t)
override {
return 0; }
2627 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2628 <<
"' with option '" << fileupdate <<
"'\n";
2630 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2632 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2636 std::auto_ptr<lat::Regexp> rxpat;
2637 if (! pattern.empty())
2638 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2651 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2665 mi =
data_.lower_bound(proto);
2666 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2669 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2670 <<
" Lumi: " << (*mi).lumi()
2671 <<
" LumiFlag: " << (*mi).getLumiFlag()
2672 <<
" streamId: " << (*mi).streamId()
2673 <<
" moduleId: " << (*mi).moduleId()
2674 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2681 if (*di != *mi->data_.dirname) {
2683 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2693 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2719 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2720 status =
std::max(status, master->data_.qreports[
i].code);
2722 if (! master || status < minStatus)
2725 std::cout <<
"DQMStore::save: skipping monitor element '"
2726 << mi->data_.objname <<
"' while saving, status is "
2727 << status <<
", required minimum status is "
2728 << minStatus << std::endl;
2735 std::cout <<
"DQMStore::save: saving monitor element '"
2736 << mi->data_.objname <<
"'\n";
2740 gDirectory->cd(
"/");
2743 else if (rxpat.get())
2754 TObjString(mi->tagString().c_str()).Write();
2758 mi->object_->Write();
2765 qi = mi->data_.qreports.begin();
2766 qe = mi->data_.qreports.end();
2767 for ( ; qi != qe; ++qi)
2768 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2773 TObjString(mi->effLabelString().c_str()).Write();
2777 TObjString(mi->tagLabelString().c_str()).Write();
2780 if (resetMEsAfterWriting)
2789 std::cout <<
"DQMStore::save: successfully wrote " << nme
2790 <<
" objects from path '" << path
2791 <<
"' into DQM file '" << filename <<
"'\n";
2804 unsigned int ntot = 0;
2805 unsigned int count = 0;
2807 if (! file->cd(curdir.c_str()))
2808 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2809 " reading file '%s'", curdir.c_str(), file->GetName());
2832 size_t slash = dirpart.find(
'/');
2833 size_t pos = dirpart.find(
"/Run summary");
2834 if (slash != std::string::npos && pos !=std::string::npos)
2836 dirpart.erase(pos,12);
2838 pos = dirpart.find(
"Run ");
2839 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2840 if (pos !=std::string::npos)
2841 dirpart.erase(pos,length);
2850 size_t slash = dirpart.find(
'/');
2852 if (slash == std::string::npos
2857 slash = dirpart.find(
'/');
2859 if (slash != std::string::npos
2860 && slash + 10 == dirpart.size()
2861 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2863 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2868 if (dirpart.empty())
2871 dirpart = prepend +
'/' + dirpart;
2873 else if (! prepend.empty())
2875 if (dirpart.empty())
2878 dirpart = prepend +
'/' + dirpart;
2886 TIter
next (gDirectory->GetListOfKeys());
2887 std::list<TObject *> delayed;
2888 while ((key = (TKey *)
next()))
2890 std::auto_ptr<TObject>
obj(key->ReadObj());
2891 if (dynamic_cast<TDirectory *>(
obj.get()))
2894 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2896 if (! curdir.empty())
2898 subdir +=
obj->GetName();
2900 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2904 else if (dynamic_cast<TObjString *>(
obj.get()))
2906 delayed.push_back(
obj.release());
2911 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2912 <<
"' of type '" <<
obj->IsA()->GetName()
2913 <<
"' from '" << file->GetName()
2914 <<
"' into '" << dirpart <<
"'\n";
2922 while (! delayed.empty())
2925 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2926 <<
"' of type '" << delayed.front()->IsA()->GetName()
2927 <<
"' from '" << file->GetName()
2928 <<
"' into '" << dirpart <<
"'\n";
2934 delete delayed.front();
2935 delayed.pop_front();
2939 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2940 <<
" objects from directory '" << dirpart <<
"'\n";
2942 return ntot +
count;
2957 bool fileMustExist )
2959 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2969 bool fileMustExist )
2971 bool overwrite =
true;
2975 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2977 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2979 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2983 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2985 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2999 bool fileMustExist )
3003 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3005 std::auto_ptr<TFile>
f;
3009 f.reset(TFile::Open(filename.c_str()));
3010 if (! f.get() || f->IsZombie())
3011 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3020 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3025 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3028 MEMap::iterator mi =
data_.begin();
3029 MEMap::iterator me =
data_.end();
3030 for ( ; mi != me; ++mi)
3031 const_cast<MonitorElement &>(*mi).updateQReportStats();
3035 std::cout <<
"DQMStore::open: successfully read " << n
3036 <<
" objects from file '" << filename <<
"'";
3037 if (! onlypath.empty())
3038 std::cout <<
" from directory '" << onlypath <<
"'";
3039 if (! prepend.empty())
3040 std::cout <<
" into directory '" << prepend <<
"'";
3050 if (buf.Length() == buf.BufferSize())
3053 void *ptr = buf.ReadObjectAny(0);
3054 return reinterpret_cast<TObject *
>(ptr);
3063 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3064 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3066 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3067 TBufferFile buf(TBufferFile::kRead, h.
size(),
3083 bool fileMustExist )
3085 using google::protobuf::io::FileInputStream;
3086 using google::protobuf::io::FileOutputStream;
3087 using google::protobuf::io::GzipInputStream;
3088 using google::protobuf::io::GzipOutputStream;
3089 using google::protobuf::io::CodedInputStream;
3090 using google::protobuf::io::ArrayInputStream;
3093 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3096 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3098 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3101 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3106 FileInputStream
fin(filedescriptor);
3107 GzipInputStream
input(&fin);
3108 CodedInputStream input_coded(&input);
3109 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3110 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3111 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3114 ::close(filedescriptor);
3138 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3140 if (me ==
nullptr) {
3166 MEMap::iterator
e =
data_.end();
3167 MEMap::iterator
i =
data_.lower_bound(proto);
3171 std::set<std::string>::iterator de =
dirs_.end();
3172 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3182 MEMap::iterator
e =
data_.end();
3183 MEMap::iterator
i =
data_.lower_bound(proto);
3185 if (dir == *i->data_.dirname)
3212 MEMap::iterator pos =
data_.find(proto);
3213 if (pos ==
data_.end() && warning)
3214 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3215 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3228 QCMap::const_iterator
i =
qtests_.find(qtname);
3229 QCMap::const_iterator
e =
qtests_.end();
3230 return (i == e ? 0 : i->second);
3240 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3243 QAMap::iterator
i =
qalgos_.find(algoname);
3245 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3246 " algorithm '%s'", algoname.c_str());
3266 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3268 " uses unacceptable characters", cleaned->c_str());
3280 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3290 MEMap::iterator mi =
data_.begin();
3291 MEMap::iterator me =
data_.end();
3294 for ( ; mi != me; ++mi)
3297 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3298 if (fm->match(path))
3315 std::cout <<
"DQMStore: running runQTests() with reset = "
3316 << (
reset_ ?
"true" :
"false" ) << std::endl;
3319 MEMap::iterator mi =
data_.begin();
3320 MEMap::iterator me =
data_.end();
3321 for ( ; mi != me; ++mi)
3339 MEMap::const_iterator mi =
data_.begin();
3340 MEMap::const_iterator me =
data_.end();
3341 for ( ; mi != me; ++mi)
3343 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3348 else if (mi->hasWarning())
3351 && mi->hasOtherReport())
3395 std::cout <<
" ------------------------------------------------------------\n"
3396 <<
" Directory structure: \n"
3397 <<
" ------------------------------------------------------------\n";
3399 std::copy(contents.begin(), contents.end(),
3400 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3402 std::cout <<
" ------------------------------------------------------------\n";
3439 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3442 factor = factor/(events*1.0);
3444 MEMap::iterator mi =
data_.begin();
3445 MEMap::iterator me =
data_.end();
3446 for ( ; mi != me; ++mi)
3498 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
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
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,...)