PSC configuration object.  
 More...
#include <Config.h>
PSC configuration object. 
Definition at line 31 of file Config.h.
◆ Config()
Definition at line 107 of file Config.cxx.
  115   const ptree::value_type& hltimpl = getHltConfigImpl(
config);
 
  116   if(hltimpl.first == 
"HLTImplementationJobOptions")
 
  118     ERS_DEBUG(1, 
"Job Options configuration");
 
  121   else if(hltimpl.first == 
"HLTImplementationDB")
 
  123     ERS_DEBUG(1, 
"DB configuration");
 
  126   else if(hltimpl.first == 
"HLTImplementationDBPython")
 
  128     ERS_DEBUG(1, 
"DBPY configuration");
 
  129     ERS_PSC_WARNING(
"HLT configured with HLTImplementationDBPython object. This" 
  130           " is for offline purposes only. Do not use this for online running!");
 
  135     string msg = 
"Unknown HLTImplementation type: " + hltimpl.first;
 
 
 
 
◆ didUserSetLogLevel()
      
        
          | bool Config::didUserSetLogLevel | ( |  | ) | const | 
      
 
Returns whether the user specified an explicit log level. 
Definition at line 245 of file Config.cxx.
  249   return getOption(
"LOGLEVEL").substr(0,4) != 
"INFO";
 
 
 
 
◆ dumpOptions()
      
        
          | std::string Config::dumpOptions | ( |  | ) | const | 
      
 
Returns a string with all options which are held in the options cache. 
Definition at line 155 of file Config.cxx.
  157   std::ostringstream 
ost;
 
  158   ost << 
