TkN 2.3
Toolkit for Nuclei
Loading...
Searching...
No Matches
tkmanager.cpp
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 * This software is governed by the CeCILL-B license under French law and *
11 * abiding by the rules of distribution of free software. You can use, *
12 * modify and/ or redistribute the software under the terms of the *
13 * CeCILL-B license as circulated by CEA, CNRS and INRIA at the following *
14 * URL \"http://www.cecill.info\". *
15 * *
16 * As a counterpart to the access to the source code and rights to copy, *
17 * modify and redistribute granted by the license, users are provided *
18 * only with a limited warranty and the software's author, the holder of *
19 * the economic rights, and the successive licensors have only limited *
20 * liability. *
21 * *
22 * In this respect, the user's attention is drawn to the risks associated *
23 * with loading, using, modifying and/or developing or reproducing the *
24 * software by the user in light of its specific status of free software, *
25 * that may mean that it is complicated to manipulate, and that also *
26 * therefore means that it is reserved for developers and experienced *
27 * professionals having in-depth computer knowledge. Users are therefore *
28 * encouraged to load and test the software's suitability as regards *
29 * their requirements in conditions enabling the security of their *
30 * systems and/or data to be ensured and, more generally, to use and *
31 * operate it in the same conditions as regards security. *
32 * *
33 * The fact that you are presently reading this means that you have had *
34 * knowledge of the CeCILL-B license and that you accept its terms. *
35 ********************************************************************************/
36
37#include <algorithm>
38#include <fstream>
39#include <iterator>
40
41#include "tkmanager.h"
42#include "tklog.h"
43#include "tkdatabase.h"
44#include "json.hpp"
45
46namespace tkn {
54
55}
56
57using namespace tkn;
58using json = nlohmann::json;
59
60tkmanager* tkmanager::g_data_manager = nullptr;
61
63{
64 if(g_data_manager) return g_data_manager;
65
66 std::lock_guard<std::recursive_mutex> lock(get_mutex());
67
68 if(g_data_manager == nullptr) {
69 g_data_manager = new tkmanager();
70 }
71
72 return g_data_manager;
73}
74
76{
77 std::lock_guard<std::recursive_mutex> lock(get_mutex());
78
79 preload_nuclei();
80
81 g_data_manager = this;
82}
83
85{
86 g_data_manager = nullptr;
87}
88
89shared_ptr<tklevel_scheme> tkmanager::get_level_scheme(const tkn::tkstring &_nuc, int _zz, int _aa)
90{
91 if(fmap_of_level_scheme.count(_nuc)) return fmap_of_level_scheme[_nuc];
92
93 std::lock_guard<std::recursive_mutex> lock(get_mutex());
94
95 auto [it, inserted] = fmap_of_level_scheme.try_emplace(
96 _nuc, make_shared<tklevel_scheme>(_nuc,_zz,_aa));
97 return it->second;
98}
99
100void tkmanager::preload_nuclei()
101{
102 // try with isotope.*, element.*
103 gdatabase->begin("isotope.*, element.*","isotope INNER JOIN element on isotope.element_id=element.element_id");
104
105 while(gdatabase->next()) {
106 tkdb_table& element = (*gdatabase)["ELEMENT"];
107 tkdb_table& iso_table = (*gdatabase)["ISOTOPE"];
108
109 shared_ptr<tknucleus> anucleus = make_shared<tknucleus>();
110
111 tkstring name = element["symbol"].get_value();
112 anucleus->felement_symbol = name;
113 anucleus->felement_name = element["name"].get_value();
114
115 int zz = element["charge"].get_value().atoi();
116 int aa = iso_table["mass"].get_value().atoi();
117
118 gdebug << aa << name << " loaded" << do_endl;
120 name.prepend(iso_table["mass"].get_value());
121
122 anucleus->set_name(name.data());
123 anucleus->fA = aa;
124 anucleus->fZ = zz;
125 anucleus->fN = aa - zz;
126 anucleus->fis_known = true;
127
128 // load element properties
129 for (auto &col : element.get_columns()) {
130 tkstring colname = col.first;
131 if(colname=="element_id") continue;
132 if(colname.ends_with("_unit")) continue;
133
134 tkstring colname_unit = colname + "_unit";
135 tkstring unit("");
136 tkstring value = col.second.get_value();
137 if(element.get_columns().count(colname_unit)) {
138 unit = element.get_columns().at(colname_unit).get_value();
139 }
140 if( colname == "atomic_mass" ||
141 colname == "atomic_radius_van_der_Waals" ||
142 colname == "boiling_point" ||
143 colname == "density" ||
144 colname == "ionization_energy" ||
145 colname == "melting_point"
146 ) {
147 shared_ptr<tkmeasure> data = make_shared<tkmeasure>(value.atof(),unit);
148 data->set_info(tkproperty::kKnown);
149 data->set_type(colname);
150 anucleus->add_property(colname,data);
151 }
152 else if(colname.begins_with("XRay")) {
153 unit = "keV";
154 shared_ptr<tkmeasure> data = make_shared<tkmeasure>(value.atof(),unit);
155 data->set_info(tkproperty::kKnown);
156 data->set_type(colname);
157 if(value.atof()>0) anucleus->add_property(colname,data);
158 }
159 else {
160 anucleus->add_property_str(colname,value,unit);
161 }
162 }
163
164 // load isotope properties
165 vector<tkstring> fNames = {
166 "lifetime", // From ENSDF
167 "abundance", "quadrupoleDeformation", "FY235U", "FY238U", "FY239Pu", "FY241Pu", "FY252Cf", "cFY235U", "cFY238U", "cFY239Pu", "cFY241Pu", "cFY252Cf", // From NUDAT
168 "mass_excess", "radius", "magnetic_dipole", "electric_quadrupole" // From IAEA-NDS API
169 };
170
171 for(auto &property_name: fNames) {
173 iso_table.read_measure(data_struct,property_name);
174 if(data_struct.filled) {
175 shared_ptr<tkmeasure> data = make_shared<tkmeasure>(data_struct.value,data_struct.unit,data_struct.err);
176 if(data_struct.info.contains("ERR=SY")) data->set_info(tkproperty::kSystematic);
177 else data->set_info(tkproperty::kKnown);
178 data->set_type(property_name);
179
180 if(property_name == "lifetime") {
181 if(!data_struct.info.is_empty()) data->set_info_tag(data_struct.info);
182 if(data->get_info_tag().contains("STABLE")) {
183 anucleus->fis_stable = true;
184 data->set_error(0);
185 anucleus->add_property(property_name,data,"STABLE","");
186 }
187 else anucleus->add_property(property_name,data, tkstring::form("%g",data->get_value()));
188 }
189 else {
190 anucleus->add_property(property_name,data);
191 }
192 }
193 }
194
195 anucleus->add_property_str("isotope_year_discovered",iso_table["isotope_year_discovered"].get_value(),"");
196
197 tkstring decay_modes = iso_table["decay_modes"].get_value();
198 anucleus->add_property_str("decay_modes",decay_modes,"");
199
200 tkstring spin_parity_str = iso_table["spin_parity"].get_value();
201 double spin = iso_table["spin"].get_value().atof();
202 int parity = iso_table["parity"].get_value().atoi();
203
204 anucleus->fspin_parity.set_spin(spin);
205 anucleus->fspin_parity.set_parity(parity);
206 anucleus->fspin_parity.set_from_str(spin_parity_str);
207
208 anucleus->add_property_str("spin_parity",spin_parity_str,"");
209
210 fmap_of_nuclei[name] = anucleus;
211 fmap_of_nuclei_per_z[anucleus->fZ].push_back(anucleus);
212 fmap_of_nuclei_per_a[anucleus->fA].push_back(anucleus);
213 fmap_of_nuclei_per_n[anucleus->fN].push_back(anucleus);
214 fmap_of_nuclei_per_z_and_a[anucleus->fZ][anucleus->fA] = anucleus;
215 fvector_of_nuclei.push_back(anucleus);
216
217 if(!fmap_of_symbols.count(anucleus->get_z()))
218 fmap_of_symbols[anucleus->get_z()] = anucleus->get_element_symbol();
219 }
220
221 // separation energy calculation
222 if(!get_nucleus(0,1)||!get_nucleus(1,1)||!get_nucleus(2,4)) return;
223 auto neutron_ME = fmap_of_nuclei_per_z_and_a.at(0).at(1)->get("mass_excess");
224 auto proton_ME = fmap_of_nuclei_per_z_and_a.at(1).at(1)->get("mass_excess");
225 auto alpha_ME = fmap_of_nuclei_per_z_and_a.at(2).at(4)->get("mass_excess");
226 tkmeasure electron_mass(0.51099895000,"MeV",0.00000000015);
227 for(auto &nuc: fmap_of_nuclei) {
228 auto ME = nuc.second->get("mass_excess");
229 if(!ME) continue;
230 // Sn calculation: Sn(A,Z) = − ME(A,Z) + ME(A−1,Z) + ME(n)
231 auto daughter = get_nucleus(nuc.second->get_z(),nuc.second->get_a()-1);
232 if(daughter && daughter->get("mass_excess")) {
233 shared_ptr<tkmeasure> Sn = make_shared<tkmeasure>(-*ME + *daughter->get("mass_excess") + *neutron_ME);
234 Sn->set_type("neutronSeparationEnergy");
235 nuc.second->add_property("neutronSeparationEnergy",Sn);
236 }
237 // S2n calculation: S2n(A,Z) = − ME(A,Z) + ME(A−2,Z) + 2*ME(n)
238 daughter = get_nucleus(nuc.second->get_z(),nuc.second->get_a()-2);
239 if(daughter && daughter->get("mass_excess")) {
240 shared_ptr<tkmeasure> S2n = make_shared<tkmeasure>(-*ME + *daughter->get("mass_excess") + 2.*(*neutron_ME));
241 S2n->set_type("twoNeutronSeparationEnergy");
242 nuc.second->add_property("twoNeutronSeparationEnergy",S2n);
243 }
244 // Sp calculation: Sp(A,Z) = − ME(A,Z) + ME(A−1,Z-1) + ME(p)
245 daughter = get_nucleus(nuc.second->get_z()-1,nuc.second->get_a()-1);
246 if(daughter && daughter->get("mass_excess")) {
247 shared_ptr<tkmeasure> Sp = make_shared<tkmeasure>(-*ME + *daughter->get("mass_excess") + *proton_ME);
248 Sp->set_type("protonSeparationEnergy");
249 nuc.second->add_property("protonSeparationEnergy",Sp);
250 }
251 // S2p calculation: S2p(A,Z) = − ME(A,Z) + ME(A−2,Z-2) + 2*ME(p)
252 daughter = get_nucleus(nuc.second->get_z()-2,nuc.second->get_a()-2);
253 if(daughter && daughter->get("mass_excess")) {
254 shared_ptr<tkmeasure> S2p = make_shared<tkmeasure>(-*ME + *daughter->get("mass_excess") + 2.*(*proton_ME));
255 S2p->set_type("twoProtonSeparationEnergy");
256 nuc.second->add_property("twoProtonSeparationEnergy",S2p);
257 }
258
259 // Qalpha
260 daughter = get_nucleus(nuc.second->get_z()-2,nuc.second->get_a()-4);
261 if(daughter && daughter->get("mass_excess")) {
262 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess") - *alpha_ME);
263 Q->set_type("Qalpha");
264 nuc.second->add_property("Qalpha",Q);
265 }
266 // QbetaMinus
267 daughter = get_nucleus(nuc.second->get_z()+1,nuc.second->get_a());
268 if(daughter && daughter->get("mass_excess")) {
269 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess"));
270 Q->set_type("QbetaMinus");
271 nuc.second->add_property("QbetaMinus",Q);
272 }
273 // QbetaMinusOneNeutronEmission
274 daughter = get_nucleus(nuc.second->get_z()+1,nuc.second->get_a()-1);
275 if(daughter && daughter->get("mass_excess")) {
276 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess") - *neutron_ME);
277 Q->set_type("QbetaMinusOneNeutronEmission");
278 nuc.second->add_property("QbetaMinusOneNeutronEmission",Q);
279 }
280 // QbetaMinusTwoNeutronEmission
281 daughter = get_nucleus(nuc.second->get_z()+1,nuc.second->get_a()-2);
282 if(daughter && daughter->get("mass_excess")) {
283 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess") - 2.*(*neutron_ME) );
284 Q->set_type("QbetaMinusTwoNeutronEmission");
285 nuc.second->add_property("QbetaMinusTwoNeutronEmission",Q);
286 }
287 // QdeltaAlpha: 0.5*(Qa(Z+2,N+2)-Qa(Z,N))
288 daughter = get_nucleus(nuc.second->get_z()+2,nuc.second->get_a()+4);
289 if(daughter && daughter->get("mass_excess") && nuc.second->get("Qalpha")) {
290 auto Qa = nuc.second->get("Qalpha");
291 auto Qa2 = *daughter->get("mass_excess") - *ME - *alpha_ME;
292 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( 0.5*(Qa2 - *Qa ));
293 Q->set_type("QdeltaAlpha");
294 nuc.second->add_property("QdeltaAlpha",Q);
295 }
296 // QdoubleBetaMinus
297 daughter = get_nucleus(nuc.second->get_z()+2,nuc.second->get_a());
298 if(daughter && daughter->get("mass_excess")) {
299 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess"));
300 Q->set_type("QdoubleBetaMinus");
301 nuc.second->add_property("QdoubleBetaMinus",Q);
302 }
303 // QelectronCapture
304 daughter = get_nucleus(nuc.second->get_z()-1,nuc.second->get_a());
305 if(daughter && daughter->get("mass_excess")) {
306 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess"));
307 Q->set_type("QelectronCapture");
308 nuc.second->add_property("QelectronCapture",Q);
309 }
310 // QdoubleElectronCapture
311 daughter = get_nucleus(nuc.second->get_z()-2,nuc.second->get_a());
312 if(daughter && daughter->get("mass_excess")) {
313 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess"));
314 Q->set_type("QdoubleElectronCapture");
315 nuc.second->add_property("QdoubleElectronCapture",Q);
316 }
317 // QelectronCaptureOneProtonEmission
318 daughter = get_nucleus(nuc.second->get_z()-2,nuc.second->get_a()-1);
319 if(daughter && daughter->get("mass_excess")) {
320 shared_ptr<tkmeasure> Q = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess") - *proton_ME);
321 Q->set_type("QelectronCaptureOneProtonEmission");
322 nuc.second->add_property("QelectronCaptureOneProtonEmission",Q);
323 }
324 // QpositronEmission
325 daughter = get_nucleus(nuc.second->get_z()-1,nuc.second->get_a());
326 if(daughter && daughter->get("mass_excess")) {
327 auto q_positron = make_shared<tkmeasure>( *ME - *daughter->get("mass_excess") - 2.*electron_mass);
328 q_positron->set_type("QpositronEmission");
329 nuc.second->add_property("QpositronEmission",q_positron);
330 }
331
332 // binding energy
333 auto q_binding = make_shared<tkmeasure>( 1./nuc.second->get_a()*(nuc.second->get_z()*(*proton_ME) + nuc.second->get_n()*(*neutron_ME) - *ME));
334 q_binding->set_type("binding_energy_overA");
335 nuc.second->add_property("binding_energy_overA",q_binding);
336
337 // pairingGap PG=0.5 x (-1)N x ( 2BE(Z,N) - BE(Z,N-1) -BE(Z,N+1) )
338 auto nuc_minus = get_nucleus(nuc.second->get_z(),nuc.second->get_a()-1);
339 auto nuc_plus = get_nucleus(nuc.second->get_z(),nuc.second->get_a()+1);
340 if(nuc_minus && nuc_plus && nuc_minus->get("mass_excess") && nuc_plus->get("mass_excess")) {
341 auto q_pairing = make_shared<tkmeasure>( 0.5 * pow(-1,nuc.second->get_n()) * ( -2* (*ME) + *nuc_minus->get("mass_excess") + *nuc_plus->get("mass_excess")));
342 q_pairing->set_type("pairingGap");
343 nuc.second->add_property("pairingGap",q_pairing);
344 }
345 }
346}
347
348void tkmanager::preload_level_schemes(bool _verbose)
349{
350 size_t nnuc=fvector_of_nuclei.size(),inuc=0;
351 for(const auto &nuc : fvector_of_nuclei){
352 if(_verbose) glog.progress_bar(nnuc,inuc,"... pre-loading");
353 get_level_scheme(nuc->get_symbol(),nuc->get_z(),nuc->get_a());
354 inuc++;
355 }
356}
357
373vector<shared_ptr<tknucleus> > tkmanager::get_nuclei(const std::function<bool (shared_ptr<tknucleus>)> &_selection)
374{
375 vector<shared_ptr<tknucleus>> res;
376 std::copy_if(fvector_of_nuclei.begin(), fvector_of_nuclei.end(), std::back_inserter(res),
377 [&_selection](const auto &nuc) { return _selection(nuc); });
378 return res;
379}
380
381bool tkmanager::known_element(tkstring _nuc, int &_z) {
382 tkstring symbol=_nuc.extract_alpha();
383 for(auto &nuc_test: fmap_of_nuclei) {
384 if(nuc_test.first.copy().extract_alpha() == symbol) {
385 _z = nuc_test.second->get_z();
386 return true;
387 }
388 }
389 return false;
390}
391
393{
394 std::lock_guard<std::recursive_mutex> lock(get_mutex());
395 fmax_level_id++;
396 return fmax_level_id;
397}
398
400{
401 std::lock_guard<std::recursive_mutex> lock(get_mutex());
402 fmax_decay_id++;
403 return fmax_decay_id;
404}
405
417 * - `S1p`, `S1p_sigma`
418 * - `S2p`, `S2p_sigma`
419 *
420 * @param json_path Path to the JSON file (default: "%s/databases/driplines.json").
421 *
422 * @note After loading, all points are sorted by (Z,N) for deterministic order.
423 *
424 * @note Data extracted from the supplementary material of:
425 * L. Neufcourt, Y. Cao, S. A. Giuliani, W. Nazarewicz, E. Olsen, O. B. Tarasov,
426 * "Quantified limits of the nuclear landscape", Phys. Rev. C 101, 044307 (2020).
427 *
428 * @code
429 * // Example usage:
430 * gmanager->load_drip_lines("path/to/nuclei_quantities.json");
431 * auto s2n = gmanager->get_drip_line("S2n");
432 * @endcode
433 */
434void tkmanager::load_drip_lines(const tkstring& json_path)
435{
436 std::ifstream f(json_path);
437 if (!f.is_open()) {
438 glog << error << "tkmanager::load_drip_lines: cannot open " << json_path << do_endl;
439 return;
440 }
441
442 json j;
443 try {
444 f >> j;
445 } catch (const std::exception& e) {
446 glog << error << "tkmanager::load_drip_lines: JSON parse error in "
447 << json_path << " : " << e.what() << do_endl;
448 return;
449 }
450
451 if (!j.is_array()) {
452 glog << error << "tkmanager::load_drip_lines: root is not an array in "
453 << json_path << do_endl;
454 return;
455 }
456
457 fdrip_lines.clear();
458
459 auto push_if_present = [&](const json& o, const char* qname, const char* sname){
460 if (!o.contains(qname)) return;
461 if (o[qname].is_null()) return;
462
463 tkn_drip_point p;
464 p.Z = o.value("Z", 0);
465 p.N = o.value("N", 0);
466 p.value_mev = o.value(qname, std::numeric_limits<double>::quiet_NaN());
467 // sigma may be absent → keep NaN
468 if (o.contains(sname) && !o[sname].is_null()) {
469 p.sigma_mev = o.value(sname, std::numeric_limits<double>::quiet_NaN());
470 }
471 p.type = qname;
472
473 fdrip_lines[p.type].push_back(std::move(p));
474 };
475
476 try {
477 for (const auto& o : j) {
478 if (!o.is_object()) continue;
479 // Z and N must exist; skip otherwise
480 if (!o.contains("Z") || !o.contains("N")) continue;
481
482 push_if_present(o, "S1n", "S1n_sigma");
483 push_if_present(o, "S2n", "S2n_sigma");
484 push_if_present(o, "S1p", "S1p_sigma");
485 push_if_present(o, "S2p", "S2p_sigma");
486 }
487 } catch (const std::exception& e) {
488 glog << error << "tkmanager::load_drip_lines: error while iterating JSON: "
489 << e.what() << do_endl;
490 fdrip_lines.clear();
491 return;
492 }
493
494 // Sort deterministically by Z, then N
495 for (auto& kv : fdrip_lines) {
496 auto& vec = kv.second;
497 std::sort(vec.begin(), vec.end(), [](const tkn_drip_point& a, const tkn_drip_point& b){
498 if (a.Z != b.Z) return a.Z < b.Z;
499 return a.N < b.N;
500 });
501 }
502
503 glog << info << "load_drip_lines: loaded " << j.size()
504 << " nuclei objects from " << json_path << do_endl;
505}
506
507
532std::vector<tkn_drip_point> tkmanager::get_drip_line(const std::string& _type, bool reduce_per_Z)
533{
534 if (fdrip_lines.empty()) {
535 // charge par défaut si pas déjà fait
536 load_drip_lines(tkstring::Form("%s/databases/driplines.json", TKN_SYS));
537 }
538
539 auto it = fdrip_lines.find(_type);
540 if (it == fdrip_lines.end()) {
541 glog << warning << "get_drip_line: unknown type '" << _type << "'" << do_endl;
542 return {};
543 }
544
545 const auto& vec = it->second;
546
547 if (!reduce_per_Z) {
548 return vec;
549 }
550
551 // --- Réduction : garder seulement le point avec min |value| par Z
552 std::unordered_map<int, tkn_drip_point> best_by_Z;
553 for (const auto& p : vec) {
554 auto itZ = best_by_Z.find(p.Z);
555 if (itZ == best_by_Z.end()) {
556 best_by_Z[p.Z] = p;
557 } else {
558 const auto& cur = itZ->second;
559 if (std::isnan(cur.value_mev) ||
560 (!std::isnan(p.value_mev) && std::abs(p.value_mev) < std::abs(cur.value_mev))) {
561 best_by_Z[p.Z] = p;
562 }
563 }
564 }
565
566 std::vector<tkn_drip_point> reduced;
567 reduced.reserve(best_by_Z.size());
568 std::transform(best_by_Z.begin(), best_by_Z.end(), std::back_inserter(reduced),
569 [](const auto &kv) { return kv.second; });
570
571 std::sort(reduced.begin(), reduced.end(), [](const tkn_drip_point& a, const tkn_drip_point& b){
572 if (a.Z != b.Z) return a.Z < b.Z;
573 return a.N < b.N;
574 });
575
576 return reduced;
577}
578
579#ifdef HAS_ROOT
581ClassImp(tkmanager)
582#endif
Representaiton of a sqlite data table.
Definition tkdb_table.h:52
void read_measure(measure_data_struct &_struct, const tkstring &_col_base_name)
row & get_columns()
Definition tkdb_table.h:139
void clear()
Definition tklog.h:179
Manages the database loading and provides access to the physics properties.
Definition tkmanager.h:74
static tkmanager * the_data_manager()
int get_new_level_id()
define a new unique level id
std::vector< tkn_drip_point > get_drip_line(const std::string &_type, bool reduce_per_Z=true)
Get the drip line for a given type (optionally reduced per Z)
shared_ptr< tknucleus > get_nucleus(const tkstring &_nuc)
return a shared pointer to a nucleus from its name
Definition tkmanager.h:148
const vector< shared_ptr< tknucleus > > & get_nuclei()
return a vector containing all the known nuclei
Definition tkmanager.h:129
int get_new_decay_id()
define a new unique decay id
virtual ~tkmanager()
bool known_element(tkstring _nuc, int &_z)
is the element symbol is known (ex: "C")
void preload_level_schemes(bool _verbose=false)
preload all the level schemes from the database
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition tkstring.h:54
tkstring extract_alpha()
Returns a tkstring composed only of the alphabetic letters of the original tkstring.
Definition tkstring.cpp:387
static const char * form(const char *_format,...)
Definition tkstring.cpp:431
static tkstring Form(const char *_format,...)
Definition tkstring.cpp:345
bool is_empty() const
Definition tkstring.h:163
bool ends_with(const char *_s, ECaseCompare _cmp=kExact) const
Definition tkstring.cpp:241
bool contains(const char *_pat, ECaseCompare _cmp=kExact) const
Definition tkstring.h:197
tkstring & prepend(const tkstring &_st)
Definition tkstring.h:224
bool begins_with(const char *_s, ECaseCompare _cmp=kExact) const
Definition tkstring.h:185
double atof() const
Converts a string to double value.
Definition tkstring.cpp:191
Definition tklog.cpp:39
tklog & info(tklog &log)
Definition tklog.h:336
tklog & error(tklog &log)
Definition tklog.h:367
tklog & do_endl(tklog &log)
Definition tklog.h:235
tklog & warning(tklog &log)
Definition tklog.h:354
data structure used to fill a tkmeasure object from the sqlite database
Definition tkdb_table.h:72
int Z
Proton number.
Definition tkmanager.h:64
double value_mev
Quantity value (MeV)
Definition tkmanager.h:66
std::string type
Quantity type: "S1n", "S2n", "S1p", or "S2p".
Definition tkmanager.h:68
int N
Neutron number.
Definition tkmanager.h:65
double sigma_mev
Quantity uncertainty (MeV)
Definition tkmanager.h:67