CMS 3D CMS Logo

Classes | Functions | Variables
cond::payloadInspector Namespace Reference

Classes

class  Histogram1D
 
class  Histogram2D
 
class  HistoryPlot
 
struct  ModuleVersion
 
class  Plot2D
 
class  Plot3D
 
struct  PlotAnnotations
 
class  PlotBase
 
class  RunHistoryPlot
 
class  ScatterPlot
 
class  TimeHistoryPlot
 

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

Variables

static const char *const JSON_FORMAT_VERSION = "1.0"
 

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

References edmIntegrityCheck::d, data, plotBeamSpotDB::first, serializeAnnotations(), and serializeValue().

Referenced by cond::payloadInspector::Plot2D< PayloadType, float, float >::serializeData(), and cond::payloadInspector::Plot3D< PayloadType, float, float, float >::serializeData().

80  {
81  // prototype implementation...
82  std::stringstream ss;
83  ss << "{";
84  ss << serializeAnnotations( annotations );
85  ss <<",";
86  ss << "\"data\": [";
87  bool first = true;
88  for ( auto d : data ){
89  if( !first ) ss <<",";
90  ss <<" { "<<serializeValue("x",std::get<0>(d))<<", "<<serializeValue( "y",std::get<1>( d))<<" }";
91  first = false;
92  }
93  ss << "]";
94  ss << "}";
95  return ss.str();
96  }
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
std::string serializeAnnotations(const PlotAnnotations &annotations)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 98 of file PayloadInspector.h.

References edmIntegrityCheck::d, data, plotBeamSpotDB::first, serializeAnnotations(), and serializeValue().

98  {
99  // prototype implementation...
100  std::stringstream ss;
101  ss << "{";
102  ss << serializeAnnotations( annotations );
103  ss <<",";
104  ss << "\"data\": [";
105  bool first = true;
106  for ( auto d : data ){
107  if( !first ) ss <<",";
108  ss <<" { "<<serializeValue("x",std::get<0>(d))<<", "<<serializeValue( "y",std::get<1>( d))<<", "<<serializeValue( "z",std::get<2>( d))<<" }";
109  first = false;
110  }
111  ss << "]";
112  ss << "}";
113  return ss.str();
114  }
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
std::string serializeAnnotations(const PlotAnnotations &annotations)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::string cond::payloadInspector::serializeAnnotations ( const PlotAnnotations annotations)

Definition at line 66 of file PayloadInspector.h.

References a, plotBeamSpotDB::first, and cond::payloadInspector::PlotAnnotations::m.

Referenced by serialize().

66  {
67  std::stringstream ss;
68  ss <<"\"version\": \""<<JSON_FORMAT_VERSION<<"\",";
69  ss <<"\"annotations\": {";
70  bool first = true;
71  for( auto a: annotations.m ){
72  if ( !first ) ss <<",";
73  ss << "\""<<a.first<<"\":\"" << a.second <<"\"";
74  first = false;
75  }
76  ss <<"}";
77  return ss.str();
78  }
static const char *const JSON_FORMAT_VERSION
double a
Definition: hdecay.h:121
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const V &  value 
)

Definition at line 36 of file PayloadInspector.h.

References relativeConstraints::value.

Referenced by serialize(), and serializeValue().

36  {
37  std::stringstream ss;
38  ss << "\""<<entryLabel<<"\":"<<value;
39  return ss.str();
40  }
template<>
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::string &  value 
)

Definition at line 42 of file PayloadInspector.h.

42  {
43  std::stringstream ss;
44  ss << "\""<<entryLabel<<"\":\""<<value<<"\"";
45  return ss.str();
46  }
Definition: value.py:1
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::tuple< V, std::string > &  value 
)

Definition at line 49 of file PayloadInspector.h.

References serializeValue(), and relativeConstraints::value.

49  {
50  std::stringstream ss;
51  ss << serializeValue( entryLabel, std::get<0>(value) );
52  ss << ", ";
53  ss << serializeValue( entryLabel+"_label", std::get<1>(value) );
54  return ss.str();
55  }
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
Definition: value.py:1
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::pair< V, V > &  value 
)

Definition at line 58 of file PayloadInspector.h.

References serializeValue().

58  {
59  std::stringstream ss;
60  ss << serializeValue( entryLabel, value.first );
61  ss << ", ";
62  ss << serializeValue( entryLabel+"_err", value.second );
63  return ss.str();
64  }
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
Definition: value.py:1

Variable Documentation

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

Definition at line 33 of file PayloadInspector.h.