8 #include "classlib/utils/RegexpMatch.h"
9 #include "classlib/utils/Regexp.h"
10 #include "classlib/utils/StringOps.h"
11 #include <google/protobuf/io/coded_stream.h>
12 #include <google/protobuf/io/gzip_stream.h>
13 #include <google/protobuf/io/zero_copy_stream_impl.h>
19 #include "TBufferFile.h"
22 #include <boost/algorithm/string.hpp>
56 static const std::string s_safe =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# ";
58 static const lat::Regexp
s_rxmeval (
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$");
59 static const lat::Regexp
s_rxmeqr1 (
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$");
60 static const lat::Regexp
s_rxmeqr2 (
"^st\\.(\\d+)\\.(.*)$");
61 static const lat::Regexp
s_rxtrace (
"(.*)\\((.*)\\+0x.*\\).*");
62 static const lat::Regexp
s_rxpbfile (
".*\\.pb$");
71 || (path.size() >= ofdir.size()
72 && path.compare(0, ofdir.size(), ofdir) == 0
73 && (path.size() == ofdir.size()
74 || path[ofdir.size()] ==
'/')));
83 size_t len = path.size();
84 for ( ; len > 0 && path[len-1] ==
'/'; --len)
87 if (len != path.size())
89 clean = path.substr(0, len);
97 size_t slash = path.rfind(
'/');
98 if (slash != std::string::npos)
100 dir.append(path, 0, slash);
101 name.append(path, slash+1, std::string::npos);
110 path.reserve(dir.size() + name.size() + 2);
120 {
return new T(qtname); }
125 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
130 fastString_ (_fastString), matching_ (UseFull)
138 catch (lat::Error &
e)
141 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality"
146 size_t starCount = 0;
151 if ((
size_t)pos == std::string::npos)
157 if ((
fastString_.find(
'"') != std::string::npos) ||
170 if (boost::algorithm::starts_with(
fastString_,
"*"))
188 if (boost::algorithm::starts_with(
fastString_,
"*") &&
208 if (input.size() < pattern.size())
214 std::string::const_reverse_iterator rit_pattern = pattern.rbegin();
215 std::string::const_reverse_iterator rit_input = input.rbegin();
217 for (; rit_pattern < pattern.rend(); rit_pattern++, rit_input++)
219 if (*rit_pattern != *rit_input)
229 if (input.size() < pattern.size())
235 std::string::const_iterator rit_pattern = pattern.begin();
236 std::string::const_iterator rit_input = input.begin();
238 for (; rit_pattern < pattern.end(); rit_pattern++, rit_input++)
240 if (*rit_pattern != *rit_input)
275 owner_->setCurrentFolder(fullpath);
283 return owner_->pwd();
287 owner_->tag(me, tag);
292 return owner_->get(path);
296 return owner_->getSubdirs();
300 return owner_->getMEs();
304 return owner_->containsAnyMonitorable(path);
308 return owner_->dirExists(path);
320 owner_->setCurrentFolder(fullpath);
336 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: "
338 <<
", stream: " << streamId
339 <<
" module: " << moduleId << std::endl;
346 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
347 std::set<MonitorElement>::const_iterator
e =
data_.end();
348 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
350 if (i->data_.run != run
351 || i->data_.streamId != streamId
352 || i->data_.moduleId != moduleId)
366 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
367 if (me !=
data_.end()) {
369 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
373 me->getTH1()->Add(i->getTH1());
377 std::cout <<
"No global Object found. " << std::endl;
378 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
379 gme =
data_.insert(global_me);
392 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
393 << run <<
" lumi: " << lumi
394 <<
", stream: " << streamId
395 <<
" module: " << moduleId << std::endl;
397 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
398 std::set<MonitorElement>::const_iterator
e =
data_.end();
399 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
402 if (i->data_.run != run
403 || i->data_.streamId != streamId
404 || i->data_.moduleId != moduleId)
419 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
420 if (me !=
data_.end()) {
422 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
426 me->getTH1()->Add(i->getTH1());
429 std::cout <<
"No global Object found. " << std::endl;
430 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
431 gme =
data_.insert(global_me);
441 std::set<MonitorElement>::const_iterator i_lumi =
data_.lower_bound(global_me);
442 while (i_lumi->data_.lumi != lumi) {
443 auto temp = i_lumi++;
444 if (i_lumi->getFullname() == i->getFullname() && i_lumi->markedToDelete())
492 collateHistograms_ (
false),
493 enableMultiThread_(
false),
494 readSelectedDirectory_ (
""),
535 std::cout <<
"DQMStore: histogram collation is enabled\n";
539 std::cout <<
"DQMStore: MultiThread option is enabled\n";
543 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
548 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
552 initQCriterion<Comp2RefChi2>(
qalgos_);
553 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
554 initQCriterion<ContentsXRange>(
qalgos_);
555 initQCriterion<ContentsYRange>(
qalgos_);
556 initQCriterion<MeanWithinExpected>(
qalgos_);
557 initQCriterion<Comp2RefEqualH>(
qalgos_);
558 initQCriterion<DeadChannel>(
qalgos_);
559 initQCriterion<NoisyChannel>(
qalgos_);
560 initQCriterion<ContentsWithinExpected>(
qalgos_);
561 initQCriterion<CompareToMedian>(
qalgos_);
562 initQCriterion<CompareLastFilledBin>(
qalgos_);
563 initQCriterion<CheckVariance>(
qalgos_);
567 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
582 static std::ofstream
stream(
"histogramBookingBT.log");
590 size = backtrace (array, 10);
591 strings = backtrace_symbols (array, size);
596 char * demangled = abi::__cxa_demangle(m.matchString(strings[4], 2).c_str(), 0, 0, &
r);
597 stream <<
"\"" << dir <<
"/"
599 << (r ? m.matchString(strings[4], 2) : demangled) <<
" "
600 << m.matchString(strings[4], 1) <<
"\n";
604 stream <<
"Skipping "<< dir <<
"/" << name
605 <<
" with stack size " << size <<
"\n";
613 for (i = 0; i <
size; i++)
614 if (
s_rxtrace.match(strings[i], 0, 0, &m))
616 char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
617 stream <<
"\t\t" << i <<
"/" << size <<
" "
618 << (r ? m.matchString(strings[i], 2) : demangled) <<
" "
619 << m.matchString(strings[i], 1) << std::endl;
656 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
680 size_t pos =
pwd_.rfind(
'/');
681 if (pos == std::string::npos)
696 prev.reserve(path.size());
697 subdir.reserve(path.size());
698 name.reserve(path.size());
706 subdir.append(path, 0, slash);
708 name.append(subdir, prevname, std::string::npos);
710 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
711 " which already exists as a monitor element",
714 if (!
dirs_.count(subdir))
715 dirs_.insert(subdir);
718 if (slash+1 >= path.size())
723 prevname = slash ? slash+1 :
slash;
725 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
733 {
return dirs_.count(path) > 0; }
738 template <
class HISTO,
class COLLATE>
741 const char *context,
int kind,
742 HISTO *
h, COLLATE collate)
744 assert(name.find(
'/') == std::string::npos);
767 << context <<
": monitor element '"
768 << path <<
"' already exists, collating" << std::endl;
778 assert(
dirs_.count(dir));
786 for ( ; qi != qe; ++qi)
788 if ( qi->first->match(path) )
789 me->addQReport(qi->second);
813 assert(name.find(
'/') == std::string::npos);
826 << context <<
": monitor element '"
827 << path <<
"' already exists, resetting" << std::endl;
835 assert(
dirs_.count(dir));
855 return book(dir, name,
"bookInt")
885 return book(dir, name,
"bookFloat")
914 return book(dir, name,
"bookString")
955 int nchX,
double lowX,
double highX)
957 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
963 int nchX,
double lowX,
double highX)
965 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
971 int nchX,
double lowX,
double highX)
973 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
979 int nchX,
double lowX,
double highX)
981 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
987 int nchX,
double lowX,
double highX)
989 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
995 int nchX,
double lowX,
double highX)
997 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1003 int nchX,
float *xbinsize)
1005 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1011 int nchX,
float *xbinsize)
1013 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1020 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1027 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1034 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1041 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1048 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1055 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1083 int nchX,
double lowX,
double highX,
1084 int nchY,
double lowY,
double highY)
1086 return book2D(
pwd_, name,
new TH2F(name, title,
1088 nchY, lowY, highY));
1094 int nchX,
double lowX,
double highX,
1095 int nchY,
double lowY,
double highY)
1097 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1099 nchY, lowY, highY));
1105 int nchX,
double lowX,
double highX,
1106 int nchY,
double lowY,
double highY)
1108 return book2S(
pwd_, name,
new TH2S(name, title,
1110 nchY, lowY, highY));
1116 int nchX,
double lowX,
double highX,
1117 int nchY,
double lowY,
double highY)
1119 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1121 nchY, lowY, highY));
1127 int nchX,
double lowX,
double highX,
1128 int nchY,
double lowY,
double highY)
1132 nchY, lowY, highY));
1138 int nchX,
double lowX,
double highX,
1139 int nchY,
double lowY,
double highY)
1141 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1143 nchY, lowY, highY));
1149 int nchX,
float *xbinsize,
int nchY,
float *ybinsize)
1151 return book2D(
pwd_, name,
new TH2F(name, title,
1152 nchX, xbinsize, nchY, ybinsize));
1158 int nchX,
float *xbinsize,
int nchY,
float *ybinsize)
1160 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1161 nchX, xbinsize, nchY, ybinsize));
1168 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1175 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1182 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1189 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1196 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1203 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1217 int nchX,
double lowX,
double highX,
1218 int nchY,
double lowY,
double highY,
1219 int nchZ,
double lowZ,
double highZ)
1221 return book3D(
pwd_, name,
new TH3F(name, title,
1224 nchZ, lowZ, highZ));
1230 int nchX,
double lowX,
double highX,
1231 int nchY,
double lowY,
double highY,
1232 int nchZ,
double lowZ,
double highZ)
1234 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1237 nchZ, lowZ, highZ));
1244 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1251 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1259 return book(dir, name,
"bookProfile",
1269 int nchX,
double lowX,
double highX,
1270 int ,
double lowY,
double highY,
1271 const char *option )
1284 int nchX,
double lowX,
double highX,
1285 int ,
double lowY,
double highY,
1286 const char *option )
1288 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1299 int nchX,
double lowX,
double highX,
1300 double lowY,
double highY,
1301 const char *option )
1314 int nchX,
double lowX,
double highX,
1315 double lowY,
double highY,
1316 const char *option )
1318 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1329 int nchX,
double *xbinsize,
1330 int ,
double lowY,
double highY,
1331 const char *option )
1344 int nchX,
double *xbinsize,
1345 int ,
double lowY,
double highY,
1346 const char *option )
1348 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1359 int nchX,
double *xbinsize,
1360 double lowY,
double highY,
1361 const char *option )
1374 int nchX,
double *xbinsize,
1375 double lowY,
double highY,
1376 const char *option )
1378 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1388 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1395 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1403 return book(dir, name,
"bookProfile2D",
1413 int nchX,
double lowX,
double highX,
1414 int nchY,
double lowY,
double highY,
1415 int ,
double lowZ,
double highZ,
1416 const char *option )
1430 int nchX,
double lowX,
double highX,
1431 int nchY,
double lowY,
double highY,
1432 int ,
double lowZ,
double highZ,
1433 const char *option )
1447 int nchX,
double lowX,
double highX,
1448 int nchY,
double lowY,
double highY,
1449 double lowZ,
double highZ,
1450 const char *option )
1464 int nchX,
double lowX,
double highX,
1465 int nchY,
double lowY,
double highY,
1466 double lowZ,
double highZ,
1467 const char *option )
1480 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1487 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1496 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1497 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1498 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1499 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1500 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1501 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1502 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1503 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1504 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1511 <<
"checkBinningMatches: different binning - cannot add object '"
1512 << h->GetName() <<
"' of type "
1513 << h->IsA()->GetName() <<
" to existing ME: '"
1597 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1600 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1601 " twice with multiple tags", me->
getFullname().c_str());
1618 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1619 " '%s' with tag %u", path.c_str(), myTag);
1628 MEMap::iterator
e =
data_.end();
1629 MEMap::iterator
i =
data_.lower_bound(proto);
1630 for ( ; i != e && path == *i->data_.dirname; ++
i)
1631 tag(const_cast<MonitorElement *>(&*i), myTag);
1645 MEMap::iterator
e =
data_.end();
1646 MEMap::iterator
i =
data_.lower_bound(proto);
1649 tag(const_cast<MonitorElement *>(&*i), myTag);
1658 std::vector<std::string>
1661 std::vector<std::string>
result;
1662 std::set<std::string>::const_iterator
e =
dirs_.end();
1663 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1674 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1675 result.push_back(*i);
1681 std::vector<std::string>
1685 std::vector<std::string>
result;
1686 MEMap::const_iterator
e =
data_.end();
1687 MEMap::const_iterator
i =
data_.lower_bound(proto);
1689 if (
pwd_ == *i->data_.dirname)
1690 result.push_back(i->getName());
1701 MEMap::const_iterator
e =
data_.end();
1702 MEMap::const_iterator
i =
data_.lower_bound(proto);
1714 MEMap::const_iterator mepos =
data_.find(proto);
1715 return (mepos ==
data_.end() ? 0
1720 std::vector<MonitorElement *>
1724 std::vector<MonitorElement *>
result;
1725 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1729 result.push_back(const_cast<MonitorElement *>(&me));
1736 std::vector<MonitorElement *>
1744 std::vector<MonitorElement *>
result;
1745 MEMap::const_iterator
e =
data_.end();
1746 MEMap::const_iterator
i =
data_.lower_bound(proto);
1748 if (*cleaned == *i->data_.dirname)
1749 result.push_back(const_cast<MonitorElement *>(&*i));
1755 std::vector<MonitorElement *>
1763 std::vector<MonitorElement *>
result;
1764 MEMap::const_iterator
e =
data_.end();
1765 MEMap::const_iterator
i =
data_.lower_bound(proto);
1767 if (*cleaned == *i->data_.dirname
1769 && i->data_.tag ==
tag)
1770 result.push_back(const_cast<MonitorElement *>(&*i));
1783 into.reserve(
dirs_.size());
1785 MEMap::const_iterator me =
data_.end();
1786 std::set<std::string>::const_iterator di =
dirs_.begin();
1787 std::set<std::string>::const_iterator de =
dirs_.end();
1788 for ( ; di != de; ++di)
1791 MEMap::const_iterator mi =
data_.lower_bound(proto);
1792 MEMap::const_iterator
m = mi;
1793 size_t sz = di->size() + 2;
1796 if (*di == *m->data_.dirname)
1798 sz += m->data_.objname.size() + 1;
1805 std::vector<std::string>::iterator istr
1814 for (sz = 0; mi !=
m; ++mi)
1816 if (*di != *mi->data_.dirname)
1822 *istr += mi->data_.objname;
1828 istr->reserve(di->size() + 2);
1840 const uint32_t
run ,
1841 const uint32_t
lumi ,
1842 const uint32_t streamId ,
1843 const uint32_t moduleId )
const
1845 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1846 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1847 " unacceptable characters", dir.c_str());
1848 if (name.find_first_not_of(
s_safe) != std::string::npos)
1849 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1850 " unacceptable characters", name.c_str());
1860 MEMap::const_iterator mepos =
data_.find(proto);
1861 return (mepos ==
data_.end() ? 0
1871 into.reserve(
dirs_.size());
1873 MEMap::const_iterator me =
data_.end();
1874 std::set<std::string>::const_iterator di =
dirs_.begin();
1875 std::set<std::string>::const_iterator de =
dirs_.end();
1878 for ( ; di != de; ++di)
1881 MEMap::const_iterator mi =
data_.lower_bound(proto);
1882 MEMap::const_iterator
m = mi;
1883 size_t sz = di->size() + 2;
1889 sz += 1 + m->data_.objname.size() + 11;
1896 std::vector<std::string>::iterator istr
1903 for (sz = 0; mi !=
m; ++mi)
1907 sprintf(tagbuf,
"/%u", mi->data_.tag);
1910 *istr += m->data_.objname;
1920 std::vector<MonitorElement*>
1923 uint32_t
lumi )
const
1931 std::vector<MonitorElement *>
result;
1932 MEMap::const_iterator
e =
data_.end();
1933 MEMap::const_iterator
i =
data_.lower_bound(proto);
1935 if (runNumber != 0) {
1936 if (i->data_.run > runNumber
1937 || i->data_.streamId != 0
1938 || i->data_.moduleId != 0)
1942 if (i->data_.lumi > lumi
1943 || i->data_.streamId != 0
1944 || i->data_.moduleId != 0)
1947 if (runNumber != 0
or lumi !=0) {
1948 assert(i->data_.streamId == 0);
1949 assert(i->data_.moduleId == 0);
1951 result.push_back(const_cast<MonitorElement *>(&*i));
1958 std::vector<MonitorElement*>
1964 rx = lat::Regexp(pattern, 0, syntaxType);
1967 catch (lat::Error &
e)
1969 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
1970 pattern.c_str(), e.explain().c_str());
1974 std::vector<MonitorElement *>
result;
1975 MEMap::const_iterator
i =
data_.begin();
1976 MEMap::const_iterator e =
data_.end();
1977 for ( ; i !=
e; ++
i)
1980 mergePath(path, *i->data_.dirname, i->data_.objname);
1982 result.push_back(const_cast<MonitorElement *>(&*i));
1997 MEMap::iterator mi =
data_.begin();
1998 MEMap::iterator me =
data_.end();
1999 for ( ; mi != me; ++mi)
2002 if (mi->wasUpdated())
2021 MEMap::iterator mi =
data_.begin();
2022 MEMap::iterator me =
data_.end();
2023 for ( ; mi != me; ++mi)
2049 std::set<MonitorElement>::const_iterator
e =
data_.end();
2050 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2053 if (i->data_.streamId != 0 ||
2054 i->data_.moduleId != 0)
2058 if (i->data_.run != run)
2064 std::cout <<
"DQMStore::markForDeletion: marked monitor element '"
2065 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2066 <<
"flags " << i->data_.flags <<
"\n";
2084 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2088 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2095 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2106 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2110 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2117 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2121 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2128 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2132 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2139 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2143 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2150 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2154 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2161 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2165 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2172 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2176 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2183 else if (dynamic_cast<TObjString *>(obj))
2186 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2188 if (strstr(obj->GetName(),
"CMSSW"))
2191 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2194 else if (strstr(obj->GetName(),
"DQMPATCH"))
2197 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2202 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2203 << obj->GetName() <<
"' of type '"
2204 << obj->IsA()->GetName() <<
"'\n";
2210 std::string kind = m.matchString(obj->GetName(), 2);
2216 if (! me || overwrite)
2218 if (! me) me =
bookInt(dir, label);
2219 me->
Fill(atoll(value.c_str()));
2222 else if (kind ==
"f")
2225 if (! me || overwrite)
2228 me->
Fill(atof(value.c_str()));
2231 else if (kind ==
"s")
2239 else if (kind ==
"e")
2244 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2245 << label <<
"' in directory '"
2246 << dir <<
"' to be marked as efficiency plot.\n";
2251 else if (kind ==
"t")
2256 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2257 << label <<
"' in directory '"
2258 << dir <<
"' for a tag\n";
2263 unsigned long val = strtoul(value.c_str(), &endp, 10);
2264 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2266 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2267 << value <<
"' for monitor element '"
2268 << label <<
"' in directory '"
2269 << dir <<
"' - invalid value\n";
2274 else if (kind ==
"qr")
2279 size_t dot = label.find(
'.');
2280 if (dot == std::string::npos)
2282 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2283 <<
"' is missing a '.' and cannot be extracted\n";
2288 std::string qrname (label, dot+1, std::string::npos);
2294 qv.
code = atoi(m.matchString(value, 1).c_str());
2295 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2296 qv.
message = m.matchString(value, 4);
2300 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2302 qv.
code = atoi(m.matchString(value, 1).c_str());
2304 qv.
message = m.matchString(value, 2);
2310 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2311 << value <<
"' is incorrectly formatted\n";
2318 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2319 << mename <<
"' in directory '"
2320 << dir <<
"' for quality test '"
2330 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2331 << obj->GetName() <<
"' of type '"
2332 << obj->IsA()->GetName() <<
"'\n";
2336 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2340 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2341 s +=
'<'; s +=
n->GetName(); s +=
'>';
2343 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2344 TObjString os(s.c_str());
2349 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2350 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2351 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2377 assert(! path.empty());
2381 size_t end = path.find(
'/', start);
2382 if (end == std::string::npos)
2390 TObject *
o = gDirectory->Get(part.c_str());
2391 if (o && ! dynamic_cast<TDirectory *>(o))
2392 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2393 " fails because the part '%s' already exists and is not"
2394 " directory", path.c_str(), part.c_str());
2396 gDirectory->mkdir(part.c_str());
2398 if (! gDirectory->cd(part.c_str()))
2399 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2400 " fails because could not cd into subdirectory '%s'",
2401 path.c_str(), part.c_str());
2404 if (end+1 >= path.size())
2409 end = path.find(
'/', start);
2410 if (end == std::string::npos)
2419 const uint32_t
run ,
2420 const uint32_t
lumi ,
2421 const bool resetMEsAfterWriting )
2423 using google::protobuf::io::FileOutputStream;
2424 using google::protobuf::io::GzipOutputStream;
2425 using google::protobuf::io::StringOutputStream;
2427 std::set<std::string>::iterator di, de;
2428 MEMap::iterator mi, me =
data_.end();
2433 std::cout <<
"\n DQMStore: Opening PBFile '"
2434 << filename <<
"'"<< std::endl;
2437 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2450 mi =
data_.lower_bound(proto);
2451 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2455 <<
" Lumi: " << (*mi).lumi()
2456 <<
" LumiFlag: " << (*mi).getLumiFlag()
2457 <<
" streamId: " << (*mi).streamId()
2458 <<
" moduleId: " << (*mi).moduleId()
2459 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2466 if (*di != *mi->data_.dirname)
2475 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2479 std::cout <<
"DQMStore::savePB: saving monitor element '"
2480 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2481 <<
"flags " << mi->data_.flags <<
"\n";
2488 TObject *toWrite =
nullptr;
2492 toWrite =
new TObjString(mi->tagString().c_str());
2493 deleteObject =
true;
2495 toWrite = mi->object_;
2498 TBufferFile buffer(TBufferFile::kWrite);
2499 buffer.WriteObject(toWrite);
2509 if (resetMEsAfterWriting)
2514 int filedescriptor =
::open(filename.c_str(),
2515 O_WRONLY | O_CREAT | O_TRUNC,
2519 FileOutputStream file_stream(filedescriptor);
2521 options.format = GzipOutputStream::GZIP;
2522 options.compression_level = 6;
2523 GzipOutputStream gzip_stream(&file_stream,
2525 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2529 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2530 <<
" objects from path '" << path
2531 <<
"' into DQM file '" << filename <<
"'\n";
2544 const uint32_t
run ,
2545 const uint32_t
lumi ,
2549 const bool resetMEsAfterWriting )
2551 std::set<std::string>::iterator di, de;
2552 MEMap::iterator mi, me =
data_.end();
2553 DQMNet::QReports::const_iterator qi, qe;
2561 class TFileNoSync :
public TFile
2564 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2565 virtual Int_t SysSync(Int_t)
override {
return 0; }
2570 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2571 <<
"' with option '" << fileupdate <<
"'\n";
2573 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2575 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2579 std::auto_ptr<lat::Regexp> rxpat;
2580 if (! pattern.empty())
2581 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2594 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2608 mi =
data_.lower_bound(proto);
2609 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2612 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2613 <<
" Lumi: " << (*mi).lumi()
2614 <<
" LumiFlag: " << (*mi).getLumiFlag()
2615 <<
" streamId: " << (*mi).streamId()
2616 <<
" moduleId: " << (*mi).moduleId()
2617 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2624 if (*di != *mi->data_.dirname) {
2626 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2636 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2662 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2663 status =
std::max(status, master->data_.qreports[
i].code);
2665 if (! master || status < minStatus)
2668 std::cout <<
"DQMStore::save: skipping monitor element '"
2669 << mi->data_.objname <<
"' while saving, status is "
2670 << status <<
", required minimum status is "
2671 << minStatus << std::endl;
2678 std::cout <<
"DQMStore::save: saving monitor element '"
2679 << mi->data_.objname <<
"'\n";
2683 gDirectory->cd(
"/");
2686 else if (rxpat.get())
2697 TObjString(mi->tagString().c_str()).Write();
2701 mi->object_->Write();
2708 qi = mi->data_.qreports.begin();
2709 qe = mi->data_.qreports.end();
2710 for ( ; qi != qe; ++qi)
2711 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2716 TObjString(mi->effLabelString().c_str()).Write();
2720 TObjString(mi->tagLabelString().c_str()).Write();
2723 if (resetMEsAfterWriting)
2732 std::cout <<
"DQMStore::save: successfully wrote " << nme
2733 <<
" objects from path '" << path
2734 <<
"' into DQM file '" << filename <<
"'\n";
2747 unsigned int ntot = 0;
2748 unsigned int count = 0;
2750 if (! file->cd(curdir.c_str()))
2751 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2752 " reading file '%s'", curdir.c_str(), file->GetName());
2775 size_t slash = dirpart.find(
'/');
2776 size_t pos = dirpart.find(
"/Run summary");
2777 if (slash != std::string::npos && pos !=std::string::npos)
2779 dirpart.erase(pos,12);
2781 pos = dirpart.find(
"Run ");
2782 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2783 if (pos !=std::string::npos)
2784 dirpart.erase(pos,length);
2793 size_t slash = dirpart.find(
'/');
2795 if (slash == std::string::npos
2800 slash = dirpart.find(
'/');
2802 if (slash != std::string::npos
2803 && slash + 10 == dirpart.size()
2804 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2806 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2811 if (dirpart.empty())
2814 dirpart = prepend +
'/' + dirpart;
2816 else if (! prepend.empty())
2818 if (dirpart.empty())
2821 dirpart = prepend +
'/' + dirpart;
2829 TIter
next (gDirectory->GetListOfKeys());
2830 std::list<TObject *> delayed;
2831 while ((key = (TKey *)
next()))
2833 std::auto_ptr<TObject>
obj(key->ReadObj());
2834 if (dynamic_cast<TDirectory *>(
obj.get()))
2837 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2839 if (! curdir.empty())
2841 subdir +=
obj->GetName();
2843 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2847 else if (dynamic_cast<TObjString *>(
obj.get()))
2849 delayed.push_back(
obj.release());
2854 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2855 <<
"' of type '" <<
obj->IsA()->GetName()
2856 <<
"' from '" << file->GetName()
2857 <<
"' into '" << dirpart <<
"'\n";
2865 while (! delayed.empty())
2868 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2869 <<
"' of type '" << delayed.front()->IsA()->GetName()
2870 <<
"' from '" << file->GetName()
2871 <<
"' into '" << dirpart <<
"'\n";
2877 delete delayed.front();
2878 delayed.pop_front();
2882 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2883 <<
" objects from directory '" << dirpart <<
"'\n";
2885 return ntot +
count;
2900 bool fileMustExist )
2902 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2912 bool fileMustExist )
2914 bool overwrite =
true;
2918 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
2920 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
2922 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
2926 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2928 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
2942 bool fileMustExist )
2946 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
2948 std::auto_ptr<TFile>
f;
2952 f.reset(TFile::Open(filename.c_str()));
2953 if (! f.get() || f->IsZombie())
2954 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
2963 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
2968 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
2971 MEMap::iterator mi =
data_.begin();
2972 MEMap::iterator me =
data_.end();
2973 for ( ; mi != me; ++mi)
2974 const_cast<MonitorElement &>(*mi).updateQReportStats();
2978 std::cout <<
"DQMStore::open: successfully read " << n
2979 <<
" objects from file '" << filename <<
"'";
2980 if (! onlypath.empty())
2981 std::cout <<
" from directory '" << onlypath <<
"'";
2982 if (! prepend.empty())
2983 std::cout <<
" into directory '" << prepend <<
"'";
2993 if (buf.Length() == buf.BufferSize())
2996 void *ptr = buf.ReadObjectAny(0);
2997 return reinterpret_cast<TObject *
>(ptr);
3006 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3007 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3009 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3010 TBufferFile buf(TBufferFile::kRead, h.
size(),
3026 bool fileMustExist )
3028 using google::protobuf::io::FileInputStream;
3029 using google::protobuf::io::FileOutputStream;
3030 using google::protobuf::io::GzipInputStream;
3031 using google::protobuf::io::GzipOutputStream;
3032 using google::protobuf::io::CodedInputStream;
3033 using google::protobuf::io::ArrayInputStream;
3036 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3039 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3041 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3044 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3049 FileInputStream
fin(filedescriptor);
3050 GzipInputStream
input(&fin);
3051 CodedInputStream input_coded(&input);
3052 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3053 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3054 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3080 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3082 if (me ==
nullptr) {
3108 MEMap::iterator
e =
data_.end();
3109 MEMap::iterator
i =
data_.lower_bound(proto);
3113 std::set<std::string>::iterator de =
dirs_.end();
3114 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3124 MEMap::iterator
e =
data_.end();
3125 MEMap::iterator
i =
data_.lower_bound(proto);
3127 if (dir == *i->data_.dirname)
3154 MEMap::iterator pos =
data_.find(proto);
3155 if (pos ==
data_.end() && warning)
3156 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3157 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3170 QCMap::const_iterator
i =
qtests_.find(qtname);
3171 QCMap::const_iterator
e =
qtests_.end();
3172 return (i == e ? 0 : i->second);
3182 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3185 QAMap::iterator
i =
qalgos_.find(algoname);
3187 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3188 " algorithm '%s'", algoname.c_str());
3208 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3210 " uses unacceptable characters", cleaned->c_str());
3222 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3232 MEMap::iterator mi =
data_.begin();
3233 MEMap::iterator me =
data_.end();
3236 for ( ; mi != me; ++mi)
3239 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3240 if (fm->match(path))
3257 std::cout <<
"DQMStore: running runQTests() with reset = "
3258 << (
reset_ ?
"true" :
"false" ) << std::endl;
3261 MEMap::iterator mi =
data_.begin();
3262 MEMap::iterator me =
data_.end();
3263 for ( ; mi != me; ++mi)
3281 MEMap::const_iterator mi =
data_.begin();
3282 MEMap::const_iterator me =
data_.end();
3283 for ( ; mi != me; ++mi)
3285 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3290 else if (mi->hasWarning())
3293 && mi->hasOtherReport())
3337 std::cout <<
" ------------------------------------------------------------\n"
3338 <<
" Directory structure: \n"
3339 <<
" ------------------------------------------------------------\n";
3341 std::copy(contents.begin(), contents.end(),
3342 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3344 std::cout <<
" ------------------------------------------------------------\n";
3381 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3384 factor = factor/(events*1.0);
3386 MEMap::iterator mi =
data_.begin();
3387 MEMap::iterator me =
data_.end();
3388 for ( ; mi != me; ++mi)
3440 std::cout <<
" The DQM object '" << me.
getFullname() <<
"' is not scalable object " << std::endl;
static void collateProfile2D(MonitorElement *me, TProfile2D *h)
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
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)
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 collate3D(MonitorElement *me, TH3F *h)
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.
static void collate1D(MonitorElement *me, TH1F *h)
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.
void markForDeletion(uint32_t run, uint32_t lumi)
static void collate1DD(MonitorElement *me, TH1D *h)
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
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)
static void collateProfile(MonitorElement *me, TProfile *h)
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);
tuple path
else: Piece not in the list, fine.
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.
static void collate1S(MonitorElement *me, TH1S *h)
bool isCollate(void) const
void removeElement(const std::string &name)
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static bool checkBinningMatches(MonitorElement *me, TH1 *h)
double getFloatValue(void) const
void tag(MonitorElement *, unsigned int)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
QCriterion * makeQCriterion(const std::string &qtname)
void setVerbose(unsigned level)
void softReset(MonitorElement *me)
Kind kind(void) const
Get the type of the monitor element.
TObject * extractNextObject(TBufferFile &) const
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
const std::string getFullname(void) const
get full name of ME including Pathname
std::vector< MonitorElement * > getContents(const std::string &path) const
std::string readSelectedDirectory_
std::vector< std::string > getMEs(void)
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
bool dirExists(const std::string &path) const
true if directory exists
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0, const bool resetMEsAfterWriting=false)
void getAllTags(std::vector< std::string > &into) const
bool dirExists(const std::string &path)
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
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)
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
void set_size(::google::protobuf::uint32 value)
static void collate2S(MonitorElement *me, TH2S *h)
int64_t getIntValue(void) const
static void collate2D(MonitorElement *me, TH2F *h)
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>.
TH1F * getTH1F(void) const
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_
static void collate2DD(MonitorElement *me, TH2D *h)
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)
void Reset(std::vector< TH2F > &depth)
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
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
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)
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,...)