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

Constructor & Destructor Documentation

JsonOutputProducer::JsonConfigurationBlock::JsonConfigurationBlock ( )
inline

Definition at line 588 of file hltDiff.cc.

Member Function Documentation

void JsonOutputProducer::JsonConfigurationBlock::extractFileBase ( )
inline

Definition at line 566 of file hltDiff.cc.

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

Referenced by HltDiff::compare().

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

Definition at line 552 of file hltDiff.cc.

References summarizeEdmComparisonLogfiles::indent, edmPickEvents::json, and crabWrapper::key.

Referenced by JsonOutputProducer::JsonConfiguration::serialise().

552  {
553  std::ostringstream json;
554  json << indent(_indent); // line
555  json << key_string("file_base", file_base) << ',';
556  json << indent(_indent); // line
557  json << key("files") << list_string(files) << ',';
558  json << indent(_indent); // line
559  json << key_string("process", process) << ',';
560  json << indent(_indent); // line
561  json << key("skipped_triggers") << list_string(skipped_triggers);
562 
563  return json.str();
564  }
static std::string indent(size_t _nTabs)
Definition: hltDiff.cc:481
std::vector< std::string > skipped_triggers
Definition: hltDiff.cc:550
static std::string list_string(const std::vector< std::string > &_values, const std::string &_delim="")
Definition: hltDiff.cc:526
std::vector< std::string > files
Definition: hltDiff.cc:548
static std::string key(const std::string &_key, const std::string &_delim="")
Definition: hltDiff.cc:495
static std::string key_string(const std::string &_key, const std::string &_string, const std::string &_delim="")
Definition: hltDiff.cc:503

Member Data Documentation

std::string JsonOutputProducer::JsonConfigurationBlock::file_base

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

Referenced by HltDiff::compare().