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_rxpbfile (
".*\\.pb$");
73 || (path.size() >= ofdir.size()
74 && path.compare(0, ofdir.size(), ofdir) == 0
75 && (path.size() == ofdir.size()
76 || path[ofdir.size()] ==
'/')));
85 size_t len = path.size();
86 for ( ; len > 0 && path[len-1] ==
'/'; --len)
89 if (len != path.size())
91 clean = path.substr(0, len);
99 size_t slash = path.rfind(
'/');
100 if (slash != std::string::npos)
102 dir.append(path, 0, slash);
103 name.append(path, slash+1, std::string::npos);
112 path.reserve(dir.size() + name.size() + 2);
122 {
return new T(qtname); }
127 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
132 fastString_ (_fastString), matching_ (UseFull)
140 catch (lat::Error &
e)
143 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality"
148 size_t starCount = 0;
153 if ((
size_t)pos == std::string::npos)
159 if ((
fastString_.find(
'"') != std::string::npos) ||
172 if (boost::algorithm::starts_with(
fastString_,
"*"))
190 if (boost::algorithm::starts_with(
fastString_,
"*") &&
210 if (input.size() < pattern.size())
216 std::string::const_reverse_iterator rit_pattern = pattern.rbegin();
217 std::string::const_reverse_iterator rit_input = input.rbegin();
219 for (; rit_pattern < pattern.rend(); rit_pattern++, rit_input++)
221 if (*rit_pattern != *rit_input)
231 if (input.size() < pattern.size())
237 std::string::const_iterator rit_pattern = pattern.begin();
238 std::string::const_iterator rit_input = input.begin();
240 for (; rit_pattern < pattern.end(); rit_pattern++, rit_input++)
242 if (*rit_pattern != *rit_input)
277 owner_->setCurrentFolder(fullpath);
285 return owner_->pwd();
289 owner_->tag(me, tag);
293 owner_->tagContents(path, myTag);
297 std::vector<MonitorElement*>
301 return owner_->getAllContents(path, runNumber, lumi);
305 return owner_->get(path);
310 if (ptr ==
nullptr) {
311 std::stringstream
msg;
312 msg <<
"DQM object not found";
317 throw std::out_of_range(msg.str());
323 return owner_->getSubdirs();
327 return owner_->getMEs();
331 return owner_->containsAnyMonitorable(path);
335 return owner_->dirExists(path);
347 owner_->setCurrentFolder(fullpath);
363 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: "
365 <<
", stream: " << streamId
366 <<
" module: " << moduleId << std::endl;
373 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
374 std::set<MonitorElement>::const_iterator
e =
data_.end();
375 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
377 if (i->data_.run != run
378 || i->data_.streamId != streamId
379 || i->data_.moduleId != moduleId)
396 std::set<MonitorElement>::const_iterator
me =
data_.find(global_me);
397 if (me !=
data_.end()) {
399 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
404 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
406 list.Add(i->getTH1());
407 if( -1 == me->getTH1()->Merge(&list)) {
408 std::cout <<
"mergeAndResetMEsRunSummaryCache: Failed to merge DQM element "<<me->getFullname();
412 if (i->getTH1()->GetEntries())
413 me->getTH1()->Add(i->getTH1());
418 std::cout <<
"No global Object found. " << std::endl;
419 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
437 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
438 << run <<
" lumi: " << lumi
439 <<
", stream: " << streamId
440 <<
" module: " << moduleId << std::endl;
442 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
443 std::set<MonitorElement>::const_iterator
e =
data_.end();
444 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
447 if (i->data_.run != run
448 || i->data_.streamId != streamId
449 || i->data_.moduleId != moduleId)
464 std::set<MonitorElement>::const_iterator
me =
data_.find(global_me);
465 if (me !=
data_.end()) {
467 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
472 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
474 list.Add(i->getTH1());
475 if( -1 == me->getTH1()->Merge(&list)) {
476 std::cout <<
"mergeAndResetMEsLuminositySummaryCache: Failed to merge DQM element "<<me->getFullname();
480 if (i->getTH1()->GetEntries())
481 me->getTH1()->Add(i->getTH1());
486 std::cout <<
"No global Object found. " << std::endl;
487 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
492 actual_global_me.
setLumi(lumi);
543 collateHistograms_ (
false),
544 enableMultiThread_(
false),
545 readSelectedDirectory_ (
""),
590 std::cout <<
"DQMStore: histogram collation is enabled\n";
594 std::cout <<
"DQMStore: MultiThread option is enabled\n";
598 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
603 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
607 initQCriterion<Comp2RefChi2>(
qalgos_);
608 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
609 initQCriterion<ContentsXRange>(
qalgos_);
610 initQCriterion<ContentsYRange>(
qalgos_);
611 initQCriterion<MeanWithinExpected>(
qalgos_);
612 initQCriterion<Comp2RefEqualH>(
qalgos_);
613 initQCriterion<DeadChannel>(
qalgos_);
614 initQCriterion<NoisyChannel>(
qalgos_);
615 initQCriterion<ContentsWithinExpected>(
qalgos_);
616 initQCriterion<CompareToMedian>(
qalgos_);
617 initQCriterion<CompareLastFilledBin>(
qalgos_);
618 initQCriterion<CheckVariance>(
qalgos_);
622 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
641 stream_ =
new std::ofstream(
"histogramBookingBT.log");
650 size = backtrace (array, 10);
651 strings = backtrace_symbols (array, size);
656 char *
demangled = abi::__cxa_demangle(m.matchString(strings[4], 2).c_str(), 0, 0, &
r);
659 << (r ? m.matchString(strings[4], 2) :
demangled) <<
" "
660 << m.matchString(strings[4], 1) <<
"\n";
664 *
stream_ <<
"Skipping "<< dir <<
"/" << name
665 <<
" with stack size " << size <<
"\n";
673 for (i = 0; i <
size; i++)
674 if (
s_rxtrace.match(strings[i], 0, 0, &m))
676 char *
demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
677 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" "
678 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" "
679 << m.matchString(strings[i], 1) << std::endl;
716 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
740 size_t pos =
pwd_.rfind(
'/');
741 if (pos == std::string::npos)
756 prev.reserve(path.size());
757 subdir.reserve(path.size());
758 name.reserve(path.size());
766 subdir.append(path, 0, slash);
768 name.append(subdir, prevname, std::string::npos);
770 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
771 " which already exists as a monitor element",
774 if (!
dirs_.count(subdir))
775 dirs_.insert(subdir);
778 if (slash+1 >= path.size())
783 prevname = slash ? slash+1 :
slash;
785 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
793 {
return dirs_.count(path) > 0; }
798 template <
class HISTO,
class COLLATE>
801 const char *context,
int kind,
802 HISTO *
h, COLLATE collate)
804 assert(name.find(
'/') == std::string::npos);
827 << context <<
": monitor element '"
828 << path <<
"' already exists, collating" << std::endl;
846 for ( ; qi != qe; ++qi)
848 if ( qi->first->match(path) )
849 me->addQReport(qi->second);
867 me->reference_ = referenceME->
object_;
880 assert(name.find(
'/') == std::string::npos);
893 << context <<
": monitor element '"
894 << path <<
"' already exists, resetting" << std::endl;
922 return book(dir, name,
"bookInt")
952 return book(dir, name,
"bookFloat")
981 return book(dir, name,
"bookString")
1022 int nchX,
double lowX,
double highX)
1024 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1030 int nchX,
double lowX,
double highX)
1032 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
1038 int nchX,
double lowX,
double highX)
1040 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1046 int nchX,
double lowX,
double highX)
1048 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1054 int nchX,
double lowX,
double highX)
1056 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1062 int nchX,
double lowX,
double highX)
1064 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1070 int nchX,
const float *xbinsize)
1072 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1078 int nchX,
const float *xbinsize)
1080 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1087 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1094 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1101 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1108 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1115 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1122 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1150 int nchX,
double lowX,
double highX,
1151 int nchY,
double lowY,
double highY)
1153 return book2D(
pwd_, name,
new TH2F(name, title,
1155 nchY, lowY, highY));
1161 int nchX,
double lowX,
double highX,
1162 int nchY,
double lowY,
double highY)
1164 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1166 nchY, lowY, highY));
1172 int nchX,
double lowX,
double highX,
1173 int nchY,
double lowY,
double highY)
1175 return book2S(
pwd_, name,
new TH2S(name, title,
1177 nchY, lowY, highY));
1183 int nchX,
double lowX,
double highX,
1184 int nchY,
double lowY,
double highY)
1186 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1188 nchY, lowY, highY));
1194 int nchX,
double lowX,
double highX,
1195 int nchY,
double lowY,
double highY)
1199 nchY, lowY, highY));
1205 int nchX,
double lowX,
double highX,
1206 int nchY,
double lowY,
double highY)
1208 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1210 nchY, lowY, highY));
1216 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1218 return book2D(
pwd_, name,
new TH2F(name, title,
1219 nchX, xbinsize, nchY, ybinsize));
1225 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1227 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1228 nchX, xbinsize, nchY, ybinsize));
1235 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1242 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1249 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1256 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1263 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1270 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1284 int nchX,
double lowX,
double highX,
1285 int nchY,
double lowY,
double highY,
1286 int nchZ,
double lowZ,
double highZ)
1288 return book3D(
pwd_, name,
new TH3F(name, title,
1291 nchZ, lowZ, highZ));
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.c_str(), title.c_str(),
1304 nchZ, lowZ, highZ));
1311 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1318 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1326 return book(dir, name,
"bookProfile",
1336 int nchX,
double lowX,
double highX,
1337 int ,
double lowY,
double highY,
1338 const char *option )
1351 int nchX,
double lowX,
double highX,
1352 int ,
double lowY,
double highY,
1353 const char *option )
1355 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1366 int nchX,
double lowX,
double highX,
1367 double lowY,
double highY,
1368 const char *option )
1381 int nchX,
double lowX,
double highX,
1382 double lowY,
double highY,
1383 const char *option )
1385 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1396 int nchX,
const double *xbinsize,
1397 int ,
double lowY,
double highY,
1398 const char *option )
1411 int nchX,
const double *xbinsize,
1412 int ,
double lowY,
double highY,
1413 const char *option )
1415 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1426 int nchX,
const double *xbinsize,
1427 double lowY,
double highY,
1428 const char *option )
1441 int nchX,
const double *xbinsize,
1442 double lowY,
double highY,
1443 const char *option )
1445 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1455 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1462 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1470 return book(dir, name,
"bookProfile2D",
1480 int nchX,
double lowX,
double highX,
1481 int nchY,
double lowY,
double highY,
1482 int ,
double lowZ,
double highZ,
1483 const char *option )
1497 int nchX,
double lowX,
double highX,
1498 int nchY,
double lowY,
double highY,
1499 int ,
double lowZ,
double highZ,
1500 const char *option )
1514 int nchX,
double lowX,
double highX,
1515 int nchY,
double lowY,
double highY,
1516 double lowZ,
double highZ,
1517 const char *option )
1531 int nchX,
double lowX,
double highX,
1532 int nchY,
double lowY,
double highY,
1533 double lowZ,
double highZ,
1534 const char *option )
1547 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1554 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1563 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1564 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1565 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1566 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1567 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1568 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1569 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1570 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1571 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1578 <<
"checkBinningMatches: different binning - cannot add object '"
1579 << h->GetName() <<
"' of type "
1580 << h->IsA()->GetName() <<
" to existing ME: '"
1664 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1667 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1668 " twice with multiple tags", me->
getFullname().c_str());
1685 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1686 " '%s' with tag %u", path.c_str(), myTag);
1695 MEMap::iterator
e =
data_.end();
1696 MEMap::iterator
i =
data_.lower_bound(proto);
1697 for ( ; i != e && path == *i->data_.dirname; ++
i)
1698 tag(const_cast<MonitorElement *>(&*i), myTag);
1712 MEMap::iterator
e =
data_.end();
1713 MEMap::iterator
i =
data_.lower_bound(proto);
1716 tag(const_cast<MonitorElement *>(&*i), myTag);
1725 std::vector<std::string>
1728 std::vector<std::string>
result;
1729 std::set<std::string>::const_iterator
e =
dirs_.end();
1730 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1741 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1742 result.push_back(*i);
1748 std::vector<std::string>
1752 std::vector<std::string>
result;
1753 MEMap::const_iterator
e =
data_.end();
1754 MEMap::const_iterator
i =
data_.lower_bound(proto);
1756 if (
pwd_ == *i->data_.dirname)
1757 result.push_back(i->getName());
1768 MEMap::const_iterator
e =
data_.end();
1769 MEMap::const_iterator
i =
data_.lower_bound(proto);
1781 MEMap::const_iterator mepos =
data_.find(proto);
1782 return (mepos ==
data_.end() ? 0
1787 std::vector<MonitorElement *>
1791 std::vector<MonitorElement *>
result;
1792 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1796 result.push_back(const_cast<MonitorElement *>(&me));
1803 std::vector<MonitorElement *>
1811 std::vector<MonitorElement *>
result;
1812 MEMap::const_iterator
e =
data_.end();
1813 MEMap::const_iterator
i =
data_.lower_bound(proto);
1815 if (*cleaned == *i->data_.dirname)
1816 result.push_back(const_cast<MonitorElement *>(&*i));
1822 std::vector<MonitorElement *>
1830 std::vector<MonitorElement *>
result;
1831 MEMap::const_iterator
e =
data_.end();
1832 MEMap::const_iterator
i =
data_.lower_bound(proto);
1834 if (*cleaned == *i->data_.dirname
1836 && i->data_.tag ==
tag)
1837 result.push_back(const_cast<MonitorElement *>(&*i));
1850 into.reserve(
dirs_.size());
1852 MEMap::const_iterator
me =
data_.end();
1853 std::set<std::string>::const_iterator di =
dirs_.begin();
1854 std::set<std::string>::const_iterator de =
dirs_.end();
1855 for ( ; di != de; ++di)
1858 MEMap::const_iterator mi =
data_.lower_bound(proto);
1859 MEMap::const_iterator
m = mi;
1860 size_t sz = di->size() + 2;
1863 if (*di == *m->data_.dirname)
1865 sz += m->data_.objname.size() + 1;
1872 std::vector<std::string>::iterator istr
1881 for (sz = 0; mi !=
m; ++mi)
1883 if (*di != *mi->data_.dirname)
1889 *istr += mi->data_.objname;
1895 istr->reserve(di->size() + 2);
1907 const uint32_t
run ,
1908 const uint32_t
lumi ,
1909 const uint32_t streamId ,
1910 const uint32_t moduleId )
const
1912 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1913 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1914 " unacceptable characters", dir.c_str());
1915 if (name.find_first_not_of(
s_safe) != std::string::npos)
1916 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1917 " unacceptable characters", name.c_str());
1927 MEMap::const_iterator mepos =
data_.find(proto);
1928 return (mepos ==
data_.end() ? 0
1938 into.reserve(
dirs_.size());
1940 MEMap::const_iterator
me =
data_.end();
1941 std::set<std::string>::const_iterator di =
dirs_.begin();
1942 std::set<std::string>::const_iterator de =
dirs_.end();
1945 for ( ; di != de; ++di)
1948 MEMap::const_iterator mi =
data_.lower_bound(proto);
1949 MEMap::const_iterator
m = mi;
1950 size_t sz = di->size() + 2;
1956 sz += 1 + m->data_.objname.size() + 11;
1963 std::vector<std::string>::iterator istr
1970 for (sz = 0; mi !=
m; ++mi)
1974 sprintf(tagbuf,
"/%u", mi->data_.tag);
1977 *istr += m->data_.objname;
1987 std::vector<MonitorElement*>
1990 uint32_t
lumi )
const
1998 std::vector<MonitorElement *>
result;
1999 MEMap::const_iterator
e =
data_.end();
2000 MEMap::const_iterator
i =
data_.lower_bound(proto);
2002 if (runNumber != 0) {
2003 if (i->data_.run > runNumber
2004 || i->data_.streamId != 0
2005 || i->data_.moduleId != 0)
2009 if (i->data_.lumi > lumi
2010 || i->data_.streamId != 0
2011 || i->data_.moduleId != 0)
2014 if (runNumber != 0
or lumi !=0) {
2015 assert(i->data_.streamId == 0);
2016 assert(i->data_.moduleId == 0);
2018 result.push_back(const_cast<MonitorElement *>(&*i));
2026 if (i->data_.run != 0 || i->data_.streamId != 0 || i->data_.moduleId != 0)
break;
2027 result.push_back(const_cast<MonitorElement *>(&*i));
2036 std::vector<MonitorElement*>
2042 rx = lat::Regexp(pattern, 0, syntaxType);
2045 catch (lat::Error &
e)
2047 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
2048 pattern.c_str(), e.explain().c_str());
2052 std::vector<MonitorElement *>
result;
2053 MEMap::const_iterator
i =
data_.begin();
2054 MEMap::const_iterator e =
data_.end();
2055 for ( ; i !=
e; ++
i)
2058 mergePath(path, *i->data_.dirname, i->data_.objname);
2060 result.push_back(const_cast<MonitorElement *>(&*i));
2075 MEMap::iterator mi =
data_.begin();
2076 MEMap::iterator
me =
data_.end();
2077 for ( ; mi !=
me; ++mi)
2080 if (mi->wasUpdated())
2099 MEMap::iterator mi =
data_.begin();
2100 MEMap::iterator
me =
data_.end();
2101 for ( ; mi !=
me; ++mi)
2132 std::set<MonitorElement>::const_iterator
e =
data_.end();
2133 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2136 if (i->data_.streamId != 0 ||
2137 i->data_.moduleId != 0)
2139 if (i->data_.lumi != lumi)
2141 if (i->data_.run != run)
2148 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2149 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2150 <<
"flags " << i->data_.flags <<
"\n";
2168 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2172 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2179 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2190 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2194 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2201 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2205 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2212 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2216 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2223 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2227 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2234 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2238 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2245 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2249 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2256 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2260 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2267 else if (dynamic_cast<TObjString *>(obj))
2270 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2272 if (strstr(obj->GetName(),
"CMSSW"))
2275 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2278 else if (strstr(obj->GetName(),
"DQMPATCH"))
2281 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2286 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2287 << obj->GetName() <<
"' of type '"
2288 << obj->IsA()->GetName() <<
"'\n";
2300 if (! me || overwrite)
2302 if (! me) me =
bookInt(dir, label);
2303 me->
Fill(atoll(value.c_str()));
2306 else if (kind ==
"f")
2309 if (! me || overwrite)
2312 me->
Fill(atof(value.c_str()));
2315 else if (kind ==
"s")
2323 else if (kind ==
"e")
2328 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2329 << label <<
"' in directory '"
2330 << dir <<
"' to be marked as efficiency plot.\n";
2335 else if (kind ==
"t")
2340 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2341 << label <<
"' in directory '"
2342 << dir <<
"' for a tag\n";
2347 unsigned long val = strtoul(value.c_str(), &endp, 10);
2348 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2350 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2351 << value <<
"' for monitor element '"
2352 << label <<
"' in directory '"
2353 << dir <<
"' - invalid value\n";
2358 else if (kind ==
"qr")
2363 size_t dot = label.find(
'.');
2364 if (dot == std::string::npos)
2366 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2367 <<
"' is missing a '.' and cannot be extracted\n";
2372 std::string qrname (label, dot+1, std::string::npos);
2378 qv.
code = atoi(m.matchString(value, 1).c_str());
2379 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2380 qv.
message = m.matchString(value, 4);
2384 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2386 qv.
code = atoi(m.matchString(value, 1).c_str());
2388 qv.
message = m.matchString(value, 2);
2394 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2395 << value <<
"' is incorrectly formatted\n";
2402 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2403 << mename <<
"' in directory '"
2404 << dir <<
"' for quality test '"
2414 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2415 << obj->GetName() <<
"' of type '"
2416 << obj->IsA()->GetName() <<
"'\n";
2420 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2424 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2425 s +=
'<'; s +=
n->GetName(); s +=
'>';
2427 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2428 TObjString os(s.c_str());
2433 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2434 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2435 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2470 size_t end = path.find(
'/', start);
2471 if (end == std::string::npos)
2479 TObject *
o = gDirectory->Get(part.c_str());
2480 if (o && ! dynamic_cast<TDirectory *>(o))
2481 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2482 " fails because the part '%s' already exists and is not"
2483 " directory", path.c_str(), part.c_str());
2485 gDirectory->mkdir(part.c_str());
2487 if (! gDirectory->cd(part.c_str()))
2488 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2489 " fails because could not cd into subdirectory '%s'",
2490 path.c_str(), part.c_str());
2493 if (end+1 >= path.size())
2498 end = path.find(
'/', start);
2499 if (end == std::string::npos)
2508 const uint32_t
run ,
2509 const uint32_t
lumi ,
2510 const bool resetMEsAfterWriting )
2512 using google::protobuf::io::FileOutputStream;
2513 using google::protobuf::io::GzipOutputStream;
2514 using google::protobuf::io::StringOutputStream;
2518 std::set<std::string>::iterator di, de;
2519 MEMap::iterator mi,
me =
data_.end();
2524 std::cout <<
"\n DQMStore: Opening PBFile '"
2525 << filename <<
"'"<< std::endl;
2528 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2541 mi =
data_.lower_bound(proto);
2542 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2546 <<
" Lumi: " << (*mi).lumi()
2547 <<
" LumiFlag: " << (*mi).getLumiFlag()
2548 <<
" streamId: " << (*mi).streamId()
2549 <<
" moduleId: " << (*mi).moduleId()
2550 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2557 if (*di != *mi->data_.dirname)
2566 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2570 std::cout <<
"DQMStore::savePB: saving monitor element '"
2571 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2572 <<
"flags " << mi->data_.flags <<
"\n";
2579 TObject *toWrite =
nullptr;
2583 toWrite =
new TObjString(mi->tagString().c_str());
2584 deleteObject =
true;
2586 toWrite = mi->object_;
2589 TBufferFile buffer(TBufferFile::kWrite);
2590 buffer.WriteObject(toWrite);
2600 if (resetMEsAfterWriting)
2605 int filedescriptor =
::open(filename.c_str(),
2606 O_WRONLY | O_CREAT | O_TRUNC,
2610 FileOutputStream file_stream(filedescriptor);
2612 options.format = GzipOutputStream::GZIP;
2613 options.compression_level = 1;
2614 GzipOutputStream gzip_stream(&file_stream,
2616 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2619 gzip_stream.Close();
2620 file_stream.Close();
2621 ::close(filedescriptor);
2625 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2626 <<
" objects from path '" << path
2627 <<
"' into DQM file '" << filename <<
"'\n";
2640 const uint32_t
run ,
2641 const uint32_t
lumi ,
2645 const bool resetMEsAfterWriting )
2649 std::set<std::string>::iterator di, de;
2650 MEMap::iterator mi,
me =
data_.end();
2651 DQMNet::QReports::const_iterator qi, qe;
2659 class TFileNoSync :
public TFile
2662 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2663 virtual Int_t SysSync(Int_t)
override {
return 0; }
2668 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2669 <<
"' with option '" << fileupdate <<
"'\n";
2671 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2673 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2677 std::auto_ptr<lat::Regexp> rxpat;
2678 if (! pattern.empty())
2679 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2692 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2706 mi =
data_.lower_bound(proto);
2707 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2710 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2711 <<
" Lumi: " << (*mi).lumi()
2712 <<
" LumiFlag: " << (*mi).getLumiFlag()
2713 <<
" streamId: " << (*mi).streamId()
2714 <<
" moduleId: " << (*mi).moduleId()
2715 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2722 if (*di != *mi->data_.dirname) {
2724 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2734 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2760 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2761 status =
std::max(status, master->data_.qreports[
i].code);
2763 if (! master || status < minStatus)
2766 std::cout <<
"DQMStore::save: skipping monitor element '"
2767 << mi->data_.objname <<
"' while saving, status is "
2768 << status <<
", required minimum status is "
2769 << minStatus << std::endl;
2776 std::cout <<
"DQMStore::save: saving monitor element '"
2777 << mi->data_.objname <<
"'\n";
2781 gDirectory->cd(
"/");
2784 else if (rxpat.get())
2795 TObjString(mi->tagString().c_str()).Write();
2799 mi->object_->Write();
2806 qi = mi->data_.qreports.begin();
2807 qe = mi->data_.qreports.end();
2808 for ( ; qi != qe; ++qi)
2809 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2814 TObjString(mi->effLabelString().c_str()).Write();
2818 TObjString(mi->tagLabelString().c_str()).Write();
2821 if (resetMEsAfterWriting)
2830 std::cout <<
"DQMStore::save: successfully wrote " << nme
2831 <<
" objects from path '" << path
2832 <<
"' into DQM file '" << filename <<
"'\n";
2845 unsigned int ntot = 0;
2846 unsigned int count = 0;
2848 if (! file->cd(curdir.c_str()))
2849 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2850 " reading file '%s'", curdir.c_str(), file->GetName());
2873 size_t slash = dirpart.find(
'/');
2874 size_t pos = dirpart.find(
"/Run summary");
2875 if (slash != std::string::npos && pos !=std::string::npos)
2877 dirpart.erase(pos,12);
2879 pos = dirpart.find(
"Run ");
2880 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2881 if (pos !=std::string::npos)
2882 dirpart.erase(pos,length);
2891 size_t slash = dirpart.find(
'/');
2893 if (slash == std::string::npos
2898 slash = dirpart.find(
'/');
2900 if (slash != std::string::npos
2901 && slash + 10 == dirpart.size()
2902 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2904 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2909 if (dirpart.empty())
2912 dirpart = prepend +
'/' + dirpart;
2914 else if (! prepend.empty())
2916 if (dirpart.empty())
2919 dirpart = prepend +
'/' + dirpart;
2927 TIter
next (gDirectory->GetListOfKeys());
2928 std::list<TObject *> delayed;
2929 while ((key = (TKey *)
next()))
2931 std::auto_ptr<TObject>
obj(key->ReadObj());
2932 if (dynamic_cast<TDirectory *>(
obj.get()))
2935 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2937 if (! curdir.empty())
2939 subdir +=
obj->GetName();
2941 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2945 else if (dynamic_cast<TObjString *>(
obj.get()))
2947 delayed.push_back(
obj.release());
2952 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2953 <<
"' of type '" <<
obj->IsA()->GetName()
2954 <<
"' from '" << file->GetName()
2955 <<
"' into '" << dirpart <<
"'\n";
2963 while (! delayed.empty())
2966 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2967 <<
"' of type '" << delayed.front()->IsA()->GetName()
2968 <<
"' from '" << file->GetName()
2969 <<
"' into '" << dirpart <<
"'\n";
2975 delete delayed.front();
2976 delayed.pop_front();
2980 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2981 <<
" objects from directory '" << dirpart <<
"'\n";
2983 return ntot +
count;
2998 bool fileMustExist )
3000 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
3010 bool fileMustExist )
3012 bool overwrite =
true;
3016 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
3018 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
3020 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
3024 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3026 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3040 bool fileMustExist )
3044 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3046 std::auto_ptr<TFile>
f;
3050 f.reset(TFile::Open(filename.c_str()));
3051 if (! f.get() || f->IsZombie())
3052 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3061 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3066 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3069 MEMap::iterator mi =
data_.begin();
3070 MEMap::iterator
me =
data_.end();
3071 for ( ; mi !=
me; ++mi)
3072 const_cast<MonitorElement &>(*mi).updateQReportStats();
3076 std::cout <<
"DQMStore::open: successfully read " << n
3077 <<
" objects from file '" << filename <<
"'";
3078 if (! onlypath.empty())
3079 std::cout <<
" from directory '" << onlypath <<
"'";
3080 if (! prepend.empty())
3081 std::cout <<
" into directory '" << prepend <<
"'";
3091 if (buf.Length() == buf.BufferSize())
3094 void *ptr = buf.ReadObjectAny(0);
3095 return reinterpret_cast<TObject *
>(ptr);
3104 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3105 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3107 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3108 TBufferFile buf(TBufferFile::kRead, h.
size(),
3124 bool fileMustExist )
3126 using google::protobuf::io::FileInputStream;
3127 using google::protobuf::io::FileOutputStream;
3128 using google::protobuf::io::GzipInputStream;
3129 using google::protobuf::io::GzipOutputStream;
3130 using google::protobuf::io::CodedInputStream;
3131 using google::protobuf::io::ArrayInputStream;
3134 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3137 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3139 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3142 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3147 FileInputStream
fin(filedescriptor);
3148 GzipInputStream
input(&fin);
3149 CodedInputStream input_coded(&input);
3150 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3151 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3152 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3155 ::close(filedescriptor);
3179 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3181 if (me ==
nullptr) {
3207 MEMap::iterator
e =
data_.end();
3208 MEMap::iterator
i =
data_.lower_bound(proto);
3212 std::set<std::string>::iterator de =
dirs_.end();
3213 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3223 MEMap::iterator
e =
data_.end();
3224 MEMap::iterator
i =
data_.lower_bound(proto);
3226 if (dir == *i->data_.dirname)
3253 MEMap::iterator pos =
data_.find(proto);
3254 if (pos !=
data_.end())
3257 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3258 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3269 QCMap::const_iterator
i =
qtests_.find(qtname);
3270 QCMap::const_iterator
e =
qtests_.end();
3271 return (i == e ? 0 : i->second);
3281 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3284 QAMap::iterator
i =
qalgos_.find(algoname);
3286 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3287 " algorithm '%s'", algoname.c_str());
3307 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3309 " uses unacceptable characters", cleaned->c_str());
3321 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3331 MEMap::iterator mi =
data_.begin();
3332 MEMap::iterator
me =
data_.end();
3335 for ( ; mi !=
me; ++mi)
3338 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3339 if (fm->match(path))
3356 std::cout <<
"DQMStore: running runQTests() with reset = "
3357 << (
reset_ ?
"true" :
"false" ) << std::endl;
3360 MEMap::iterator mi =
data_.begin();
3361 MEMap::iterator
me =
data_.end();
3362 for ( ; mi !=
me; ++mi)
3380 MEMap::const_iterator mi =
data_.begin();
3381 MEMap::const_iterator
me =
data_.end();
3382 for ( ; mi !=
me; ++mi)
3384 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3389 else if (mi->hasWarning())
3392 && mi->hasOtherReport())
3436 std::cout <<
" ------------------------------------------------------------\n"
3437 <<
" Directory structure: \n"
3438 <<
" ------------------------------------------------------------\n";
3440 std::copy(contents.begin(), contents.end(),
3441 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3443 std::cout <<
" ------------------------------------------------------------\n";
3480 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3483 factor = factor/(events*1.0);
3485 MEMap::iterator mi =
data_.begin();
3486 MEMap::iterator
me =
data_.end();
3487 for ( ; mi !=
me; ++mi)
3539 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
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
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.
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.
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);
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
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)
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
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,...)