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.

Member Function Documentation

◆ extractFileBase()

void JsonOutputProducer::JsonConfigurationBlock::extractFileBase ( )
inline

Definition at line 511 of file hltDiff.cc.

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

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  }
std::vector< std::string > files
Definition: hltDiff.cc:493

◆ serialise()

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

Definition at line 497 of file hltDiff.cc.

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

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  }
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:425
nlohmann::json json
std::vector< std::string > skipped_triggers
Definition: hltDiff.cc:495
static std::string list_string(const std::vector< std::string > &_values, const std::string &_delim="")
Definition: hltDiff.cc:470
std::vector< std::string > files
Definition: hltDiff.cc:493
static std::string key(const std::string &_key, const std::string &_delim="")
Definition: hltDiff.cc:439
static std::string key_string(const std::string &_key, const std::string &_string, const std::string &_delim="")
Definition: hltDiff.cc:447

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.