ATLAS Offline Software
Loading...
Searching...
No Matches
JsonFileWriterHLT.cxx File Reference
#include "TrigConfIO/JsonFileWriterHLT.h"
#include "TrigConfData/HLTMenu.h"
#include "TrigConfData/HLTPrescalesSet.h"
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <nlohmann/json.hpp>
Include dependency graph for JsonFileWriterHLT.cxx:

Go to the source code of this file.

Functions

template<typename T>
std::vector< T > ToVector (const TrigConf::DataStructure &ds, const std::string &child)
 Helper function ptree key->[] to std::vector<T>
template<typename T>
std::vector< std::vector< T > > ToVectorVector (const TrigConf::DataStructure &ds, const std::string &child)
 Helper function ptree key->[[]] to std::vector<std::vector<T>>

Function Documentation

◆ ToVector()

template<typename T>
std::vector< T > ToVector ( const TrigConf::DataStructure & ds,
const std::string & child )

Helper function ptree key->[] to std::vector<T>

Definition at line 24 of file JsonFileWriterHLT.cxx.

24 {
25 using ptree = boost::property_tree::ptree;
26 std::vector<T> return_vector;
27 for( const ptree::value_type& entry : ds.data().get_child(child) ) {
28 return_vector.push_back( entry.second.get_value<T>() );
29 }
30 return return_vector;
31}
boost::property_tree::ptree ptree

◆ ToVectorVector()

template<typename T>
std::vector< std::vector< T > > ToVectorVector ( const TrigConf::DataStructure & ds,
const std::string & child )

Helper function ptree key->[[]] to std::vector<std::vector<T>>

Definition at line 35 of file JsonFileWriterHLT.cxx.

35 {
36 using ptree = boost::property_tree::ptree;
37 std::vector<std::vector<T>> return_vector;
38 for( const ptree::value_type& outer : ds.data().get_child(child) ) {
39 return_vector.push_back(std::vector<T>());
40 for (const ptree::value_type& inner : outer.second) {
41 return_vector.back().push_back( inner.second.get_value<T>() );
42 }
43 }
44 return return_vector;
45}