test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
JsonOutputProducer::JsonVars Struct Reference

Public Member Functions

 JsonVars ()
 
std::string serialise (size_t _indent=0) const
 

Public Attributes

std::vector< std::string > label
 
std::vector< std::string > state
 
std::vector< std::string > trigger
 
std::vector< std::pair< int,
int > > 
trigger_passed_count
 
std::vector< std::string > type
 

Detailed Description

Definition at line 611 of file hltDiff.cc.

Constructor & Destructor Documentation

JsonOutputProducer::JsonVars::JsonVars ( )
inline

Definition at line 637 of file hltDiff.cc.

637 : state(0), trigger(0), trigger_passed_count(0), label(0), type(0) {}
std::vector< std::pair< int, int > > trigger_passed_count
Definition: hltDiff.cc:614
std::vector< std::string > label
Definition: hltDiff.cc:615
std::vector< std::string > trigger
Definition: hltDiff.cc:613
std::vector< std::string > state
Definition: hltDiff.cc:612
std::vector< std::string > type
Definition: hltDiff.cc:616

Member Function Documentation

std::string JsonOutputProducer::JsonVars::serialise ( size_t  _indent = 0) const
inline

Definition at line 618 of file hltDiff.cc.

References dataformats::indent(), L1Trigger_dataformats::json, relval_steps::key, and diffTwoXMLs::label.

618  {
619  std::ostringstream json;
620  json << indent(_indent) << key("vars") << '{'; // line open
621  json << indent(_indent+1) << key("state") << list_string(state) << ','; // line
622  json << indent(_indent+1) << key("trigger") << list_string(trigger) << ','; // line
623  json << indent(_indent+1) << key("trigger_passed_count") << '['; // line
624  for (std::vector<std::pair<int, int> >::const_iterator it = trigger_passed_count.begin(); it != trigger_passed_count.end(); ++it) {
625  json << '{' << key("o") << (*it).first << ',' << key("n") << (*it).second << '}';
626  if (it != trigger_passed_count.end()-1)
627  json << ',';
628  }
629  json << "],";
630  json << indent(_indent+1) << key("label") << list_string(label) << ','; // line
631  json << indent(_indent+1) << key("type") << list_string(type); // line
632  json << indent(_indent) << '}'; // line close
633 
634  return json.str();
635  }
type
Definition: HCALResponse.h:21
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:475
std::vector< std::pair< int, int > > trigger_passed_count
Definition: hltDiff.cc:614
std::vector< std::string > label
Definition: hltDiff.cc:615
std::vector< std::string > trigger
Definition: hltDiff.cc:613
static std::string list_string(const std::vector< std::string > &_values, const std::string &_delim="")
Definition: hltDiff.cc:520
std::vector< std::string > state
Definition: hltDiff.cc:612
static std::string key(const std::string &_key, const std::string &_delim="")
Definition: hltDiff.cc:489

Member Data Documentation

std::vector<std::string> JsonOutputProducer::JsonVars::label
std::vector<std::string> JsonOutputProducer::JsonVars::state

Definition at line 612 of file hltDiff.cc.

Referenced by HltDiff::compare().

std::vector<std::string> JsonOutputProducer::JsonVars::trigger

Definition at line 613 of file hltDiff.cc.

Referenced by HltDiff::compare().

std::vector<std::pair<int, int> > JsonOutputProducer::JsonVars::trigger_passed_count

Definition at line 614 of file hltDiff.cc.

Referenced by HltDiff::compare().

std::vector<std::string> JsonOutputProducer::JsonVars::type