CMS 3D CMS Logo

Classes | Enumerations | Functions | Variables
cond::payloadInspector Namespace Reference

Classes

class  Histogram1D
 
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
 

Enumerations

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

Functions

std::string serialize (const PlotAnnotations &annotations, const std::string &imageFileName)
 
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 serializeAnnotations (const PlotAnnotations &annotations)
 
template<typename V >
std::string serializeValue (const std::string &entryLabel, const std::pair< V, 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 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"
 

Enumeration Type Documentation

◆ IOVMultiplicity

Enumerator
UNSPECIFIED_IOV 
MULTI_IOV 
SINGLE_IOV 

Definition at line 289 of file PayloadInspector.h.

289 { UNSPECIFIED_IOV = 0, MULTI_IOV = 1, SINGLE_IOV = 2 };

Function Documentation

◆ serialize() [1/3]

std::string cond::payloadInspector::serialize ( const PlotAnnotations annotations,
const std::string &  imageFileName 
)
inline

Definition at line 176 of file PayloadInspector.h.

176  {
177  std::stringstream ss;
178  ss << "{";
179  ss << serializeAnnotations(annotations);
180  ss << ",";
181  ss << "\"file\": \"" << imageFileName << "\"";
182  ss << "}";
183  return ss.str();
184  }

References serializeAnnotations(), and contentValuesCheck::ss.

◆ serialize() [2/3]

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

Definition at line 126 of file PayloadInspector.h.

126  {
127  // prototype implementation...
128  std::stringstream ss;
129  ss << "{";
130  ss << serializeAnnotations(annotations);
131  ss << ",";
132  ss << "\"data\": [";
133  bool first = true;
134  for (auto d : data) {
135  auto serializedX = serializeValue("x", std::get<0>(d));
136  auto serializedY = serializeValue("y", std::get<1>(d));
137 
138  // N.B.:
139  // we output to JSON only if the stringstream
140  // from serializeValue is not empty
141 
142  if (!serializedY.empty()) {
143  if (!first) {
144  ss << ",";
145  }
146  ss << " { " << serializedX << ", " << serializedY << " }";
147  first = false;
148  }
149  }
150  ss << "]";
151  ss << "}";
152  return ss.str();
153  }

References ztail::d, data, dqmdumpme::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().

◆ serialize() [3/3]

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 156 of file PayloadInspector.h.

156  {
157  // prototype implementation...
158  std::stringstream ss;
159  ss << "{";
160  ss << serializeAnnotations(annotations);
161  ss << ",";
162  ss << "\"data\": [";
163  bool first = true;
164  for (auto d : data) {
165  if (!first)
166  ss << ",";
167  ss << " { " << serializeValue("x", std::get<0>(d)) << ", " << serializeValue("y", std::get<1>(d)) << ", "
168  << serializeValue("z", std::get<2>(d)) << " }";
169  first = false;
170  }
171  ss << "]";
172  ss << "}";
173  return ss.str();
174  }

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

◆ serializeAnnotations()

std::string cond::payloadInspector::serializeAnnotations ( const PlotAnnotations annotations)
inline

Definition at line 110 of file PayloadInspector.h.

110  {
111  std::stringstream ss;
112  ss << "\"version\": \"" << JSON_FORMAT_VERSION << "\",";
113  ss << "\"annotations\": {";
114  bool first = true;
115  for (const auto& a : annotations.m) {
116  if (!first)
117  ss << ",";
118  ss << "\"" << a.first << "\":\"" << a.second << "\"";
119  first = false;
120  }
121  ss << "}";
122  return ss.str();
123  }

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

Referenced by serialize().

◆ serializeValue() [1/4]

template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::pair< V, V > &  value 
)

Definition at line 102 of file PayloadInspector.h.

102  {
103  std::stringstream ss;
104  ss << serializeValue(entryLabel, value.first);
105  ss << ", ";
106  ss << serializeValue(entryLabel + "_err", value.second);
107  return ss.str();
108  }

References serializeValue(), and contentValuesCheck::ss.

◆ serializeValue() [2/4]

template<>
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::string &  value 
)
inline

Definition at line 84 of file PayloadInspector.h.

84  {
85  std::stringstream ss;
86  ss << "\"" << entryLabel << "\":\"" << value << "\"";
87  return ss.str();
88  }

References contentValuesCheck::ss.

◆ serializeValue() [3/4]

template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::tuple< V, std::string > &  value 
)

Definition at line 92 of file PayloadInspector.h.

92  {
93  std::stringstream ss;
94  ss << serializeValue(entryLabel, std::get<0>(value));
95  ss << ", ";
96  ss << serializeValue(entryLabel + "_label", std::get<1>(value));
97  return ss.str();
98  }

References serializeValue(), and contentValuesCheck::ss.

◆ serializeValue() [4/4]

template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const V &  value 
)

Definition at line 64 of file PayloadInspector.h.

64  {
65  std::stringstream ss;
66 
67  // N.B.:
68  // This hack is to output a line to stringstream only in case the
69  // return type of getFromPayload is a std::pair<bool, float>
70  // and the bool is true. This allows to control which points should
71  // enter the trend and which should not.
72 
73  if constexpr (std::is_same_v<V, std::pair<bool, float>>) {
74  if (value.first) {
75  ss << "\"" << entryLabel << "\":" << value.second;
76  }
77  } else {
78  ss << "\"" << entryLabel << "\":" << value;
79  }
80  return ss.str();
81  }

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

Referenced by serialize(), and serializeValue().

◆ setAnnotations()

void cond::payloadInspector::setAnnotations ( const std::string &  type,
const std::string &  title,
IOVMultiplicity  IOV_M,
int  NTAGS,
PlotAnnotations target 
)
inline

Variable Documentation

◆ JSON_FORMAT_VERSION

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

Definition at line 60 of file PayloadInspector.h.

Referenced by serializeAnnotations().

cms::cuda::V
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t V
Definition: HistoContainer.h:99
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
dqmdumpme.first
first
Definition: dqmdumpme.py:55
cond::payloadInspector::JSON_FORMAT_VERSION
static const char *const JSON_FORMAT_VERSION
Definition: PayloadInspector.h:60
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
cond::payloadInspector::UNSPECIFIED_IOV
Definition: PayloadInspector.h:289
cond::payloadInspector::serializeValue
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
Definition: PayloadInspector.h:102
a
double a
Definition: hdecay.h:119
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
cond::payloadInspector::MULTI_IOV
Definition: PayloadInspector.h:289
value
Definition: value.py:1
relativeConstraints.value
value
Definition: relativeConstraints.py:53
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
ztail.d
d
Definition: ztail.py:151
cond::payloadInspector::SINGLE_IOV
Definition: PayloadInspector.h:289
cond::payloadInspector::serializeAnnotations
std::string serializeAnnotations(const PlotAnnotations &annotations)
Definition: PayloadInspector.h:110