|
|
Go to the documentation of this file. 1 #ifndef CondCore_Utilities_PayloadInspector_h
2 #define CondCore_Utilities_PayloadInspector_h
15 #include <boost/python/list.hpp>
16 #include <boost/python/dict.hpp>
17 #include <boost/python/tuple.hpp>
22 ret.append(boost::python::make_tuple(
tagName, std::to_string(
start), std::to_string(
end)));
32 ret.append(boost::python::make_tuple(tagName0, std::to_string(start0), std::to_string(end0)));
33 ret.append(boost::python::make_tuple(tagName1, std::to_string(start1), std::to_string(end1)));
40 namespace payloadInspector {
45 static constexpr
const char*
const TITLE_K =
"title";
47 static constexpr
const char*
const INFO_K =
"info";
48 static constexpr
const char*
const XAXIS_K =
"x_label";
49 static constexpr
const char*
const YAXIS_K =
"y_label";
50 static constexpr
const char*
const ZAXIS_K =
"z_label";
53 std::map<std::string, std::string>
m;
65 ss <<
"\"" << entryLabel <<
"\":" <<
value;
72 ss <<
"\"" << entryLabel <<
"\":\"" <<
value <<
"\"";
80 ss << serializeValue(entryLabel, std::get<0>(
value));
99 ss <<
"\"annotations\": {";
101 for (
auto a : annotations.
m) {
104 ss <<
"\"" <<
a.first <<
"\":\"" <<
a.second <<
"\"";
111 template <
typename X,
typename Y>
114 std::stringstream
ss;
120 for (
auto d :
data) {
131 template <
typename X,
typename Y,
typename Z>
134 std::stringstream
ss;
140 for (
auto d :
data) {
153 std::stringstream
ss;
157 ss <<
"\"file\": \"" << imageFileName <<
"\"";
163 static constexpr
const char*
const label =
"2.0";
168 const std::pair<cond::Time_t, cond::Time_t>&
b,
169 const std::vector<std::tuple<cond::Time_t, cond::Hash>>&
i)
173 const std::pair<cond::Time_t, cond::Time_t>&
boundary;
174 const std::vector<std::tuple<cond::Time_t, cond::Hash>>&
iovs;
192 unsigned int ntags()
const;
214 const std::vector<std::tuple<std::string, cond::Time_t, cond::Time_t>>& tagsWithTimeBoundaries);
229 template <
typename PayloadType>
239 if (sz == 0 ||
index > (sz - 1)) {
256 std::vector<std::vector<std::tuple<cond::Time_t, cond::Hash>>>
m_tagIovs;
275 template <IOVMultiplicity IOV_M,
int NTAGS>
290 virtual bool fill() = 0;
309 virtual bool fill() = 0;
329 virtual bool fill() = 0;
354 virtual bool fill() = 0;
380 std::vector<std::tuple<cond::Time_t, cond::Hash>> theIovs = PlotBase::getTag<0>().iovs;
382 auto tag2iovs = PlotBase::getTag<1>().iovs;
383 size_t oldSize = theIovs.size();
384 size_t newSize = oldSize + tag2iovs.size();
385 theIovs.resize(newSize);
386 for (
size_t i = 0;
i < tag2iovs.size();
i++) {
387 theIovs[
i + oldSize] = tag2iovs[
i];
390 return fill(theIovs);
393 virtual bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash>>& iovs) {
return false; }
397 m_singleIovSet =
true;
409 bool m_singleIovSet =
false;
428 std::vector<std::tuple<cond::Time_t, cond::Hash>> theIovs = PlotBase::getTag<0>().iovs;
430 auto tag2iovs = PlotBase::getTag<1>().iovs;
431 size_t oldSize = theIovs.size();
432 size_t newSize = oldSize + tag2iovs.size();
433 theIovs.resize(newSize);
434 for (
size_t i = 0;
i < tag2iovs.size();
i++) {
435 theIovs[
i + oldSize] = tag2iovs[
i];
438 return fill(theIovs);
441 virtual bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash>>& iovs) {
return false; }
447 template <
typename PayloadType,
typename X,
typename Y, IOVMultiplicity IOV_M = UNSPECIFIED_IOV,
int NTAGS = 0>
461 return PlotBase::fetchPayload<PayloadType>(payloadHash);
468 template <
typename PayloadType,
492 return PlotBase::fetchPayload<PayloadType>(payloadHash);
499 template <
typename PayloadType,
typename Y>
509 auto tag = PlotBase::getTag<0>();
510 for (
auto iov :
tag.iovs) {
523 template <
typename PayloadType,
typename Y>
529 :
Base(
"RunHistory",
title,
"iov_since", yLabel) {}
534 auto tag = PlotBase::getTag<0>();
536 std::map<cond::Time_t, unsigned int>
runs;
540 for (
auto iov :
tag.iovs) {
541 unsigned int run = std::get<0>(iov) >> 32;
543 if (it ==
runs.end())
544 it =
runs.insert(std::make_pair(
run, 0)).first;
548 unsigned int currentRun = 0;
550 unsigned int lumiSize = 0;
551 unsigned int rind = 0;
554 for (
auto iov :
tag.iovs) {
555 unsigned long long since = std::get<0>(iov);
560 if (
run != currentRun) {
564 if (it ==
runs.end()) {
568 lumiSize = it->second;
573 label = std::to_string(
run) +
" : " + std::to_string(
lumi);
580 label = boost::posix_time::to_simple_string(
t);
597 template <
typename PayloadType,
typename Y>
603 :
Base(
"TimeHistory",
title,
"iov_since", yLabel) {}
607 auto tag = PlotBase::getTag<0>();
620 for (
auto iov :
tag.iovs) {
622 boost::posix_time::ptime
time;
625 unsigned int nlumi =
since & 0xFFFFFFFF;
630 if (it == runInfo.
end()) {
638 label += (
" : " + std::to_string(nlumi));
642 label = boost::posix_time::to_simple_string(
time);
656 template <
typename PayloadType,
typename X,
typename Y>
662 :
Base(
"Scatter",
title, xLabel, yLabel) {}
666 auto tag = PlotBase::getTag<0>();
667 for (
auto iov :
tag.iovs) {
681 template <
typename PayloadType, IOVMultiplicity IOV_M = UNSPECIFIED_IOV>
725 auto tag = PlotBase::getTag<0>();
726 for (
auto iov :
tag.iovs) {
747 template <
typename PayloadType, IOVMultiplicity IOV_M = UNSPECIFIED_IOV>
761 :
Base(
"Histo2D",
title, xLabel, yLabel,
"entries"),
774 if (xbinSize > 0 && ybinSize > 0) {
798 auto tag = PlotBase::getTag<0>();
799 for (
auto iov :
tag.iovs) {
813 return std::make_tuple(x, y);
828 template <
typename PayloadType, IOVMultiplicity IOV_M = UNSPECIFIED_IOV,
int NTAGS = 0>
833 std::string payloadTypeName = cond::demangledName(
typeid(PayloadType));
841 return PlotBase::fetchPayload<PayloadType>(payloadHash);
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash >> &iovs)
ret
prodAgent to be discontinued
Plot2D< PayloadType, float, float, IOV_M, 1 > Base
std::string processData() override
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t V
std::string m_imageFileName
~HistoryPlot() override=default
~Plot3D() override=default
Iterator find(Time_t target) const
PlotImpl(const std::string &type, const std::string &title)
boost::posix_time::ptime to_boost(Time_t iValue)
bool process(const std::string &connectionString, const boost::python::list &tagsWithTimeBoundaries)
void fillWithValue(float value, float weight=1)
virtual float getFromPayload(PayloadType &payload)
boost::python::list mk_input(const std::string &tagName, cond::Time_t start, cond::Time_t end)
std::string payloadType() const
Histogram2D(const std::string &title, const std::string &xLabel, size_t nxbins, float xmin, float xmax, const std::string &yLabel, size_t nybins, float ymin, float ymax)
void setSingleIov(bool flag)
~TimeHistoryPlot() override=default
cond::persistency::Session m_dbSession
std::vector< std::pair< cond::Time_t, cond::Time_t > > m_tagBoundaries
~Plot2D() override=default
static constexpr const char *const PLOT_TYPE_K
std::string get(const std::string &key) const
Plot2D< PayloadType, X, Y, MULTI_IOV, 1 > Base
static constexpr const char *const INFO_K
const std::map< std::string, std::string > & inputParamValues() const
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
~ScatterPlot() override=default
PlotImage(const std::string &title)
boost::python::list inputParams() const
PlotImpl< IOV_M, NTAGS > Base
RunHistoryPlot(const std::string &title, const std::string &yLabel)
static const char *const JSON_FORMAT_VERSION
std::string serializeValue(const std::string &entryLabel, const V &value)
std::string serialize(const PlotAnnotations &annotations, const std::vector< std::tuple< X, Y >> &data)
void setTwoTags(bool flag)
void setTwoTags(bool flag)
virtual Y getFromPayload(PayloadType &payload)=0
bool exec_process(const std::string &connectionString, const std::vector< std::tuple< std::string, cond::Time_t, cond::Time_t >> &tagsWithTimeBoundaries)
std::unique_ptr< T > fetchPayload(const cond::Hash &payloadHash)
std::map< std::string, std::string > m
static constexpr const char *const ZAXIS_K
std::vector< std::tuple< X, Y > > m_plotData
virtual std::tuple< X, Y > getFromPayload(PayloadType &payload)=0
std::string serializeData() override
void setAnnotations(const std::string &type, const std::string &title, IOVMultiplicity IOV_M, int NTAGS, PlotAnnotations &target)
const unsigned int SECONDS_PER_LUMI(23)
PlotImpl(const std::string &type, const std::string &title)
void setTwoTags(bool flag)
unsigned int ntags() const
virtual std::string serializeData()=0
std::vector< std::string > m_tagNames
PlotImpl< IOV_M, NTAGS > Base
cond::persistency::Session dbSession()
std::map< std::string, std::string > m_inputParamValues
Plot2D< PayloadType, std::tuple< unsigned long long, std::string >, Y, MULTI_IOV, 1 > Base
cond::Tag_t getTagInfo(const std::string &tag)
Plot2D(const std::string &type, const std::string &title, const std::string xLabel, const std::string &yLabel)
RunInfoProxy getRunInfo(cond::Time_t start, cond::Time_t end)
static constexpr const char *const label
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
~PlotImpl() override=default
PlotImpl(const std::string &type, const std::string &title)
Plot3D< PayloadType, float, float, float, IOV_M, 1 > Base
std::string title() const
std::string processData() override
Plot2D< PayloadType, unsigned long long, Y, MULTI_IOV, 1 > Base
std::string processData() override
void setInputParamValues(const boost::python::dict &values)
virtual std::tuple< float, float > getFromPayload(PayloadType &payload)
ScatterPlot(const std::string &title, const std::string &xLabel, const std::string &yLabel)
void fillWithValue(float xvalue, float yvalue, float weight=1)
Time_t from_boost(boost::posix_time::ptime bt)
PlotImpl< IOV_M, NTAGS > Base
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
unsigned long long Time_t
static constexpr const char *const TITLE_K
~RunHistoryPlot() override=default
HistoryPlot(const std::string &title, const std::string &yLabel)
std::vector< std::tuple< X, Y, Z > > m_plotData
std::set< std::string > m_inputParams
static constexpr const char *const PAYLOAD_TYPE_K
virtual Y getFromPayload(PayloadType &payload)=0
std::string processData() override
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
std::vector< std::vector< std::tuple< cond::Time_t, cond::Hash > > > m_tagIovs
TagReference(const TagReference &rhs)
virtual Y getFromPayload(PayloadType &payload)=0
virtual std::string processData()
virtual ~PlotBase()=default
const std::vector< std::tuple< cond::Time_t, cond::Hash > > & iovs
TimeHistoryPlot(const std::string &title, const std::string &yLabel)
const std::pair< cond::Time_t, cond::Time_t > & boundary
std::string serializeData() override
TagReference(const std::string &n, const std::pair< cond::Time_t, cond::Time_t > &b, const std::vector< std::tuple< cond::Time_t, cond::Hash >> &i)
std::string processData() override
static constexpr const char *const XAXIS_K
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash >> &iovs)
char data[epos_bytes_allocation]
PlotImpl(const std::string &type, const std::string &title)
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
Plot2D< PayloadType, std::tuple< float, std::string >, Y, MULTI_IOV, 1 > Base
Plot3D(const std::string &type, const std::string &title, const std::string xLabel, const std::string &yLabel, const std::string &zLabel)
PlotImpl(const std::string &type, const std::string &title)
void addInputParam(const std::string ¶mName)
Histogram1D(const std::string &title, const std::string &xLabel, size_t nbins, float min, float max, const std::string &yLabel="entries")
void setSingleIov(bool flag)
PlotAnnotations m_plotAnnotations
static constexpr const char *const YAXIS_K
std::string serializeAnnotations(const PlotAnnotations &annotations)
std::string serializeData() override
void throwException(const std::string &message, const std::string &methodName)
std::string createGlobalIdentifier()
void fillWithBinAndValue(size_t bin, float weight=1)