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::JsonEvent Struct Reference

Public Member Functions

 JsonEvent (int _run, int _lumi, int _event)
 
JsonTriggerEventStatepushTrigger (int _tr)
 
std::string serialise (size_t _indent=0) const
 

Public Attributes

int event
 
int lumi
 
int run
 
std::vector
< JsonTriggerEventState
triggerStates
 

Detailed Description

Definition at line 703 of file hltDiff.cc.

Constructor & Destructor Documentation

JsonOutputProducer::JsonEvent::JsonEvent ( int  _run,
int  _lumi,
int  _event 
)
inline

Definition at line 723 of file hltDiff.cc.

723  :
724  run(_run), lumi(_lumi), event(_event), triggerStates(0) { }
std::vector< JsonTriggerEventState > triggerStates
Definition: hltDiff.cc:707

Member Function Documentation

JsonTriggerEventState& JsonOutputProducer::JsonEvent::pushTrigger ( int  _tr)
inline

Definition at line 726 of file hltDiff.cc.

References JsonOutputProducer::JsonTriggerEventState::tr.

726  {
727  // check whether the last trigger is the one
728  if (triggerStates.size() > 0) {
729  JsonTriggerEventState& lastTrigger = triggerStates.back();
730  if (lastTrigger.tr == _tr)
731  return lastTrigger;
732  }
733  triggerStates.push_back(JsonTriggerEventState(_tr));
734  return triggerStates.back();
735  }
std::vector< JsonTriggerEventState > triggerStates
Definition: hltDiff.cc:707
std::string JsonOutputProducer::JsonEvent::serialise ( size_t  _indent = 0) const
inline

Definition at line 709 of file hltDiff.cc.

References dataformats::indent(), L1Trigger_dataformats::json, fjr2json::lumi, and DTTTrigCorrFirst::run.

709  {
710  std::ostringstream json;
711  json << indent(_indent) << '{' << "\"r\"" << ':' << run << ",\"l\":" << lumi << ",\"e\":" << event << ",\"t\":["; // line open
712  for (std::vector<JsonTriggerEventState>::const_iterator it = triggerStates.begin(); it != triggerStates.end(); ++it) {
713  json << '{'; // line open
714  json << (*it).serialise(_indent+2); // block
715  json << indent(_indent+1) << '}'; // line close
716  if (it != --triggerStates.end()) json << ',';
717  }
718  json << indent(_indent) << ']' << '}'; // line close
719 
720  return json.str();
721  }
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:475
std::vector< JsonTriggerEventState > triggerStates
Definition: hltDiff.cc:707

Member Data Documentation

int JsonOutputProducer::JsonEvent::event
int JsonOutputProducer::JsonEvent::lumi
int JsonOutputProducer::JsonEvent::run
std::vector<JsonTriggerEventState> JsonOutputProducer::JsonEvent::triggerStates

Definition at line 707 of file hltDiff.cc.

Referenced by SummaryOutputProducer::GenericSummary::addEntry().