TkN 2.4
Toolkit for Nuclei
Loading...
Searching...
No Matches
tkensdf_reader.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 tkensdf_reader_H
15#define tkensdf_reader_H
16
17#include <fstream>
18#include <map>
19
20#include "tkstring.h"
21#include "tkensdf_ident_rec.h"
22
23namespace tkn {
24
26
28
29private:
30
32 std::ifstream fEnsdf_file{};
33
35 ensdf_data_type fdata_type = kensdf;
36
38 tkstring fNucleus{};
39
41 bool fVerbose = false;
42
44 std::map<tkensdf_record::record_type, std::pair<long long, long long > > frecords_counter;
45
46 tkstring finput_folder;
47
48protected:
49
51 std::vector<tkensdf_ident_rec> fDataSets;
52
53public:
54
55 tkensdf_reader(const tkstring &_input_folder) : finput_folder(_input_folder) {};
56 virtual ~tkensdf_reader() = default;
57
59 bool open_nuc(const tkstring &_nuc_name, const ensdf_data_type &_ftype=kensdf);
60
62 void print_datasets();
63
65 void reset_record_counter() {frecords_counter.clear();}
68
70 std::vector<tkensdf_ident_rec> *get_datasets() {return &fDataSets;}
71
73 bool first_record(tkensdf_ident_rec *_dataset, tkstring &record);
74
76 bool next_record(tkensdf_ident_rec *_dataset, tkstring &record);
77
78private:
79
81 bool open_file(const tkstring &_file_name);
82
84 virtual void close_file();
85};
86}
87
88
89#endif
Decodding of the ENSDF identification record properties.
void print_datasets()
print the list of loaded data sets for the current nucleus and data type
virtual ~tkensdf_reader()=default
bool open_nuc(const tkstring &_nuc_name, const ensdf_data_type &_ftype=kensdf)
open the file for the slected nucleus and data type, and extract the available data sets
bool first_record(tkensdf_ident_rec *_dataset, tkstring &record)
move in the current file to the first record of the selected data set
tkensdf_reader(const tkstring &_input_folder)
void print_record_counters()
print record counters
bool next_record(tkensdf_ident_rec *_dataset, tkstring &record)
get the next record of the selected data set
void reset_record_counter()
reset the record counters
std::vector< tkensdf_ident_rec > * get_datasets()
get access to the identification records
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition tkstring.h:31
Definition tklog.cpp:16
ensdf_data_type