CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Typedefs | Enumerations | Functions | Variables
cond::payloadInspector Namespace Reference

Classes

class  Histogram1
 
class  Histogram2D
 
class  HistoryPlot
 
struct  ModuleVersion
 
class  Plot2D
 
class  Plot3D
 
struct  PlotAnnotations
 
class  PlotBase
 
class  PlotImage
 
class  PlotImpl
 
class  PlotImpl< MULTI_IOV, 0 >
 
class  PlotImpl< SINGLE_IOV, 0 >
 
class  PlotImpl< UNSPECIFIED_IOV, 0 >
 
class  PlotImpl< UNSPECIFIED_IOV, 1 >
 
class  PlotImpl< UNSPECIFIED_IOV, NTAGS >
 
class  RunHistoryPlot
 
class  ScatterPlot
 
struct  TagReference
 
class  TimeHistoryPlot
 

Typedefs

template<typename PayloadType , IOVMultiplicity IOV_M = UNSPECIFIED_IOV>
using Histogram1D = Histogram1< float, PayloadType, UNSPECIFIED_IOV >
 
template<typename PayloadType , IOVMultiplicity IOV_M = UNSPECIFIED_IOV>
using Histogram1DD = Histogram1< double, PayloadType, UNSPECIFIED_IOV >
 

Enumerations

enum  IOVMultiplicity { UNSPECIFIED_IOV = 0, MULTI_IOV = 1, SINGLE_IOV = 2 }
 

Functions

template<typename X , typename Y >
std::string serialize (const PlotAnnotations &annotations, const std::vector< std::tuple< X, Y >> &data)
 
template<typename X , typename Y , typename Z >
std::string serialize (const PlotAnnotations &annotations, const std::vector< std::tuple< X, Y, Z >> &data)
 
std::string serialize (const PlotAnnotations &annotations, const std::string &imageFileName)
 
std::string serializeAnnotations (const PlotAnnotations &annotations)
 
template<typename V >
std::string serializeValue (const std::string &entryLabel, const V &value)
 
template<>
std::string serializeValue (const std::string &entryLabel, const std::string &value)
 
template<typename V >
std::string serializeValue (const std::string &entryLabel, const std::tuple< V, std::string > &value)
 
template<typename V >
std::string serializeValue (const std::string &entryLabel, const std::pair< V, V > &value)
 
void setAnnotations (const std::string &type, const std::string &title, IOVMultiplicity IOV_M, int NTAGS, PlotAnnotations &target)
 

Variables

static const char *const JSON_FORMAT_VERSION = "1.0"
 

Typedef Documentation

template<typename PayloadType , IOVMultiplicity IOV_M = UNSPECIFIED_IOV>
using cond::payloadInspector::Histogram1D = typedef Histogram1<float, PayloadType, UNSPECIFIED_IOV>

Definition at line 794 of file PayloadInspector.h.

template<typename PayloadType , IOVMultiplicity IOV_M = UNSPECIFIED_IOV>
using cond::payloadInspector::Histogram1DD = typedef Histogram1<double, PayloadType, UNSPECIFIED_IOV>

Definition at line 797 of file PayloadInspector.h.

Enumeration Type Documentation

Function Documentation

template<typename X , typename Y >
std::string cond::payloadInspector::serialize ( const PlotAnnotations &  annotations,
const std::vector< std::tuple< X, Y >> &  data 
)

Definition at line 135 of file PayloadInspector.h.

References ztail::d, data, first, serializeAnnotations(), serializeValue(), and contentValuesCheck::ss.

Referenced by cond::payloadInspector::Plot2D< PayloadType, X, Y, MULTI_IOV, 1 >::serializeData(), cond::payloadInspector::Plot3D< PayloadType, float, float, float, IOV_M, 1 >::serializeData(), and cond::payloadInspector::PlotImage< PayloadType >::serializeData().

135  {
136  // prototype implementation...
137  std::stringstream ss;
138  ss << "{";
139  ss << serializeAnnotations(annotations);
140  ss << ",";
141  ss << "\"data\": [";
142  bool first = true;
143  for (auto d : data) {
144  auto serializedX = serializeValue("x", std::get<0>(d));
145  auto serializedY = serializeValue("y", std::get<1>(d));
146 
147  // N.B.:
148  // we output to JSON only if the stringstream
149  // from serializeValue is not empty
150 
151  if (!serializedY.empty()) {
152  if (!first) {
153  ss << ",";
154  }
155  ss << " { " << serializedX << ", " << serializedY << " }";
156  first = false;
157  }
158  }
159  ss << "]";
160  ss << "}";
161  return ss.str();
162  }
tuple d
Definition: ztail.py:151
std::string serializeValue(const std::string &entryLabel, const V &value)
std::string serializeAnnotations(const PlotAnnotations &annotations)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
template<typename X , typename Y , typename Z >
std::string cond::payloadInspector::serialize ( const PlotAnnotations &  annotations,
const std::vector< std::tuple< X, Y, Z >> &  data 
)

