CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
JsonOutputProducer::JsonConfigurationBlock Struct Reference

Public Member Functions

void extractFileBase ()
 
 JsonConfigurationBlock ()
 
std::string serialise (size_t _indent=0) const
 

Public Attributes

std::string file_base
 
std::vector< std::string > files
 
std::string process
 
std::vector< std::string > skipped_triggers
 

Detailed Description

Definition at line 492 of file hltDiff.cc.

Constructor & Destructor Documentation

◆ JsonConfigurationBlock()

JsonOutputProducer::JsonConfigurationBlock::JsonConfigurationBlock ( )
inline

Definition at line 537 of file hltDiff.cc.

537 : file_base(""), files(0), process(""), skipped_triggers(0) {}

Member Function Documentation

◆ extractFileBase()

void JsonOutputProducer::JsonConfigurationBlock::extractFileBase ( )
inline

Definition at line 512 of file hltDiff.cc.

512  {
513  std::string file0 = files.at(0);
514  // determining the last position at which all filenames have the same character
515  for (size_t i = 0; i < file0.length(); ++i) {
516  bool identicalInAll = true;
517  char character = file0.at(i);
518  for (std::string file : files) {
519  if (file.at(i) == character)
520  continue;
521  identicalInAll = false;
522  break;
523  }
524  if (!identicalInAll)
525  break;
526  file_base.push_back(character);
527  }
528  const unsigned int file_base_len = file_base.length();
529  if (file_base_len < 1)
530  return;
531  // removing the file_base from each filename
532  for (std::string& file : files) {
533  file.erase(0, file_base_len);
534  }
535  }

References FrontierConditions_GlobalTag_cff::file, MainPageGenerator::files, mps_fire::i, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ serialise()

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

Definition at line 498 of file hltDiff.cc.

498  {
499  std::ostringstream json;
500  json << indent(_indent); // line
501  json << key_string("file_base", file_base) << ',';
502  json << indent(_indent); // line
503  json << key("files") << list_string(files) << ',';
504  json << indent(_indent); // line
505  json << key_string("process", process) << ',';
506  json << indent(_indent); // line
507  json << key("skipped_triggers") << list_string(skipped_triggers);
508 
509  return json.str();
510  }

References MainPageGenerator::files, util.rrClient::indent, crabWrapper::key, and LaserDQM_cfg::process.

Member Data Documentation

◆ file_base

std::string JsonOutputProducer::JsonConfigurationBlock::file_base

Definition at line 493 of file hltDiff.cc.

◆ files

std::vector<std::string> JsonOutputProducer::JsonConfigurationBlock::files

◆ process

std::string JsonOutputProducer::JsonConfigurationBlock::process

◆ skipped_triggers

std::vector<std::string> JsonOutputProducer::JsonConfigurationBlock::skipped_triggers

Definition at line 496 of file hltDiff.cc.

mps_fire.i
i
Definition: mps_fire.py:355
JsonOutputProducer::indent
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:426
JsonOutputProducer::JsonConfigurationBlock::file_base
std::string file_base
Definition: hltDiff.cc:493
JsonOutputProducer::JsonConfigurationBlock::files
std::vector< std::string > files
Definition: hltDiff.cc:494
JsonOutputProducer::key
static std::string key(const std::string &_key, const std::string &_delim="")
Definition: hltDiff.cc:440
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
JsonOutputProducer::JsonConfigurationBlock::skipped_triggers
std::vector< std::string > skipped_triggers
Definition: hltDiff.cc:496
JsonOutputProducer::JsonConfigurationBlock::process
std::string process
Definition: hltDiff.cc:495
JsonOutputProducer::list_string
static std::string list_string(const std::vector< std::string > &_values, const std::string &_delim="")
Definition: hltDiff.cc:471
JsonOutputProducer::key_string
static std::string key_string(const std::string &_key, const std::string &_string, const std::string &_delim="")
Definition: hltDiff.cc:448
json
nlohmann::json json
Definition: FastTimerService.cc:19