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>
55 static const std::string s_safe =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# ";
57 static const lat::Regexp
s_rxmeval (
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$");
58 static const lat::Regexp
s_rxmeqr1 (
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$");
59 static const lat::Regexp
s_rxmeqr2 (
"^st\\.(\\d+)\\.(.*)$");
60 static const lat::Regexp
s_rxtrace (
"(.*)\\((.*)\\+0x.*\\).*");
61 static const lat::Regexp
s_rxpbfile (
".*\\.pb$");
70 || (path.size() >= ofdir.size()
71 && path.compare(0, ofdir.size(), ofdir) == 0
72 && (path.size() == ofdir.size()
73 || path[ofdir.size()] ==
'/')));
82 size_t len = path.size();
83 for ( ; len > 0 && path[len-1] ==
'/'; --len)
86 if (len != path.size())
88 clean = path.substr(0, len);
96 size_t slash = path.rfind(
'/');
97 if (slash != std::string::npos)
99 dir.append(path, 0, slash);
100 name.append(path, slash+1, std::string::npos);
109 path.reserve(dir.size() + name.size() + 2);
119 {
return new T(qtname); }
124 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
129 fastString_ (_fastString), matching_ (UseFull)
137 catch (lat::Error &
e)
140 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality"
145 size_t starCount = 0;
150 if ((
size_t)pos == std::string::npos)
156 if ((
fastString_.find(
'"') != std::string::npos) ||
169 if (boost::algorithm::starts_with(
fastString_,
"*"))
187 if (boost::algorithm::starts_with(
fastString_,
"*") &&
207 if (input.size() < pattern.size())
213 std::string::const_reverse_iterator rit_pattern = pattern.rbegin();
214 std::string::const_reverse_iterator rit_input = input.rbegin();
216 for (; rit_pattern < pattern.rend(); rit_pattern++, rit_input++)
218 if (*rit_pattern != *rit_input)
228 if (input.size() < pattern.size())
234 std::string::const_iterator rit_pattern = pattern.begin();
235 std::string::const_iterator rit_input = input.begin();
237 for (; rit_pattern < pattern.end(); rit_pattern++, rit_input++)
239 if (*rit_pattern != *rit_input)
274 owner_->setCurrentFolder(fullpath);
282 return owner_->pwd();
286 owner_->tag(me, tag);
290 owner_->tagContents(path, myTag);
294 std::vector<MonitorElement*>
298 return owner_->getAllContents(path, runNumber, lumi);
302 return owner_->get(path);
306 return owner_->getSubdirs();
310 return owner_->getMEs();
314 return owner_->containsAnyMonitorable(path);
318 return owner_->dirExists(path);
330 owner_->setCurrentFolder(fullpath);
346 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: "
348 <<
", stream: " << streamId
349 <<
" module: " << moduleId << std::endl;
356 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
357 std::set<MonitorElement>::const_iterator
e =
data_.end();
358 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
360 if (i->data_.run != run
361 || i->data_.streamId != streamId
362 || i->data_.moduleId != moduleId)
379 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
380 if (me !=
data_.end()) {
382 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
387 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
389 list.Add(i->getTH1());
390 if( -1 == me->getTH1()->Merge(&list)) {
391 std::cout <<
"mergeAndResetMEsRunSummaryCache: Failed to merge DQM element "<<me->getFullname();
395 me->getTH1()->Add(i->getTH1());
399 std::cout <<
"No global Object found. " << std::endl;
400 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
418 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
419 << run <<
" lumi: " << lumi
420 <<
", stream: " << streamId
421 <<
" module: " << moduleId << std::endl;
423 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
424 std::set<MonitorElement>::const_iterator
e =
data_.end();
425 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
428 if (i->data_.run != run
429 || i->data_.streamId != streamId
430 || i->data_.moduleId != moduleId)
445 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
446 if (me !=
data_.end()) {
448 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
453 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
455 list.Add(i->getTH1());
456 if( -1 == me->getTH1()->Merge(&list)) {
457 std::cout <<
"mergeAndResetMEsLuminositySummaryCache: Failed to merge DQM element "<<me->getFullname();
461 me->getTH1()->Add(i->getTH1());
465 std::cout <<
"No global Object found. " << std::endl;
466 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
471 actual_global_me.
setLumi(lumi);
522 collateHistograms_ (
false),
523 enableMultiThread_(
false),
524 readSelectedDirectory_ (
""),
569 std::cout <<
"DQMStore: histogram collation is enabled\n";
573 std::cout <<
"DQMStore: MultiThread option is enabled\n";
577 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
582 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
586 initQCriterion<Comp2RefChi2>(
qalgos_);
587 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
588 initQCriterion<ContentsXRange>(
qalgos_);
589 initQCriterion<ContentsYRange>(
qalgos_);
590 initQCriterion<MeanWithinExpected>(
qalgos_);
591 initQCriterion<Comp2RefEqualH>(
qalgos_);
592 initQCriterion<DeadChannel>(
qalgos_);
593 initQCriterion<NoisyChannel>(
qalgos_);
594 initQCriterion<ContentsWithinExpected>(
qalgos_);
595 initQCriterion<CompareToMedian>(
qalgos_);
596 initQCriterion<CompareLastFilledBin>(
qalgos_);
597 initQCriterion<CheckVariance>(
qalgos_);
601 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
620 stream_ =
new std::ofstream(
"histogramBookingBT.log");
629 size = backtrace (array, 10);
630 strings = backtrace_symbols (array, size);
635 char *
demangled = abi::__cxa_demangle(m.matchString(strings[4], 2).c_str(), 0, 0, &
r);
638 << (r ? m.matchString(strings[4], 2) :
demangled) <<
" "
639 << m.matchString(strings[4], 1) <<
"\n";
643 *
stream_ <<
"Skipping "<< dir <<
"/" << name
644 <<
" with stack size " << size <<
"\n";
652 for (i = 0; i <
size; i++)
653 if (
s_rxtrace.match(strings[i], 0, 0, &m))
655 char *
demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
656 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" "
657 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" "
658 << m.matchString(strings[i], 1) << std::endl;
695 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
719 size_t pos =
pwd_.rfind(
'/');
720 if (pos == std::string::npos)
735 prev.reserve(path.size());
736 subdir.reserve(path.size());
737 name.reserve(path.size());
745 subdir.append(path, 0, slash);
747 name.append(subdir, prevname, std::string::npos);
749 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
750 " which already exists as a monitor element",
753 if (!
dirs_.count(subdir))
754 dirs_.insert(subdir);
757 if (slash+1 >= path.size())
762 prevname = slash ? slash+1 :
slash;
764 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
772 {
return dirs_.count(path) > 0; }
777 template <
class HISTO,
class COLLATE>
780 const char *context,
int kind,
781 HISTO *
h, COLLATE collate)
783 assert(name.find(
'/') == std::string::npos);
806 << context <<
": monitor element '"
807 << path <<
"' already exists, collating" << std::endl;
825 for ( ; qi != qe; ++qi)
827 if ( qi->first->match(path) )
828 me->addQReport(qi->second);
852 assert(name.find(
'/') == std::string::npos);
865 << context <<
": monitor element '"
866 << path <<
"' already exists, resetting" << std::endl;
894 return book(dir, name,
"bookInt")
924 return book(dir, name,
"bookFloat")
953 return book(dir, name,
"bookString")
994 int nchX,
double lowX,
double highX)
996 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1002 int nchX,
double lowX,
double highX)
1004 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
1010 int nchX,
double lowX,
double highX)
1012 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1018 int nchX,
double lowX,
double highX)
1020 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1026 int nchX,
double lowX,
double highX)
1028 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1034 int nchX,
double lowX,
double highX)
1036 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1042 int nchX,
const float *xbinsize)
1044 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1050 int nchX,
const float *xbinsize)
1052 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1059 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1066 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1073 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1080 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1087 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1094 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1122 int nchX,
double lowX,
double highX,
1123 int nchY,
double lowY,
double highY)
1125 return book2D(
pwd_, name,
new TH2F(name, title,
1127 nchY, lowY, highY));
1133 int nchX,
double lowX,
double highX,
1134 int nchY,
double lowY,
double highY)
1136 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1138 nchY, lowY, highY));
1144 int nchX,
double lowX,
double highX,
1145 int nchY,
double lowY,
double highY)
1147 return book2S(
pwd_, name,
new TH2S(name, title,
1149 nchY, lowY, highY));
1155 int nchX,
double lowX,
double highX,
1156 int nchY,
double lowY,
double highY)
1158 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1160 nchY, lowY, highY));
1166 int nchX,
double lowX,
double highX,
1167 int nchY,
double lowY,
double highY)
1171 nchY, lowY, highY));
1177 int nchX,
double lowX,
double highX,
1178 int nchY,
double lowY,
double highY)
1180 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1182 nchY, lowY, highY));
1188 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1190 return book2D(
pwd_, name,
new TH2F(name, title,
1191 nchX, xbinsize, nchY, ybinsize));
1197 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1199 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1200 nchX, xbinsize, nchY, ybinsize));
1207 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1214 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1221 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1228 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1235 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1242 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1256 int nchX,
double lowX,
double highX,
1257 int nchY,
double lowY,
double highY,
1258 int nchZ,
double lowZ,
double highZ)
1260 return book3D(
pwd_, name,
new TH3F(name, title,
1263 nchZ, lowZ, highZ));
1269 int nchX,
double lowX,
double highX,
1270 int nchY,
double lowY,
double highY,
1271 int nchZ,
double lowZ,
double highZ)
1273 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1276 nchZ, lowZ, highZ));
1283 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1290 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1298 return book(dir, name,
"bookProfile",
1308 int nchX,
double lowX,
double highX,
1309 int ,
double lowY,
double highY,
1310 const char *option )
1323 int nchX,
double lowX,
double highX,
1324 int ,
double lowY,
double highY,
1325 const char *option )
1327 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1338 int nchX,
double lowX,
double highX,
1339 double lowY,
double highY,
1340 const char *option )
1353 int nchX,
double lowX,
double highX,
1354 double lowY,
double highY,
1355 const char *option )
1357 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1368 int nchX,
const double *xbinsize,
1369 int ,
double lowY,
double highY,
1370 const char *option )
1383 int nchX,
const double *xbinsize,
1384 int ,
double lowY,
double highY,
1385 const char *option )
1387 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1398 int nchX,
const double *xbinsize,
1399 double lowY,
double highY,
1400 const char *option )
1413 int nchX,
const double *xbinsize,
1414 double lowY,
double highY,
1415 const char *option )
1417 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1427 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1434 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1442 return book(dir, name,
"bookProfile2D",
1452 int nchX,
double lowX,
double highX,
1453 int nchY,
double lowY,
double highY,
1454 int ,
double lowZ,
double highZ,
1455 const char *option )
1469 int nchX,
double lowX,
double highX,
1470 int nchY,
double lowY,
double highY,
1471 int ,
double lowZ,
double highZ,
1472 const char *option )
1486 int nchX,
double lowX,
double highX,
1487 int nchY,
double lowY,
double highY,
1488 double lowZ,
double highZ,
1489 const char *option )
1503 int nchX,
double lowX,
double highX,
1504 int nchY,
double lowY,
double highY,
1505 double lowZ,
double highZ,
1506 const char *option )
1519 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1526 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1535 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1536 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1537 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1538 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1539 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1540 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1541 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1542 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1543 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1550 <<
"checkBinningMatches: different binning - cannot add object '"
1551 << h->GetName() <<
"' of type "
1552 << h->IsA()->GetName() <<
" to existing ME: '"
1636 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1639 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1640 " twice with multiple tags", me->
getFullname().c_str());
1657 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1658 " '%s' with tag %u", path.c_str(), myTag);
1667 MEMap::iterator
e =
data_.end();
1668 MEMap::iterator
i =
data_.lower_bound(proto);
1669 for ( ; i != e && path == *i->data_.dirname; ++
i)
1670 tag(const_cast<MonitorElement *>(&*i), myTag);
1684 MEMap::iterator
e =
data_.end();
1685 MEMap::iterator
i =
data_.lower_bound(proto);
1688 tag(const_cast<MonitorElement *>(&*i), myTag);
1697 std::vector<std::string>
1700 std::vector<std::string>
result;
1701 std::set<std::string>::const_iterator
e =
dirs_.end();
1702 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1713 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1714 result.push_back(*i);
1720 std::vector<std::string>
1724 std::vector<std::string>
result;
1725 MEMap::const_iterator
e =
data_.end();
1726 MEMap::const_iterator
i =
data_.lower_bound(proto);
1728 if (
pwd_ == *i->data_.dirname)
1729 result.push_back(i->getName());
1740 MEMap::const_iterator
e =
data_.end();
1741 MEMap::const_iterator
i =
data_.lower_bound(proto);
1753 MEMap::const_iterator mepos =
data_.find(proto);
1754 return (mepos ==
data_.end() ? 0
1759 std::vector<MonitorElement *>
1763 std::vector<MonitorElement *>
result;
1764 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1768 result.push_back(const_cast<MonitorElement *>(&me));
1775 std::vector<MonitorElement *>
1783 std::vector<MonitorElement *>
result;
1784 MEMap::const_iterator
e =
data_.end();
1785 MEMap::const_iterator
i =
data_.lower_bound(proto);
1787 if (*cleaned == *i->data_.dirname)
1788 result.push_back(const_cast<MonitorElement *>(&*i));
1794 std::vector<MonitorElement *>
1802 std::vector<MonitorElement *>
result;
1803 MEMap::const_iterator
e =
data_.end();
1804 MEMap::const_iterator
i =
data_.lower_bound(proto);
1806 if (*cleaned == *i->data_.dirname
1808 && i->data_.tag ==
tag)
1809 result.push_back(const_cast<MonitorElement *>(&*i));
1822 into.reserve(
dirs_.size());
1824 MEMap::const_iterator me =
data_.end();
1825 std::set<std::string>::const_iterator di =
dirs_.begin();
1826 std::set<std::string>::const_iterator de =
dirs_.end();
1827 for ( ; di != de; ++di)
1830 MEMap::const_iterator mi =
data_.lower_bound(proto);
1831 MEMap::const_iterator
m = mi;
1832 size_t sz = di->size() + 2;
1835 if (*di == *m->data_.dirname)
1837 sz += m->data_.objname.size() + 1;
1844 std::vector<std::string>::iterator istr
1853 for (sz = 0; mi !=
m; ++mi)
1855 if (*di != *mi->data_.dirname)
1861 *istr += mi->data_.objname;
1867 istr->reserve(di->size() + 2);
1879 const uint32_t
run ,
1880 const uint32_t
lumi ,
1881 const uint32_t streamId ,
1882 const uint32_t moduleId )
const
1884 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1885 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1886 " unacceptable characters", dir.c_str());
1887 if (name.find_first_not_of(
s_safe) != std::string::npos)
1888 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1889 " unacceptable characters", name.c_str());
1899 MEMap::const_iterator mepos =
data_.find(proto);
1900 return (mepos ==
data_.end() ? 0
1910 into.reserve(
dirs_.size());
1912 MEMap::const_iterator me =
data_.end();
1913 std::set<std::string>::const_iterator di =
dirs_.begin();
1914 std::set<std::string>::const_iterator de =
dirs_.end();
1917 for ( ; di != de; ++di)
1920 MEMap::const_iterator mi =
data_.lower_bound(proto);
1921 MEMap::const_iterator
m = mi;
1922 size_t sz = di->size() + 2;
1928 sz += 1 + m->data_.objname.size() + 11;
1935 std::vector<std::string>::iterator istr
1942 for (sz = 0; mi !=
m; ++mi)
1946 sprintf(tagbuf,
"/%u", mi->data_.tag);
1949 *istr += m->data_.objname;
1959 std::vector<MonitorElement*>
1962 uint32_t
lumi )
const
1970 std::vector<MonitorElement *>
result;
1971 MEMap::const_iterator
e =
data_.end();
1972 MEMap::const_iterator
i =
data_.lower_bound(proto);
1974 if (runNumber != 0) {
1975 if (i->data_.run > runNumber
1976 || i->data_.streamId != 0
1977 || i->data_.moduleId != 0)
1981 if (i->data_.lumi > lumi
1982 || i->data_.streamId != 0
1983 || i->data_.moduleId != 0)
1986 if (runNumber != 0
or lumi !=0) {
1987 assert(i->data_.streamId == 0);
1988 assert(i->data_.moduleId == 0);
1990 result.push_back(const_cast<MonitorElement *>(&*i));
1998 if (i->data_.run != 0 || i->data_.streamId != 0 || i->data_.moduleId != 0)
break;
1999 result.push_back(const_cast<MonitorElement *>(&*i));
2008 std::vector<MonitorElement*>
2014 rx = lat::Regexp(pattern, 0, syntaxType);
2017 catch (lat::Error &
e)
2019 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
2020 pattern.c_str(), e.explain().c_str());
2024 std::vector<MonitorElement *>
result;
2025 MEMap::const_iterator
i =
data_.begin();
2026 MEMap::const_iterator e =
data_.end();
2027 for ( ; i !=
e; ++
i)
2030 mergePath(path, *i->data_.dirname, i->data_.objname);
2032 result.push_back(const_cast<MonitorElement *>(&*i));
2047 MEMap::iterator mi =
data_.begin();
2048 MEMap::iterator me =
data_.end();
2049 for ( ; mi != me; ++mi)
2052 if (mi->wasUpdated())
2071 MEMap::iterator mi =
data_.begin();
2072 MEMap::iterator me =
data_.end();
2073 for ( ; mi != me; ++mi)
2104 std::set<MonitorElement>::const_iterator
e =
data_.end();
2105 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2108 if (i->data_.streamId != 0 ||
2109 i->data_.moduleId != 0)
2111 if (i->data_.lumi != lumi)
2113 if (i->data_.run != run)
2120 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2121 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2122 <<
"flags " << i->data_.flags <<
"\n";
2140 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2144 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2151 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2162 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2166 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2173 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2177 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2184 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2188 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2195 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2199 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2206 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2210 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2217 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2221 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2228 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2232 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2239 else if (dynamic_cast<TObjString *>(obj))
2242 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2244 if (strstr(obj->GetName(),
"CMSSW"))
2247 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2250 else if (strstr(obj->GetName(),
"DQMPATCH"))
2253 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2258 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2259 << obj->GetName() <<
"' of type '"
2260 << obj->IsA()->GetName() <<
"'\n";
2272 if (! me || overwrite)
2274 if (! me) me =
bookInt(dir, label);
2275 me->
Fill(atoll(value.c_str()));
2278 else if (kind ==
"f")
2281 if (! me || overwrite)
2284 me->
Fill(atof(value.c_str()));
2287 else if (kind ==
"s")
2295 else if (kind ==
"e")
2300 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2301 << label <<
"' in directory '"
2302 << dir <<
"' to be marked as efficiency plot.\n";
2307 else if (kind ==
"t")
2312 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2313 << label <<
"' in directory '"
2314 << dir <<
"' for a tag\n";
2319 unsigned long val = strtoul(value.c_str(), &endp, 10);
2320 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2322 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2323 << value <<
"' for monitor element '"
2324 << label <<
"' in directory '"
2325 << dir <<
"' - invalid value\n";
2330 else if (kind ==
"qr")
2335 size_t dot = label.find(
'.');
2336 if (dot == std::string::npos)
2338 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2339 <<
"' is missing a '.' and cannot be extracted\n";
2344 std::string qrname (label, dot+1, std::string::npos);
2350 qv.
code = atoi(m.matchString(value, 1).c_str());
2351 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2352 qv.
message = m.matchString(value, 4);
2356 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2358 qv.
code = atoi(m.matchString(value, 1).c_str());
2360 qv.
message = m.matchString(value, 2);
2366 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2367 << value <<
"' is incorrectly formatted\n";
2374 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2375 << mename <<
"' in directory '"
2376 << dir <<
"' for quality test '"
2386 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2387 << obj->GetName() <<
"' of type '"
2388 << obj->IsA()->GetName() <<
"'\n";
2392 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2396 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2397 s +=
'<'; s +=
n->GetName(); s +=
'>';
2399 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2400 TObjString os(s.c_str());
2405 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2406 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2407 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2437 size_t end = path.find(
'/', start);
2438 if (end == std::string::npos)
2446 TObject *
o = gDirectory->Get(part.c_str());
2447 if (o && ! dynamic_cast<TDirectory *>(o))
2448 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2449 " fails because the part '%s' already exists and is not"
2450 " directory", path.c_str(), part.c_str());
2452 gDirectory->mkdir(part.c_str());
2454 if (! gDirectory->cd(part.c_str()))
2455 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2456 " fails because could not cd into subdirectory '%s'",
2457 path.c_str(), part.c_str());
2460 if (end+1 >= path.size())
2465 end = path.find(
'/', start);
2466 if (end == std::string::npos)
2475 const uint32_t
run ,
2476 const uint32_t
lumi ,
2477 const bool resetMEsAfterWriting )
2479 using google::protobuf::io::FileOutputStream;
2480 using google::protobuf::io::GzipOutputStream;
2481 using google::protobuf::io::StringOutputStream;
2485 std::set<std::string>::iterator di, de;
2486 MEMap::iterator mi, me =
data_.end();
2491 std::cout <<
"\n DQMStore: Opening PBFile '"
2492 << filename <<
"'"<< std::endl;
2495 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2508 mi =
data_.lower_bound(proto);
2509 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2513 <<
" Lumi: " << (*mi).lumi()
2514 <<
" LumiFlag: " << (*mi).getLumiFlag()
2515 <<
" streamId: " << (*mi).streamId()
2516 <<
" moduleId: " << (*mi).moduleId()
2517 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2524 if (*di != *mi->data_.dirname)
2533 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2537 std::cout <<
"DQMStore::savePB: saving monitor element '"
2538 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2539 <<
"flags " << mi->data_.flags <<
"\n";
2546 TObject *toWrite =
nullptr;
2550 toWrite =
new TObjString(mi->tagString().c_str());
2551 deleteObject =
true;
2553 toWrite = mi->object_;
2556 TBufferFile buffer(TBufferFile::kWrite);
2557 buffer.WriteObject(toWrite);
2567 if (resetMEsAfterWriting)
2572 int filedescriptor =
::open(filename.c_str(),
2573 O_WRONLY | O_CREAT | O_TRUNC,
2577 FileOutputStream file_stream(filedescriptor);
2579 options.format = GzipOutputStream::GZIP;
2580 options.compression_level = 6;
2581 GzipOutputStream gzip_stream(&file_stream,
2583 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2586 gzip_stream.Close();
2587 file_stream.Close();
2588 ::close(filedescriptor);
2592 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2593 <<
" objects from path '" << path
2594 <<
"' into DQM file '" << filename <<
"'\n";
2607 const uint32_t
run ,
2608 const uint32_t
lumi ,
2612 const bool resetMEsAfterWriting )
2616 std::set<std::string>::iterator di, de;
2617 MEMap::iterator mi, me =
data_.end();
2618 DQMNet::QReports::const_iterator qi, qe;
2626 class TFileNoSync :
public TFile
2629 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2630 virtual Int_t SysSync(Int_t)
override {
return 0; }
2635 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2636 <<
"' with option '" << fileupdate <<
"'\n";
2638 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2640 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2644 std::auto_ptr<lat::Regexp> rxpat;
2645 if (! pattern.empty())
2646 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2659 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2673 mi =
data_.lower_bound(proto);
2674 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2677 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2678 <<
" Lumi: " << (*mi).lumi()
2679 <<
" LumiFlag: " << (*mi).getLumiFlag()
2680 <<
" streamId: " << (*mi).streamId()
2681 <<
" moduleId: " << (*mi).moduleId()
2682 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2689 if (*di != *mi->data_.dirname) {
2691 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2701 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2727 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2728 status =
std::max(status, master->data_.qreports[
i].code);
2730 if (! master || status < minStatus)
2733 std::cout <<
"DQMStore::save: skipping monitor element '"
2734 << mi->data_.objname <<
"' while saving, status is "
2735 << status <<
", required minimum status is "
2736 << minStatus << std::endl;
2743 std::cout <<
"DQMStore::save: saving monitor element '"
2744 << mi->data_.objname <<
"'\n";
2748 gDirectory->cd(
"/");
2751 else if (rxpat.get())
2762 TObjString(mi->tagString().c_str()).Write();
2766 mi->object_->Write();
2773 qi = mi->data_.qreports.begin();
2774 qe = mi->data_.qreports.end();
2775 for ( ; qi != qe; ++qi)
2776 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2781 TObjString(mi->effLabelString().c_str()).Write();
2785 TObjString(mi->tagLabelString().c_str()).Write();
2788 if (resetMEsAfterWriting)
2797 std::cout <<
"DQMStore::save: successfully wrote " << nme
2798 <<
" objects from path '" << path
2799 <<
"' into DQM file '" << filename <<
"'\n";
2812 unsigned int ntot = 0;
2813 unsigned int count = 0;
2815 if (! file->cd(curdir.c_str()))
2816 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2817 " reading file '%s'", curdir.c_str(), file->GetName());
2840 size_t slash = dirpart.find(
'/');
2841 size_t pos = dirpart.find(
"/Run summary");
2842 if (slash != std::string::npos && pos !=std::string::npos)
2844 dirpart.erase(pos,12);
2846 pos = dirpart.find(
"Run ");
2847 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2848 if (pos !=std::string::npos)
2849 dirpart.erase(pos,length);
2858 size_t slash = dirpart.find(
'/');
2860 if (slash == std::string::npos
2865 slash = dirpart.find(
'/');
2867 if (slash != std::string::npos
2868 && slash + 10 == dirpart.size()
2869 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2871 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2876 if (dirpart.empty())
2879 dirpart = prepend +
'/' + dirpart;
2881 else if (! prepend.empty())
2883 if (dirpart.empty())
2886 dirpart = prepend +
'/' + dirpart;
2894 TIter
next (gDirectory->GetListOfKeys());
2895 std::list<TObject *> delayed;
2896 while ((key = (TKey *)
next()))
2898 std::auto_ptr<TObject>
obj(key->ReadObj());
2899 if (dynamic_cast<TDirectory *>(
obj.get()))
2902 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2904 if (! curdir.empty())
2906 subdir +=
obj->GetName();
2908 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2912 else if (dynamic_cast<TObjString *>(
obj.get()))
2914 delayed.push_back(
obj.release());
2919 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2920 <<
"' of type '" <<
obj->IsA()->GetName()
2921 <<
"' from '" << file->GetName()
2922 <<
"' into '" << dirpart <<
"'\n";
2930 while (! delayed.empty())
2933 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2934 <<
"' of type '" << delayed.front()->IsA()->GetName()
2935 <<
"' from '" << file->GetName()
2936 <<
"' into '" << dirpart <<
"'\n";
2942 delete delayed.front();
2943 delayed.pop_front();
2947 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2948 <<
" objects from directory '" << dirpart <<
"'\n";
2950 return ntot +
count;
2965 bool fileMustExist )
2967 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2977 bool fileMustExist )
2979 bool overwrite =
true;
2983 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2985 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2987 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2991 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2993 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3007 bool fileMustExist )
3011 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3013 std::auto_ptr<TFile>
f;
3017 f.reset(TFile::Open(filename.c_str()));
3018 if (! f.get() || f->IsZombie())
3019 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3028 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3033 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3036 MEMap::iterator mi =
data_.begin();
3037 MEMap::iterator me =
data_.end();
3038 for ( ; mi != me; ++mi)
3039 const_cast<MonitorElement &>(*mi).updateQReportStats();
3043 std::cout <<
"DQMStore::open: successfully read " << n
3044 <<
" objects from file '" << filename <<
"'";
3045 if (! onlypath.empty())
3046 std::cout <<
" from directory '" << onlypath <<
"'";
3047 if (! prepend.empty())
3048 std::cout <<
" into directory '" << prepend <<
"'";
3058 if (buf.Length() == buf.BufferSize())
3061 void *ptr = buf.ReadObjectAny(0);
3062 return reinterpret_cast<TObject *
>(ptr);
3071 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3072 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3074 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3075 TBufferFile buf(TBufferFile::kRead, h.
size(),
3091 bool fileMustExist )
3093 using google::protobuf::io::FileInputStream;
3094 using google::protobuf::io::FileOutputStream;
3095 using google::protobuf::io::GzipInputStream;
3096 using google::protobuf::io::GzipOutputStream;
3097 using google::protobuf::io::CodedInputStream;
3098 using google::protobuf::io::ArrayInputStream;
3101 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3104 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3106 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3109 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3114 FileInputStream
fin(filedescriptor);
3115 GzipInputStream
input(&fin);
3116 CodedInputStream input_coded(&input);
3117 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3118 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3119 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3122 ::close(filedescriptor);
3146 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3148 if (me ==
nullptr) {
3174 MEMap::iterator
e =
data_.end();
3175 MEMap::iterator
i =
data_.lower_bound(proto);
3179 std::set<std::string>::iterator de =
dirs_.end();
3180 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3190 MEMap::iterator
e =
data_.end();
3191 MEMap::iterator
i =
data_.lower_bound(proto);
3193 if (dir == *i->data_.dirname)
3220 MEMap::iterator pos =
data_.find(proto);
3221 if (pos !=
data_.end())
3224 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3225 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3236 QCMap::const_iterator
i =
qtests_.find(qtname);
3237 QCMap::const_iterator
e =
qtests_.end();
3238 return (i == e ? 0 : i->second);
3248 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3251 QAMap::iterator
i =
qalgos_.find(algoname);
3253 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3254 " algorithm '%s'", algoname.c_str());
3274 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3276 " uses unacceptable characters", cleaned->c_str());
3288 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3298 MEMap::iterator mi =
data_.begin();
3299 MEMap::iterator me =
data_.end();
3302 for ( ; mi != me; ++mi)
3305 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3306 if (fm->match(path))
3323 std::cout <<
"DQMStore: running runQTests() with reset = "
3324 << (
reset_ ?
"true" :
"false" ) << std::endl;
3327 MEMap::iterator mi =
data_.begin();
3328 MEMap::iterator me =
data_.end();
3329 for ( ; mi != me; ++mi)
3347 MEMap::const_iterator mi =
data_.begin();
3348 MEMap::const_iterator me =
data_.end();
3349 for ( ; mi != me; ++mi)
3351 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3356 else if (mi->hasWarning())
3359 && mi->hasOtherReport())
3403 std::cout <<
" ------------------------------------------------------------\n"
3404 <<
" Directory structure: \n"
3405 <<
" ------------------------------------------------------------\n";
3407 std::copy(contents.begin(), contents.end(),
3408 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3410 std::cout <<
" ------------------------------------------------------------\n";
3447 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3450 factor = factor/(events*1.0);
3452 MEMap::iterator mi =
data_.begin();
3453 MEMap::iterator me =
data_.end();
3454 for ( ; mi != me; ++mi)
3506 std::cout <<
" The DQM object '" << me.
getFullname() <<
"' is not scalable object " << std::endl;
QCriterion * getQCriterion(const std::string &qtname) const
bool compare_strings_reverse(std::string const &pattern, std::string const &input) const
std::pair< fastmatch *, QCriterion * > QTestSpec
TH2S * getTH2S(void) const
TH1S * getTH1S(void) const
T getUntrackedParameter(std::string const &, T const &) const
DQMStore(const edm::ParameterSet &pset, edm::ActivityRegistry &)
static const lat::Regexp s_rxmeqr2("^st\\.(\\d+)\\.(.*)$")
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
bool containsAnyMonitorable(const std::string &path) const
inline::google::protobuf::uint32 size() const
bool isCollateME(MonitorElement *me) const
void resetUpdate(void)
reset "was updated" flag
tuple start
Check for commandline option errors.
bool cdInto(const std::string &path) const
const ::std::string & full_pathname() const
int getStatus(const std::string &path="") const
MonitorElement * initialise(Kind kind)
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
std::vector< std::string > getSubdirs(void) const
TProfile2D * getTProfile2D(void) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void rmdir(const std::string &fullpath)
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
bool match(std::string const &s) const
bool readFile(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
void setLumi(uint32_t ls)
void cd(void)
go to top directory (ie. root)
MonitorElement * get(const std::string &path)
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
static const std::string s_safe
static void splitPath(std::string &dir, std::string &name, const std::string &path)
const std::string & pwd(void)
void disableSoftReset(void)
reverts action of softReset
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
std::vector< MonitorElement * > getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
TH3F * getTH3F(void) const
static const uint32_t DQM_PROP_TAGGED
TH1D * getTH1D(void) const
MatchingHeuristicEnum matching_
void runQTests(void)
run all quality tests
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
TH2D * getTH2D(void) const
const std::string * dirname
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void initializeFrom(const edm::ParameterSet &)
void set_flags(::google::protobuf::uint32 value)
const ::std::string & streamed_histo() const
void initQCriterion(std::map< std::string, QCriterion *(*)(const std::string &)> &m)
static const std::string s_collateDirName
MonitorElement * book(const std::string &dir, const std::string &name, const char *context)
static const std::string s_monitorDirName
name of global monitoring folder (containing all sources subdirectories)
MonitorElement * bookFloat(const char *name)
Book float.
static std::string const input
static const lat::Regexp s_rxtrace("(.*)\\((.*)\\+0x.*\\).*")
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Preallocate preallocateSignal_
signal is emitted before beginJob
void tag(MonitorElement *me, unsigned int myTag)
void disableSoftReset(MonitorElement *me)
unsigned int maxNumberOfStreams() const
static const lat::Regexp s_rxmeval("^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$")
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
fastmatch(std::string const &_fastString)
static const uint32_t DQM_PROP_HAS_REFERENCE
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi)
void get_info(const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
MonitorElement * bookString(const char *name, const char *value)
Book string.
bool isCollate(void) const
void removeElement(const std::string &name)
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
double getFloatValue(void) const
void tag(MonitorElement *, unsigned int)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
QCriterion * makeQCriterion(const std::string &qtname)
void setVerbose(unsigned level)
void softReset(MonitorElement *me)
Kind kind(void) const
Get the type of the monitor element.
TObject * extractNextObject(TBufferFile &) const
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
const std::string getFullname(void) const
get full name of ME including Pathname
std::vector< MonitorElement * > getContents(const std::string &path) const
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::string readSelectedDirectory_
std::vector< std::string > getMEs(void)
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
bool dirExists(const std::string &path) const
true if directory exists
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0, const bool resetMEsAfterWriting=false)
void getAllTags(std::vector< std::string > &into) const
bool dirExists(const std::string &path)
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
void tagAllContents(const std::string &path, unsigned int myTag)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * initialise(MonitorElement *me, const std::string &path)
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
bool containsAnyMonitorable(const std::string &path)
void tagContents(const std::string &, unsigned int)
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
void set_size(::google::protobuf::uint32 value)
int64_t getIntValue(void) const
static const std::string s_referenceDirName
void print_trace(const std::string &dir, const std::string &name)
int useQTestByMatch(const std::string &pattern, const std::string &qtname)
attach quality test <qc> to monitor elements matching <pattern>.
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0)
TH1F * getTH1F(void) const
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
static const lat::Regexp s_rxpbfile(".*\\.pb$")
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
bool resetMe(void) const
true if ME should be reset at end of monitoring cycle
void set_full_pathname(const ::std::string &value)
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
void setVerbose(int verbose)
probability limits for warnings, errors
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
bool forceResetOnBeginLumi_
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::vector< boost::shared_ptr< fireworks::OptionNode > > Options
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
inline::dqmstorepb::ROOTFilePB_Histo * add_histo()
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
bool readFilePB(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
TProfile * getTProfile(void) const
void useQTest(const std::string &dir, const std::string &qtname)
void goUp(void)
equivalent to "cd .."
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
inline::google::protobuf::uint32 flags() const
static const int STATUS_OK
void setAccumulate(MonitorElement *me, bool flag)
void setEfficiencyFlag(void)
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
void Reset(std::vector< TH2F > &depth)
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
volatile std::atomic< bool > shutdown_flag false
void showDirStructure(void) const
bool deleteObject(T *fObject, const std::string &fInput, const std::string &fInputTag, HcalDbTool::IOVRun fInputRun, bool fVerbose)
TH2F * getTH2F(void) const
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
for(const auto &isodef:isoDefs)
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
std::set< std::string > dirs_
void Reset(void)
reset ME (ie. contents, errors, etc)
static const uint32_t DQM_PROP_LUMI
static std::string const source
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
tuple size
Write out results.
static const lat::Regexp s_rxmeqr1("^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$")
void makeDirectory(const std::string &path)
bool compare_strings(std::string const &pattern, std::string const &input) const
void setCurrentFolder(const std::string &fullpath)
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
const std::string & pwd(void) const
void set_streamed_histo(const ::std::string &value)
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
void raiseDQMError(const char *context, const char *fmt,...)