9 #define BOOST_BIND_GLOBAL_PLACEHOLDERS // Needed to silence Boost pragma message
10 #include <boost/property_tree/json_parser.hpp>
21 template<
typename COLL>
25 for (
const auto&
el:
data ) {
28 array.push_back(std::make_pair(
"",
one));
38 std::set<std::string>
names;
40 for (
const auto te:
sig->outputTEs() ) {
42 for (
const auto inTE: sequence->inputTEs() ) {
43 if ( not ( inTE->name().find(
"L2_") == 0 or inTE->name().find(
"EF_") == 0 or inTE->name().find(
"HLT_") == 0 ) ) {
44 names.insert(inTE->name());
49 return std::vector<std::string>(
names.begin(),
names.end() );
55 boost::property_tree::json_parser::write_json(
ss,
p);
56 std::cout <<
ss.str() << std::endl;
62 top.put(
"filetype",
"hltmenu");
66 std::map<std::string, const TrigConf::HLTStreamTag*> allStreams;
70 pChain.put(
"counter", cptr->chain_counter());
71 pChain.put(
"nameHash", cptr->chain_hash_id());
72 pChain.put(
"l1item", cptr->lower_chain_name());
75 pChain.add_child(
"sequencers",
asArray(std::vector<std::string>({
"missing"})));
77 std::vector<std::string> strNames;
78 for (
const auto st: cptr->streams()) {
79 strNames.push_back(st->stream());
80 allStreams[st->stream()] = st;
82 pChain.add_child(
"streams",
asArray(strNames));
84 pChain.add_child(
"groups",
asArray(cptr->groups()));
89 std::vector<uint32_t> counters;
90 std::vector<int> logics;
91 std::vector<std::string>
labels;
92 ptree outputTEs_outerArray;
94 for(
auto& signature : cptr->signatureList() ){
95 uint32_t cntr = signature->signature_counter();
96 counters.push_back(cntr);
97 logics.push_back(signature->logic());
98 labels.push_back(signature->label());
99 ptree outputTEs_innerArray;
100 for(
auto& outputTE : signature->outputTEs()){
101 outputTEs_innerArray.push_back( ptree::value_type(
"", outputTE->name()) );
103 outputTEs_outerArray.push_back( ptree::value_type(
"", outputTEs_innerArray) );
107 pSig.add_child(
"counters",
asArray(counters));
108 pSig.add_child(
"logics",
asArray(logics));
109 pSig.add_child(
"outputTEs", outputTEs_outerArray);
112 pChain.add_child(
"signature", pSig);
115 pChains.push_back(std::make_pair(cptr->chain_name(), pChain));
118 for (
auto [sname,
stream]: allStreams ) {
120 pStream.put(
"name", sname);
121 pStream.put(
"type",
stream->type());
122 pStream.put(
"obeyLB",
stream->obeyLB());
123 pStream.put(
"forceFullEventBuilding",
true);
124 pStreams.push_back(std::make_pair(sname, pStream));
127 top.add_child(
"chains", pChains);
129 top.add_child(
"streams", pStreams);
131 pSequencers.add_child(
"missing",
asArray(std::vector<std::string>({
""})));
132 top.add_child(
"sequencers", pSequencers);
136 std::vector<std::string> outputTEs;
137 ptree inputTEs_outerArray;
138 ptree algorithms_outerArray;
139 for(
auto&
seq : sequenceList){
140 outputTEs.push_back(
seq->outputTE()->name());
142 ptree inputTEs_innerArray;
143 for(
auto&
input :
seq->inputTEs()) {
144 inputTEs_innerArray.push_back( ptree::value_type(
"",
input->name()) );
146 inputTEs_outerArray.push_back( ptree::value_type(
"", inputTEs_innerArray) );
148 ptree algorithms_innerArray;
149 for(
const std::string&
alg :
seq->algorithms()) {
150 algorithms_innerArray.push_back( ptree::value_type(
"",
alg) );
152 algorithms_outerArray.push_back( ptree::value_type(
"", algorithms_innerArray) );
155 pSequence.add_child(
"outputTEs",
asArray(outputTEs));
156 pSequence.add_child(
"inputTEs", inputTEs_outerArray);
157 pSequence.add_child(
"algorithms", algorithms_outerArray);
158 top.add_child(
"sequence_run2", pSequence);
177 top.put(
"filetype",
"hltprescale");
178 top.put(
"name", frame->
name());
182 pChain.put(
"name", cptr->chain_name());
183 pChain.put(
"counter", cptr->chain_counter());
184 pChain.put(
"hash", cptr->chain_hash_id());
185 pChain.put(
"prescale", cptr->prescale());
186 pChain.put(
"enabled", (cptr->prescale()>0 ?
true:
false));
188 pChains.push_back(std::make_pair(cptr->chain_name(), pChain));
190 top.add_child(
"prescales", pChains);