TkN 2.4
Toolkit for Nuclei
Loading...
Searching...
No Matches
tkelement_builder.h
1/********************************************************************************
2 * Copyright (c) : Université de Lyon 1, CNRS/IN2P3, UMR5822, *
3 * IP2I, F-69622 Villeurbanne Cedex, France *
4 * Normandie Université, ENSICAEN, UNICAEN, CNRS/IN2P3, *
5 * LPC Caen, F-14000 Caen, France *
6 * Contibutor(s) : *
7 * Jérémie Dudouet jeremie.dudouet@cnrs.fr [2020] *
8 * Diego Gruyer diego.gruyer@cnrs.fr [2020] *
9 * *
10 * Licensed under the MIT License <http://opensource.org/licenses/MIT>. *
11 * SPDX-License-Identifier: MIT *
12 ********************************************************************************/
13
14#ifndef tkelement_builder_H
15#define tkelement_builder_H
16
17#include <vector>
18#include <set>
19
20#include "tkn_config.h"
21#include "tkdatabase.h"
22
23#ifdef HAS_ROOT
24#include "TClass.h"
25#endif
26
27using namespace std;
28
29namespace tkn {
30
32
33private:
34 using atomic_properties = std::tuple<tkstring,tkstring,tkstring,tkstring>;
35 using atomic_xray = std::tuple<tkstring,tkstring,double>;
36
37 tkdatabase *fDataBase = nullptr;
38 tkstring fTableName;
39
40 map<int,map<tkstring,atomic_properties>> fmap_of_atomic_properties;
41 vector<tkstring> columns;
42 vector<tkstring> units;
43 vector<tkstring> types;
44 vector<int> indexes;
45
46 map<int,vector<atomic_xray>> fmap_of_xrays;
47 set<tkstring> fxrays_possible_names;
48
49public:
50 tkelement_builder(tkdatabase *_database, const char* _table_name="ELEMENT");
52
53public:
54 int fill_database(const char* _atomic_db, const char* _xrays_db, int _only_charge=0);
55
56private:
57
58 void read_atomic_db(const char *_atomic_db);
59 void read_xrays_db(const char *_xrays_db);
60
61#ifdef HAS_ROOT
63 ClassDef(tkelement_builder,0);
64#endif
65};
66
67}
68#endif
69
70
Interface to the sqlite database.
Definition tkdatabase.h:34
virtual ~tkelement_builder()
int fill_database(const char *_atomic_db, const char *_xrays_db, int _only_charge=0)
tkelement_builder(tkdatabase *_database, const char *_table_name="ELEMENT")
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition tkstring.h:31
Definition tklog.cpp:16