11 #include <nlohmann/json.hpp>
25 std::vector<T> return_vector;
26 for(
const ptree::value_type&
entry :
ds.data().get_child(child) ) {
27 return_vector.push_back(
entry.second.get_value<T>() );
36 std::vector<std::vector<T>> return_vector;
37 for(
const ptree::value_type& outer :
ds.data().get_child(child) ) {
38 return_vector.push_back(std::vector<T>());
39 for (
const ptree::value_type& inner : outer.second) {
40 return_vector.back().push_back( inner.second.get_value<T>() );
53 jChain[
"counter"] =
chain.counter();
54 jChain[
"nameHash"] =
chain.namehash();
55 jChain[
"l1item"] =
chain.l1item();
56 jChain[
"legMultiplicities"] =
chain.legMultiplicities();
57 jChain[
"l1thresholds"] =
chain.l1thresholds();
58 jChain[
"groups"] =
chain.groups();
59 jChain[
"streams"] =
chain.streams();
60 jChain[
"seqeuncers"] =
chain.sequencers();
63 if (
chain.hasChild(
"signature")) {
65 jSig[
"counters"] = ToVector<uint32_t>(
chain,
"signature.counters");
66 jSig[
"logics"] = ToVector<int>(
chain,
"signature.logics");
67 jSig[
"labels"] = ToVector<std::string>(
chain,
"signature.labels");
68 jSig[
"outputTEs"] = ToVectorVector<std::string>(
chain,
"signature.outputTEs");
69 jChain[
"signature"] = jSig;
76 for (
const auto& [seqName, algsList]:
menu.sequencers() ) {
77 json jSeq( algsList );
78 sequencers[seqName] = jSeq;
83 jStream[
"name"] =
stream[
"name"];
84 jStream[
"type"] =
stream[
"type"];
85 jStream[
"obeyLB"] =
stream.getAttribute<
bool>(
"obeyLB");
86 jStream[
"forceFullEventBuilding"] =
stream.getAttribute<
bool>(
"forceFullEventBuilding");
92 j[
"filetype"] =
"hltmenu";
93 j[
"name"] =
menu.name();
95 j[
"sequencers"] = sequencers;
99 if (
menu.hasChild(
"sequence_run2")) {
101 jSequence[
"outputTEs"] = ToVector<std::string>(
menu,
"sequence_run2.outputTEs");
102 jSequence[
"inputTEs"] = ToVectorVector<std::string>(
menu,
"sequence_run2.inputTEs");
103 jSequence[
"algorithms"] = ToVectorVector<std::string>(
menu,
"sequence_run2.algorithms");
104 j[
"sequence_run2"] = jSequence;
108 outfile << std::setw(4) << j << std::endl;
119 jChain[
"name"] =
chain.name();
120 jChain[
"counter"] =
chain.counter();
121 jChain[
"hash"] =
chain.namehash();
127 j[
"filetype"] =
"hltprescale";
128 j[
"name"] = ps.
name();
131 outfile << std::setw(4) << j << std::endl;