CMS 3D CMS Logo

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

Detailed Description

Definition at line 709 of file hltDiff.cc.

Constructor & Destructor Documentation

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

Definition at line 729 of file hltDiff.cc.

729  :
730  run(_run), lumi(_lumi), event(_event), triggerStates(0) { }
std::vector< JsonTriggerEventState > triggerStates
Definition: hltDiff.cc:713

Member Function Documentation

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

Definition at line 732 of file hltDiff.cc.

References JsonOutputProducer::JsonTriggerEventState::tr.

732  {
733  // check whether the last trigger is the one
734  if (!triggerStates.empty()) {
735  JsonTriggerEventState& lastTrigger = triggerStates.back();
736  if (lastTrigger.tr == _tr)
737  return lastTrigger;
738  }
739  triggerStates.push_back(JsonTriggerEventState(_tr));
740  return triggerStates.back();
741  }
std::vector< JsonTriggerEventState > triggerStates
Definition: hltDiff.cc:713
std::string JsonOutputProducer::JsonEvent::serialise ( size_t  _indent = 0) const
inline

Definition at line 715 of file hltDiff.cc.

References summarizeEdmComparisonLogfiles::indent, and edmPickEvents::json.

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

Member Data Documentation

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

Definition at line 713 of file hltDiff.cc.

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