7 #include "classlib/utils/RegexpMatch.h" 8 #include "classlib/utils/Regexp.h" 9 #include "classlib/utils/StringOps.h" 10 #include <google/protobuf/io/coded_stream.h> 11 #include <google/protobuf/io/gzip_stream.h> 12 #include <google/protobuf/io/zero_copy_stream_impl.h> 18 #include "TBufferFile.h" 21 #include <boost/algorithm/string.hpp> 58 static const std::string s_safe =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# ";
60 static const lat::Regexp
s_rxmeval (
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$");
61 static const lat::Regexp
s_rxmeqr1 (
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$");
62 static const lat::Regexp
s_rxmeqr2 (
"^st\\.(\\d+)\\.(.*)$");
63 static const lat::Regexp
s_rxtrace (
"(.*)\\((.*)\\+0x.*\\).*");
64 static const lat::Regexp
s_rxself (
"^[^()]*DQMStore::.*");
65 static const lat::Regexp
s_rxpbfile (
".*\\.pb$");
74 || (path.size() >= ofdir.size()
75 && path.compare(0, ofdir.size(), ofdir) == 0
76 && (path.size() == ofdir.size()
77 || path[ofdir.size()] ==
'/')));
86 size_t len = path.size();
87 for ( ; len > 0 && path[len-1] ==
'/'; --len)
90 if (len != path.size())
92 clean = path.substr(0, len);
100 size_t slash = path.rfind(
'/');
101 if (slash != std::string::npos)
103 dir.append(path, 0, slash);
104 name.append(path, slash+1, std::string::npos);
113 path.reserve(dir.size() + name.size() + 2);
123 {
return new T(qtname); }
128 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
133 fastString_ (_fastString), matching_ (UseFull)
141 catch (lat::Error &
e)
144 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality" 149 size_t starCount = 0;
154 if ((
size_t)pos == std::string::npos)
160 if ((
fastString_.find(
'"') != std::string::npos) ||
173 if (boost::algorithm::starts_with(
fastString_,
"*"))
191 if (boost::algorithm::starts_with(
fastString_,
"*") &&
211 if (input.size() < pattern.size())
217 std::string::const_reverse_iterator rit_pattern = pattern.rbegin();
218 std::string::const_reverse_iterator rit_input = input.rbegin();
220 for (; rit_pattern < pattern.rend(); rit_pattern++, rit_input++)
222 if (*rit_pattern != *rit_input)
232 if (input.size() < pattern.size())
238 std::string::const_iterator rit_pattern = pattern.begin();
239 std::string::const_iterator rit_input = input.begin();
241 for (; rit_pattern < pattern.end(); rit_pattern++, rit_input++)
243 if (*rit_pattern != *rit_input)
278 owner_->setCurrentFolder(fullpath);
286 return owner_->pwd();
290 owner_->tag(me, tag);
294 owner_->tagContents(path, myTag);
298 std::vector<MonitorElement*>
302 return owner_->getAllContents(path, runNumber, lumi);
306 return owner_->get(path);
311 if (ptr ==
nullptr) {
312 std::stringstream
msg;
313 msg <<
"DQM object not found";
318 throw std::out_of_range(msg.str());
324 return owner_->getSubdirs();
328 return owner_->getMEs();
332 return owner_->containsAnyMonitorable(path);
336 return owner_->dirExists(path);
348 owner_->setCurrentFolder(fullpath);
364 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: " 366 <<
", stream: " << streamId
367 <<
" module: " << moduleId << std::endl;
374 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
377 std::lock_guard<std::mutex> guard(book_mutex_);
379 std::set<MonitorElement>::const_iterator
e = data_.end();
380 std::set<MonitorElement>::const_iterator
i = data_.lower_bound(proto);
382 if (i->data_.run != run
383 || i->data_.streamId != streamId
384 || i->data_.moduleId != moduleId)
388 if (i->getLumiFlag() || LSbasedMode_) {
398 std::set<MonitorElement>::const_iterator me = data_.find(global_me);
399 if (me != data_.end()) {
401 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
406 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
408 list.Add(i->getTH1());
409 if( -1 == me->getTH1()->Merge(&list)) {
410 std::cout <<
"mergeAndResetMEsRunSummaryCache: Failed to merge DQM element "<<me->getFullname();
414 if (i->getTH1()->GetEntries())
415 me->getTH1()->Add(i->getTH1());
420 std::cout <<
"No global Object found. " << std::endl;
421 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
426 gme = data_.insert(
std::move(actual_global_me));
439 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: " 440 << run <<
" lumi: " << lumi
441 <<
", stream: " << streamId
442 <<
" module: " << moduleId << std::endl;
444 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
448 std::lock_guard<std::mutex> guard(book_mutex_);
450 std::set<MonitorElement>::const_iterator
e = data_.end();
451 std::set<MonitorElement>::const_iterator
i = data_.lower_bound(proto);
454 if (i->data_.run != run
455 || i->data_.streamId != streamId
456 || i->data_.moduleId != moduleId)
460 if (not (i->getLumiFlag() || LSbasedMode_)) {
468 std::set<MonitorElement>::const_iterator me = data_.find(global_me);
469 if (me != data_.end()) {
471 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
476 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
478 list.Add(i->getTH1());
479 if( -1 == me->getTH1()->Merge(&list)) {
480 std::cout <<
"mergeAndResetMEsLuminositySummaryCache: Failed to merge DQM element "<<me->getFullname();
484 if (i->getTH1()->GetEntries())
485 me->getTH1()->Add(i->getTH1());
490 std::cout <<
"No global Object found. " << std::endl;
491 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
496 actual_global_me.
setLumi(lumi);
497 gme = data_.insert(
std::move(actual_global_me));
511 collateHistograms_ (
false),
512 enableMultiThread_(
false),
513 forceResetOnBeginLumi_(
false),
514 readSelectedDirectory_ (
""),
594 std::cout <<
"DQMStore: histogram collation is enabled\n";
598 std::cout <<
"DQMStore: MultiThread option is enabled\n";
602 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
607 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
611 initQCriterion<Comp2RefChi2>(
qalgos_);
612 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
613 initQCriterion<ContentsXRange>(
qalgos_);
614 initQCriterion<ContentsYRange>(
qalgos_);
615 initQCriterion<MeanWithinExpected>(
qalgos_);
616 initQCriterion<Comp2RefEqualH>(
qalgos_);
617 initQCriterion<DeadChannel>(
qalgos_);
618 initQCriterion<NoisyChannel>(
qalgos_);
619 initQCriterion<ContentsWithinExpected>(
qalgos_);
620 initQCriterion<CompareToMedian>(
qalgos_);
621 initQCriterion<CompareLastFilledBin>(
qalgos_);
622 initQCriterion<CheckVariance>(
qalgos_);
626 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
645 stream_ =
new std::ofstream(
"histogramBookingBT.log");
654 size = backtrace (array, 10);
655 strings = backtrace_symbols (array, size);
659 for (; level <
size; level++) {
660 if (!
s_rxtrace.match(strings[level], 0, 0, &m))
continue;
661 demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(), 0, 0, &
r);
662 if (!demangled)
continue;
663 if (!
s_rxself.match(demangled, 0, 0))
break;
668 if (demangled !=
nullptr) {
671 << (r ? m.matchString(strings[level], 2) :
demangled) <<
" " 672 << m.matchString(strings[level], 1) <<
"\n";
675 *
stream_ <<
"Skipping "<< dir <<
"/" << name
676 <<
" with stack size " << size <<
"\n";
681 if (
verbose_ > 4 || demangled ==
nullptr)
686 for (i = 0; i <
size; i++)
687 if (
s_rxtrace.match(strings[i], 0, 0, &m))
689 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
690 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" " 691 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" " 692 << m.matchString(strings[i], 1) << std::endl;
729 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
754 if (pos == std::string::npos)
769 prev.reserve(path.size());
770 subdir.reserve(path.size());
771 name.reserve(path.size());
779 subdir.append(path, 0, slash);
781 name.append(subdir, prevname, std::string::npos);
783 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'" 784 " which already exists as a monitor element",
787 if (!
dirs_.count(subdir))
788 dirs_.insert(subdir);
791 if (slash+1 >= path.size())
796 prevname = slash ? slash+1 :
slash;
798 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
806 {
return dirs_.count(path) > 0; }
811 template <
class HISTO,
class COLLATE>
814 const char *context,
int kind,
815 HISTO *
h, COLLATE collate)
817 assert(name.find(
'/') == std::string::npos);
840 << context <<
": monitor element '" 841 << path <<
"' already exists, collating" << std::endl;
851 assert(
dirs_.count(dir));
859 for ( ; qi != qe; ++qi)
861 if ( qi->first->match(path) )
862 me->addQReport(qi->second);
880 me->reference_ = referenceME->
object_;
893 assert(name.find(
'/') == std::string::npos);
906 << context <<
": monitor element '" 907 << path <<
"' already exists, resetting" << std::endl;
915 assert(
dirs_.count(dir));
935 return book(dir, name,
"bookInt")
965 return book(dir, name,
"bookFloat")
994 return book(dir, name,
"bookString")
1035 int nchX,
double lowX,
double highX)
1037 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1043 int nchX,
double lowX,
double highX)
1045 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
1051 int nchX,
double lowX,
double highX)
1053 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1059 int nchX,
double lowX,
double highX)
1061 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1067 int nchX,
double lowX,
double highX)
1069 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1075 int nchX,
double lowX,
double highX)
1077 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1083 int nchX,
const float *xbinsize)
1085 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1091 int nchX,
const float *xbinsize)
1093 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1100 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1107 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1114 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1121 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1128 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1135 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1163 int nchX,
double lowX,
double highX,
1164 int nchY,
double lowY,
double highY)
1166 return book2D(
pwd_, name,
new TH2F(name, title,
1168 nchY, lowY, highY));
1174 int nchX,
double lowX,
double highX,
1175 int nchY,
double lowY,
double highY)
1177 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1179 nchY, lowY, highY));
1185 int nchX,
double lowX,
double highX,
1186 int nchY,
double lowY,
double highY)
1188 return book2S(
pwd_, name,
new TH2S(name, title,
1190 nchY, lowY, highY));
1196 int nchX,
double lowX,
double highX,
1197 int nchY,
double lowY,
double highY)
1199 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1201 nchY, lowY, highY));
1207 int nchX,
double lowX,
double highX,
1208 int nchY,
double lowY,
double highY)
1212 nchY, lowY, highY));
1218 int nchX,
double lowX,
double highX,
1219 int nchY,
double lowY,
double highY)
1221 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1223 nchY, lowY, highY));
1229 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1231 return book2D(
pwd_, name,
new TH2F(name, title,
1232 nchX, xbinsize, nchY, ybinsize));
1238 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1240 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1241 nchX, xbinsize, nchY, ybinsize));
1248 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1255 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1262 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1269 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1276 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1283 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1297 int nchX,
double lowX,
double highX,
1298 int nchY,
double lowY,
double highY,
1299 int nchZ,
double lowZ,
double highZ)
1301 return book3D(
pwd_, name,
new TH3F(name, title,
1304 nchZ, lowZ, highZ));
1310 int nchX,
double lowX,
double highX,
1311 int nchY,
double lowY,
double highY,
1312 int nchZ,
double lowZ,
double highZ)
1314 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1317 nchZ, lowZ, highZ));
1324 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1331 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1339 return book(dir, name,
"bookProfile",
1349 int nchX,
double lowX,
double highX,
1350 int ,
double lowY,
double highY,
1364 int nchX,
double lowX,
double highX,
1365 int ,
double lowY,
double highY,
1368 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1379 int nchX,
double lowX,
double highX,
1380 double lowY,
double highY,
1394 int nchX,
double lowX,
double highX,
1395 double lowY,
double highY,
1398 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1409 int nchX,
const double *xbinsize,
1410 int ,
double lowY,
double highY,
1424 int nchX,
const double *xbinsize,
1425 int ,
double lowY,
double highY,
1428 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1439 int nchX,
const double *xbinsize,
1440 double lowY,
double highY,
1454 int nchX,
const double *xbinsize,
1455 double lowY,
double highY,
1458 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1468 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1475 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1483 return book(dir, name,
"bookProfile2D",
1493 int nchX,
double lowX,
double highX,
1494 int nchY,
double lowY,
double highY,
1495 int ,
double lowZ,
double highZ,
1510 int nchX,
double lowX,
double highX,
1511 int nchY,
double lowY,
double highY,
1512 int ,
double lowZ,
double highZ,
1527 int nchX,
double lowX,
double highX,
1528 int nchY,
double lowY,
double highY,
1529 double lowZ,
double highZ,
1544 int nchX,
double lowX,
double highX,
1545 int nchY,
double lowY,
double highY,
1546 double lowZ,
double highZ,
1560 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1567 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1576 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1577 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1578 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1579 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1580 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1581 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1582 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1583 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1584 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1591 <<
"checkBinningMatches: different binning - cannot add object '" 1592 << h->GetName() <<
"' of type " 1593 << h->IsA()->GetName() <<
" to existing ME: '" 1677 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1680 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1681 " twice with multiple tags", me->
getFullname().c_str());
1698 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element" 1699 " '%s' with tag %u", path.c_str(), myTag);
1708 MEMap::iterator
e =
data_.end();
1709 MEMap::iterator
i =
data_.lower_bound(proto);
1710 for ( ; i != e && path == *i->data_.dirname; ++
i)
1711 tag(const_cast<MonitorElement *>(&*i), myTag);
1725 MEMap::iterator
e =
data_.end();
1726 MEMap::iterator
i =
data_.lower_bound(proto);
1729 tag(const_cast<MonitorElement *>(&*i), myTag);
1738 std::vector<std::string>
1741 std::vector<std::string>
result;
1742 std::set<std::string>::const_iterator
e =
dirs_.end();
1743 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1754 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1755 result.push_back(*i);
1761 std::vector<std::string>
1765 std::vector<std::string>
result;
1766 MEMap::const_iterator
e =
data_.end();
1767 MEMap::const_iterator
i =
data_.lower_bound(proto);
1769 if (
pwd_ == *i->data_.dirname)
1770 result.push_back(i->getName());
1781 MEMap::const_iterator
e =
data_.end();
1782 MEMap::const_iterator
i =
data_.lower_bound(proto);
1794 MEMap::const_iterator mepos =
data_.find(proto);
1795 return (mepos ==
data_.end() ? 0
1800 std::vector<MonitorElement *>
1804 std::vector<MonitorElement *>
result;
1805 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1809 result.push_back(const_cast<MonitorElement *>(&me));
1816 std::vector<MonitorElement *>
1824 std::vector<MonitorElement *>
result;
1825 MEMap::const_iterator
e =
data_.end();
1826 MEMap::const_iterator
i =
data_.lower_bound(proto);
1828 if (*cleaned == *i->data_.dirname)
1829 result.push_back(const_cast<MonitorElement *>(&*i));
1835 std::vector<MonitorElement *>
1843 std::vector<MonitorElement *>
result;
1844 MEMap::const_iterator
e =
data_.end();
1845 MEMap::const_iterator
i =
data_.lower_bound(proto);
1847 if (*cleaned == *i->data_.dirname
1849 && i->data_.tag ==
tag)
1850 result.push_back(const_cast<MonitorElement *>(&*i));
1863 into.reserve(
dirs_.size());
1865 MEMap::const_iterator me =
data_.end();
1866 std::set<std::string>::const_iterator di =
dirs_.begin();
1867 std::set<std::string>::const_iterator de =
dirs_.end();
1868 for ( ; di != de; ++di)
1871 MEMap::const_iterator mi =
data_.lower_bound(proto);
1872 MEMap::const_iterator
m = mi;
1873 size_t sz = di->size() + 2;
1876 if (*di == *m->data_.dirname)
1878 sz += m->data_.objname.size() + 1;
1885 std::vector<std::string>::iterator istr
1894 for (sz = 0; mi !=
m; ++mi)
1896 if (*di != *mi->data_.dirname)
1902 *istr += mi->data_.objname;
1908 istr->reserve(di->size() + 2);
1920 const uint32_t
run ,
1921 const uint32_t
lumi ,
1922 const uint32_t streamId ,
1923 const uint32_t moduleId )
const 1925 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1926 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1927 " unacceptable characters", dir.c_str());
1928 if (name.find_first_not_of(
s_safe) != std::string::npos)
1929 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1930 " unacceptable characters", name.c_str());
1940 MEMap::const_iterator mepos =
data_.find(proto);
1941 return (mepos ==
data_.end() ? 0
1951 into.reserve(
dirs_.size());
1953 MEMap::const_iterator me =
data_.end();
1954 std::set<std::string>::const_iterator di =
dirs_.begin();
1955 std::set<std::string>::const_iterator de =
dirs_.end();
1958 for ( ; di != de; ++di)
1961 MEMap::const_iterator mi =
data_.lower_bound(proto);
1962 MEMap::const_iterator
m = mi;
1963 size_t sz = di->size() + 2;
1969 sz += 1 + m->data_.objname.size() + 11;
1976 std::vector<std::string>::iterator istr
1983 for (sz = 0; mi !=
m; ++mi)
1987 sprintf(tagbuf,
"/%u", mi->data_.tag);
1990 *istr += m->data_.objname;
2000 std::vector<MonitorElement*>
2003 uint32_t
lumi )
const 2011 std::vector<MonitorElement *>
result;
2012 MEMap::const_iterator
e =
data_.end();
2013 MEMap::const_iterator
i =
data_.lower_bound(proto);
2015 if (runNumber != 0) {
2016 if (i->data_.run > runNumber
2017 || i->data_.streamId != 0
2018 || i->data_.moduleId != 0)
2022 if (i->data_.lumi > lumi
2023 || i->data_.streamId != 0
2024 || i->data_.moduleId != 0)
2027 if (runNumber != 0
or lumi !=0) {
2028 assert(i->data_.streamId == 0);
2029 assert(i->data_.moduleId == 0);
2031 result.push_back(const_cast<MonitorElement *>(&*i));
2039 if (i->data_.run != 0 || i->data_.streamId != 0 || i->data_.moduleId != 0)
break;
2040 result.push_back(const_cast<MonitorElement *>(&*i));
2049 std::vector<MonitorElement*>
2055 rx = lat::Regexp(pattern, 0, syntaxType);
2058 catch (lat::Error &
e)
2060 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
2061 pattern.c_str(), e.explain().c_str());
2065 std::vector<MonitorElement *>
result;
2066 MEMap::const_iterator
i =
data_.begin();
2067 MEMap::const_iterator e =
data_.end();
2068 for ( ; i !=
e; ++
i)
2071 mergePath(path, *i->data_.dirname, i->data_.objname);
2073 result.push_back(const_cast<MonitorElement *>(&*i));
2088 MEMap::iterator mi =
data_.begin();
2089 MEMap::iterator me =
data_.end();
2090 for ( ; mi != me; ++mi)
2093 if (mi->wasUpdated())
2112 MEMap::iterator mi =
data_.begin();
2113 MEMap::iterator me =
data_.end();
2114 for ( ; mi != me; ++mi)
2145 std::set<MonitorElement>::const_iterator
e =
data_.end();
2146 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2149 if (i->data_.streamId != 0 ||
2150 i->data_.moduleId != 0)
2152 if (i->data_.lumi != lumi)
2154 if (i->data_.run != run)
2161 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '" 2162 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'" 2163 <<
"flags " << i->data_.flags <<
"\n";
2181 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2185 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2192 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2203 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2207 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2214 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2218 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2225 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2229 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2236 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2240 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2247 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2251 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2258 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2262 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2269 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2273 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2280 else if (dynamic_cast<TObjString *>(obj))
2283 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2285 if (strstr(obj->GetName(),
"CMSSW"))
2288 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2291 else if (strstr(obj->GetName(),
"DQMPATCH"))
2294 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2299 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2300 << obj->GetName() <<
"' of type '" 2301 << obj->IsA()->GetName() <<
"'\n";
2313 if (! me || overwrite)
2315 if (! me) me =
bookInt(dir, label);
2316 me->
Fill(atoll(value.c_str()));
2319 else if (kind ==
"f")
2322 if (! me || overwrite)
2325 me->
Fill(atof(value.c_str()));
2328 else if (kind ==
"s")
2336 else if (kind ==
"e")
2341 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2342 << label <<
"' in directory '" 2343 << dir <<
"' to be marked as efficiency plot.\n";
2348 else if (kind ==
"t")
2353 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2354 << label <<
"' in directory '" 2355 << dir <<
"' for a tag\n";
2360 unsigned long val = strtoul(value.c_str(), &endp, 10);
2361 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2363 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '" 2364 << value <<
"' for monitor element '" 2365 << label <<
"' in directory '" 2366 << dir <<
"' - invalid value\n";
2371 else if (kind ==
"qr")
2376 size_t dot = label.find(
'.');
2377 if (dot == std::string::npos)
2379 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2380 <<
"' is missing a '.' and cannot be extracted\n";
2385 std::string qrname (label, dot+1, std::string::npos);
2391 qv.
code = atoi(m.matchString(value, 1).c_str());
2392 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2393 qv.
message = m.matchString(value, 4);
2397 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2399 qv.
code = atoi(m.matchString(value, 1).c_str());
2401 qv.
message = m.matchString(value, 2);
2407 std::cout <<
"*** DQMStore: WARNING: quality test value '" 2408 << value <<
"' is incorrectly formatted\n";
2415 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2416 << mename <<
"' in directory '" 2417 << dir <<
"' for quality test '" 2427 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2428 << obj->GetName() <<
"' of type '" 2429 << obj->IsA()->GetName() <<
"'\n";
2433 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2437 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2438 s +=
'<'; s +=
n->GetName(); s +=
'>';
2440 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2441 TObjString os(s.c_str());
2446 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2447 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2448 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2479 assert(! path.empty());
2483 size_t end = path.find(
'/', start);
2484 if (end == std::string::npos)
2492 TObject *
o = gDirectory->Get(part.c_str());
2493 if (o && ! dynamic_cast<TDirectory *>(o))
2494 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2495 " fails because the part '%s' already exists and is not" 2496 " directory", path.c_str(), part.c_str());
2498 gDirectory->mkdir(part.c_str());
2500 if (! gDirectory->cd(part.c_str()))
2501 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2502 " fails because could not cd into subdirectory '%s'",
2503 path.c_str(), part.c_str());
2506 if (end+1 >= path.size())
2511 end = path.find(
'/', start);
2512 if (end == std::string::npos)
2521 const uint32_t
run ,
2522 const uint32_t
lumi ,
2523 const bool resetMEsAfterWriting )
2525 using google::protobuf::io::FileOutputStream;
2526 using google::protobuf::io::GzipOutputStream;
2527 using google::protobuf::io::StringOutputStream;
2531 std::set<std::string>::iterator di, de;
2532 MEMap::iterator mi, me =
data_.end();
2537 std::cout <<
"\n DQMStore: Opening PBFile '" 2538 << filename <<
"'"<< std::endl;
2541 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2554 mi =
data_.lower_bound(proto);
2555 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2559 <<
" Lumi: " << (*mi).lumi()
2560 <<
" LumiFlag: " << (*mi).getLumiFlag()
2561 <<
" streamId: " << (*mi).streamId()
2562 <<
" moduleId: " << (*mi).moduleId()
2563 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2570 if (*di != *mi->data_.dirname)
2579 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2583 std::cout <<
"DQMStore::savePB: saving monitor element '" 2584 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'" 2585 <<
"flags " << mi->data_.flags <<
"\n";
2592 TObject *toWrite =
nullptr;
2593 bool deleteObject =
false;
2596 toWrite =
new TObjString(mi->tagString().c_str());
2597 deleteObject =
true;
2599 toWrite = mi->object_;
2602 TBufferFile buffer(TBufferFile::kWrite);
2603 buffer.WriteObject(toWrite);
2613 if (resetMEsAfterWriting)
2618 int filedescriptor =
::open(filename.c_str(),
2619 O_WRONLY | O_CREAT | O_TRUNC,
2623 FileOutputStream file_stream(filedescriptor);
2625 options.format = GzipOutputStream::GZIP;
2626 options.compression_level = 1;
2627 GzipOutputStream gzip_stream(&file_stream,
2629 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2632 gzip_stream.Close();
2633 file_stream.Close();
2634 ::close(filedescriptor);
2638 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2639 <<
" objects from path '" << path
2640 <<
"' into DQM file '" << filename <<
"'\n";
2653 const uint32_t
run ,
2654 const uint32_t
lumi ,
2658 const bool resetMEsAfterWriting )
2662 std::set<std::string>::iterator di, de;
2663 MEMap::iterator mi, me =
data_.end();
2664 DQMNet::QReports::const_iterator qi, qe;
2672 class TFileNoSync :
public TFile
2675 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2676 virtual Int_t SysSync(Int_t)
override {
return 0; }
2681 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2682 <<
"' with option '" << fileupdate <<
"'\n";
2684 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2686 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2690 std::auto_ptr<lat::Regexp> rxpat;
2691 if (! pattern.empty())
2692 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2705 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2719 mi =
data_.lower_bound(proto);
2720 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2723 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2724 <<
" Lumi: " << (*mi).lumi()
2725 <<
" LumiFlag: " << (*mi).getLumiFlag()
2726 <<
" streamId: " << (*mi).streamId()
2727 <<
" moduleId: " << (*mi).moduleId()
2728 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2735 if (*di != *mi->data_.dirname) {
2737 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2747 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2773 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2774 status =
std::max(status, master->data_.qreports[
i].code);
2776 if (! master || status < minStatus)
2779 std::cout <<
"DQMStore::save: skipping monitor element '" 2780 << mi->data_.objname <<
"' while saving, status is " 2781 << status <<
", required minimum status is " 2782 << minStatus << std::endl;
2789 std::cout <<
"DQMStore::save: saving monitor element '" 2790 << mi->data_.objname <<
"'\n";
2794 gDirectory->cd(
"/");
2797 else if (rxpat.get())
2808 TObjString(mi->tagString().c_str()).Write();
2812 mi->object_->Write();
2819 qi = mi->data_.qreports.begin();
2820 qe = mi->data_.qreports.end();
2821 for ( ; qi != qe; ++qi)
2822 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2827 TObjString(mi->effLabelString().c_str()).Write();
2831 TObjString(mi->tagLabelString().c_str()).Write();
2834 if (resetMEsAfterWriting)
2843 std::cout <<
"DQMStore::save: successfully wrote " << nme
2844 <<
" objects from path '" << path
2845 <<
"' into DQM file '" << filename <<
"'\n";
2858 unsigned int ntot = 0;
2859 unsigned int count = 0;
2861 if (! file->cd(curdir.c_str()))
2862 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while" 2863 " reading file '%s'", curdir.c_str(), file->GetName());
2886 size_t slash = dirpart.find(
'/');
2887 size_t pos = dirpart.find(
"/Run summary");
2888 if (slash != std::string::npos && pos !=std::string::npos)
2890 dirpart.erase(pos,12);
2892 pos = dirpart.find(
"Run ");
2893 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2894 if (pos !=std::string::npos)
2895 dirpart.erase(pos,length);
2904 size_t slash = dirpart.find(
'/');
2906 if (slash == std::string::npos
2911 slash = dirpart.find(
'/');
2913 if (slash != std::string::npos
2914 && slash + 10 == dirpart.size()
2915 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2917 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2922 if (dirpart.empty())
2925 dirpart = prepend +
'/' + dirpart;
2927 else if (! prepend.empty())
2929 if (dirpart.empty())
2932 dirpart = prepend +
'/' + dirpart;
2940 TIter
next (gDirectory->GetListOfKeys());
2941 std::list<TObject *> delayed;
2942 while ((key = (TKey *)
next()))
2944 std::auto_ptr<TObject>
obj(key->ReadObj());
2945 if (dynamic_cast<TDirectory *>(
obj.get()))
2948 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2950 if (! curdir.empty())
2952 subdir +=
obj->GetName();
2954 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2958 else if (dynamic_cast<TObjString *>(
obj.get()))
2960 delayed.push_back(
obj.release());
2965 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2966 <<
"' of type '" <<
obj->IsA()->GetName()
2967 <<
"' from '" << file->GetName()
2968 <<
"' into '" << dirpart <<
"'\n";
2976 while (! delayed.empty())
2979 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2980 <<
"' of type '" << delayed.front()->IsA()->GetName()
2981 <<
"' from '" << file->GetName()
2982 <<
"' into '" << dirpart <<
"'\n";
2988 delete delayed.front();
2989 delayed.pop_front();
2993 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2994 <<
" objects from directory '" << dirpart <<
"'\n";
2996 return ntot +
count;
3011 bool fileMustExist )
3013 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
3023 bool fileMustExist )
3025 bool overwrite =
true;
3029 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
3031 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
3033 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
3037 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3039 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3053 bool fileMustExist )
3057 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3059 std::auto_ptr<TFile>
f;
3063 f.reset(TFile::Open(filename.c_str()));
3064 if (! f.get() || f->IsZombie())
3065 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3074 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3079 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3082 MEMap::iterator mi =
data_.begin();
3083 MEMap::iterator me =
data_.end();
3084 for ( ; mi != me; ++mi)
3085 const_cast<MonitorElement &>(*mi).updateQReportStats();
3089 std::cout <<
"DQMStore::open: successfully read " << n
3090 <<
" objects from file '" << filename <<
"'";
3091 if (! onlypath.empty())
3092 std::cout <<
" from directory '" << onlypath <<
"'";
3093 if (! prepend.empty())
3094 std::cout <<
" into directory '" << prepend <<
"'";
3104 if (buf.Length() == buf.BufferSize())
3107 void *ptr = buf.ReadObjectAny(0);
3108 return reinterpret_cast<TObject *
>(ptr);
3117 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3118 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3120 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3121 TBufferFile buf(TBufferFile::kRead, h.
size(),
3137 bool fileMustExist )
3139 using google::protobuf::io::FileInputStream;
3140 using google::protobuf::io::FileOutputStream;
3141 using google::protobuf::io::GzipInputStream;
3142 using google::protobuf::io::GzipOutputStream;
3143 using google::protobuf::io::CodedInputStream;
3144 using google::protobuf::io::ArrayInputStream;
3147 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3150 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3152 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3155 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3160 FileInputStream
fin(filedescriptor);
3161 GzipInputStream
input(&fin);
3162 CodedInputStream input_coded(&input);
3163 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3164 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3165 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3168 ::close(filedescriptor);
3192 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3194 if (me ==
nullptr) {
3220 MEMap::iterator
e =
data_.end();
3221 MEMap::iterator
i =
data_.lower_bound(proto);
3225 std::set<std::string>::iterator de =
dirs_.end();
3226 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3236 MEMap::iterator
e =
data_.end();
3237 MEMap::iterator
i =
data_.lower_bound(proto);
3239 if (dir == *i->data_.dirname)
3266 MEMap::iterator
pos =
data_.find(proto);
3267 if (pos !=
data_.end())
3270 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent" 3271 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3282 QCMap::const_iterator
i =
qtests_.find(qtname);
3283 QCMap::const_iterator
e =
qtests_.end();
3284 return (i == e ? 0 : i->second);
3294 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3297 QAMap::iterator
i =
qalgos_.find(algoname);
3299 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown" 3300 " algorithm '%s'", algoname.c_str());
3320 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3322 " uses unacceptable characters", cleaned->c_str());
3334 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3344 MEMap::iterator mi =
data_.begin();
3345 MEMap::iterator me =
data_.end();
3348 for ( ; mi != me; ++mi)
3351 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3352 if (fm->match(path))
3369 std::cout <<
"DQMStore: running runQTests() with reset = " 3370 << (
reset_ ?
"true" :
"false" ) << std::endl;
3373 MEMap::iterator mi =
data_.begin();
3374 MEMap::iterator me =
data_.end();
3375 for ( ; mi != me; ++mi)
3393 MEMap::const_iterator mi =
data_.begin();
3394 MEMap::const_iterator me =
data_.end();
3395 for ( ; mi != me; ++mi)
3397 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3402 else if (mi->hasWarning())
3405 && mi->hasOtherReport())
3449 std::cout <<
" ------------------------------------------------------------\n" 3450 <<
" Directory structure: \n" 3451 <<
" ------------------------------------------------------------\n";
3453 std::copy(contents.begin(), contents.end(),
3454 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3456 std::cout <<
" ------------------------------------------------------------\n";
3493 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3496 factor = factor/(events*1.0);
3498 MEMap::iterator mi =
data_.begin();
3499 MEMap::iterator me =
data_.end();
3500 for ( ; mi != me; ++mi)
3552 std::cout <<
" The DQM object '" << me.
getFullname() <<
"' is not scalable object " << std::endl;
QCriterion * getQCriterion(const std::string &qtname) const
MonitorElement * getElement(const std::string &path)
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
Master< F > master(const F &f)
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
::google::protobuf::uint32 size() const
bool isCollateME(MonitorElement *me) const
void resetUpdate(void)
reset "was updated" flag
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
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
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.
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
def replace(string, replacements)
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);
void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi)
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
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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)
std::vector< std::shared_ptr< fireworks::OptionNode > > Options
static const lat::Regexp s_rxself("^[^()]*DQMStore::.*")
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.
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
::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)
::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)
void showDirStructure(void) const
TH2F * getTH2F(void) const
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.
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.
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,...)