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);
375 std::set<MonitorElement>::const_iterator
e =
data_.end();
376 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
378 if (i->data_.run != run
379 || i->data_.streamId != streamId
380 || i->data_.moduleId != moduleId)
397 std::set<MonitorElement>::const_iterator
me =
data_.find(global_me);
398 if (me !=
data_.end()) {
400 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
405 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
407 list.Add(i->getTH1());
408 if( -1 == me->getTH1()->Merge(&list)) {
409 std::cout <<
"mergeAndResetMEsRunSummaryCache: Failed to merge DQM element "<<me->getFullname();
413 if (i->getTH1()->GetEntries())
414 me->getTH1()->Add(i->getTH1());
419 std::cout <<
"No global Object found. " << std::endl;
420 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
438 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
439 << run <<
" lumi: " << lumi
440 <<
", stream: " << streamId
441 <<
" module: " << moduleId << std::endl;
443 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
444 std::set<MonitorElement>::const_iterator
e =
data_.end();
445 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
448 if (i->data_.run != run
449 || i->data_.streamId != streamId
450 || i->data_.moduleId != moduleId)
465 std::set<MonitorElement>::const_iterator
me =
data_.find(global_me);
466 if (me !=
data_.end()) {
468 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
473 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
475 list.Add(i->getTH1());
476 if( -1 == me->getTH1()->Merge(&list)) {
477 std::cout <<
"mergeAndResetMEsLuminositySummaryCache: Failed to merge DQM element "<<me->getFullname();
481 if (i->getTH1()->GetEntries())
482 me->getTH1()->Add(i->getTH1());
487 std::cout <<
"No global Object found. " << std::endl;
488 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
493 actual_global_me.
setLumi(lumi);
544 collateHistograms_ (
false),
545 enableMultiThread_(
false),
546 readSelectedDirectory_ (
""),
591 std::cout <<
"DQMStore: histogram collation is enabled\n";
595 std::cout <<
"DQMStore: MultiThread option is enabled\n";
599 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
604 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
608 initQCriterion<Comp2RefChi2>(
qalgos_);
609 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
610 initQCriterion<ContentsXRange>(
qalgos_);
611 initQCriterion<ContentsYRange>(
qalgos_);
612 initQCriterion<MeanWithinExpected>(
qalgos_);
613 initQCriterion<Comp2RefEqualH>(
qalgos_);
614 initQCriterion<DeadChannel>(
qalgos_);
615 initQCriterion<NoisyChannel>(
qalgos_);
616 initQCriterion<ContentsWithinExpected>(
qalgos_);
617 initQCriterion<CompareToMedian>(
qalgos_);
618 initQCriterion<CompareLastFilledBin>(
qalgos_);
619 initQCriterion<CheckVariance>(
qalgos_);
623 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
642 stream_ =
new std::ofstream(
"histogramBookingBT.log");
651 size = backtrace (array, 10);
652 strings = backtrace_symbols (array, size);
656 for (; level <
size; level++) {
657 if (!
s_rxtrace.match(strings[level], 0, 0, &m))
continue;
658 demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(), 0, 0, &
r);
659 if (!demangled)
continue;
660 if (!
s_rxself.match(demangled, 0, 0))
break;
665 if (demangled !=
nullptr) {
668 << (r ? m.matchString(strings[level], 2) :
demangled) <<
" "
669 << m.matchString(strings[level], 1) <<
"\n";
672 *
stream_ <<
"Skipping "<< dir <<
"/" << name
673 <<
" with stack size " << size <<
"\n";
678 if (
verbose_ > 4 || demangled ==
nullptr)
683 for (i = 0; i <
size; i++)
684 if (
s_rxtrace.match(strings[i], 0, 0, &m))
686 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
687 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" "
688 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" "
689 << m.matchString(strings[i], 1) << std::endl;
726 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
750 size_t pos =
pwd_.rfind(
'/');
751 if (pos == std::string::npos)
766 prev.reserve(path.size());
767 subdir.reserve(path.size());
768 name.reserve(path.size());
776 subdir.append(path, 0, slash);
778 name.append(subdir, prevname, std::string::npos);
780 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
781 " which already exists as a monitor element",
784 if (!
dirs_.count(subdir))
785 dirs_.insert(subdir);
788 if (slash+1 >= path.size())
793 prevname = slash ? slash+1 :
slash;
795 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
803 {
return dirs_.count(path) > 0; }
808 template <
class HISTO,
class COLLATE>
811 const char *context,
int kind,
812 HISTO *
h, COLLATE collate)
814 assert(name.find(
'/') == std::string::npos);
837 << context <<
": monitor element '"
838 << path <<
"' already exists, collating" << std::endl;
856 for ( ; qi != qe; ++qi)
858 if ( qi->first->match(path) )
859 me->addQReport(qi->second);
877 me->reference_ = referenceME->
object_;
890 assert(name.find(
'/') == std::string::npos);
903 << context <<
": monitor element '"
904 << path <<
"' already exists, resetting" << std::endl;
932 return book(dir, name,
"bookInt")
962 return book(dir, name,
"bookFloat")
991 return book(dir, name,
"bookString")
1032 int nchX,
double lowX,
double highX)
1034 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1040 int nchX,
double lowX,
double highX)
1042 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
1048 int nchX,
double lowX,
double highX)
1050 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1056 int nchX,
double lowX,
double highX)
1058 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1064 int nchX,
double lowX,
double highX)
1066 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1072 int nchX,
double lowX,
double highX)
1074 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1080 int nchX,
const float *xbinsize)
1082 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1088 int nchX,
const float *xbinsize)
1090 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1097 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1104 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1111 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1118 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1125 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1132 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1160 int nchX,
double lowX,
double highX,
1161 int nchY,
double lowY,
double highY)
1163 return book2D(
pwd_, name,
new TH2F(name, title,
1165 nchY, lowY, highY));
1171 int nchX,
double lowX,
double highX,
1172 int nchY,
double lowY,
double highY)
1174 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1176 nchY, lowY, highY));
1182 int nchX,
double lowX,
double highX,
1183 int nchY,
double lowY,
double highY)
1185 return book2S(
pwd_, name,
new TH2S(name, title,
1187 nchY, lowY, highY));
1193 int nchX,
double lowX,
double highX,
1194 int nchY,
double lowY,
double highY)
1196 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1198 nchY, lowY, highY));
1204 int nchX,
double lowX,
double highX,
1205 int nchY,
double lowY,
double highY)
1209 nchY, lowY, highY));
1215 int nchX,
double lowX,
double highX,
1216 int nchY,
double lowY,
double highY)
1218 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1220 nchY, lowY, highY));
1226 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1228 return book2D(
pwd_, name,
new TH2F(name, title,
1229 nchX, xbinsize, nchY, ybinsize));
1235 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1237 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1238 nchX, xbinsize, nchY, ybinsize));
1245 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1252 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1259 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1266 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1273 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1280 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1294 int nchX,
double lowX,
double highX,
1295 int nchY,
double lowY,
double highY,
1296 int nchZ,
double lowZ,
double highZ)
1298 return book3D(
pwd_, name,
new TH3F(name, title,
1301 nchZ, lowZ, highZ));
1307 int nchX,
double lowX,
double highX,
1308 int nchY,
double lowY,
double highY,
1309 int nchZ,
double lowZ,
double highZ)
1311 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1314 nchZ, lowZ, highZ));
1321 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1328 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1336 return book(dir, name,
"bookProfile",
1346 int nchX,
double lowX,
double highX,
1347 int ,
double lowY,
double highY,
1348 const char *option )
1361 int nchX,
double lowX,
double highX,
1362 int ,
double lowY,
double highY,
1363 const char *option )
1365 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1376 int nchX,
double lowX,
double highX,
1377 double lowY,
double highY,
1378 const char *option )
1391 int nchX,
double lowX,
double highX,
1392 double lowY,
double highY,
1393 const char *option )
1395 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1406 int nchX,
const double *xbinsize,
1407 int ,
double lowY,
double highY,
1408 const char *option )
1421 int nchX,
const double *xbinsize,
1422 int ,
double lowY,
double highY,
1423 const char *option )
1425 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1436 int nchX,
const double *xbinsize,
1437 double lowY,
double highY,
1438 const char *option )
1451 int nchX,
const double *xbinsize,
1452 double lowY,
double highY,
1453 const char *option )
1455 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1465 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1472 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1480 return book(dir, name,
"bookProfile2D",
1490 int nchX,
double lowX,
double highX,
1491 int nchY,
double lowY,
double highY,
1492 int ,
double lowZ,
double highZ,
1493 const char *option )
1507 int nchX,
double lowX,
double highX,
1508 int nchY,
double lowY,
double highY,
1509 int ,
double lowZ,
double highZ,
1510 const char *option )
1524 int nchX,
double lowX,
double highX,
1525 int nchY,
double lowY,
double highY,
1526 double lowZ,
double highZ,
1527 const char *option )
1541 int nchX,
double lowX,
double highX,
1542 int nchY,
double lowY,
double highY,
1543 double lowZ,
double highZ,
1544 const char *option )
1557 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1564 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1573 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1574 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1575 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1576 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1577 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1578 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1579 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1580 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1581 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1588 <<
"checkBinningMatches: different binning - cannot add object '"
1589 << h->GetName() <<
"' of type "
1590 << h->IsA()->GetName() <<
" to existing ME: '"
1674 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1677 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1678 " twice with multiple tags", me->
getFullname().c_str());
1695 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1696 " '%s' with tag %u", path.c_str(), myTag);
1705 MEMap::iterator
e =
data_.end();
1706 MEMap::iterator
i =
data_.lower_bound(proto);
1707 for ( ; i != e && path == *i->data_.dirname; ++
i)
1708 tag(const_cast<MonitorElement *>(&*i), myTag);
1722 MEMap::iterator
e =
data_.end();
1723 MEMap::iterator
i =
data_.lower_bound(proto);
1726 tag(const_cast<MonitorElement *>(&*i), myTag);
1735 std::vector<std::string>
1738 std::vector<std::string>
result;
1739 std::set<std::string>::const_iterator
e =
dirs_.end();
1740 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1751 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1752 result.push_back(*i);
1758 std::vector<std::string>
1762 std::vector<std::string>
result;
1763 MEMap::const_iterator
e =
data_.end();
1764 MEMap::const_iterator
i =
data_.lower_bound(proto);
1766 if (
pwd_ == *i->data_.dirname)
1767 result.push_back(i->getName());
1778 MEMap::const_iterator
e =
data_.end();
1779 MEMap::const_iterator
i =
data_.lower_bound(proto);
1791 MEMap::const_iterator mepos =
data_.find(proto);
1792 return (mepos ==
data_.end() ? 0
1797 std::vector<MonitorElement *>
1801 std::vector<MonitorElement *>
result;
1802 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1806 result.push_back(const_cast<MonitorElement *>(&me));
1813 std::vector<MonitorElement *>
1821 std::vector<MonitorElement *>
result;
1822 MEMap::const_iterator
e =
data_.end();
1823 MEMap::const_iterator
i =
data_.lower_bound(proto);
1825 if (*cleaned == *i->data_.dirname)
1826 result.push_back(const_cast<MonitorElement *>(&*i));
1832 std::vector<MonitorElement *>
1840 std::vector<MonitorElement *>
result;
1841 MEMap::const_iterator
e =
data_.end();
1842 MEMap::const_iterator
i =
data_.lower_bound(proto);
1844 if (*cleaned == *i->data_.dirname
1846 && i->data_.tag ==
tag)
1847 result.push_back(const_cast<MonitorElement *>(&*i));
1860 into.reserve(
dirs_.size());
1862 MEMap::const_iterator
me =
data_.end();
1863 std::set<std::string>::const_iterator di =
dirs_.begin();
1864 std::set<std::string>::const_iterator de =
dirs_.end();
1865 for ( ; di != de; ++di)
1868 MEMap::const_iterator mi =
data_.lower_bound(proto);
1869 MEMap::const_iterator
m = mi;
1870 size_t sz = di->size() + 2;
1873 if (*di == *m->data_.dirname)
1875 sz += m->data_.objname.size() + 1;
1882 std::vector<std::string>::iterator istr
1891 for (sz = 0; mi !=
m; ++mi)
1893 if (*di != *mi->data_.dirname)
1899 *istr += mi->data_.objname;
1905 istr->reserve(di->size() + 2);
1917 const uint32_t
run ,
1918 const uint32_t
lumi ,
1919 const uint32_t streamId ,
1920 const uint32_t moduleId )
const
1922 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1923 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1924 " unacceptable characters", dir.c_str());
1925 if (name.find_first_not_of(
s_safe) != std::string::npos)
1926 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1927 " unacceptable characters", name.c_str());
1937 MEMap::const_iterator mepos =
data_.find(proto);
1938 return (mepos ==
data_.end() ? 0
1948 into.reserve(
dirs_.size());
1950 MEMap::const_iterator
me =
data_.end();
1951 std::set<std::string>::const_iterator di =
dirs_.begin();
1952 std::set<std::string>::const_iterator de =
dirs_.end();
1955 for ( ; di != de; ++di)
1958 MEMap::const_iterator mi =
data_.lower_bound(proto);
1959 MEMap::const_iterator
m = mi;
1960 size_t sz = di->size() + 2;
1966 sz += 1 + m->data_.objname.size() + 11;
1973 std::vector<std::string>::iterator istr
1980 for (sz = 0; mi !=
m; ++mi)
1984 sprintf(tagbuf,
"/%u", mi->data_.tag);
1987 *istr += m->data_.objname;
1997 std::vector<MonitorElement*>
2000 uint32_t
lumi )
const
2008 std::vector<MonitorElement *>
result;
2009 MEMap::const_iterator
e =
data_.end();
2010 MEMap::const_iterator
i =
data_.lower_bound(proto);
2012 if (runNumber != 0) {
2013 if (i->data_.run > runNumber
2014 || i->data_.streamId != 0
2015 || i->data_.moduleId != 0)
2019 if (i->data_.lumi > lumi
2020 || i->data_.streamId != 0
2021 || i->data_.moduleId != 0)
2024 if (runNumber != 0
or lumi !=0) {
2025 assert(i->data_.streamId == 0);
2026 assert(i->data_.moduleId == 0);
2028 result.push_back(const_cast<MonitorElement *>(&*i));
2036 if (i->data_.run != 0 || i->data_.streamId != 0 || i->data_.moduleId != 0)
break;
2037 result.push_back(const_cast<MonitorElement *>(&*i));
2046 std::vector<MonitorElement*>
2052 rx = lat::Regexp(pattern, 0, syntaxType);
2055 catch (lat::Error &
e)
2057 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
2058 pattern.c_str(), e.explain().c_str());
2062 std::vector<MonitorElement *>
result;
2063 MEMap::const_iterator
i =
data_.begin();
2064 MEMap::const_iterator e =
data_.end();
2065 for ( ; i !=
e; ++
i)
2068 mergePath(path, *i->data_.dirname, i->data_.objname);
2070 result.push_back(const_cast<MonitorElement *>(&*i));
2085 MEMap::iterator mi =
data_.begin();
2086 MEMap::iterator
me =
data_.end();
2087 for ( ; mi !=
me; ++mi)
2090 if (mi->wasUpdated())
2109 MEMap::iterator mi =
data_.begin();
2110 MEMap::iterator
me =
data_.end();
2111 for ( ; mi !=
me; ++mi)
2142 std::set<MonitorElement>::const_iterator
e =
data_.end();
2143 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2146 if (i->data_.streamId != 0 ||
2147 i->data_.moduleId != 0)
2149 if (i->data_.lumi != lumi)
2151 if (i->data_.run != run)
2158 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2159 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2160 <<
"flags " << i->data_.flags <<
"\n";
2178 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2182 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2189 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2200 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2204 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2211 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2215 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2222 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2226 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2233 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2237 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2244 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2248 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2255 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2259 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2266 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2270 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2277 else if (dynamic_cast<TObjString *>(obj))
2280 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2282 if (strstr(obj->GetName(),
"CMSSW"))
2285 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2288 else if (strstr(obj->GetName(),
"DQMPATCH"))
2291 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2296 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2297 << obj->GetName() <<
"' of type '"
2298 << obj->IsA()->GetName() <<
"'\n";
2310 if (! me || overwrite)
2312 if (! me) me =
bookInt(dir, label);
2313 me->
Fill(atoll(value.c_str()));
2316 else if (kind ==
"f")
2319 if (! me || overwrite)
2322 me->
Fill(atof(value.c_str()));
2325 else if (kind ==
"s")
2333 else if (kind ==
"e")
2338 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2339 << label <<
"' in directory '"
2340 << dir <<
"' to be marked as efficiency plot.\n";
2345 else if (kind ==
"t")
2350 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2351 << label <<
"' in directory '"
2352 << dir <<
"' for a tag\n";
2357 unsigned long val = strtoul(value.c_str(), &endp, 10);
2358 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2360 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2361 << value <<
"' for monitor element '"
2362 << label <<
"' in directory '"
2363 << dir <<
"' - invalid value\n";
2368 else if (kind ==
"qr")
2373 size_t dot = label.find(
'.');
2374 if (dot == std::string::npos)
2376 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2377 <<
"' is missing a '.' and cannot be extracted\n";
2382 std::string qrname (label, dot+1, std::string::npos);
2388 qv.
code = atoi(m.matchString(value, 1).c_str());
2389 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2390 qv.
message = m.matchString(value, 4);
2394 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2396 qv.
code = atoi(m.matchString(value, 1).c_str());
2398 qv.
message = m.matchString(value, 2);
2404 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2405 << value <<
"' is incorrectly formatted\n";
2412 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2413 << mename <<
"' in directory '"
2414 << dir <<
"' for quality test '"
2424 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2425 << obj->GetName() <<
"' of type '"
2426 << obj->IsA()->GetName() <<
"'\n";
2430 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2434 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2435 s +=
'<'; s +=
n->GetName(); s +=
'>';
2437 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2438 TObjString os(s.c_str());
2443 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2444 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2445 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2480 size_t end = path.find(
'/', start);
2481 if (end == std::string::npos)
2489 TObject *
o = gDirectory->Get(part.c_str());
2490 if (o && ! dynamic_cast<TDirectory *>(o))
2491 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2492 " fails because the part '%s' already exists and is not"
2493 " directory", path.c_str(), part.c_str());
2495 gDirectory->mkdir(part.c_str());
2497 if (! gDirectory->cd(part.c_str()))
2498 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2499 " fails because could not cd into subdirectory '%s'",
2500 path.c_str(), part.c_str());
2503 if (end+1 >= path.size())
2508 end = path.find(
'/', start);
2509 if (end == std::string::npos)
2518 const uint32_t
run ,
2519 const uint32_t
lumi ,
2520 const bool resetMEsAfterWriting )
2522 using google::protobuf::io::FileOutputStream;
2523 using google::protobuf::io::GzipOutputStream;
2524 using google::protobuf::io::StringOutputStream;
2528 std::set<std::string>::iterator di, de;
2529 MEMap::iterator mi,
me =
data_.end();
2534 std::cout <<
"\n DQMStore: Opening PBFile '"
2535 << filename <<
"'"<< std::endl;
2538 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2551 mi =
data_.lower_bound(proto);
2552 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2556 <<
" Lumi: " << (*mi).lumi()
2557 <<
" LumiFlag: " << (*mi).getLumiFlag()
2558 <<
" streamId: " << (*mi).streamId()
2559 <<
" moduleId: " << (*mi).moduleId()
2560 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2567 if (*di != *mi->data_.dirname)
2576 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2580 std::cout <<
"DQMStore::savePB: saving monitor element '"
2581 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2582 <<
"flags " << mi->data_.flags <<
"\n";
2589 TObject *toWrite =
nullptr;
2593 toWrite =
new TObjString(mi->tagString().c_str());
2594 deleteObject =
true;
2596 toWrite = mi->object_;
2599 TBufferFile buffer(TBufferFile::kWrite);
2600 buffer.WriteObject(toWrite);
2610 if (resetMEsAfterWriting)
2615 int filedescriptor =
::open(filename.c_str(),
2616 O_WRONLY | O_CREAT | O_TRUNC,
2620 FileOutputStream file_stream(filedescriptor);
2622 options.format = GzipOutputStream::GZIP;
2623 options.compression_level = 1;
2624 GzipOutputStream gzip_stream(&file_stream,
2626 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2629 gzip_stream.Close();
2630 file_stream.Close();
2631 ::close(filedescriptor);
2635 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2636 <<
" objects from path '" << path
2637 <<
"' into DQM file '" << filename <<
"'\n";
2650 const uint32_t
run ,
2651 const uint32_t
lumi ,
2655 const bool resetMEsAfterWriting )
2659 std::set<std::string>::iterator di, de;
2660 MEMap::iterator mi,
me =
data_.end();
2661 DQMNet::QReports::const_iterator qi, qe;
2669 class TFileNoSync :
public TFile
2672 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2673 virtual Int_t SysSync(Int_t)
override {
return 0; }
2678 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2679 <<
"' with option '" << fileupdate <<
"'\n";
2681 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2683 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2687 std::auto_ptr<lat::Regexp> rxpat;
2688 if (! pattern.empty())
2689 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2702 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2716 mi =
data_.lower_bound(proto);
2717 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2720 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2721 <<
" Lumi: " << (*mi).lumi()
2722 <<
" LumiFlag: " << (*mi).getLumiFlag()
2723 <<
" streamId: " << (*mi).streamId()
2724 <<
" moduleId: " << (*mi).moduleId()
2725 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2732 if (*di != *mi->data_.dirname) {
2734 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2744 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2770 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2771 status =
std::max(status, master->data_.qreports[
i].code);
2773 if (! master || status < minStatus)
2776 std::cout <<
"DQMStore::save: skipping monitor element '"
2777 << mi->data_.objname <<
"' while saving, status is "
2778 << status <<
", required minimum status is "
2779 << minStatus << std::endl;
2786 std::cout <<
"DQMStore::save: saving monitor element '"
2787 << mi->data_.objname <<
"'\n";
2791 gDirectory->cd(
"/");
2794 else if (rxpat.get())
2805 TObjString(mi->tagString().c_str()).Write();
2809 mi->object_->Write();
2816 qi = mi->data_.qreports.begin();
2817 qe = mi->data_.qreports.end();
2818 for ( ; qi != qe; ++qi)
2819 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2824 TObjString(mi->effLabelString().c_str()).Write();
2828 TObjString(mi->tagLabelString().c_str()).Write();
2831 if (resetMEsAfterWriting)
2840 std::cout <<
"DQMStore::save: successfully wrote " << nme
2841 <<
" objects from path '" << path
2842 <<
"' into DQM file '" << filename <<
"'\n";
2855 unsigned int ntot = 0;
2856 unsigned int count = 0;
2858 if (! file->cd(curdir.c_str()))
2859 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2860 " reading file '%s'", curdir.c_str(), file->GetName());
2883 size_t slash = dirpart.find(
'/');
2884 size_t pos = dirpart.find(
"/Run summary");
2885 if (slash != std::string::npos && pos !=std::string::npos)
2887 dirpart.erase(pos,12);
2889 pos = dirpart.find(
"Run ");
2890 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2891 if (pos !=std::string::npos)
2892 dirpart.erase(pos,length);
2901 size_t slash = dirpart.find(
'/');
2903 if (slash == std::string::npos
2908 slash = dirpart.find(
'/');
2910 if (slash != std::string::npos
2911 && slash + 10 == dirpart.size()
2912 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2914 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2919 if (dirpart.empty())
2922 dirpart = prepend +
'/' + dirpart;
2924 else if (! prepend.empty())
2926 if (dirpart.empty())
2929 dirpart = prepend +
'/' + dirpart;
2937 TIter
next (gDirectory->GetListOfKeys());
2938 std::list<TObject *> delayed;
2939 while ((key = (TKey *)
next()))
2941 std::auto_ptr<TObject>
obj(key->ReadObj());
2942 if (dynamic_cast<TDirectory *>(
obj.get()))
2945 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2947 if (! curdir.empty())
2949 subdir +=
obj->GetName();
2951 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2955 else if (dynamic_cast<TObjString *>(
obj.get()))
2957 delayed.push_back(
obj.release());
2962 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2963 <<
"' of type '" <<
obj->IsA()->GetName()
2964 <<
"' from '" << file->GetName()
2965 <<
"' into '" << dirpart <<
"'\n";
2973 while (! delayed.empty())
2976 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2977 <<
"' of type '" << delayed.front()->IsA()->GetName()
2978 <<
"' from '" << file->GetName()
2979 <<
"' into '" << dirpart <<
"'\n";
2985 delete delayed.front();
2986 delayed.pop_front();
2990 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2991 <<
" objects from directory '" << dirpart <<
"'\n";
2993 return ntot +
count;
3008 bool fileMustExist )
3010 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
3020 bool fileMustExist )
3022 bool overwrite =
true;
3026 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
3028 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
3030 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
3034 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3036 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3050 bool fileMustExist )
3054 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3056 std::auto_ptr<TFile>
f;
3060 f.reset(TFile::Open(filename.c_str()));
3061 if (! f.get() || f->IsZombie())
3062 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3071 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3076 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3079 MEMap::iterator mi =
data_.begin();
3080 MEMap::iterator
me =
data_.end();
3081 for ( ; mi !=
me; ++mi)
3082 const_cast<MonitorElement &>(*mi).updateQReportStats();
3086 std::cout <<
"DQMStore::open: successfully read " << n
3087 <<
" objects from file '" << filename <<
"'";
3088 if (! onlypath.empty())
3089 std::cout <<
" from directory '" << onlypath <<
"'";
3090 if (! prepend.empty())
3091 std::cout <<
" into directory '" << prepend <<
"'";
3101 if (buf.Length() == buf.BufferSize())
3104 void *ptr = buf.ReadObjectAny(0);
3105 return reinterpret_cast<TObject *
>(ptr);
3114 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3115 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3117 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3118 TBufferFile buf(TBufferFile::kRead, h.
size(),
3134 bool fileMustExist )
3136 using google::protobuf::io::FileInputStream;
3137 using google::protobuf::io::FileOutputStream;
3138 using google::protobuf::io::GzipInputStream;
3139 using google::protobuf::io::GzipOutputStream;
3140 using google::protobuf::io::CodedInputStream;
3141 using google::protobuf::io::ArrayInputStream;
3144 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3147 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3149 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3152 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3157 FileInputStream
fin(filedescriptor);
3158 GzipInputStream
input(&fin);
3159 CodedInputStream input_coded(&input);
3160 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3161 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3162 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3165 ::close(filedescriptor);
3189 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3191 if (me ==
nullptr) {
3217 MEMap::iterator
e =
data_.end();
3218 MEMap::iterator
i =
data_.lower_bound(proto);
3222 std::set<std::string>::iterator de =
dirs_.end();
3223 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3233 MEMap::iterator
e =
data_.end();
3234 MEMap::iterator
i =
data_.lower_bound(proto);
3236 if (dir == *i->data_.dirname)
3263 MEMap::iterator pos =
data_.find(proto);
3264 if (pos !=
data_.end())
3267 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3268 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3279 QCMap::const_iterator
i =
qtests_.find(qtname);
3280 QCMap::const_iterator
e =
qtests_.end();
3281 return (i == e ? 0 : i->second);
3291 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3294 QAMap::iterator
i =
qalgos_.find(algoname);
3296 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3297 " algorithm '%s'", algoname.c_str());
3317 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3319 " uses unacceptable characters", cleaned->c_str());
3331 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3341 MEMap::iterator mi =
data_.begin();
3342 MEMap::iterator
me =
data_.end();
3345 for ( ; mi !=
me; ++mi)
3348 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3349 if (fm->match(path))
3366 std::cout <<
"DQMStore: running runQTests() with reset = "
3367 << (
reset_ ?
"true" :
"false" ) << std::endl;
3370 MEMap::iterator mi =
data_.begin();
3371 MEMap::iterator
me =
data_.end();
3372 for ( ; mi !=
me; ++mi)
3390 MEMap::const_iterator mi =
data_.begin();
3391 MEMap::const_iterator
me =
data_.end();
3392 for ( ; mi !=
me; ++mi)
3394 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3399 else if (mi->hasWarning())
3402 && mi->hasOtherReport())
3446 std::cout <<
" ------------------------------------------------------------\n"
3447 <<
" Directory structure: \n"
3448 <<
" ------------------------------------------------------------\n";
3450 std::copy(contents.begin(), contents.end(),
3451 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3453 std::cout <<
" ------------------------------------------------------------\n";
3490 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3493 factor = factor/(events*1.0);
3495 MEMap::iterator mi =
data_.begin();
3496 MEMap::iterator
me =
data_.end();
3497 for ( ; mi !=
me; ++mi)
3549 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
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)
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
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.
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,...)