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 659 of file hltDiff.cc.

Constructor & Destructor Documentation

◆ JsonEvent()

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

Definition at line 681 of file hltDiff.cc.

681 : run(_run), lumi(_lumi), event(_event), triggerStates(0) {}

Member Function Documentation

◆ pushTrigger()

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

Definition at line 683 of file hltDiff.cc.

683  {
684  // check whether the last trigger is the one
685  if (!triggerStates.empty()) {
686  JsonTriggerEventState& lastTrigger = triggerStates.back();
687  if (lastTrigger.tr == _tr)
688  return lastTrigger;
689  }
690  triggerStates.push_back(JsonTriggerEventState(_tr));
691  return triggerStates.back();
692  }

References JsonOutputProducer::JsonTriggerEventState::tr.

◆ serialise()

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

Definition at line 665 of file hltDiff.cc.

665  {
666  std::ostringstream json;
667  json << indent(_indent) << '{' << "\"r\"" << ':' << run << ",\"l\":" << lumi << ",\"e\":" << event
668  << ",\"t\":["; // line open
669  for (auto it = triggerStates.begin(); it != triggerStates.end(); ++it) {
670  json << '{'; // line open
671  json << (*it).serialise(_indent + 2); // block
672  json << indent(_indent + 1) << '}'; // line close
673  if (it != --triggerStates.end())
674  json << ',';
675  }
676  json << indent(_indent) << ']' << '}'; // line close
677 
678  return json.str();
679  }

References util.rrClient::indent, and writedatasetfile::run.

Member Data Documentation

◆ event

int JsonOutputProducer::JsonEvent::event

◆ lumi

int JsonOutputProducer::JsonEvent::lumi

Definition at line 661 of file hltDiff.cc.

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

◆ run

int JsonOutputProducer::JsonEvent::run

◆ triggerStates

std::vector<JsonTriggerEventState> JsonOutputProducer::JsonEvent::triggerStates

Definition at line 663 of file hltDiff.cc.

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

JsonOutputProducer::indent
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:426
JsonOutputProducer::JsonEvent::run
int run
Definition: hltDiff.cc:660
JsonOutputProducer::JsonEvent::lumi
int lumi
Definition: hltDiff.cc:661
JsonOutputProducer::JsonEvent::triggerStates
std::vector< JsonTriggerEventState > triggerStates
Definition: hltDiff.cc:663
lumi
Definition: LumiSectionData.h:20
json
nlohmann::json json
Definition: FastTimerService.cc:21
JsonOutputProducer::JsonEvent::event
int event
Definition: hltDiff.cc:662