Loader of trigger configurations from Json files.
More...
#include <JsonFileWriterHLT.h>
Loader of trigger configurations from Json files.
Definition at line 23 of file JsonFileWriterHLT.h.
◆ JsonFileWriterHLT()
| TrigConf::JsonFileWriterHLT::JsonFileWriterHLT |
( |
| ) |
|
◆ ~JsonFileWriterHLT()
| virtual TrigConf::JsonFileWriterHLT::~JsonFileWriterHLT |
( |
| ) |
|
|
overridevirtualdefault |
◆ getName()
| const std::string & TrigConf::TrigConfMessaging::getName |
( |
| ) |
const |
|
inlineinherited |
◆ 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 86 of file TrigConfMessaging.h.
87 {
89 if (!ms) {
92 }
94 }
boost::thread_specific_ptr< MsgStreamTC > m_msg_tls
MsgStreamTC instance (a std::cout like with print-out levels)
◆ 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 96 of file TrigConfMessaging.h.
97 {
99 }
MsgStreamTC & msg() const
The standard message stream.
◆ msgLvl()
| bool TrigConf::TrigConfMessaging::msgLvl |
( |
const MSGTC::Level | lvl | ) |
const |
|
inlineinherited |
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 75 of file TrigConfMessaging.h.
76 {
79 return true;
80 }
81 else {
82 return false;
83 }
84 }
◆ writeJsonFile() [1/2]
| bool TrigConf::JsonFileWriterHLT::writeJsonFile |
( |
const std::string & | filename, |
|
|
const HLTMenu & | menu ) const |
Definition at line 49 of file JsonFileWriterHLT.cxx.
50{
52 for ( const auto & chain : menu ) {
54 jChain[
"counter"] =
chain.counter();
55 jChain[
"nameHash"] =
chain.namehash();
56 jChain[
"l1item"] =
chain.l1item();
57 jChain[
"legMultiplicities"] =
chain.legMultiplicities();
58 jChain[
"l1thresholds"] =
chain.l1thresholds();
59 jChain[
"groups"] =
chain.groups();
60 jChain[
"streams"] =
chain.streams();
61 jChain[
"seqeuncers"] =
chain.sequencers();
62
63
64 if (
chain.hasChild(
"signature")) {
70 jChain["signature"] = std::move(jSig);
71 }
72
74 }
75
77 for (
const auto& [seqName, algsList]:
menu.sequencers() ) {
78 json jSeq( algsList );
79 sequencers[seqName] = std::move(jSeq);
80 }
82 for (
const auto& stream:
menu.streams() ) {
84 jStream[
"name"] =
stream[
"name"];
85 jStream[
"type"] =
stream[
"type"];
86 jStream[
"obeyLB"] =
stream.getAttribute<
bool>(
"obeyLB");
87 jStream[
"forceFullEventBuilding"] =
stream.getAttribute<
bool>(
"forceFullEventBuilding");
89 }
90
91
93 j["filetype"] = "hltmenu";
94 j[
"name"] =
menu.name();
95 j["chains"] = std::move(chains);
96 j["sequencers"] = std::move(sequencers);
97 j["streams"] = std::move(streams);
98
99
100 if (
menu.hasChild(
"sequence_run2")) {
105 j["sequence_run2"] = std::move(jSequence);
106 }
107
108 std::ofstream
outfile(filename);
109 outfile << std::setw(4) << j << std::endl;
110
112 return true;
113}
std::vector< std::vector< T > > ToVectorVector(const TrigConf::DataStructure &ds, const std::string &child)
Helper function ptree key->[[]] to std::vector<std::vector<T>>
std::vector< T > ToVector(const TrigConf::DataStructure &ds, const std::string &child)
Helper function ptree key->[] to std::vector<T>
◆ writeJsonFile() [2/2]
| bool TrigConf::JsonFileWriterHLT::writeJsonFile |
( |
const std::string & | filename, |
|
|
const HLTMenu & | menu, |
|
|
const HLTPrescalesSet & | ps ) const |
Definition at line 115 of file JsonFileWriterHLT.cxx.
116{
118 for ( const auto & chain : menu ) {
120 jChain[
"name"] =
chain.name();
121 jChain[
"counter"] =
chain.counter();
122 jChain[
"hash"] =
chain.namehash();
123 jChain[
"prescale"] =
ps.prescale(
chain.name()).prescale;
124 jChain[
"enabled"] =
ps.prescale(
chain.name()).enabled;
126 }
128 j["filetype"] = "hltprescale";
129 j[
"name"] =
ps.name();
130 j["prescales"] = std::move(chains);
131 std::ofstream
outfile(filename);
132 outfile << std::setw(4) << j << std::endl;
133
135 return true;
136}
◆ 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: