9 #define BOOST_BIND_GLOBAL_PLACEHOLDERS // Needed to silence Boost pragma message
10 #include <boost/property_tree/json_parser.hpp>
19 template<
typename COLL>
23 for (
const auto&
el:
data ) {
26 array.push_back(std::make_pair(
"",
one));
36 std::set<std::string>
names;
38 for (
const auto te:
sig->outputTEs() ) {
40 for (
const auto inTE: sequence->inputTEs() ) {
41 if ( not ( inTE->name().find(
"L2_") == 0 or inTE->name().find(
"EF_") == 0 or inTE->name().find(
"HLT_") == 0 ) ) {
42 names.insert(inTE->name());
47 return std::vector<std::string>(
names.begin(),
names.end() );
53 boost::property_tree::json_parser::write_json(
ss,
p);
54 std::cout <<
ss.str() << std::endl;
60 top.put(
"filetype",
"hltmenu");
64 std::map<std::string, const TrigConf::HLTStreamTag*> allStreams;
68 pChain.put(
"counter", cptr->chain_counter());
69 pChain.put(
"nameHash", cptr->chain_hash_id());
70 pChain.put(
"l1item", cptr->lower_chain_name());
73 pChain.add_child(
"sequencers",
asArray(std::vector<std::string>({
"missing"})));
75 std::vector<std::string> strNames;
76 for (
const auto st: cptr->streams()) {
77 strNames.push_back(st->stream());
78 allStreams[st->stream()] = st;
80 pChain.add_child(
"streams",
asArray(strNames));
82 pChain.add_child(
"groups",
asArray(cptr->groups()));
87 std::vector<uint32_t> counters;
88 std::vector<int> logics;
89 std::vector<std::string>
labels;
90 ptree outputTEs_outerArray;
92 for(
auto& signature : cptr->signatureList() ){
93 uint32_t cntr = signature->signature_counter();
94 counters.push_back(cntr);
95 logics.push_back(signature->logic());
96 labels.push_back(signature->label());
97 ptree outputTEs_innerArray;
98 for(
auto& outputTE : signature->outputTEs()){
99 outputTEs_innerArray.push_back( ptree::value_type(
"", outputTE->name()) );
101 outputTEs_outerArray.push_back( ptree::value_type(
"", outputTEs_innerArray) );
105 pSig.add_child(
"counters",
asArray(counters));
106 pSig.add_child(
"logics",
asArray(logics));
107 pSig.add_child(
"outputTEs", outputTEs_outerArray);
110 pChain.add_child(
"signature", pSig);
113 pChains.push_back(std::make_pair(cptr->chain_name(), pChain));
116 for (
auto [sname,
stream]: allStreams ) {
118 pStream.put(
"name", sname);
119 pStream.put(
"type",
stream->type());
120 pStream.put(
"obeyLB",
stream->obeyLB());
121 pStream.put(
"forceFullEventBuilding",
true);
122 pStreams.push_back(std::make_pair(sname, pStream));
125 top.add_child(
"chains", pChains);
127 top.add_child(
"streams", pStreams);
129 pSequencers.add_child(
"missing",
asArray(std::vector<std::string>({
""})));
130 top.add_child(
"sequencers", pSequencers);
134 std::vector<std::string> outputTEs;
135 ptree inputTEs_outerArray;
136 ptree algorithms_outerArray;
137 for(
auto&
seq : sequenceList){
138 outputTEs.push_back(
seq->outputTE()->name());
140 ptree inputTEs_innerArray;
141 for(
auto&
input :
seq->inputTEs()) {
142 inputTEs_innerArray.push_back( ptree::value_type(
"",
input->name()) );
144 inputTEs_outerArray.push_back( ptree::value_type(
"", inputTEs_innerArray) );
146 ptree algorithms_innerArray;
147 for(
const std::string&
alg :
seq->algorithms()) {
148 algorithms_innerArray.push_back( ptree::value_type(
"",
alg) );
150 algorithms_outerArray.push_back( ptree::value_type(
"", algorithms_innerArray) );
153 pSequence.add_child(
"outputTEs",
asArray(outputTEs));
154 pSequence.add_child(
"inputTEs", inputTEs_outerArray);
155 pSequence.add_child(
"algorithms", algorithms_outerArray);
156 top.add_child(
"sequence_run2", pSequence);
175 top.put(
"filetype",
"hltprescale");
176 top.put(
"name", frame->
name());
180 pChain.put(
"name", cptr->chain_name());
181 pChain.put(
"counter", cptr->chain_counter());
182 pChain.put(
"hash", cptr->chain_hash_id());
183 pChain.put(
"prescale", cptr->prescale());
184 pChain.put(
"enabled", (cptr->prescale()>0 ?
true:
false));
186 pChains.push_back(std::make_pair(cptr->chain_name(), pChain));
188 top.add_child(
"prescales", pChains);