ATLAS Offline Software
Config.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef TRIGPSC_CONFIG_H
13 #define TRIGPSC_CONFIG_H
14 
15 #include <map>
16 #include <string>
17 #include <vector>
18 #include <sstream>
19 #include <boost/property_tree/ptree.hpp>
20 
21 namespace TrigConf
22 {
24 }
25 
26 namespace psc {
27 
31  class Config
32  {
33  public:
35 
37 
41  std::string dumpOptions() const;
42 
47  std::string getOption(const std::string& key, bool quiet=false) const;
48 
53  std::string toPython(const std::string& dictName) const;
54 
59  std::string getLogLevelAsNumStr() const;
60 
64  bool didUserSetLogLevel() const;
65 
66  public:
67 
71  std::map<std::string, std::string> optmap;
72 
76  std::vector<uint32_t> enabled_robs;
77  std::vector<uint32_t> enabled_SubDets;
78 
79  private:
80 
81  // setup needed optmap defaults for options that may not always be filled
82  void setup_optmap_defaults();
83 
84  // fill in options for HLTImplementationJobOptions
85  void fillopt_jo(const boost::property_tree::ptree& hlt);
86 
87  // fill in options for HLTImplementationDB
88  void fillopt_db(const boost::property_tree::ptree& hlt);
89 
90  // fill in options for HLTImplementationDBPython
92 
93  // fill in what is common to jo and dbpy
94  void fillopt_py(const boost::property_tree::ptree& hlt);
95 
96  // fill in common options
98 
99  // fill in athenaHLT specific options
100  void fillopt_athenaHLT();
101 
102  // sets fields with info on this process
103  void setPInfo();
104 
105  // fill the vector of enabled ROBs and sub-detectors and the vectors of MET ROBs for
106  // LAr and Tile
107  void fill_enabled_robs(const boost::property_tree::ptree& ros2robs);
108  void fill_enabled_dets(const boost::property_tree::ptree& ros2robs);
109 
110  void updatePids();
111  void updateSeed();
112 
113  private:
115 
116  };
117 }
118 
119 #endif /* TRIGPSC_CONFIG_H */
psc::Config::getOption
std::string getOption(const std::string &key, bool quiet=false) const
Gets an option in a "safer" way.
Definition: Config.cxx:208
psc::Config::fillopt_db
void fillopt_db(const boost::property_tree::ptree &hlt)
Definition: Config.cxx:282
quiet
bool quiet
Definition: TrigGlobEffCorrValidation.cxx:190
psc::Config::updatePids
void updatePids()
Definition: Config.cxx:393
psc::Config::enabled_SubDets
std::vector< uint32_t > enabled_SubDets
Definition: Config.h:77
psc::Config::optmap
std::map< std::string, std::string > optmap
Map with name/value pairs of parameters.
Definition: Config.h:71
psc::Config::toPython
std::string toPython(const std::string &dictName) const
Incredibly simple minded way to access this object from python.
Definition: Config.cxx:222
psc::Config
PSC configuration object.
Definition: Config.h:32
psc::Config::fill_enabled_dets
void fill_enabled_dets(const boost::property_tree::ptree &ros2robs)
Definition: Config.cxx:381
TrigConf::TrigDBConnectionConfig
Definition: TrigDBConnectionConfig.h:22
psc::Config::enabled_robs
std::vector< uint32_t > enabled_robs
Lists of statically enabled ROBs and sub-detectors
Definition: Config.h:76
psc::Config::didUserSetLogLevel
bool didUserSetLogLevel() const
Returns whether the user specified an explicit log level.
Definition: Config.cxx:245
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
psc::Config::fill_enabled_robs
void fill_enabled_robs(const boost::property_tree::ptree &ros2robs)
Definition: Config.cxx:369
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
psc
Definition: Config.h:26
psc::Config::setup_optmap_defaults
void setup_optmap_defaults()
Definition: Config.cxx:253
psc::Config::setPInfo
void setPInfo()
Definition: Config.cxx:354
psc::Config::fillopt_dbpy
void fillopt_dbpy(const boost::property_tree::ptree &hlt)
Definition: Config.cxx:298
psc::Config::prepareWorker
void prepareWorker(const boost::property_tree::ptree &args)
Definition: Config.cxx:144
psc::Config::Config
Config(const boost::property_tree::ptree &config)
Definition: Config.cxx:107
psc::Config::fillopt_athenaHLT
void fillopt_athenaHLT()
Definition: Config.cxx:339
psc::Config::m_config
const boost::property_tree::ptree & m_config
Definition: Config.h:114
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
psc::Config::fillopt_py
void fillopt_py(const boost::property_tree::ptree &hlt)
Definition: Config.cxx:305
psc::Config::fillopt_common
void fillopt_common(const boost::property_tree::ptree &hlt)
Definition: Config.cxx:312
psc::Config::dumpOptions
std::string dumpOptions() const
Returns a string with all options which are held in the options cache.
Definition: Config.cxx:155
psc::Config::updateSeed
void updateSeed()
Definition: Config.cxx:400
psc::Config::getLogLevelAsNumStr
std::string getLogLevelAsNumStr() const
Get a string representing the actual number value of the first LOGLEVEL in this configuration.
Definition: Config.cxx:240
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
psc::Config::fillopt_jo
void fillopt_jo(const boost::property_tree::ptree &hlt)
Definition: Config.cxx:263
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37