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

Constructor & Destructor Documentation

◆ JsonConfigurationBlock()

JsonOutputProducer::JsonConfigurationBlock::JsonConfigurationBlock ( )
inline

Definition at line 536 of file hltDiff.cc.

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

Member Function Documentation

◆ extractFileBase()

void JsonOutputProducer::JsonConfigurationBlock::extractFileBase ( )
inline

Definition at line 511 of file hltDiff.cc.

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

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

◆ serialise()

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

Definition at line 497 of file hltDiff.cc.

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

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

Member Data Documentation

◆ file_base

std::string JsonOutputProducer::JsonConfigurationBlock::file_base

Definition at line 492 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 495 of file hltDiff.cc.

mps_fire.i
i
Definition: mps_fire.py:428
JsonOutputProducer::indent
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:425
JsonOutputProducer::JsonConfigurationBlock::file_base
std::string file_base
Definition: hltDiff.cc:492
JsonOutputProducer::JsonConfigurationBlock::files
std::vector< std::string > files
Definition: hltDiff.cc:493
JsonOutputProducer::key
static std::string key(const std::string &_key, const std::string &_delim="")
Definition: hltDiff.cc:439
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:495
JsonOutputProducer::JsonConfigurationBlock::process
std::string process
Definition: hltDiff.cc:494
JsonOutputProducer::list_string
static std::string list_string(const std::vector< std::string > &_values, const std::string &_delim="")
Definition: hltDiff.cc:470
JsonOutputProducer::key_string
static std::string key_string(const std::string &_key, const std::string &_string, const std::string &_delim="")
Definition: hltDiff.cc:447
json
nlohmann::json json
Definition: FastTimerService.cc:21