test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 540 of file hltDiff.cc.

Constructor & Destructor Documentation

JsonOutputProducer::JsonConfigurationBlock::JsonConfigurationBlock ( )
inline

Definition at line 582 of file hltDiff.cc.

Member Function Documentation

void JsonOutputProducer::JsonConfigurationBlock::extractFileBase ( )
inline

Definition at line 560 of file hltDiff.cc.

References mergeVDriftHistosByStation::file, MainPageGenerator::files, i, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HltDiff::compare().

560  {
561  std::string file0 = files.at(0);
562  // determining the last position at which all filenames have the same character
563  for (size_t i = 0; i < file0.length(); ++i) {
564  bool identicalInAll = true;
565  char character = file0.at(i);
566  for (std::string file : files) {
567  if (file.at(i) == character) continue;
568  identicalInAll = false;
569  break;
570  }
571  if (!identicalInAll) break;
572  file_base.push_back(character);
573  }
574  const unsigned int file_base_len = file_base.length();
575  if (file_base_len < 1) return;
576  // removing the file_base from each filename
577  for (std::string &file : files) {
578  file.erase(0, file_base_len);
579  }
580  }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > files
Definition: hltDiff.cc:542
std::string JsonOutputProducer::JsonConfigurationBlock::serialise ( size_t  _indent = 0) const
inline

Definition at line 546 of file hltDiff.cc.

References MainPageGenerator::files, dataformats::indent(), L1Trigger_dataformats::json, relval_steps::key, and LaserDQM_cfg::process.

546  {
547  std::ostringstream json;
548  json << indent(_indent); // line
549  json << key_string("file_base", file_base) << ',';
550  json << indent(_indent); // line
551  json << key("files") << list_string(files) << ',';
552  json << indent(_indent); // line
553  json << key_string("process", process) << ',';
554  json << indent(_indent); // line
555  json << key("skipped_triggers") << list_string(skipped_triggers);
556 
557  return json.str();
558  }
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:475
std::vector< std::string > skipped_triggers
Definition: hltDiff.cc:544
static std::string list_string(const std::vector< std::string > &_values, const std::string &_delim="")
Definition: hltDiff.cc:520
std::vector< std::string > files
Definition: hltDiff.cc:542
static std::string key(const std::string &_key, const std::string &_delim="")
Definition: hltDiff.cc:489
static std::string key_string(const std::string &_key, const std::string &_string, const std::string &_delim="")
Definition: hltDiff.cc:497

Member Data Documentation

std::string JsonOutputProducer::JsonConfigurationBlock::file_base

Definition at line 541 of file hltDiff.cc.

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

Definition at line 544 of file hltDiff.cc.

Referenced by HltDiff::compare().