7 std::unordered_map<int, std::string> name_database;
8 std::unordered_map<std::string, std::vector<int>> omonymes_database;
9 std::map<int, std::vector<int>>
database;
17 template <
typename...
Args>
22 template <
typename...
Args>
32 std::pair<int, std::string>
get_id_name(
int id) {
return {
id, name_database[
id]}; }
53template <
typename...
Args>
57 static_assert((std::is_same_v<Args, std::string> && ...),
"[ERROR][database::tree_database::add_node] All ancestors must be of type std::string");
94template <
typename...
Args>
97 static_assert((std::is_same_v<Args, std::string> && ...),
"[ERROR][tree_database::find_or_create_node] All ancestors must be of type std::string");
138 std::vector<std::pair<int, std::string>>
result;
146 { return filter.first < 1 || filter.first > depth; }),
182 std::vector<std::pair<int, std::string>>
result;
183 for (
auto current_id :
id_list)
184 result.push_back({current_id, name_database[current_id]});
191 std::pair<int, std::string>
result;
206 std::cout <<
"Printing database";
211 std::cout << name_database[
node_id] << std::endl;
Definition tree_database.h:6
int find_node(int parent_id, const std::string &name)
Definition tree_database.h:69
std::vector< std::pair< int, std::string > > get_children(int parent_id, int depth, std::vector< std::pair< int, std::string > > filters)
Definition tree_database.h:30
int add_node(const std::string &child_name)
Definition tree_database.h:16
std::vector< int > get_name_ids(std::string name)
Definition tree_database.h:31
void print_tree()
Definition tree_database.h:40
int get_ancestor_id(int child_id, int depth)
Definition tree_database.h:187
std::vector< std::pair< int, std::string > > get_children(int parent_id, int depth)
Definition tree_database.h:28
std::vector< std::pair< int, std::string > > get_ids_name(std::vector< int > id_list)
Definition tree_database.h:180
std::pair< int, std::string > get_ancestor(int child_id, int depth)
Definition tree_database.h:35
std::vector< int > get_children_ids(int parent_id)
Definition tree_database.h:110
int find_or_create_node(int parent_id, const std::string &name)
Definition tree_database.h:85
int add_node(int parent_id, const std::string &child_name)
Definition tree_database.h:45
bool is_name_unique(std::string name)
Definition tree_database.h:37
std::pair< int, std::string > get_id_name(int id)
Definition tree_database.h:32
std::vector< std::pair< int, std::string > > get_children(int parent_id)
Definition tree_database.h:26
TH2_Type * build_fine_tune_raw_histogram(std::vector< TString > kInputFileNames, TString kRunTag, TString kOutputFileName, bool kRecalculate)
Functions -------------------------------------------------------------------------------------------...
Definition fine_analysis.h:80
std::vector< T > merge(const std::vector< T > &vec1, const std::vector< T > &vec2)
Definition general_utility.h:78