Loader of trigger configurations from Json files.
More...
#include <JsonFileLoader.h>
Loader of trigger configurations from Json files.
Definition at line 25 of file JsonFileLoader.h.
◆ JsonFileLoader()
TrigConf::JsonFileLoader::JsonFileLoader |
( |
| ) |
|
◆ ~JsonFileLoader()
virtual TrigConf::JsonFileLoader::~JsonFileLoader |
( |
| ) |
|
|
overridevirtualdefault |
◆ checkTriggerLevel()
bool TrigConf::JsonFileLoader::checkTriggerLevel |
( |
const std::string & |
filename, |
|
|
std::string & |
level |
|
) |
| const |
Checks the trigger level of a given json file.
- Parameters
-
filename | [in] Name of the json file |
level | [out] either "L1", "HLT" or "UNKNOWN" |
Definition at line 128 of file JsonFileLoader.cxx.
138 if (
data.hasChild(
"chains")) {
140 }
else if (
data.hasChild(
"items")) {
◆ findFile()
std::string TrigConf::JsonFileLoader::findFile |
( |
const std::string & |
filename | ) |
const |
|
private |
◆ getFileType()
std::string TrigConf::JsonFileLoader::getFileType |
( |
const std::string & |
filename | ) |
const |
Checks the trigger level of a given json file.
- Parameters
-
filename | [in] Name of the json file |
Definition at line 114 of file JsonFileLoader.cxx.
116 std::string
ft =
"UNKNOWN";
120 ft =
data.getAttribute(
"filetype",
true,
ft);
◆ loadFile() [1/2]
Load content of json file into a ptree.
- Parameters
-
filename | [in] Name of the json file |
data | [out] |
pathToChild | [in] Path to a sub structure for partial loading of data |
If the optional parameter pathToChild
is specified, one can load parts if the configuration from the file.
const std::string l1_filename = "TriggerMenuXML/LVL1config_Physics_pp_v7.json";
fileLoader.
loadFile( l1_filename, metSignificance,
"CaloInfo.METSignificance");
Definition at line 45 of file JsonFileLoader.cxx.
58 boost::property_tree::read_json(
file,
data);
60 catch (
const boost::property_tree::json_parser_error&
e) {
65 if( ! pathToChild.empty() ) {
68 boost::optional<ptree&> subtree =
data.get_child_optional(pathToChild);
◆ loadFile() [2/2]
bool TrigConf::JsonFileLoader::loadFile |
( |
const std::string & |
filename, |
|
|
DataStructure & |
data, |
|
|
const std::string & |
pathToChild = "" |
|
) |
| const |
Load content of json file into a ptree.
- Parameters
-
filename | [in] Name of the json file |
data | [out] |
pathToChild | [in] Path to a sub structure for partial loading of data |
Definition at line 82 of file JsonFileLoader.cxx.
91 data.setData(std::move(
pt));
◆ msg() [1/2]
MsgStreamTC & TrigConf::TrigConfMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 81 of file TrigConfMessaging.h.
◆ msg() [2/2]
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 91 of file TrigConfMessaging.h.
◆ msgLvl()
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 70 of file TrigConfMessaging.h.
◆ outputLevel()
MSGTC::Level TrigConf::JsonFileLoader::outputLevel |
( |
| ) |
const |
|
inline |
◆ saveFile()
Save content of DataStructure (underlying ptree) to a file.
- Parameters
-
filename | [in] Name of the json file |
data | [in] |
Definition at line 99 of file JsonFileLoader.cxx.
103 TRG_MSG_ERROR(
"Could not save to file, as specified filename is empty");
106 boost::property_tree::write_json(
filename,
data.data());
◆ setLevel()
◆ m_msg_tls
boost::thread_specific_ptr<MsgStreamTC> TrigConf::TrigConfMessaging::m_msg_tls |
|
mutableprivateinherited |
◆ m_name
std::string TrigConf::TrigConfMessaging::m_name |
|
privateinherited |
The documentation for this class was generated from the following files: