7 #include "classlib/utils/RegexpMatch.h"
8 #include "classlib/utils/Regexp.h"
9 #include "classlib/utils/StringOps.h"
10 #include <google/protobuf/io/coded_stream.h>
11 #include <google/protobuf/io/gzip_stream.h>
12 #include <google/protobuf/io/zero_copy_stream_impl.h>
18 #include "TBufferFile.h"
21 #include <boost/algorithm/string.hpp>
58 static const std::string s_safe =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# ";
60 static const lat::Regexp
s_rxmeval (
"^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$");
61 static const lat::Regexp
s_rxmeqr1 (
"^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$");
62 static const lat::Regexp
s_rxmeqr2 (
"^st\\.(\\d+)\\.(.*)$");
63 static const lat::Regexp
s_rxtrace (
"(.*)\\((.*)\\+0x.*\\).*");
64 static const lat::Regexp
s_rxpbfile (
".*\\.pb$");
73 || (path.size() >= ofdir.size()
74 && path.compare(0, ofdir.size(), ofdir) == 0
75 && (path.size() == ofdir.size()
76 || path[ofdir.size()] ==
'/')));
85 size_t len = path.size();
86 for ( ; len > 0 && path[len-1] ==
'/'; --len)
89 if (len != path.size())
91 clean = path.substr(0, len);
99 size_t slash = path.rfind(
'/');
100 if (slash != std::string::npos)
102 dir.append(path, 0, slash);
103 name.append(path, slash+1, std::string::npos);
112 path.reserve(dir.size() + name.size() + 2);
122 {
return new T(qtname); }
127 {
m[T::getAlgoName()] = &makeQCriterion<T>; }
132 fastString_ (_fastString), matching_ (UseFull)
140 catch (lat::Error &
e)
143 raiseDQMError(
"DQMStore",
"Invalid wildcard pattern '%s' in quality"
148 size_t starCount = 0;
153 if ((
size_t)pos == std::string::npos)
159 if ((
fastString_.find(
'"') != std::string::npos) ||
172 if (boost::algorithm::starts_with(
fastString_,
"*"))
190 if (boost::algorithm::starts_with(
fastString_,
"*") &&
210 if (input.size() < pattern.size())
216 std::string::const_reverse_iterator rit_pattern = pattern.rbegin();
217 std::string::const_reverse_iterator rit_input = input.rbegin();
219 for (; rit_pattern < pattern.rend(); rit_pattern++, rit_input++)
221 if (*rit_pattern != *rit_input)
231 if (input.size() < pattern.size())
237 std::string::const_iterator rit_pattern = pattern.begin();
238 std::string::const_iterator rit_input = input.begin();
240 for (; rit_pattern < pattern.end(); rit_pattern++, rit_input++)
242 if (*rit_pattern != *rit_input)
277 owner_->setCurrentFolder(fullpath);
285 return owner_->pwd();
289 owner_->tag(me, tag);
293 owner_->tagContents(path, myTag);
297 std::vector<MonitorElement*>
301 return owner_->getAllContents(path, runNumber, lumi);
305 return owner_->get(path);
310 if (ptr ==
nullptr) {
311 std::stringstream
msg;
312 msg <<
"DQM object not found";
317 throw std::out_of_range(msg.str());
323 return owner_->getSubdirs();
327 return owner_->getMEs();
331 return owner_->containsAnyMonitorable(path);
335 return owner_->dirExists(path);
347 owner_->setCurrentFolder(fullpath);
363 std::cout <<
"DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: "
365 <<
", stream: " << streamId
366 <<
" module: " << moduleId << std::endl;
373 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
374 std::set<MonitorElement>::const_iterator
e =
data_.end();
375 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
377 if (i->data_.run != run
378 || i->data_.streamId != streamId
379 || i->data_.moduleId != moduleId)
396 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
397 if (me !=
data_.end()) {
399 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
404 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
406 list.Add(i->getTH1());
407 if( -1 == me->getTH1()->Merge(&list)) {
408 std::cout <<
"mergeAndResetMEsRunSummaryCache: Failed to merge DQM element "<<me->getFullname();
412 me->getTH1()->Add(i->getTH1());
416 std::cout <<
"No global Object found. " << std::endl;
417 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
435 std::cout <<
"DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
436 << run <<
" lumi: " << lumi
437 <<
", stream: " << streamId
438 <<
" module: " << moduleId << std::endl;
440 MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
441 std::set<MonitorElement>::const_iterator
e =
data_.end();
442 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
445 if (i->data_.run != run
446 || i->data_.streamId != streamId
447 || i->data_.moduleId != moduleId)
462 std::set<MonitorElement>::const_iterator me =
data_.find(global_me);
463 if (me !=
data_.end()) {
465 std::cout <<
"Found global Object, using it --> " << me->getFullname() << std::endl;
470 if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
472 list.Add(i->getTH1());
473 if( -1 == me->getTH1()->Merge(&list)) {
474 std::cout <<
"mergeAndResetMEsLuminositySummaryCache: Failed to merge DQM element "<<me->getFullname();
478 me->getTH1()->Add(i->getTH1());
482 std::cout <<
"No global Object found. " << std::endl;
483 std::pair<std::set<MonitorElement>::const_iterator,
bool> gme;
488 actual_global_me.
setLumi(lumi);
539 collateHistograms_ (
false),
540 enableMultiThread_(
false),
541 readSelectedDirectory_ (
""),
586 std::cout <<
"DQMStore: histogram collation is enabled\n";
590 std::cout <<
"DQMStore: MultiThread option is enabled\n";
594 std::cout <<
"DQMStore: LSbasedMode option is enabled\n";
599 std::cout <<
"DQMStore: using reference file '" << ref <<
"'\n";
603 initQCriterion<Comp2RefChi2>(
qalgos_);
604 initQCriterion<Comp2RefKolmogorov>(
qalgos_);
605 initQCriterion<ContentsXRange>(
qalgos_);
606 initQCriterion<ContentsYRange>(
qalgos_);
607 initQCriterion<MeanWithinExpected>(
qalgos_);
608 initQCriterion<Comp2RefEqualH>(
qalgos_);
609 initQCriterion<DeadChannel>(
qalgos_);
610 initQCriterion<NoisyChannel>(
qalgos_);
611 initQCriterion<ContentsWithinExpected>(
qalgos_);
612 initQCriterion<CompareToMedian>(
qalgos_);
613 initQCriterion<CompareLastFilledBin>(
qalgos_);
614 initQCriterion<CheckVariance>(
qalgos_);
618 std::cout <<
"DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
637 stream_ =
new std::ofstream(
"histogramBookingBT.log");
646 size = backtrace (array, 10);
647 strings = backtrace_symbols (array, size);
652 char *
demangled = abi::__cxa_demangle(m.matchString(strings[4], 2).c_str(), 0, 0, &
r);
655 << (r ? m.matchString(strings[4], 2) :
demangled) <<
" "
656 << m.matchString(strings[4], 1) <<
"\n";
660 *
stream_ <<
"Skipping "<< dir <<
"/" << name
661 <<
" with stack size " << size <<
"\n";
669 for (i = 0; i <
size; i++)
670 if (
s_rxtrace.match(strings[i], 0, 0, &m))
672 char *
demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), 0, 0, &
r);
673 *
stream_ <<
"\t\t" << i <<
"/" << size <<
" "
674 << (r ? m.matchString(strings[i], 2) :
demangled) <<
" "
675 << m.matchString(strings[i], 1) << std::endl;
712 raiseDQMError(
"DQMStore",
"Cannot 'cd' into non-existent directory '%s'",
736 size_t pos =
pwd_.rfind(
'/');
737 if (pos == std::string::npos)
752 prev.reserve(path.size());
753 subdir.reserve(path.size());
754 name.reserve(path.size());
762 subdir.append(path, 0, slash);
764 name.append(subdir, prevname, std::string::npos);
766 raiseDQMError(
"DQMStore",
"Attempt to create subdirectory '%s'"
767 " which already exists as a monitor element",
770 if (!
dirs_.count(subdir))
771 dirs_.insert(subdir);
774 if (slash+1 >= path.size())
779 prevname = slash ? slash+1 :
slash;
781 if ((slash = path.find(
'/', ++slash)) == std::string::npos)
789 {
return dirs_.count(path) > 0; }
794 template <
class HISTO,
class COLLATE>
797 const char *context,
int kind,
798 HISTO *
h, COLLATE collate)
800 assert(name.find(
'/') == std::string::npos);
823 << context <<
": monitor element '"
824 << path <<
"' already exists, collating" << std::endl;
842 for ( ; qi != qe; ++qi)
844 if ( qi->first->match(path) )
845 me->addQReport(qi->second);
863 me->reference_ = referenceME->
object_;
876 assert(name.find(
'/') == std::string::npos);
889 << context <<
": monitor element '"
890 << path <<
"' already exists, resetting" << std::endl;
918 return book(dir, name,
"bookInt")
948 return book(dir, name,
"bookFloat")
977 return book(dir, name,
"bookString")
1018 int nchX,
double lowX,
double highX)
1020 return book1D(
pwd_, name,
new TH1F(name, title, nchX, lowX, highX));
1026 int nchX,
double lowX,
double highX)
1028 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
1034 int nchX,
double lowX,
double highX)
1036 return book1S(
pwd_, name,
new TH1S(name, title, nchX, lowX, highX));
1042 int nchX,
double lowX,
double highX)
1044 return book1S(
pwd_, name,
new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1050 int nchX,
double lowX,
double highX)
1052 return book1DD(
pwd_, name,
new TH1D(name, title, nchX, lowX, highX));
1058 int nchX,
double lowX,
double highX)
1060 return book1DD(
pwd_, name,
new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1066 int nchX,
const float *xbinsize)
1068 return book1D(
pwd_, name,
new TH1F(name, title, nchX, xbinsize));
1074 int nchX,
const float *xbinsize)
1076 return book1D(
pwd_, name,
new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1083 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1090 return book1D(
pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1097 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1104 return book1S(
pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1111 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1118 return book1DD(
pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1146 int nchX,
double lowX,
double highX,
1147 int nchY,
double lowY,
double highY)
1149 return book2D(
pwd_, name,
new TH2F(name, title,
1151 nchY, lowY, highY));
1157 int nchX,
double lowX,
double highX,
1158 int nchY,
double lowY,
double highY)
1160 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1162 nchY, lowY, highY));
1168 int nchX,
double lowX,
double highX,
1169 int nchY,
double lowY,
double highY)
1171 return book2S(
pwd_, name,
new TH2S(name, title,
1173 nchY, lowY, highY));
1179 int nchX,
double lowX,
double highX,
1180 int nchY,
double lowY,
double highY)
1182 return book2S(
pwd_, name,
new TH2S(name.c_str(), title.c_str(),
1184 nchY, lowY, highY));
1190 int nchX,
double lowX,
double highX,
1191 int nchY,
double lowY,
double highY)
1195 nchY, lowY, highY));
1201 int nchX,
double lowX,
double highX,
1202 int nchY,
double lowY,
double highY)
1204 return book2DD(
pwd_, name,
new TH2D(name.c_str(), title.c_str(),
1206 nchY, lowY, highY));
1212 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1214 return book2D(
pwd_, name,
new TH2F(name, title,
1215 nchX, xbinsize, nchY, ybinsize));
1221 int nchX,
const float *xbinsize,
int nchY,
const float *ybinsize)
1223 return book2D(
pwd_, name,
new TH2F(name.c_str(), title.c_str(),
1224 nchX, xbinsize, nchY, ybinsize));
1231 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1238 return book2D(
pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1245 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1252 return book2S(
pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1259 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1266 return book2DD(
pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1280 int nchX,
double lowX,
double highX,
1281 int nchY,
double lowY,
double highY,
1282 int nchZ,
double lowZ,
double highZ)
1284 return book3D(
pwd_, name,
new TH3F(name, title,
1287 nchZ, lowZ, highZ));
1293 int nchX,
double lowX,
double highX,
1294 int nchY,
double lowY,
double highY,
1295 int nchZ,
double lowZ,
double highZ)
1297 return book3D(
pwd_, name,
new TH3F(name.c_str(), title.c_str(),
1300 nchZ, lowZ, highZ));
1307 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1314 return book3D(
pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1322 return book(dir, name,
"bookProfile",
1332 int nchX,
double lowX,
double highX,
1333 int ,
double lowY,
double highY,
1334 const char *option )
1347 int nchX,
double lowX,
double highX,
1348 int ,
double lowY,
double highY,
1349 const char *option )
1351 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1362 int nchX,
double lowX,
double highX,
1363 double lowY,
double highY,
1364 const char *option )
1377 int nchX,
double lowX,
double highX,
1378 double lowY,
double highY,
1379 const char *option )
1381 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1392 int nchX,
const double *xbinsize,
1393 int ,
double lowY,
double highY,
1394 const char *option )
1407 int nchX,
const double *xbinsize,
1408 int ,
double lowY,
double highY,
1409 const char *option )
1411 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1422 int nchX,
const double *xbinsize,
1423 double lowY,
double highY,
1424 const char *option )
1437 int nchX,
const double *xbinsize,
1438 double lowY,
double highY,
1439 const char *option )
1441 return bookProfile(
pwd_, name,
new TProfile(name.c_str(), title.c_str(),
1451 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1458 return bookProfile(
pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1466 return book(dir, name,
"bookProfile2D",
1476 int nchX,
double lowX,
double highX,
1477 int nchY,
double lowY,
double highY,
1478 int ,
double lowZ,
double highZ,
1479 const char *option )
1493 int nchX,
double lowX,
double highX,
1494 int nchY,
double lowY,
double highY,
1495 int ,
double lowZ,
double highZ,
1496 const char *option )
1510 int nchX,
double lowX,
double highX,
1511 int nchY,
double lowY,
double highY,
1512 double lowZ,
double highZ,
1513 const char *option )
1527 int nchX,
double lowX,
double highX,
1528 int nchY,
double lowY,
double highY,
1529 double lowZ,
double highZ,
1530 const char *option )
1543 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1550 return bookProfile2D(
pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1559 if (me->
getTH1()->GetNbinsX() != h->GetNbinsX()
1560 || me->
getTH1()->GetNbinsY() != h->GetNbinsY()
1561 || me->
getTH1()->GetNbinsZ() != h->GetNbinsZ()
1562 || me->
getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1563 || me->
getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1564 || me->
getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1565 || me->
getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1566 || me->
getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1567 || me->
getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1574 <<
"checkBinningMatches: different binning - cannot add object '"
1575 << h->GetName() <<
"' of type "
1576 << h->IsA()->GetName() <<
" to existing ME: '"
1660 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1663 raiseDQMError(
"DQMStore",
"Attempt to tag monitor element '%s'"
1664 " twice with multiple tags", me->
getFullname().c_str());
1681 raiseDQMError(
"DQMStore",
"Attempt to tag non-existent monitor element"
1682 " '%s' with tag %u", path.c_str(), myTag);
1691 MEMap::iterator
e =
data_.end();
1692 MEMap::iterator
i =
data_.lower_bound(proto);
1693 for ( ; i != e && path == *i->data_.dirname; ++
i)
1694 tag(const_cast<MonitorElement *>(&*i), myTag);
1708 MEMap::iterator
e =
data_.end();
1709 MEMap::iterator
i =
data_.lower_bound(proto);
1712 tag(const_cast<MonitorElement *>(&*i), myTag);
1721 std::vector<std::string>
1724 std::vector<std::string>
result;
1725 std::set<std::string>::const_iterator
e =
dirs_.end();
1726 std::set<std::string>::const_iterator
i =
dirs_.find(
pwd_);
1737 if (i->find(
'/',
pwd_.size()+1) == std::string::npos)
1738 result.push_back(*i);
1744 std::vector<std::string>
1748 std::vector<std::string>
result;
1749 MEMap::const_iterator
e =
data_.end();
1750 MEMap::const_iterator
i =
data_.lower_bound(proto);
1752 if (
pwd_ == *i->data_.dirname)
1753 result.push_back(i->getName());
1764 MEMap::const_iterator
e =
data_.end();
1765 MEMap::const_iterator
i =
data_.lower_bound(proto);
1777 MEMap::const_iterator mepos =
data_.find(proto);
1778 return (mepos ==
data_.end() ? 0
1783 std::vector<MonitorElement *>
1787 std::vector<MonitorElement *>
result;
1788 for (MEMap::const_iterator
i =
data_.begin(),
e =
data_.end();
i !=
e; ++
i)
1792 result.push_back(const_cast<MonitorElement *>(&me));
1799 std::vector<MonitorElement *>
1807 std::vector<MonitorElement *>
result;
1808 MEMap::const_iterator
e =
data_.end();
1809 MEMap::const_iterator
i =
data_.lower_bound(proto);
1811 if (*cleaned == *i->data_.dirname)
1812 result.push_back(const_cast<MonitorElement *>(&*i));
1818 std::vector<MonitorElement *>
1826 std::vector<MonitorElement *>
result;
1827 MEMap::const_iterator
e =
data_.end();
1828 MEMap::const_iterator
i =
data_.lower_bound(proto);
1830 if (*cleaned == *i->data_.dirname
1832 && i->data_.tag ==
tag)
1833 result.push_back(const_cast<MonitorElement *>(&*i));
1846 into.reserve(
dirs_.size());
1848 MEMap::const_iterator me =
data_.end();
1849 std::set<std::string>::const_iterator di =
dirs_.begin();
1850 std::set<std::string>::const_iterator de =
dirs_.end();
1851 for ( ; di != de; ++di)
1854 MEMap::const_iterator mi =
data_.lower_bound(proto);
1855 MEMap::const_iterator
m = mi;
1856 size_t sz = di->size() + 2;
1859 if (*di == *m->data_.dirname)
1861 sz += m->data_.objname.size() + 1;
1868 std::vector<std::string>::iterator istr
1877 for (sz = 0; mi !=
m; ++mi)
1879 if (*di != *mi->data_.dirname)
1885 *istr += mi->data_.objname;
1891 istr->reserve(di->size() + 2);
1903 const uint32_t
run ,
1904 const uint32_t
lumi ,
1905 const uint32_t streamId ,
1906 const uint32_t moduleId )
const
1908 if (dir.find_first_not_of(
s_safe) != std::string::npos)
1909 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1910 " unacceptable characters", dir.c_str());
1911 if (name.find_first_not_of(
s_safe) != std::string::npos)
1912 raiseDQMError(
"DQMStore",
"Monitor element path name '%s' uses"
1913 " unacceptable characters", name.c_str());
1923 MEMap::const_iterator mepos =
data_.find(proto);
1924 return (mepos ==
data_.end() ? 0
1934 into.reserve(
dirs_.size());
1936 MEMap::const_iterator me =
data_.end();
1937 std::set<std::string>::const_iterator di =
dirs_.begin();
1938 std::set<std::string>::const_iterator de =
dirs_.end();
1941 for ( ; di != de; ++di)
1944 MEMap::const_iterator mi =
data_.lower_bound(proto);
1945 MEMap::const_iterator
m = mi;
1946 size_t sz = di->size() + 2;
1952 sz += 1 + m->data_.objname.size() + 11;
1959 std::vector<std::string>::iterator istr
1966 for (sz = 0; mi !=
m; ++mi)
1970 sprintf(tagbuf,
"/%u", mi->data_.tag);
1973 *istr += m->data_.objname;
1983 std::vector<MonitorElement*>
1986 uint32_t
lumi )
const
1994 std::vector<MonitorElement *>
result;
1995 MEMap::const_iterator
e =
data_.end();
1996 MEMap::const_iterator
i =
data_.lower_bound(proto);
1998 if (runNumber != 0) {
1999 if (i->data_.run > runNumber
2000 || i->data_.streamId != 0
2001 || i->data_.moduleId != 0)
2005 if (i->data_.lumi > lumi
2006 || i->data_.streamId != 0
2007 || i->data_.moduleId != 0)
2010 if (runNumber != 0
or lumi !=0) {
2011 assert(i->data_.streamId == 0);
2012 assert(i->data_.moduleId == 0);
2014 result.push_back(const_cast<MonitorElement *>(&*i));
2022 if (i->data_.run != 0 || i->data_.streamId != 0 || i->data_.moduleId != 0)
break;
2023 result.push_back(const_cast<MonitorElement *>(&*i));
2032 std::vector<MonitorElement*>
2038 rx = lat::Regexp(pattern, 0, syntaxType);
2041 catch (lat::Error &
e)
2043 raiseDQMError(
"DQMStore",
"Invalid regular expression '%s': %s",
2044 pattern.c_str(), e.explain().c_str());
2048 std::vector<MonitorElement *>
result;
2049 MEMap::const_iterator
i =
data_.begin();
2050 MEMap::const_iterator e =
data_.end();
2051 for ( ; i !=
e; ++
i)
2054 mergePath(path, *i->data_.dirname, i->data_.objname);
2056 result.push_back(const_cast<MonitorElement *>(&*i));
2071 MEMap::iterator mi =
data_.begin();
2072 MEMap::iterator me =
data_.end();
2073 for ( ; mi != me; ++mi)
2076 if (mi->wasUpdated())
2095 MEMap::iterator mi =
data_.begin();
2096 MEMap::iterator me =
data_.end();
2097 for ( ; mi != me; ++mi)
2128 std::set<MonitorElement>::const_iterator
e =
data_.end();
2129 std::set<MonitorElement>::const_iterator
i =
data_.lower_bound(proto);
2132 if (i->data_.streamId != 0 ||
2133 i->data_.moduleId != 0)
2135 if (i->data_.lumi != lumi)
2137 if (i->data_.run != run)
2144 std::cout <<
"DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2145 << *i->data_.dirname <<
"/" << i->data_.objname <<
"'"
2146 <<
"flags " << i->data_.flags <<
"\n";
2164 if (TProfile *
h = dynamic_cast<TProfile *>(obj))
2168 me =
bookProfile(dir,
h->GetName(), (TProfile *)
h->Clone());
2175 else if (TProfile2D *
h = dynamic_cast<TProfile2D *>(obj))
2186 else if (TH1F *
h = dynamic_cast<TH1F *>(obj))
2190 me =
book1D(dir,
h->GetName(), (TH1F *)
h->Clone());
2197 else if (TH1S *
h = dynamic_cast<TH1S *>(obj))
2201 me =
book1S(dir,
h->GetName(), (TH1S *)
h->Clone());
2208 else if (TH1D *
h = dynamic_cast<TH1D *>(obj))
2212 me =
book1DD(dir,
h->GetName(), (TH1D *)
h->Clone());
2219 else if (TH2F *
h = dynamic_cast<TH2F *>(obj))
2223 me =
book2D(dir,
h->GetName(), (TH2F *)
h->Clone());
2230 else if (TH2S *
h = dynamic_cast<TH2S *>(obj))
2234 me =
book2S(dir,
h->GetName(), (TH2S *)
h->Clone());
2241 else if (TH2D *
h = dynamic_cast<TH2D *>(obj))
2245 me =
book2DD(dir,
h->GetName(), (TH2D *)
h->Clone());
2252 else if (TH3F *
h = dynamic_cast<TH3F *>(obj))
2256 me =
book3D(dir,
h->GetName(), (TH3F *)
h->Clone());
2263 else if (dynamic_cast<TObjString *>(obj))
2266 if (!
s_rxmeval.match(obj->GetName(), 0, 0, &
m))
2268 if (strstr(obj->GetName(),
"CMSSW"))
2271 std::cout <<
"Input file version: " << obj->GetName() << std::endl;
2274 else if (strstr(obj->GetName(),
"DQMPATCH"))
2277 std::cout <<
"DQM patch version: " << obj->GetName() << std::endl;
2282 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2283 << obj->GetName() <<
"' of type '"
2284 << obj->IsA()->GetName() <<
"'\n";
2296 if (! me || overwrite)
2298 if (! me) me =
bookInt(dir, label);
2299 me->
Fill(atoll(value.c_str()));
2302 else if (kind ==
"f")
2305 if (! me || overwrite)
2308 me->
Fill(atof(value.c_str()));
2311 else if (kind ==
"s")
2319 else if (kind ==
"e")
2324 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2325 << label <<
"' in directory '"
2326 << dir <<
"' to be marked as efficiency plot.\n";
2331 else if (kind ==
"t")
2336 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2337 << label <<
"' in directory '"
2338 << dir <<
"' for a tag\n";
2343 unsigned long val = strtoul(value.c_str(), &endp, 10);
2344 if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2346 std::cout <<
"*** DQMStore: WARNING: cannot restore tag '"
2347 << value <<
"' for monitor element '"
2348 << label <<
"' in directory '"
2349 << dir <<
"' - invalid value\n";
2354 else if (kind ==
"qr")
2359 size_t dot = label.find(
'.');
2360 if (dot == std::string::npos)
2362 std::cout <<
"*** DQMStore: WARNING: quality report label in '" << label
2363 <<
"' is missing a '.' and cannot be extracted\n";
2368 std::string qrname (label, dot+1, std::string::npos);
2374 qv.
code = atoi(m.matchString(value, 1).c_str());
2375 qv.
qtresult = strtod(m.matchString(value, 2).c_str(), 0);
2376 qv.
message = m.matchString(value, 4);
2380 else if (
s_rxmeqr2.match(value, 0, 0, &m))
2382 qv.
code = atoi(m.matchString(value, 1).c_str());
2384 qv.
message = m.matchString(value, 2);
2390 std::cout <<
"*** DQMStore: WARNING: quality test value '"
2391 << value <<
"' is incorrectly formatted\n";
2398 std::cout <<
"*** DQMStore: WARNING: no monitor element '"
2399 << mename <<
"' in directory '"
2400 << dir <<
"' for quality test '"
2410 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2411 << obj->GetName() <<
"' of type '"
2412 << obj->IsA()->GetName() <<
"'\n";
2416 else if (TNamed *
n = dynamic_cast<TNamed *>(obj))
2420 s.reserve(6 + strlen(
n->GetTitle()) + 2*strlen(
n->GetName()));
2421 s +=
'<'; s +=
n->GetName(); s +=
'>';
2423 s +=
'<'; s +=
'/'; s +=
n->GetName(); s +=
'>';
2424 TObjString os(s.c_str());
2429 std::cout <<
"*** DQMStore: WARNING: cannot extract object '"
2430 << obj->GetName() <<
"' of type '" << obj->IsA()->GetName()
2431 <<
"' and with title '" << obj->GetTitle() <<
"'\n";
2466 size_t end = path.find(
'/', start);
2467 if (end == std::string::npos)
2475 TObject *
o = gDirectory->Get(part.c_str());
2476 if (o && ! dynamic_cast<TDirectory *>(o))
2477 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2478 " fails because the part '%s' already exists and is not"
2479 " directory", path.c_str(), part.c_str());
2481 gDirectory->mkdir(part.c_str());
2483 if (! gDirectory->cd(part.c_str()))
2484 raiseDQMError(
"DQMStore",
"Attempt to create directory '%s' in a file"
2485 " fails because could not cd into subdirectory '%s'",
2486 path.c_str(), part.c_str());
2489 if (end+1 >= path.size())
2494 end = path.find(
'/', start);
2495 if (end == std::string::npos)
2504 const uint32_t
run ,
2505 const uint32_t
lumi ,
2506 const bool resetMEsAfterWriting )
2508 using google::protobuf::io::FileOutputStream;
2509 using google::protobuf::io::GzipOutputStream;
2510 using google::protobuf::io::StringOutputStream;
2514 std::set<std::string>::iterator di, de;
2515 MEMap::iterator mi, me =
data_.end();
2520 std::cout <<
"\n DQMStore: Opening PBFile '"
2521 << filename <<
"'"<< std::endl;
2524 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2537 mi =
data_.lower_bound(proto);
2538 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2542 <<
" Lumi: " << (*mi).lumi()
2543 <<
" LumiFlag: " << (*mi).getLumiFlag()
2544 <<
" streamId: " << (*mi).streamId()
2545 <<
" moduleId: " << (*mi).moduleId()
2546 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2553 if (*di != *mi->data_.dirname)
2562 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0))
2566 std::cout <<
"DQMStore::savePB: saving monitor element '"
2567 << *mi->data_.dirname <<
"/" << mi->data_.objname <<
"'"
2568 <<
"flags " << mi->data_.flags <<
"\n";
2575 TObject *toWrite =
nullptr;
2579 toWrite =
new TObjString(mi->tagString().c_str());
2580 deleteObject =
true;
2582 toWrite = mi->object_;
2585 TBufferFile buffer(TBufferFile::kWrite);
2586 buffer.WriteObject(toWrite);
2596 if (resetMEsAfterWriting)
2601 int filedescriptor =
::open(filename.c_str(),
2602 O_WRONLY | O_CREAT | O_TRUNC,
2606 FileOutputStream file_stream(filedescriptor);
2608 options.format = GzipOutputStream::GZIP;
2609 options.compression_level = 6;
2610 GzipOutputStream gzip_stream(&file_stream,
2612 dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2615 gzip_stream.Close();
2616 file_stream.Close();
2617 ::close(filedescriptor);
2621 std::cout <<
"DQMStore::savePB: successfully wrote " << nme
2622 <<
" objects from path '" << path
2623 <<
"' into DQM file '" << filename <<
"'\n";
2636 const uint32_t
run ,
2637 const uint32_t
lumi ,
2641 const bool resetMEsAfterWriting )
2645 std::set<std::string>::iterator di, de;
2646 MEMap::iterator mi, me =
data_.end();
2647 DQMNet::QReports::const_iterator qi, qe;
2655 class TFileNoSync :
public TFile
2658 TFileNoSync(
const char *
file,
const char *opt) : TFile(file, opt) {}
2659 virtual Int_t SysSync(Int_t)
override {
return 0; }
2664 std::cout <<
"\n DQMStore: Opening TFile '" << filename
2665 <<
"' with option '" << fileupdate <<
"'\n";
2667 TFileNoSync
f(filename.c_str(), fileupdate.c_str());
2669 raiseDQMError(
"DQMStore",
"Failed to create/update file '%s'", filename.c_str());
2673 std::auto_ptr<lat::Regexp> rxpat;
2674 if (! pattern.empty())
2675 rxpat.reset(
new lat::Regexp(pattern.c_str()));
2688 for (di =
dirs_.begin(), de =
dirs_.end(); di != de; ++di)
2702 mi =
data_.lower_bound(proto);
2703 for ( ; mi != me &&
isSubdirectory(*di, *mi->data_.dirname); ++mi)
2706 std::cout <<
"DQMStore::save: Run: " << (*mi).run()
2707 <<
" Lumi: " << (*mi).lumi()
2708 <<
" LumiFlag: " << (*mi).getLumiFlag()
2709 <<
" streamId: " << (*mi).streamId()
2710 <<
" moduleId: " << (*mi).moduleId()
2711 <<
" fullpathname: " << (*mi).getFullname() << std::endl;
2718 if (*di != *mi->data_.dirname) {
2720 std::cout <<
"DQMStore::save: isn't a direct child. Skipping" << std::endl;
2730 if (run != 0 && (mi->data_.streamId !=0 || mi->data_.moduleId !=0)) {
2756 for (
size_t i = 0,
e = master->data_.qreports.size();
i !=
e; ++
i)
2757 status =
std::max(status, master->data_.qreports[
i].code);
2759 if (! master || status < minStatus)
2762 std::cout <<
"DQMStore::save: skipping monitor element '"
2763 << mi->data_.objname <<
"' while saving, status is "
2764 << status <<
", required minimum status is "
2765 << minStatus << std::endl;
2772 std::cout <<
"DQMStore::save: saving monitor element '"
2773 << mi->data_.objname <<
"'\n";
2777 gDirectory->cd(
"/");
2780 else if (rxpat.get())
2791 TObjString(mi->tagString().c_str()).Write();
2795 mi->object_->Write();
2802 qi = mi->data_.qreports.begin();
2803 qe = mi->data_.qreports.end();
2804 for ( ; qi != qe; ++qi)
2805 TObjString(mi->qualityTagString(*qi).c_str()).Write();
2810 TObjString(mi->effLabelString().c_str()).Write();
2814 TObjString(mi->tagLabelString().c_str()).Write();
2817 if (resetMEsAfterWriting)
2826 std::cout <<
"DQMStore::save: successfully wrote " << nme
2827 <<
" objects from path '" << path
2828 <<
"' into DQM file '" << filename <<
"'\n";
2841 unsigned int ntot = 0;
2842 unsigned int count = 0;
2844 if (! file->cd(curdir.c_str()))
2845 raiseDQMError(
"DQMStore",
"Failed to process directory '%s' while"
2846 " reading file '%s'", curdir.c_str(), file->GetName());
2869 size_t slash = dirpart.find(
'/');
2870 size_t pos = dirpart.find(
"/Run summary");
2871 if (slash != std::string::npos && pos !=std::string::npos)
2873 dirpart.erase(pos,12);
2875 pos = dirpart.find(
"Run ");
2876 size_t length = dirpart.find(
'/',pos+1)-pos+1;
2877 if (pos !=std::string::npos)
2878 dirpart.erase(pos,length);
2887 size_t slash = dirpart.find(
'/');
2889 if (slash == std::string::npos
2894 slash = dirpart.find(
'/');
2896 if (slash != std::string::npos
2897 && slash + 10 == dirpart.size()
2898 && dirpart.compare( slash+1 , 9 ,
"EventInfo") == 0) {
2900 std::cout <<
"DQMStore::readDirectory: skipping '" << dirpart <<
"'\n";
2905 if (dirpart.empty())
2908 dirpart = prepend +
'/' + dirpart;
2910 else if (! prepend.empty())
2912 if (dirpart.empty())
2915 dirpart = prepend +
'/' + dirpart;
2923 TIter
next (gDirectory->GetListOfKeys());
2924 std::list<TObject *> delayed;
2925 while ((key = (TKey *)
next()))
2927 std::auto_ptr<TObject>
obj(key->ReadObj());
2928 if (dynamic_cast<TDirectory *>(
obj.get()))
2931 subdir.reserve(curdir.size() + strlen(
obj->GetName()) + 2);
2933 if (! curdir.empty())
2935 subdir +=
obj->GetName();
2937 ntot +=
readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2941 else if (dynamic_cast<TObjString *>(
obj.get()))
2943 delayed.push_back(
obj.release());
2948 std::cout <<
"DQMStore: reading object '" <<
obj->GetName()
2949 <<
"' of type '" <<
obj->IsA()->GetName()
2950 <<
"' from '" << file->GetName()
2951 <<
"' into '" << dirpart <<
"'\n";
2959 while (! delayed.empty())
2962 std::cout <<
"DQMStore: reading object '" << delayed.front()->GetName()
2963 <<
"' of type '" << delayed.front()->IsA()->GetName()
2964 <<
"' from '" << file->GetName()
2965 <<
"' into '" << dirpart <<
"'\n";
2971 delete delayed.front();
2972 delayed.pop_front();
2976 std::cout <<
"DQMStore: read " << count <<
'/' << ntot
2977 <<
" objects from directory '" << dirpart <<
"'\n";
2979 return ntot +
count;
2994 bool fileMustExist )
2996 return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
3006 bool fileMustExist )
3008 bool overwrite =
true;
3012 std::cout <<
"DQMStore::load: reading from file '" << filename <<
"'\n";
3014 std::cout <<
"DQMStore::load: in collate mode " <<
"\n";
3016 std::cout <<
"DQMStore::load: in overwrite mode " <<
"\n";
3020 return readFile(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3022 return readFilePB(filename, overwrite,
"",
"", stripdirs, fileMustExist);
3036 bool fileMustExist )
3040 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3042 std::auto_ptr<TFile>
f;
3046 f.reset(TFile::Open(filename.c_str()));
3047 if (! f.get() || f->IsZombie())
3048 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3057 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3062 unsigned n =
readDirectory(f.get(), overwrite, onlypath, prepend,
"", stripdirs);
3065 MEMap::iterator mi =
data_.begin();
3066 MEMap::iterator me =
data_.end();
3067 for ( ; mi != me; ++mi)
3068 const_cast<MonitorElement &>(*mi).updateQReportStats();
3072 std::cout <<
"DQMStore::open: successfully read " << n
3073 <<
" objects from file '" << filename <<
"'";
3074 if (! onlypath.empty())
3075 std::cout <<
" from directory '" << onlypath <<
"'";
3076 if (! prepend.empty())
3077 std::cout <<
" into directory '" << prepend <<
"'";
3087 if (buf.Length() == buf.BufferSize())
3090 void *ptr = buf.ReadObjectAny(0);
3091 return reinterpret_cast<TObject *
>(ptr);
3100 size_t dirpos = (slash == std::string::npos ? 0 :
slash);
3101 size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3103 objname.assign(h.
full_pathname(), namepos, std::string::npos);
3104 TBufferFile buf(TBufferFile::kRead, h.
size(),
3120 bool fileMustExist )
3122 using google::protobuf::io::FileInputStream;
3123 using google::protobuf::io::FileOutputStream;
3124 using google::protobuf::io::GzipInputStream;
3125 using google::protobuf::io::GzipOutputStream;
3126 using google::protobuf::io::CodedInputStream;
3127 using google::protobuf::io::ArrayInputStream;
3130 std::cout <<
"DQMStore::readFile: reading from file '" << filename <<
"'\n";
3133 if ((filedescriptor = ::
open(filename.c_str(), O_RDONLY)) == -1) {
3135 raiseDQMError(
"DQMStore",
"Failed to open file '%s'", filename.c_str());
3138 std::cout <<
"DQMStore::readFile: file '" << filename <<
"' does not exist, continuing\n";
3143 FileInputStream
fin(filedescriptor);
3144 GzipInputStream
input(&fin);
3145 CodedInputStream input_coded(&input);
3146 input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3147 if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3148 raiseDQMError(
"DQMStore",
"Fatal parsing file '%s'", filename.c_str());
3151 ::close(filedescriptor);
3175 extract(static_cast<TObject *>(obj), path, overwrite, collate);
3177 if (me ==
nullptr) {
3203 MEMap::iterator
e =
data_.end();
3204 MEMap::iterator
i =
data_.lower_bound(proto);
3208 std::set<std::string>::iterator de =
dirs_.end();
3209 std::set<std::string>::iterator di =
dirs_.lower_bound(*cleaned);
3219 MEMap::iterator
e =
data_.end();
3220 MEMap::iterator
i =
data_.lower_bound(proto);
3222 if (dir == *i->data_.dirname)
3249 MEMap::iterator pos =
data_.find(proto);
3250 if (pos !=
data_.end())
3253 std::cout <<
"DQMStore: WARNING: attempt to remove non-existent"
3254 <<
" monitor element '" << name <<
"' in '" << dir <<
"'\n";
3265 QCMap::const_iterator
i =
qtests_.find(qtname);
3266 QCMap::const_iterator
e =
qtests_.end();
3267 return (i == e ? 0 : i->second);
3277 raiseDQMError(
"DQMStore",
"Attempt to create duplicate quality test '%s'",
3280 QAMap::iterator
i =
qalgos_.find(algoname);
3282 raiseDQMError(
"DQMStore",
"Cannot create a quality test using unknown"
3283 " algorithm '%s'", algoname.c_str());
3303 if (cleaned->find_first_not_of(
s_safe) != std::string::npos)
3305 " uses unacceptable characters", cleaned->c_str());
3317 raiseDQMError(
"DQMStore",
"Cannot apply non-existent quality test '%s'",
3327 MEMap::iterator mi =
data_.begin();
3328 MEMap::iterator me =
data_.end();
3331 for ( ; mi != me; ++mi)
3334 mergePath(path, *mi->data_.dirname, mi->data_.objname);
3335 if (fm->match(path))
3352 std::cout <<
"DQMStore: running runQTests() with reset = "
3353 << (
reset_ ?
"true" :
"false" ) << std::endl;
3356 MEMap::iterator mi =
data_.begin();
3357 MEMap::iterator me =
data_.end();
3358 for ( ; mi != me; ++mi)
3376 MEMap::const_iterator mi =
data_.begin();
3377 MEMap::const_iterator me =
data_.end();
3378 for ( ; mi != me; ++mi)
3380 if (! cleaned->empty() && !
isSubdirectory(*cleaned, *mi->data_.dirname))
3385 else if (mi->hasWarning())
3388 && mi->hasOtherReport())
3432 std::cout <<
" ------------------------------------------------------------\n"
3433 <<
" Directory structure: \n"
3434 <<
" ------------------------------------------------------------\n";
3436 std::copy(contents.begin(), contents.end(),
3437 std::ostream_iterator<std::string>(
std::cout,
"\n"));
3439 std::cout <<
" ------------------------------------------------------------\n";
3476 MonitorElement * event_me =
get(
"Info/EventInfo/processedEvents");
3479 factor = factor/(events*1.0);
3481 MEMap::iterator mi =
data_.begin();
3482 MEMap::iterator me =
data_.end();
3483 for ( ; mi != me; ++mi)
3535 std::cout <<
" The DQM object '" << me.
getFullname() <<
"' is not scalable object " << std::endl;
QCriterion * getQCriterion(const std::string &qtname) const
MonitorElement * getElement(const std::string &path)
bool compare_strings_reverse(std::string const &pattern, std::string const &input) const
std::pair< fastmatch *, QCriterion * > QTestSpec
TH2S * getTH2S(void) const
TH1S * getTH1S(void) const
T getUntrackedParameter(std::string const &, T const &) const
DQMStore(const edm::ParameterSet &pset, edm::ActivityRegistry &)
static const lat::Regexp s_rxmeqr2("^st\\.(\\d+)\\.(.*)$")
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
bool containsAnyMonitorable(const std::string &path) const
inline::google::protobuf::uint32 size() const
bool isCollateME(MonitorElement *me) const
void resetUpdate(void)
reset "was updated" flag
tuple start
Check for commandline option errors.
bool cdInto(const std::string &path) const
const ::std::string & full_pathname() const
int getStatus(const std::string &path="") const
MonitorElement * initialise(Kind kind)
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
std::vector< std::string > getSubdirs(void) const
TProfile2D * getTProfile2D(void) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void rmdir(const std::string &fullpath)
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
bool match(std::string const &s) const
bool readFile(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
void setLumi(uint32_t ls)
void cd(void)
go to top directory (ie. root)
MonitorElement * get(const std::string &path)
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
static const std::string s_safe
static void splitPath(std::string &dir, std::string &name, const std::string &path)
const std::string & pwd(void)
void disableSoftReset(void)
reverts action of softReset
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
std::vector< MonitorElement * > getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
TH3F * getTH3F(void) const
static const uint32_t DQM_PROP_TAGGED
TH1D * getTH1D(void) const
MatchingHeuristicEnum matching_
void runQTests(void)
run all quality tests
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
TH2D * getTH2D(void) const
const std::string * dirname
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void initializeFrom(const edm::ParameterSet &)
void set_flags(::google::protobuf::uint32 value)
const ::std::string & streamed_histo() const
void initQCriterion(std::map< std::string, QCriterion *(*)(const std::string &)> &m)
static const std::string s_collateDirName
MonitorElement * book(const std::string &dir, const std::string &name, const char *context)
static const std::string s_monitorDirName
name of global monitoring folder (containing all sources subdirectories)
MonitorElement * bookFloat(const char *name)
Book float.
static std::string const input
static const lat::Regexp s_rxtrace("(.*)\\((.*)\\+0x.*\\).*")
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Preallocate preallocateSignal_
signal is emitted before beginJob
void tag(MonitorElement *me, unsigned int myTag)
void disableSoftReset(MonitorElement *me)
unsigned int maxNumberOfStreams() const
static const lat::Regexp s_rxmeval("^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$")
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
fastmatch(std::string const &_fastString)
static const uint32_t DQM_PROP_HAS_REFERENCE
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi)
void get_info(const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
MonitorElement * bookString(const char *name, const char *value)
Book string.
bool isCollate(void) const
void removeElement(const std::string &name)
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
double getFloatValue(void) const
void tag(MonitorElement *, unsigned int)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
QCriterion * makeQCriterion(const std::string &qtname)
void setVerbose(unsigned level)
void softReset(MonitorElement *me)
Kind kind(void) const
Get the type of the monitor element.
TObject * extractNextObject(TBufferFile &) const
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
const std::string getFullname(void) const
get full name of ME including Pathname
std::vector< MonitorElement * > getContents(const std::string &path) const
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
std::string readSelectedDirectory_
std::vector< std::string > getMEs(void)
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
bool dirExists(const std::string &path) const
true if directory exists
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0, const bool resetMEsAfterWriting=false)
void getAllTags(std::vector< std::string > &into) const
bool dirExists(const std::string &path)
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
void tagAllContents(const std::string &path, unsigned int myTag)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * initialise(MonitorElement *me, const std::string &path)
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
bool containsAnyMonitorable(const std::string &path)
void tagContents(const std::string &, unsigned int)
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
void set_size(::google::protobuf::uint32 value)
int64_t getIntValue(void) const
static const std::string s_referenceDirName
void print_trace(const std::string &dir, const std::string &name)
int useQTestByMatch(const std::string &pattern, const std::string &qtname)
attach quality test <qc> to monitor elements matching <pattern>.
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0)
TH1F * getTH1F(void) const
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
static const lat::Regexp s_rxpbfile(".*\\.pb$")
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
bool resetMe(void) const
true if ME should be reset at end of monitoring cycle
void set_full_pathname(const ::std::string &value)
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
void setVerbose(int verbose)
probability limits for warnings, errors
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
bool forceResetOnBeginLumi_
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::vector< boost::shared_ptr< fireworks::OptionNode > > Options
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
inline::dqmstorepb::ROOTFilePB_Histo * add_histo()
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
bool readFilePB(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
TProfile * getTProfile(void) const
void useQTest(const std::string &dir, const std::string &qtname)
void goUp(void)
equivalent to "cd .."
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
inline::google::protobuf::uint32 flags() const
static const int STATUS_OK
void setAccumulate(MonitorElement *me, bool flag)
void setEfficiencyFlag(void)
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
void Reset(std::vector< TH2F > &depth)
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
volatile std::atomic< bool > shutdown_flag false
void showDirStructure(void) const
bool deleteObject(T *fObject, const std::string &fInput, const std::string &fInputTag, HcalDbTool::IOVRun fInputRun, bool fVerbose)
TH2F * getTH2F(void) const
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
for(const auto &isodef:isoDefs)
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
std::set< std::string > dirs_
void Reset(void)
reset ME (ie. contents, errors, etc)
static const uint32_t DQM_PROP_LUMI
static std::string const source
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
tuple size
Write out results.
static const lat::Regexp s_rxmeqr1("^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$")
void makeDirectory(const std::string &path)
bool compare_strings(std::string const &pattern, std::string const &input) const
void setCurrentFolder(const std::string &fullpath)
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
const std::string & pwd(void) const
void set_streamed_histo(const ::std::string &value)
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
void raiseDQMError(const char *context, const char *fmt,...)