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

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

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

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

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

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

100  {
101  // prototype implementation...
102  std::stringstream ss;
103  ss << "{";
104  ss << serializeAnnotations( annotations );
105  ss <<",";
106  ss << "\"data\": [";
107  bool first = true;
108  for ( auto d : data ){
109  if( !first ) ss <<",";
110  ss <<" { "<<serializeValue("x",std::get<0>(d))<<", "<<serializeValue( "y",std::get<1>( d))<<", "<<serializeValue( "z",std::get<2>( d))<<" }";
111  first = false;
112  }
113  ss << "]";
114  ss << "}";
115  return ss.str();
116  }
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::serialize ( const PlotAnnotations annotations,
const std::string &  imageFileName 
)

Definition at line 118 of file PayloadInspector.h.

References serializeAnnotations().

118  {
119  std::stringstream ss;
120  ss << "{";
121  ss << serializeAnnotations( annotations );
122  ss <<",";
123  ss << "\"file\": \""<<imageFileName<<"\"";
124  ss << "}";
125  return ss.str();
126  }
std::string serializeAnnotations(const PlotAnnotations &annotations)
std::string cond::payloadInspector::serializeAnnotations ( const PlotAnnotations annotations)

Definition at line 68 of file PayloadInspector.h.

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

Referenced by serialize().

68  {
69  std::stringstream ss;
70  ss <<"\"version\": \""<<JSON_FORMAT_VERSION<<"\",";
71  ss <<"\"annotations\": {";
72  bool first = true;
73  for( auto a: annotations.m ){
74  if ( !first ) ss <<",";
75  ss << "\""<<a.first<<"\":\"" << a.second <<"\"";
76  first = false;
77  }
78  ss <<"}";
79  return ss.str();
80  }
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 38 of file PayloadInspector.h.

References relativeConstraints::value.

Referenced by serialize(), and serializeValue().

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

Definition at line 44 of file PayloadInspector.h.

44  {
45  std::stringstream ss;
46  ss << "\""<<entryLabel<<"\":\""<<value<<"\"";
47  return ss.str();
48  }
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 51 of file PayloadInspector.h.

References serializeValue(), and relativeConstraints::value.

51  {
52  std::stringstream ss;
53  ss << serializeValue( entryLabel, std::get<0>(value) );
54  ss << ", ";
55  ss << serializeValue( entryLabel+"_label", std::get<1>(value) );
56  return ss.str();
57  }
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 60 of file PayloadInspector.h.

References serializeValue().

60  {
61  std::stringstream ss;
62  ss << serializeValue( entryLabel, value.first );
63  ss << ", ";
64  ss << serializeValue( entryLabel+"_err", value.second );
65  return ss.str();
66  }
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 35 of file PayloadInspector.h.