" --- Dump of all options held by Config --- total size = " << 
optmap.size() <<
"\n";
 
  160   for(std::map<std::string, std::string>::const_iterator
 
  162     ost << 
" # = " << std::setw(3) << 
pos 
  163         << 
" Option : " << 
"'" << 
it->first
 
  164         << 
"' = '" << 
it->second << 
"'\n";
 
  168   ost << 
" --- Number of enabled ROB IDs read from OKS             = " << 
enabled_robs.size() << 
"\n";
 
  169   ost << 
"List of enabled ROBs: [";
 
  172   eformat::SubDetector previous_subDet(eformat::OTHER);
 
  176     if (eformat::helper::SourceIdentifier(rob).subdetector_id() != previous_subDet) {
 
  177       previous_subDet = eformat::helper::SourceIdentifier(rob).subdetector_id();
 
  181     ost << 
" 0x" << std::setw(6) << std::hex << rob << std::dec;
 
  188   ost << 
" --- Number of enabled Sub Detector configured = " 
  190   ost << 
"List of enabled Sub-Detectors: [\n";
 
  198     ost << std::setw(4) << 
index << 
": 0x" << std::setw(2) << std::hex << 
det << std::dec
 
  199         << 
" (" << std::setw(26) << eformat::helper::SourceIdentifier((eformat::SubDetector)
det,0).human_detector() << 
" )";
 
 
 
 
◆ fill_enabled_dets()
Definition at line 381 of file Config.cxx.
  383   std::set<eformat::SubDetector> set_enabled_subDets;
 
  384   for(
const auto& 
ros : r2r)
 
  385     for(
const auto& rob: 
ros.second)
 
  386       set_enabled_subDets.insert(eformat::helper::SourceIdentifier(rob.second.get_value<
uint32_t>()).subdetector_id());
 
  389   for(
const auto& it_det: set_enabled_subDets) 
enabled_SubDets.push_back(it_det);
 
 
 
 
◆ fill_enabled_robs()
Definition at line 369 of file Config.cxx.
  371   std::set<uint32_t> set_enabled_robs;
 
  372   for(
const auto& 
ros : r2r)
 
  373     for(
const auto& rob: 
ros.second)
 
  374       set_enabled_robs.insert(rob.second.get_value<
uint32_t>());
 
  377   for(
const auto& it_rob: set_enabled_robs) 
enabled_robs.push_back(it_rob);
 
 
 
 
◆ fillopt_athenaHLT()
  
  | 
        
          | void Config::fillopt_athenaHLT | ( |  | ) |  |  | private | 
 
Definition at line 339 of file Config.cxx.
  341   const auto& ath_hlt = 
m_config.get_child_optional(athlt_path);
 
  344     const auto& llnode = ath_hlt->get_child_optional(
"logLevels");
 
  345     optmap[
"LOGLEVEL"] = plevelToStr(llnode, 
',');
 
  347     const auto& psnode = ath_hlt->get_child_optional(
"pythonSetupFile");
 
  349       optmap[
"PYTHONSETUPFILE"] = psnode->data();
 
 
 
 
◆ fillopt_common()
Definition at line 312 of file Config.cxx.
  314   boost::optional<const ptree&> circbuf = 
m_config.get_child_optional(
 
  315       "Configuration.HLTMPPUApplication.MuonCalibrationConfig.CircBuffer");
 
  318     optmap[
"MUONCALBUFFERNAME"] = circbuf->get_child(
"CircName").data();
 
  319     optmap[
"MUONCALBUFFERSIZE"] = circbuf->get_child(
"CircSize").data();
 
  322   const ptree& com = 
hlt.get_child(
"HLTCommonParameters.HLTCommonParameters");
 
  323   optmap[
"MESSAGESVCTYPE"]    = com.get_child(
"messageSvcType").data();
 
  324   optmap[
"JOBOPTIONSSVCTYPE"] = com.get_child(
"jobOptionsSvcType").data();
 
  326   optmap[
"DF_PARTITION_NAME"] = 
m_config.get_child(
"Configuration.Partition.UID").data();
 
  328   const ptree& hltmppu = 
m_config.get_child(
"Configuration.HLTMPPUApplication");
 
  329   optmap[
"DF_APPLICATIONNAME"]  = hltmppu.get_child(
"UID").data();
 
  330   optmap[
"HARDTIMEOUT"]         = hltmppu.get_child(
"HardTimeout").data();
 
  331   optmap[
"SOFTTIMEOUTFRACTION"] = hltmppu.get_child(
"softTimeoutFraction").data();
 
  332   optmap[
"NEVENTSLOTS"]         = hltmppu.get_child(
"numberOfEventSlots").data();
 
  333   optmap[
"NTHREADS"]            = hltmppu.get_child(
"numberOfAthenaMTThreads").data();
 
  334   optmap[
"NPROCS"]              = hltmppu.get_child(
"numForks").data();
 
  335   optmap[
"MAXEVENTSIZEMB"]      = hltmppu.get_child(
"maximumHltResultMb").data();
 
 
 
 
◆ fillopt_db()
Definition at line 282 of file Config.cxx.
  285   std::ostringstream 
s;
 
  286   s << 
"server=" << 
db.get_child(
"Alias").data()
 
  287     << 
";smkey=" << 
db.get_child(
"SuperMasterKey").data()
 
  288     << 
";lvl1key=" << 
m_config.get_child(l1_path + 
".Lvl1PrescaleKey").data()
 
  289     << 
";hltkey=" << 
hlt.get_child(
"hltPrescaleKey").data();
 
  291   optmap[
"JOBOPTIONSPATH"] = 
s.str();
 
  292   optmap[
"JOBOPTIONSTYPE"] = 
"DB";
 
 
 
 
◆ fillopt_dbpy()
◆ fillopt_jo()
Definition at line 263 of file Config.cxx.
  265   optmap[
"JOBOPTIONSPATH"]  = 
hlt.get_child(
"jobOptionsPath").data();
 
  266   optmap[
"PYTHONSETUPFILE"] = 
hlt.get_child(
"pythonSetupFile").data();
 
  269   if (boost::algorithm::to_lower_copy(
optmap[
"JOBOPTIONSPATH"]).ends_with(
".json")) {
 
  270     optmap[
"JOBOPTIONSTYPE"]  = 
"FILE";
 
  273     optmap[
"JOBOPTIONSTYPE"]  = 
"NONE";
 
  275   optmap[
"LOGLEVEL"] = plevelToStr(
hlt.get_child_optional(
"logLevels"),
',');
 
 
 
 
◆ fillopt_py()
Definition at line 305 of file Config.cxx.
  307   optmap[
"PRECOMMAND"]  = plevelToStr(
hlt.get_child_optional(
"preCommands"));
 
  308   optmap[
"POSTCOMMAND"] = plevelToStr(
hlt.get_child_optional(
"postCommands"));
 
 
 
 
◆ getLogLevelAsNumStr()
      
        
          | std::string Config::getLogLevelAsNumStr | ( |  | ) | const | 
      
 
Get a string representing the actual number value of the first LOGLEVEL in this configuration. 
Definition at line 240 of file Config.cxx.
  242   return log_level_as_num_str(
getOption(
"LOGLEVEL"));
 
 
 
 
◆ getOption()
      
        
          | std::string Config::getOption | ( | const std::string & | key, | 
        
          |  |  | bool | quiet = false | 
        
          |  | ) |  | const | 
      
 
Gets an option in a "safer" way. 
- Parameters
- 
  
    | quiet | Print warning if option is not available |  
 
Definition at line 208 of file Config.cxx.
  210   std::map<std::string, std::string>::const_iterator 
it = 
optmap.find(
key);
 
 
 
 
◆ prepareWorker()
Definition at line 144 of file Config.cxx.
  149   optmap[
"DF_APPLICATIONNAME"] = 
args.get_child(
"appName").data();
 
  150   optmap[
"DF_WORKER_ID"] = 
args.get_child(
"workerId").data();
 
  151   optmap[
"DF_NUMBER_OF_WORKERS"] = 
args.get_child(
"numberOfWorkers").data();
 
 
 
 
◆ setPInfo()
  
  | 
        
          | void Config::setPInfo | ( |  | ) |  |  | private | 
 
Definition at line 354 of file Config.cxx.
  356   char cstr_host[HOST_NAME_MAX];
 
  357   gethostname(cstr_host, 
sizeof(cstr_host));
 
  358   optmap[
"DF_MACHINE_NAME"] = string(cstr_host);
 
  361   oss << 
"0x" << std::hex << gethostid() ;
 
  362   optmap[
"DF_HOST_ID"] = oss.str();
 
 
 
 
◆ setup_optmap_defaults()
  
  | 
        
          | void Config::setup_optmap_defaults | ( |  | ) |  |  | private | 
 
 
◆ toPython()
      
        
          | std::string Config::toPython | ( | const std::string & | dictName | ) | const | 
      
 
Incredibly simple minded way to access this object from python. 
Create a python dictionary with key/value pairs. 
Definition at line 222 of file Config.cxx.
  225   oss << dictName << 
" = {";
 
  227   std::map<std::string, std::string>::const_iterator 
it = 
optmap.begin();
 
  232     oss << 
"'" << 
it->first << 
"':'" << 
it->second << 
"'";
 
  235   oss << 
"}" << std::endl;
 
 
 
 
◆ updatePids()
  
  | 
        
          | void Config::updatePids | ( |  | ) |  |  | private | 
 
 
◆ updateSeed()
  
  | 
        
          | void Config::updateSeed | ( |  | ) |  |  | private | 
 
Definition at line 400 of file Config.cxx.
  412   unsigned int extract_mask = 0;
 
  413   for(
unsigned i = 0; 
i < 
sizeof(
int)/2; ++
i)
 
  414     extract_mask |= UCHAR_MAX << (
i*CHAR_BIT);
 
  418   oss << 
"0x" << std::hex << (gethostid() & extract_mask)
 
  419                           << (getpid() & extract_mask);
 
  421   optmap[
"DF_RANDOM_SEED"] = oss.str();
 
 
 
 
◆ enabled_robs
      
        
          | std::vector<uint32_t> psc::Config::enabled_robs | 
      
 
Lists of statically enabled ROBs and sub-detectors 
 
Definition at line 76 of file Config.h.
 
 
◆ enabled_SubDets
      
        
          | std::vector<uint32_t> psc::Config::enabled_SubDets | 
      
 
 
◆ m_config
◆ optmap
      
        
          | std::map<std::string, std::string> psc::Config::optmap | 
      
 
Map with name/value pairs of parameters. 
Definition at line 71 of file Config.h.
 
 
The documentation for this class was generated from the following files: