11#ifndef FRAMEWORK_VARIANTPTREEHELPERS_H
12#define FRAMEWORK_VARIANTPTREEHELPERS_H
16#include <boost/property_tree/ptree.hpp>
23 boost::property_tree::ptree branch;
24 for (
auto i = 0u;
i <
size; ++
i) {
25 boost::property_tree::ptree leaf;
27 branch.push_back(std::make_pair(
"", leaf));
41 boost::property_tree::ptree branch;
55 boost::property_tree::ptree subtree;
56 for (
auto i = 0u;
i <
array.rows; ++
i) {
57 boost::property_tree::ptree branch;
58 for (
auto j = 0u;
j <
array.cols; ++
j) {
59 boost::property_tree::ptree leaf;
61 branch.push_back(std::make_pair(
"", leaf));
63 subtree.push_back(std::make_pair(
"", branch));
71 boost::property_tree::ptree subtree;
79 std::vector<T>
result(branch.size());
81 for (
auto const&
entry : branch) {
90 return basicVectorFromBranch<T>(branch.get_child(
"values"));
97 uint32_t nrows = branch.size();
101 for (
auto const&
row : branch) {
103 ncols =
row.second.size();
107 for (
auto const&
entry :
row.second) {
108 cache.push_back(
entry.second.get_value<T>());
119 return basicArray2DFromBranch<T>(ptree.get_child(
"values"));
122std::pair<std::vector<std::string>, std::vector<std::string>>
extractLabels(boost::property_tree::ptree
const&
tree);
128 auto values = basicArray2DFromBranch<T>(
tree.get_child(
"values"));
136 boost::property_tree::ptree subtree;
170extern template std::vector<float> o2::framework::basicVectorFromBranch<float>(boost::property_tree::ptree
const&
tree);
171extern template std::vector<int> o2::framework::basicVectorFromBranch<int>(boost::property_tree::ptree
const&
tree);
172extern template std::vector<std::basic_string<char>> o2::framework::basicVectorFromBranch<std::basic_string<char>>(boost::property_tree::ptree
const&
tree);
173extern template std::vector<double> o2::framework::basicVectorFromBranch<double>(boost::property_tree::ptree
const&
tree);
std::vector< std::string > labels_rows
std::vector< std::string > labels_cols
GLenum GLsizei GLsizei GLint * values
Defining PrimaryVertex explicitly as messageable.
LabeledArray< T > labeledArrayFromBranch(boost::property_tree::ptree const &tree)
Array2D< T > basicArray2DFromBranch(boost::property_tree::ptree const &branch)
boost::property_tree::ptree labeledArrayToBranch(LabeledArray< T > &&array)
boost::property_tree::ptree basicVectorToBranch(T *values, size_t size)
boost::property_tree::ptree basicArray2DToBranch(Array2D< T > &&array)
std::pair< std::vector< std::string >, std::vector< std::string > > extractLabels(boost::property_tree::ptree const &tree)
boost::property_tree::ptree vectorToBranch(T *values, size_t size)
boost::property_tree::ptree array2DToBranch(Array2D< T > &&array)
Array2D< T > array2DFromBranch(boost::property_tree::ptree const &ptree)
std::vector< T > vectorFromBranch(boost::property_tree::ptree const &branch)
std::vector< T > basicVectorFromBranch(boost::property_tree::ptree const &branch)
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))