CMS 3D CMS Logo

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

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"
 

Typedef Documentation

◆ Histogram1D

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

Definition at line 790 of file PayloadInspector.h.

◆ Histogram1DD

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

Definition at line 793 of file PayloadInspector.h.

Enumeration Type Documentation

◆ IOVMultiplicity

Enumerator
UNSPECIFIED_IOV 
MULTI_IOV 
SINGLE_IOV 

Definition at line 295 of file PayloadInspector.h.

295 { 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 182 of file PayloadInspector.h.

182  {
183  std::stringstream ss;
184  ss << "{";
185  ss << serializeAnnotations(annotations);
186  ss << ",";
187  ss << "\"file\": \"" << imageFileName << "\"";
188  ss << "}";
189  return ss.str();
190  }

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

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

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().

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

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

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

◆ serializeAnnotations()

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

Definition at line 116 of file PayloadInspector.h.

116  {
117  std::stringstream ss;
118  ss << "\"version\": \"" << JSON_FORMAT_VERSION << "\",";
119  ss << "\"annotations\": {";
120  bool first = true;
121  for (const auto& a : annotations.m) {
122  if (!first)
123  ss << ",";
124  ss << "\"" << a.first << "\":\"" << a.second << "\"";
125  first = false;
126  }
127  ss << "}";
128  return ss.str();
129  }

References a, 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 108 of file PayloadInspector.h.

108  {
109  std::stringstream ss;
110  ss << serializeValue(entryLabel, value.first);
111  ss << ", ";
112  ss << serializeValue(entryLabel + "_err", value.second);
113  return ss.str();
114  }

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

90  {
91  std::stringstream ss;
92  ss << "\"" << entryLabel << "\":\"" << value << "\"";
93  return ss.str();
94  }

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

98  {
99  std::stringstream ss;
100  ss << serializeValue(entryLabel, std::get<0>(value));
101  ss << ", ";
102  ss << serializeValue(entryLabel + "_label", std::get<1>(value));
103  return ss.str();
104  }

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

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

References alignBH_cfg::fixed, 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 61 of file PayloadInspector.h.

Referenced by serializeAnnotations().

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
cond::payloadInspector::JSON_FORMAT_VERSION
static const char *const JSON_FORMAT_VERSION
Definition: PayloadInspector.h:61
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
cond::payloadInspector::UNSPECIFIED_IOV
Definition: PayloadInspector.h:295
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
cond::payloadInspector::serializeValue
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
Definition: PayloadInspector.h:108
a
double a
Definition: hdecay.h:119
cms::cuda::V
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t V
Definition: HistoContainer.h:51
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
cond::payloadInspector::MULTI_IOV
Definition: PayloadInspector.h:295
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:295
cond::payloadInspector::serializeAnnotations
std::string serializeAnnotations(const PlotAnnotations &annotations)
Definition: PayloadInspector.h:116