Definition at line 165 of file PayloadInspector.h.

References ztail::d, data, first, serializeAnnotations(), serializeValue(), and contentValuesCheck::ss.

165  {
166  // prototype implementation...
167  std::stringstream ss;
168  ss << "{";
169  ss << serializeAnnotations(annotations);
170  ss << ",";
171  ss << "\"data\": [";
172  bool first = true;
173  for (auto d : data) {
174  if (!first)
175  ss << ",";
176  ss << " { " << serializeValue("x", std::get<0>(d)) << ", " << serializeValue("y", std::get<1>(d)) << ", "
177  << serializeValue("z", std::get<2>(d)) << " }";
178  first = false;
179  }
180  ss << "]";
181  ss << "}";
182  return ss.str();
183  }
tuple d
Definition: ztail.py:151
std::string serializeValue(const std::string &entryLabel, const V &value)
std::string serializeAnnotations(const PlotAnnotations &annotations)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::string cond::payloadInspector::serialize ( const PlotAnnotations &  annotations,
const std::string &  imageFileName 
)
inline

Definition at line 185 of file PayloadInspector.h.

References serializeAnnotations(), and contentValuesCheck::ss.

185  {
186  std::stringstream ss;
187  ss << "{";
188  ss << serializeAnnotations(annotations);
189  ss << ",";
190  ss << "\"file\": \"" << imageFileName << "\"";
191  ss << "}";
192  return ss.str();
193  }
std::string serializeAnnotations(const PlotAnnotations &annotations)
std::string cond::payloadInspector::serializeAnnotations ( const PlotAnnotations &  annotations)
inline

Definition at line 119 of file PayloadInspector.h.

References a, first, JSON_FORMAT_VERSION, cond::payloadInspector::PlotAnnotations::m, and contentValuesCheck::ss.

Referenced by serialize().

119  {
120  std::stringstream ss;
121  ss << "\"version\": \"" << JSON_FORMAT_VERSION << "\",";
122  ss << "\"annotations\": {";
123  bool first = true;
124  for (const auto& a : annotations.m) {
125  if (!first)
126  ss << ",";
127  ss << "\"" << a.first << "\":\"" << a.second << "\"";
128  first = false;
129  }
130  ss << "}";
131  return ss.str();
132  }
static const char *const JSON_FORMAT_VERSION
double a
Definition: hdecay.h:119
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const V &  value 
)

Definition at line 68 of file PayloadInspector.h.

References contentValuesCheck::ss, cms::cuda::V, and relativeConstraints::value.

Referenced by serialize(), and serializeValue().

68  {
69  std::stringstream ss;
70 
71  // N.B.:
72  // This hack is to output a line to stringstream only in case the
73  // return type of getFromPayload is a std::pair<bool, float>
74  // and the bool is true. This allows to control which points should
75  // enter the trend and which should not.
76 
77  if constexpr (std::is_same_v<V, std::pair<bool, float>>) {
78  if (value.first) {
79  ss << "\"" << entryLabel << "\":" << value.second;
80  }
81  } else if constexpr (std::is_same_v<V, double>) {
82  if ((value - int(value)) == 0) {
83  ss.precision(0);
84  }
85  ss << "\"" << entryLabel << "\":" << std::fixed << value;
86  } else {
87  ss << "\"" << entryLabel << "\":" << value;
88  }
89  return ss.str();
90  }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
template<>
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::string &  value 
)
inline

Definition at line 93 of file PayloadInspector.h.

References contentValuesCheck::ss.

93  {
94  std::stringstream ss;
95  ss << "\"" << entryLabel << "\":\"" << value << "\"";
96  return ss.str();
97  }
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::tuple< V, std::string > &  value 
)

Definition at line 101 of file PayloadInspector.h.

References serializeValue(), contentValuesCheck::ss, and relativeConstraints::value.

101  {
102  std::stringstream ss;
103  ss << serializeValue(entryLabel, std::get<0>(value));
104  ss << ", ";
105  ss << serializeValue(entryLabel + "_label", std::get<1>(value));
106  return ss.str();
107  }
std::string serializeValue(const std::string &entryLabel, const V &value)
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::pair< V, V > &  value 
)

Definition at line 111 of file PayloadInspector.h.

References serializeValue(), and contentValuesCheck::ss.

111  {
112  std::stringstream ss;
113  ss << serializeValue(entryLabel, value.first);
114  ss << ", ";
115  ss << serializeValue(entryLabel + "_err", value.second);
116  return ss.str();
117  }
std::string serializeValue(const std::string &entryLabel, const V &value)
void cond::payloadInspector::setAnnotations ( const std::string &  type,
const std::string &  title,
IOVMultiplicity  IOV_M,
int  NTAGS,
PlotAnnotations &  target 
)
inline

Variable Documentation

const char* const cond::payloadInspector::JSON_FORMAT_VERSION = "1.0"
static

Definition at line 64 of file PayloadInspector.h.

Referenced by serializeAnnotations().