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

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

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

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

References serializeAnnotations().

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

Definition at line 69 of file PayloadInspector.h.

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

Referenced by serialize().

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

References relativeConstraints::value.

Referenced by serialize(), and serializeValue().

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

Definition at line 45 of file PayloadInspector.h.

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

References serializeValue(), and relativeConstraints::value.

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

References serializeValue().

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