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> 22 #include <boost/range/iterator_range_core.hpp> 60 static const std::string s_safe =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# ";
62 static const lat::Regexp
s_rxmeval (
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$");
63 static const lat::Regexp
s_rxmeqr1 (
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$");
64 static const lat::Regexp
s_rxmeqr2 (
"^st\\.(\\d+)\\.(.*)$");
65 static const lat::Regexp
s_rxtrace (
"(.*)\\((.*)\\+0x.*\\).*");
66 static const lat::Regexp
s_rxself (
"^[^()]*DQMStore::.*");
67 static const lat::Regexp
s_rxpbfile (
".*\\.pb$");
76 || (path.size() >= ofdir.size()
77 && path.compare(0, ofdir.size(), ofdir) == 0
78 && (path.size() == ofdir.size()
79 || path[ofdir.size()] ==
'/')));
88 size_t len = path.size();
89 for ( ; len > 0 && path[len-1] ==
'/'; --len)
92 if (len != path.size())
94 clean = path.substr(0, len);
102 size_t slash = path.rfind(
'/');
103 if (slash != std::string::npos)
105 dir.append(path, 0, slash);
106 name.append(path, slash+1, std::string::npos);
115 path.reserve(dir.size() + name.size() + 2);
125 {
return new T(qtname); }
130 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
135 fastString_ (
std::
move(_fastString)), matching_ (UseFull)
143 catch (lat::Error &
e)
146 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality" 151 size_t starCount = 0;
156 if ((
size_t)pos == std::string::npos)
162 if ((
fastString_.find(
'"') != std::string::npos) ||
175 if (boost::algorithm::starts_with(
fastString_,
"*"))
193 if (boost::algorithm::starts_with(
fastString_,
"*") &&
213 if (input.size() < pattern.size())
219 std::string::const_reverse_iterator rit_pattern = pattern.rbegin();
220 std::string::const_reverse_iterator rit_input = input.rbegin();
222 for (; rit_pattern < pattern.rend(); rit_pattern++, rit_input++)
224 if (*rit_pattern != *rit_input)
234 if (input.size() < pattern.size())
240 std::string::const_iterator rit_pattern = pattern.begin();
241 std::string::const_iterator rit_input = input.begin();
243 for (; rit_pattern < pattern.end(); rit_pattern++, rit_input++)
245 if (*rit_pattern != *rit_input)
280 owner_->setCurrentFolder(fullpath);
288 return owner_->pwd();
292 owner_->tag(me, tag);
296 owner_->tagContents(path, myTag);
300 std::vector<MonitorElement*>
304 return owner_->getAllContents(path, runNumber, lumi);
308 return owner_->get(path);
313 if (ptr ==
nullptr) {
314 std::stringstream
msg;
315 msg <<
"DQM object not found";
320 throw std::out_of_range(msg.str());
326 return owner_->getSubdirs();
330 return owner_->getMEs();
334 return owner_->containsAnyMonitorable(path);
338 return owner_->dirExists(path);
350 owner_->setCurrentFolder(fullpath);
366 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: " 368 <<
", stream: " << streamId
369 <<
" module: " << moduleId << std::endl;
376 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
379 std::lock_guard<std::mutex> guard(book_mutex_);
381 auto e = data_.end();
382 auto i = data_.lower_bound(proto);
384 if (
i->data_.run != run
385 ||
i->data_.streamId != streamId
386 ||
i->data_.moduleId != moduleId)
390 if (
i->getLumiFlag() || LSbasedMode_) {
400 auto me = data_.find(global_me);
401 if (me != data_.end()) {
403 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
408 if(me->getTH1()->CanExtendAllAxes() &&
i->getTH1()->CanExtendAllAxes()) {
410 list.Add(
i->getTH1());
411 if( -1 == me->getTH1()->Merge(&list)) {
412 std::cout <<
"mergeAndResetMEsRunSummaryCache: Failed to merge DQM element "<<me->getFullname();
416 if (
i->getTH1()->GetEntries())
417 me->getTH1()->Add(
i->getTH1());
422 std::cout <<
"No global Object found. " << std::endl;
423 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
429 gme = data_.insert(
std::move(actual_global_me));
442 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: " 443 << run <<
" lumi: " << lumi
444 <<
", stream: " << streamId
445 <<
" module: " << moduleId << std::endl;
447 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
451 std::lock_guard<std::mutex> guard(book_mutex_);
453 auto e = data_.end();
454 auto i = data_.lower_bound(proto);
457 if (
i->data_.run != run
458 ||
i->data_.streamId != streamId
459 ||
i->data_.moduleId != moduleId)
463 if (not (
i->getLumiFlag() || LSbasedMode_)) {
471 auto me = data_.find(global_me);
472 if (me != data_.end()) {
474 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
479 if(me->getTH1()->CanExtendAllAxes() &&
i->getTH1()->CanExtendAllAxes()) {
481 list.Add(
i->getTH1());
482 if( -1 == me->getTH1()->Merge(&list)) {
483 std::cout <<
"mergeAndResetMEsLuminositySummaryCache: Failed to merge DQM element "<<me->getFullname();
487 if (
i->getTH1()->GetEntries())
488 me->getTH1()->Add(
i->getTH1());
493 std::cout <<
"No global Object found. " << std::endl;
494 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
499 actual_global_me.
setLumi(lumi);
501 gme = data_.insert(
std::move(actual_global_me));
515 collateHistograms_ (
false),
516 enableMultiThread_(
false),
517 forceResetOnBeginLumi_(
false),
518 readSelectedDirectory_ (
""),
576 delete qtestspec.first;
599 std::cout <<
"DQMStore: histogram collation is enabled\n";
603 std::cout <<
"DQMStore: MultiThread option is enabled\n";
607 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
612 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
616 initQCriterion<Comp2RefChi2>(
qalgos_);
617 initQCriterion<Comp2Ref2DChi2>(
qalgos_);
618 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
619 initQCriterion<ContentsXRange>(
qalgos_);
620 initQCriterion<ContentsYRange>(
qalgos_);
621 initQCriterion<MeanWithinExpected>(
qalgos_);
622 initQCriterion<Comp2RefEqualH>(
qalgos_);
623 initQCriterion<DeadChannel>(
qalgos_);
624 initQCriterion<NoisyChannel>(
qalgos_);
625 initQCriterion<ContentsWithinExpected>(
qalgos_);
626 initQCriterion<CompareToMedian>(
qalgos_);
627 initQCriterion<CompareLastFilledBin>(
qalgos_);
628 initQCriterion<CheckVariance>(
qalgos_);
632 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
651 stream_ =
new std::ofstream(
"histogramBookingBT.log");
660 size = backtrace (array, 10);
661 strings = backtrace_symbols (array, size);
665 for (; level <
size; level++) {
666 if (!
s_rxtrace.match(strings[level], 0, 0, &m))
continue;
667 demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(),
nullptr,
nullptr, &
r);
668 if (!demangled)
continue;
669 if (!
s_rxself.match(demangled, 0, 0))
break;
674 if (demangled !=
nullptr) {
677 << (r ? m.matchString(strings[level], 2) :
demangled) <<
" " 678 << m.matchString(strings[level], 1) <<
"\n";
681 *
stream_ <<
"Skipping "<< dir <<
"/" << name
682 <<
" with stack size " << size <<
"\n";
687 if (
verbose_ > 4 || demangled ==
nullptr)
692 for (i = 0; i <
size; i++)
693 if (
s_rxtrace.match(strings[i], 0, 0, &m))
695 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(),
nullptr,
nullptr, &
r);
696 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" " 697 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" " 698 << m.matchString(strings[i], 1) << std::endl;
735 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
760 if (pos == std::string::npos)
775 prev.reserve(path.size());
776 subdir.reserve(path.size());
777 name.reserve(path.size());
785 subdir.append(path, 0, slash);
787 name.append(subdir, prevname, std::string::npos);
789 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'" 790 " which already exists as a monitor element",
793 if (!
dirs_.count(subdir))
794 dirs_.insert(subdir);
797 if (slash+1 >= path.size())
802 prevname = slash ? slash+1 :
slash;
804 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
812 {
return dirs_.count(path) > 0; }
817 template <
class HISTO,
class COLLATE>
820 const char *context,
int kind,
821 HISTO *
h, COLLATE collate)
823 assert(name.find(
'/') == std::string::npos);
830 h->SetDirectory(
nullptr);
846 << context <<
": monitor element '" 847 << path <<
"' already exists, collating" << std::endl;
857 assert(
dirs_.count(dir));
865 for ( ; qi != qe; ++qi)
867 if ( qi->first->match(path) )
868 me->addQReport(qi->second);
886 me->reference_ = referenceME->
object_;
899 assert(name.find(
'/') == std::string::npos);
912 << context <<
": monitor element '" 913 << path <<
"' already exists, resetting" << std::endl;
921 assert(
dirs_.count(dir));
941 return book_(dir, name,
"bookInt")
971 return book_(dir, name,
"bookFloat")
1000 return book_(dir, name,
"bookString")
1041 int nchX,
double lowX,
double highX)
1043 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1049 int nchX,
double lowX,
double highX)
1051 return book1D_(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
1057 int nchX,
double lowX,
double highX)
1059 return book1S_(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1065 int nchX,
double lowX,
double highX)
1067 return book1S_(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1073 int nchX,
double lowX,
double highX)
1075 return book1DD_(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1081 int nchX,
double lowX,
double highX)
1083 return book1DD_(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1089 int nchX,
const float *xbinsize)
1091 return book1D_(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1097 int nchX,
const float *xbinsize)
1099 return book1D_(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1106 return book1D_(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1113 return book1D_(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1120 return book1S_(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1127 return book1S_(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1134 return book1DD_(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1141 return book1DD_(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1169 int nchX,
double lowX,
double highX,
1170 int nchY,
double lowY,
double highY)
1174 nchY, lowY, highY));
1180 int nchX,
double lowX,
double highX,
1181 int nchY,
double lowY,
double highY)
1183 return book2D_(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1185 nchY, lowY, highY));
1191 int nchX,
double lowX,
double highX,
1192 int nchY,
double lowY,
double highY)
1196 nchY, lowY, highY));
1202 int nchX,
double lowX,
double highX,
1203 int nchY,
double lowY,
double highY)
1205 return book2S_(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1207 nchY, lowY, highY));
1213 int nchX,
double lowX,
double highX,
1214 int nchY,
double lowY,
double highY)
1218 nchY, lowY, highY));
1224 int nchX,
double lowX,
double highX,
1225 int nchY,
double lowY,
double highY)
1227 return book2DD_(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1229 nchY, lowY, highY));
1235 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1238 nchX, xbinsize, nchY, ybinsize));
1244 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1246 return book2D_(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1247 nchX, xbinsize, nchY, ybinsize));
1253 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1256 nchX, xbinsize, nchY, ybinsize));
1262 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1264 return book2S_(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1265 nchX, xbinsize, nchY, ybinsize));
1272 return book2D_(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1279 return book2D_(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1286 return book2S_(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1293 return book2S_(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1300 return book2DD_(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1307 return book2DD_(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1321 int nchX,
double lowX,
double highX,
1322 int nchY,
double lowY,
double highY,
1323 int nchZ,
double lowZ,
double highZ)
1328 nchZ, lowZ, highZ));
1334 int nchX,
double lowX,
double highX,
1335 int nchY,
double lowY,
double highY,
1336 int nchZ,
double lowZ,
double highZ)
1338 return book3D_(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1341 nchZ, lowZ, highZ));
1348 return book3D_(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1355 return book3D_(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1363 return book_(dir, name,
"bookProfile",
1373 int nchX,
double lowX,
double highX,
1374 int ,
double lowY,
double highY,
1388 int nchX,
double lowX,
double highX,
1389 int ,
double lowY,
double highY,
1403 int nchX,
double lowX,
double highX,
1404 double lowY,
double highY,
1418 int nchX,
double lowX,
double highX,
1419 double lowY,
double highY,
1433 int nchX,
const double *xbinsize,
1434 int ,
double lowY,
double highY,
1448 int nchX,
const double *xbinsize,
1449 int ,
double lowY,
double highY,
1463 int nchX,
const double *xbinsize,
1464 double lowY,
double highY,
1478 int nchX,
const double *xbinsize,
1479 double lowY,
double highY,
1492 return bookProfile_(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1499 return bookProfile_(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1507 return book_(dir, name,
"bookProfile2D",
1517 int nchX,
double lowX,
double highX,
1518 int nchY,
double lowY,
double highY,
1519 int ,
double lowZ,
double highZ,
1534 int nchX,
double lowX,
double highX,
1535 int nchY,
double lowY,
double highY,
1536 int ,
double lowZ,
double highZ,
1551 int nchX,
double lowX,
double highX,
1552 int nchY,
double lowY,
double highY,
1553 double lowZ,
double highZ,
1568 int nchX,
double lowX,
double highX,
1569 int nchY,
double lowY,
double highY,
1570 double lowZ,
double highZ,
1591 return bookProfile2D_(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1600 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1601 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1602 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1603 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1604 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1605 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1606 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1607 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1608 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1615 <<
"checkBinningMatches: different binning - cannot add object '" 1616 << h->GetName() <<
"' of type " 1617 << h->IsA()->GetName() <<
" to existing ME: '" 1701 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1704 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'" 1705 " twice with multiple tags", me->
getFullname().c_str());
1722 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element" 1723 " '%s' with tag %u", path.c_str(), myTag);
1733 auto i =
data_.lower_bound(proto);
1734 for ( ;
i !=
e && path == *
i->data_.dirname; ++
i)
1735 tag(const_cast<MonitorElement *>(&*
i), myTag);
1750 auto i =
data_.lower_bound(proto);
1753 tag(const_cast<MonitorElement *>(&*
i), myTag);
1762 std::vector<std::string>
1765 std::vector<std::string>
result;
1778 if (
i->find(
'/',
pwd_.size()+1) == std::string::npos)
1779 result.push_back(*
i);
1785 std::vector<std::string>
1789 std::vector<std::string>
result;
1791 auto i =
data_.lower_bound(proto);
1793 if (
pwd_ == *
i->data_.dirname)
1794 result.push_back(
i->getName());
1806 auto i =
data_.lower_bound(proto);
1818 auto mepos =
data_.find(proto);
1819 return (mepos ==
data_.end() ?
nullptr 1824 std::vector<MonitorElement *>
1828 std::vector<MonitorElement *>
result;
1829 for (
auto const & me :
data_)
1832 result.push_back(const_cast<MonitorElement *>(&me));
1839 std::vector<MonitorElement *>
1847 std::vector<MonitorElement *>
result;
1849 auto i =
data_.lower_bound(proto);
1851 if (*cleaned == *
i->data_.dirname)
1852 result.push_back(const_cast<MonitorElement *>(&*
i));
1858 std::vector<MonitorElement *>
1866 std::vector<MonitorElement *>
result;
1868 auto i =
data_.lower_bound(proto);
1870 if (*cleaned == *
i->data_.dirname
1872 &&
i->data_.tag ==
tag)
1873 result.push_back(const_cast<MonitorElement *>(&*
i));
1886 into.reserve(
dirs_.size());
1888 auto me =
data_.end();
1889 auto di =
dirs_.begin();
1890 auto de =
dirs_.end();
1891 for ( ; di != de; ++di)
1894 auto mi =
data_.lower_bound(proto);
1896 size_t sz = di->size() + 2;
1899 if (*di == *
m->data_.dirname)
1901 sz +=
m->data_.objname.size() + 1;
1917 for (sz = 0; mi !=
m; ++mi)
1919 if (*di != *mi->data_.dirname)
1925 *istr += mi->data_.objname;
1931 istr->reserve(di->size() + 2);
1943 const uint32_t
run ,
1944 const uint32_t
lumi ,
1945 const uint32_t streamId ,
1946 const uint32_t moduleId )
const 1948 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1949 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1950 " unacceptable characters", dir.c_str());
1951 if (name.find_first_not_of(
s_safe) != std::string::npos)
1952 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses" 1953 " unacceptable characters", name.c_str());
1963 auto mepos =
data_.find(proto);
1964 return (mepos ==
data_.end() ?
nullptr 1974 into.reserve(
dirs_.size());
1976 auto me =
data_.end();
1977 auto di =
dirs_.begin();
1978 auto de =
dirs_.end();
1981 for ( ; di != de; ++di)
1984 auto mi =
data_.lower_bound(proto);
1986 size_t sz = di->size() + 2;
1992 sz += 1 +
m->data_.objname.size() + 11;
2006 for (sz = 0; mi !=
m; ++mi)
2010 sprintf(tagbuf,
"/%u", mi->data_.tag);
2013 *istr +=
m->data_.objname;
2023 std::vector<MonitorElement*>
2026 uint32_t
lumi )
const 2034 std::vector<MonitorElement *>
result;
2036 auto i =
data_.lower_bound(proto);
2038 if (runNumber != 0) {
2039 if (
i->data_.run > runNumber
2040 ||
i->data_.streamId != 0
2041 ||
i->data_.moduleId != 0)
2045 if (
i->data_.lumi > lumi
2046 ||
i->data_.streamId != 0
2047 ||
i->data_.moduleId != 0)
2050 if (runNumber != 0
or lumi !=0) {
2051 assert(
i->data_.streamId == 0);
2052 assert(
i->data_.moduleId == 0);
2054 result.push_back(const_cast<MonitorElement *>(&*
i));
2062 if (
i->data_.run != 0 ||
i->data_.streamId != 0 ||
i->data_.moduleId != 0)
break;
2063 result.push_back(const_cast<MonitorElement *>(&*
i));
2072 std::vector<MonitorElement*>
2078 rx = lat::Regexp(pattern, 0, syntaxType);
2081 catch (lat::Error &
e)
2083 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
2084 pattern.c_str(), e.explain().c_str());
2088 std::vector<MonitorElement *>
result;
2090 auto e =
data_.end();
2091 for ( ;
i !=
e; ++
i)
2094 mergePath(path, *
i->data_.dirname,
i->data_.objname);
2096 result.push_back(const_cast<MonitorElement *>(&*
i));
2111 auto mi =
data_.begin();
2112 auto me =
data_.end();
2113 for ( ; mi != me; ++mi)
2116 if (mi->wasUpdated())
2135 auto mi =
data_.begin();
2136 auto me =
data_.end();
2137 for ( ; mi != me; ++mi)
2163 uint32_t
run = lumiblock.run();
2169 auto i =
data_.lower_bound(begin);
2170 const auto e =
data_.lower_bound(end);
2201 auto i =
data_.lower_bound(proto);
2204 if (
i->data_.streamId != 0 ||
2205 i->data_.moduleId != 0)
2207 if (
i->data_.lumi != lumi)
2209 if (
i->data_.run != run)
2211 if (not
i->markedToDelete()) {
2217 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '" 2218 << *
i->data_.dirname <<
"/" <<
i->data_.objname <<
"'" 2219 <<
"flags " <<
i->data_.flags <<
"\n";
2237 if (
auto *
h = dynamic_cast<TProfile *>(obj))
2248 else if (
auto *
h = dynamic_cast<TProfile2D *>(obj))
2259 else if (
auto *
h = dynamic_cast<TH1F *>(obj))
2263 me =
book1D_(dir,
h->GetName(), (TH1F *)
h->Clone());
2270 else if (
auto *
h = dynamic_cast<TH1S *>(obj))
2274 me =
book1S_(dir,
h->GetName(), (TH1S *)
h->Clone());
2281 else if (
auto *
h = dynamic_cast<TH1D *>(obj))
2285 me =
book1DD_(dir,
h->GetName(), (TH1D *)
h->Clone());
2292 else if (
auto *
h = dynamic_cast<TH2F *>(obj))
2296 me =
book2D_(dir,
h->GetName(), (TH2F *)
h->Clone());
2303 else if (
auto *
h = dynamic_cast<TH2S *>(obj))
2307 me =
book2S_(dir,
h->GetName(), (TH2S *)
h->Clone());
2314 else if (
auto *
h = dynamic_cast<TH2D *>(obj))
2318 me =
book2DD_(dir,
h->GetName(), (TH2D *)
h->Clone());
2325 else if (
auto *
h = dynamic_cast<TH3F *>(obj))
2329 me =
book3D_(dir,
h->GetName(), (TH3F *)
h->Clone());
2336 else if (dynamic_cast<TObjString *>(obj))
2339 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2341 if (strstr(obj->GetName(),
"CMSSW"))
2344 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2347 else if (strstr(obj->GetName(),
"DQMPATCH"))
2350 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2355 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2356 << obj->GetName() <<
"' of type '" 2357 << obj->IsA()->GetName() <<
"'\n";
2369 if (! me || overwrite)
2371 if (! me) me =
bookInt_(dir, label);
2372 me->
Fill(atoll(value.c_str()));
2375 else if (kind ==
"f")
2378 if (! me || overwrite)
2381 me->
Fill(atof(value.c_str()));
2384 else if (kind ==
"s")
2392 else if (kind ==
"e")
2397 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2398 << label <<
"' in directory '" 2399 << dir <<
"' to be marked as efficiency plot.\n";
2404 else if (kind ==
"t")
2409 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2410 << label <<
"' in directory '" 2411 << dir <<
"' for a tag\n";
2415 char *endp =
nullptr;
2416 unsigned long val = strtoul(value.c_str(), &endp, 10);
2417 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2419 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '" 2420 << value <<
"' for monitor element '" 2421 << label <<
"' in directory '" 2422 << dir <<
"' - invalid value\n";
2427 else if (kind ==
"qr")
2432 size_t dot = label.find(
'.');
2433 if (dot == std::string::npos)
2435 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2436 <<
"' is missing a '.' and cannot be extracted\n";
2441 std::string qrname (label, dot+1, std::string::npos);
2447 qv.
code = atoi(m.matchString(value, 1).c_str());
2448 qv.
qtresult = strtod(m.matchString(value, 2).c_str(),
nullptr);
2449 qv.
message = m.matchString(value, 4);
2453 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2455 qv.
code = atoi(m.matchString(value, 1).c_str());
2457 qv.
message = m.matchString(value, 2);
2463 std::cout <<
"*** DQMStore: WARNING: quality test value '" 2464 << value <<
"' is incorrectly formatted\n";
2471 std::cout <<
"*** DQMStore: WARNING: no monitor element '" 2472 << mename <<
"' in directory '" 2473 << dir <<
"' for quality test '" 2483 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2484 << obj->GetName() <<
"' of type '" 2485 << obj->IsA()->GetName() <<
"'\n";
2489 else if (
auto *
n = dynamic_cast<TNamed *>(obj))
2493 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2494 s +=
'<'; s +=
n->GetName(); s +=
'>';
2496 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2497 TObjString os(s.c_str());
2502 std::cout <<
"*** DQMStore: WARNING: cannot extract object '" 2503 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2504 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2535 assert(! path.empty());
2539 size_t end = path.find(
'/', start);
2540 if (end == std::string::npos)
2548 TObject *
o = gDirectory->Get(part.c_str());
2549 if (o && ! dynamic_cast<TDirectory *>(o))
2550 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2551 " fails because the part '%s' already exists and is not" 2552 " directory", path.c_str(), part.c_str());
2554 gDirectory->mkdir(part.c_str());
2556 if (! gDirectory->cd(part.c_str()))
2557 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file" 2558 " fails because could not cd into subdirectory '%s'",
2559 path.c_str(), part.c_str());
2562 if (end+1 >= path.size())
2567 end = path.find(
'/', start);
2568 if (end == std::string::npos)
2582 TObjString(me.
tagString().c_str()).Write();
2613 MEMap::const_iterator
begin,
2614 MEMap::const_iterator
end,
2618 for (
auto const& me: boost::make_iterator_range(begin, end))
2625 <<
" run: " << me.run()
2626 <<
" lumi: " << me.lumi()
2627 <<
" lumiFlag: " << me.getLumiFlag()
2628 <<
" streamId: " << me.streamId()
2629 <<
" moduleId: " << me.moduleId()
2630 <<
" fullpathname: " << me.getFullname()
2631 <<
" flags: " << std::hex << me.data_.flags
2635 if (dir != *me.data_.dirname) {
2637 std::cout <<
"DQMStore::save: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2644 if (run != 0 and (me.data_.streamId != 0
or me.data_.moduleId != 0)) {
2646 std::cout <<
"DQMStore::save: skipping per-stream monitor element" << std::endl;
2673 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2674 status =
std::max(status, master->data_.qreports[
i].code);
2676 if (not master
or status < minStatus)
2679 std::cout <<
"DQMStore::save: skipping monitor element '" 2680 << me.data_.objname <<
"' while saving, status is " 2681 << status <<
", required minimum status is " 2682 << minStatus << std::endl;
2689 std::cout <<
"DQMStore::save: saving monitor element" << std::endl;
2706 const uint32_t
run ,
2707 const uint32_t
lumi ,
2717 class TFileNoSync :
public TFile
2720 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2721 Int_t SysSync(Int_t)
override {
return 0; }
2726 unsigned int nme = 0;
2730 std::cout <<
"DQMStore::save: Opening TFile '" << filename
2731 <<
"' with option '" << fileupdate <<
"'" 2735 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2737 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2741 std::unique_ptr<lat::Regexp> rxpat;
2742 if (not pattern.empty())
2743 rxpat = std::make_unique<lat::Regexp>(pattern);
2749 if (not path.empty())
2760 if (not path.empty()
2766 std::cout <<
"DQMStore::save: DQM folder " <<
dir <<
"/" << std::endl;
2770 gDirectory->cd(
"/");
2773 else if (rxpat.get())
2790 auto end =
data_.lower_bound(proto);
2798 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2809 std::cout <<
"DQMStore::save: successfully wrote " << nme
2810 <<
" objects from path '" << path <<
"/" 2811 <<
"' into DQM file '" << filename <<
"'\n";
2821 TBufferFile
buffer(TBufferFile::kWrite);
2824 buffer.WriteObject(&
object);
2826 buffer.WriteObject(me.
object_);
2848 MEMap::const_iterator
begin,
2849 MEMap::const_iterator
end,
2853 for (
auto const& me: boost::make_iterator_range(begin, end))
2860 <<
" run: " << me.run()
2861 <<
" lumi: " << me.lumi()
2862 <<
" lumiFlag: " << me.getLumiFlag()
2863 <<
" streamId: " << me.streamId()
2864 <<
" moduleId: " << me.moduleId()
2865 <<
" fullpathname: " << me.getFullname()
2866 <<
" flags: " << std::hex << me.data_.flags
2870 if (dir != *me.data_.dirname) {
2872 std::cout <<
"DQMStore::savePB: skipping monitor element in a subfolder of " << dir <<
"/" << std::endl;
2879 if (run != 0 and (me.data_.streamId != 0
or me.data_.moduleId != 0)) {
2881 std::cout <<
"DQMStore::savePB: skipping per-stream monitor element" << std::endl;
2890 std::cout <<
"DQMStore::savePB: saving monitor element" << std::endl;
2905 const uint32_t
run ,
2906 const uint32_t
lumi )
2908 using google::protobuf::io::FileOutputStream;
2909 using google::protobuf::io::GzipOutputStream;
2910 using google::protobuf::io::StringOutputStream;
2914 unsigned int nme = 0;
2917 std::cout <<
"DQMStore::savePB: Opening PBFile '" << filename <<
"'" 2927 if (not path.empty()
2932 std::cout <<
"DQMStore::savePB: DQM folder " <<
dir <<
"/" << std::endl;
2947 auto end =
data_.lower_bound(proto);
2955 if (enableMultiThread_ and
LSbasedMode_ and lumi != 0) {
2962 int filedescriptor =
::open(filename.c_str(),
2963 O_WRONLY | O_CREAT | O_TRUNC,
2967 FileOutputStream file_stream(filedescriptor);
2969 options.format = GzipOutputStream::GZIP;
2970 options.compression_level = 1;
2971 GzipOutputStream gzip_stream(&file_stream, options);
2972 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2975 gzip_stream.Close();
2976 file_stream.Close();
2977 ::close(filedescriptor);
2981 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2982 <<
" objects from path '" << path <<
"/" 2983 <<
"' into DQM file '" << filename <<
"'\n";
2998 unsigned int ntot = 0;
2999 unsigned int count = 0;
3001 if (! file->cd(curdir.c_str()))
3002 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while" 3003 " reading file '%s'", curdir.c_str(), file->GetName());
3026 size_t slash = dirpart.find(
'/');
3027 size_t pos = dirpart.find(
"/Run summary");
3028 if (slash != std::string::npos && pos !=std::string::npos)
3030 dirpart.erase(pos,12);
3032 pos = dirpart.find(
"Run ");
3033 size_t length = dirpart.find(
'/',pos+1)-pos+1;
3034 if (pos !=std::string::npos)
3035 dirpart.erase(pos,length);
3044 size_t slash = dirpart.find(
'/');
3046 if (slash == std::string::npos
3051 slash = dirpart.find(
'/');
3053 if (slash != std::string::npos
3054 && slash + 10 == dirpart.size()
3055 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
3057 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
3062 if (dirpart.empty())
3065 dirpart = prepend +
'/' + dirpart;
3067 else if (! prepend.empty())
3069 if (dirpart.empty())
3072 dirpart = prepend +
'/' + dirpart;
3080 TIter
next (gDirectory->GetListOfKeys());
3081 std::list<TObject *> delayed;
3082 while ((key = (TKey *)
next()))
3084 std::unique_ptr<TObject>
obj(key->ReadObj());
3085 if (dynamic_cast<TDirectory *>(
obj.get()))
3088 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
3090 if (! curdir.empty())
3092 subdir +=
obj->GetName();
3094 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
3098 else if (dynamic_cast<TObjString *>(
obj.get()))
3100 delayed.push_back(
obj.release());
3105 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
3106 <<
"' of type '" <<
obj->IsA()->GetName()
3107 <<
"' from '" << file->GetName()
3108 <<
"' into '" << dirpart <<
"'\n";
3116 while (! delayed.empty())
3119 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
3120 <<
"' of type '" << delayed.front()->IsA()->GetName()
3121 <<
"' from '" << file->GetName()
3122 <<
"' into '" << dirpart <<
"'\n";
3128 delete delayed.front();
3129 delayed.pop_front();
3133 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
3134 <<
" objects from directory '" << dirpart <<
"'\n";
3136 return ntot +
count;
3151 bool fileMustExist )
3153 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
3163 bool fileMustExist )
3165 bool overwrite =
true;
3169 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
3171 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
3173 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
3177 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3179 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3193 bool fileMustExist )
3197 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3199 std::unique_ptr<TFile>
f;
3203 f.reset(TFile::Open(filename.c_str()));
3204 if (! f.get() || f->IsZombie())
3205 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3214 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3219 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3222 auto mi =
data_.begin();
3223 auto me =
data_.end();
3224 for ( ; mi != me; ++mi)
3225 const_cast<MonitorElement &>(*mi).updateQReportStats();
3229 std::cout <<
"DQMStore::open: successfully read " << n
3230 <<
" objects from file '" << filename <<
"'";
3231 if (! onlypath.empty())
3232 std::cout <<
" from directory '" << onlypath <<
"'";
3233 if (! prepend.empty())
3234 std::cout <<
" into directory '" << prepend <<
"'";
3244 if (buf.Length() == buf.BufferSize())
3247 void *ptr = buf.ReadObjectAny(
nullptr);
3248 return reinterpret_cast<TObject *
>(ptr);
3257 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3258 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3260 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3261 TBufferFile buf(TBufferFile::kRead, h.
size(),
3277 bool fileMustExist )
3279 using google::protobuf::io::FileInputStream;
3280 using google::protobuf::io::FileOutputStream;
3281 using google::protobuf::io::GzipInputStream;
3282 using google::protobuf::io::GzipOutputStream;
3283 using google::protobuf::io::CodedInputStream;
3284 using google::protobuf::io::ArrayInputStream;
3287 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3290 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3292 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3295 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3300 FileInputStream
fin(filedescriptor);
3301 GzipInputStream
input(&fin);
3302 CodedInputStream input_coded(&input);
3303 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3304 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3305 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3308 ::close(filedescriptor);
3314 TObject *
obj =
nullptr;
3332 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3334 if (me ==
nullptr) {
3361 auto i =
data_.lower_bound(proto);
3365 auto de =
dirs_.end();
3366 auto di =
dirs_.lower_bound(*cleaned);
3377 auto i =
data_.lower_bound(proto);
3379 if (dir == *
i->data_.dirname)
3410 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent" 3411 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3424 return (
i ==
e ?
nullptr :
i->second);
3434 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3439 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown" 3440 " algorithm '%s'", algoname.c_str());
3460 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3462 " uses unacceptable characters", cleaned->c_str());
3474 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3484 auto mi =
data_.begin();
3485 auto me =
data_.end();
3488 for ( ; mi != me; ++mi)
3491 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3492 if (fm->match(path))
3509 std::cout <<
"DQMStore: running runQTests() with reset = " 3510 << (
reset_ ?
"true" :
"false" ) << std::endl;
3513 auto mi =
data_.begin();
3514 auto me =
data_.end();
3515 for ( ; mi != me; ++mi)
3533 auto mi =
data_.begin();
3534 auto me =
data_.end();
3535 for ( ; mi != me; ++mi)
3537 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3542 else if (mi->hasWarning())
3545 && mi->hasOtherReport())
3589 std::cout <<
" ------------------------------------------------------------\n" 3590 <<
" Directory structure: \n" 3591 <<
" ------------------------------------------------------------\n";
3593 std::copy(contents.begin(), contents.end(),
3594 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3596 std::cout <<
" ------------------------------------------------------------\n";
3633 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3636 factor = factor/(events*1.0);
3638 auto mi =
data_.begin();
3639 auto me =
data_.end();
3640 for ( ; mi != me; ++mi)
3647 me.getTH1F()->Scale(factor);
3652 me.getTH1S()->Scale(factor);
3657 me.getTH1D()->Scale(factor);
3662 me.getTH2F()->Scale(factor);
3667 me.getTH2S()->Scale(factor);
3672 me.getTH2D()->Scale(factor);
3677 me.getTH3F()->Scale(factor);
3682 me.getTProfile()->Scale(factor);
3687 me.getTProfile2D()->Scale(factor);
3692 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
TProfile * getTProfile() const
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Master< F > master(const F &f)
T getUntrackedParameter(std::string const &, T const &) const
DQMStore(const edm::ParameterSet &pset, edm::ActivityRegistry &)
static const lat::Regexp s_rxmeqr2("^st\\.(\\d+)\\.(.*)$")
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
bool containsAnyMonitorable(const std::string &path) const
::google::protobuf::uint32 size() const
int64_t getIntValue() const
bool isCollateME(MonitorElement *me) const
bool cdInto(const std::string &path) const
const ::std::string & full_pathname() const
int getStatus(const std::string &path="") const
const std::string & pwd() const
MonitorElement * initialise(Kind kind)
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
TProfile2D * getTProfile2D() const
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
bool match(std::string const &s) const
bool readFile(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
double getFloatValue() const
void setLumi(uint32_t ls)
MonitorElement * get(const std::string &path)
void postGlobalBeginLumi(const edm::GlobalContext &)
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
std::pair< fastmatch *, QCriterion * > QTestSpec
static const std::string s_safe
std::string qualityTagString(const DQMNet::QValue &qv) const
static void splitPath(std::string &dir, std::string &name, const std::string &path)
LuminosityBlockID const & luminosityBlockID() const
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
def replace(string, replacements)
static const uint32_t DQM_PROP_TAGGED
MatchingHeuristicEnum matching_
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
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)
void disableSoftReset()
reverts action of softReset
const ::std::string & streamed_histo() const
void initQCriterion(std::map< std::string, QCriterion *(*)(const std::string &)> &m)
static const std::string s_collateDirName
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)
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
void disableSoftReset(MonitorElement *me)
unsigned int maxNumberOfStreams() const
void saveMonitorElementRangeToROOT(std::string const &dir, std::string const &refpath, SaveReferenceTag ref, int minStatus, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, TFile &file, unsigned int &counter)
static const lat::Regexp s_rxmeval("^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$")
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
void saveMonitorElementToROOT(MonitorElement const &me, TFile &file)
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
static const uint32_t DQM_PROP_HAS_REFERENCE
void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi)
fastmatch(std::string _fastString)
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.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
MonitorElement * bookString_(const std::string &dir, const std::string &name, const std::string &value)
Book string.
void removeElement(const std::string &name)
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
std::string tagString() const
void tag(MonitorElement *, unsigned int)
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")
std::vector< std::shared_ptr< fireworks::OptionNode > > Options
void saveMonitorElementRangeToPB(std::string const &dir, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, dqmstorepb::ROOTFilePB &file, unsigned int &counter)
MonitorElement * bookInt_(const std::string &dir, const std::string &name)
Book int.
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
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)
TObject * extractNextObject(TBufferFile &) const
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void Reset()
reset ME (ie. contents, errors, etc)
std::vector< MonitorElement * > getContents(const std::string &path) const
std::string readSelectedDirectory_
std::vector< std::string > getSubdirs() const
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
const std::string getFullname() const
get full name of ME including Pathname
bool dirExists(const std::string &path) const
true if directory exists
void runQTests()
run all quality tests
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)
void saveMonitorElementToPB(MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
void tagAllContents(const std::string &path, unsigned int myTag)
void showDirStructure() const
void setCurrentFolder(const std::string &fullpath)
MonitorElement * initialise(MonitorElement *me, const std::string &path)
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
void cd()
go to top directory (ie. root)
bool containsAnyMonitorable(const std::string &path)
void tagContents(const std::string &, unsigned int)
std::string effLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
void set_size(::google::protobuf::uint32 value)
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
static const std::string s_referenceDirName
void print_trace(const std::string &dir, const std::string &name)
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
const std::string & pwd()
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)
std::string tagLabelString() const
return label string for the monitor element tag (eg. <name>t=12345</name>)
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
std::vector< std::string > getMEs() const
get list of (non-dir) MEs of current directory
static const lat::Regexp s_rxpbfile(".*\\.pb$")
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
void setCurrentFolder(const std::string &fullpath)
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
void removeContents()
erase all monitoring elements in current directory (not including subfolders);
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
bool forceResetOnBeginLumi_
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
::dqmstorepb::ROOTFilePB_Histo * add_histo()
static std::atomic< unsigned int > counter
bool readFilePB(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
void useQTest(const std::string &dir, const std::string &qtname)
std::vector< std::string > getSubdirs()
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
::google::protobuf::uint32 flags() const
static const int STATUS_OK
void setAccumulate(MonitorElement *me, bool flag)
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
void Reset(std::vector< TH2F > &depth)
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
void goUp()
equivalent to "cd .."
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0)
MonitorElement * bookFloat_(const std::string &dir, const std::string &name)
Book float.
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.
std::vector< std::string > getMEs()
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
std::set< std::string > dirs_
static const uint32_t DQM_PROP_LUMI
static std::string const source
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
static const lat::Regexp s_rxmeqr1("^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$")
void makeDirectory(const std::string &path)
Kind kind() const
Get the type of the monitor element.
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)
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
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
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,...)