TkN 2.1
Toolkit for Nuclei
list_BE2_WU.C
1#include "TH2F.h"
2#include "TStyle.h"
3
4#include "tkmanager.h"
5#include "tknuclear_chart.h"
6
7using namespace tkn;
8
9void list_BE2_WU()
10{
11 // to remove warning of emty datasets
12 glog.set_warnings(false);
13
14 // creation of a 2D histogram to plot the BE2 values on a nuclear chart view
15 tknuclear_chart* nn = nullptr;
16 nn = new tknuclear_chart("B(E2) (in Weisskopf unit)",tknuclear_chart::kEven,0,true);
17
18 std::cout << "*-----------------------------------------*" << std::endl;
19 std::cout << "* List of known B(E2) in Weisskopf unit *" << std::endl;
20 std::cout << "*-----------------------------------------*" << std::endl;
21
22 cout << left << setw(7) << "Nuc" << "Data " << setw(15) << "E gamma (keV)" << setw(6) << "mult" << setw(28) << "E from -> E to (keV)" << "Transition probability" << endl;
23
24 // loop on all the even-even nuclei using a lambda function as parameter of the get_nuclei method
25 for(const auto &nuc : gmanager->get_nuclei([](auto nuc) {return (nuc->get_z()%2==0 && nuc->get_n()%2==0);})) {
26 // loop on all the datasets available on the ENSDF database
27 for(const auto &dataset: nuc->get_level_scheme()->get_datasets()) {
28
29 // Here we ask only data comming from the aggregated adopted datasets from ensdf, and the non evaluated XUNDL datasets
30 bool xundl = dataset.second->get_name().contains("XUNDL");
31 bool adopted = dataset.second->get_name().contains("ADOPTED");
32 if(!(adopted || xundl)) continue;
33
34 // we extract the pointer to the level scheme
35 auto lev_scheme = nuc->get_level_scheme();
36 // and we select the selected dataset
37 lev_scheme->select_dataset(dataset.first);
38
39 // here we ask for (if existing) the gamma transition from the first 2+ state to the ground state
40 auto gamma = lev_scheme->get_decay<tkgammadecay>("2+1->0+1",false);
41 if(!gamma) continue;
42
43 // here we ask, if known, the BE2 value (1: electric, 2:L, 1: Weisskopf units)
44 auto BE2W = gamma->get_trans_prob(true,2,true);
45 if(BE2W<=0||std::isnan(BE2W)) continue;
46
47 // the following lines are for printing in the terminal some informations on the transition
48 cout << setw(6) << nuc->get_symbol();
49 if(xundl) cout << " [XUNDL] ";
50 else cout << " [ENSDF] ";
51 cout << setw(15) << setprecision(2) << gamma->get_energy();
52 cout << setw(6) <<gamma->get_multipolarity();
53 tkstring transname = tkstring::Form("%-4s (%-6.1f) --> %s (%2.1f)",
54 gamma->get_level_from()->get_spin_parity()->get_jpi_str().data(),
55 gamma->get_level_from()->get_energy(),
56 gamma->get_level_to()->get_spin_parity_str().data(),
57 gamma->get_level_to()->get_energy());
58 cout << setw(28) << transname << " :" << BE2W;
59 cout<<endl;
60
61 // and finally we fill the histogram with the given BE2 value in Weisskopf unit
62 if(adopted) nn->set_value(nuc->get_z(),nuc->get_n(),BE2W);
63 }
64 }
65 // we plot the 2D histogram
66 nn->draw();
67 nn->save_as("list_BE2_WU.png");
68}
Stores information on a gamma-ray decay.
Definition: tkdecay.h:131
double get_trans_prob(bool _elec, int _L, bool _WU)
returns the gamma gamma transition probability value (ex: BE2 in Weiksopf units, get_trans_prob(1,...
Definition: tkdecay.cpp:262
nuclear chart plot with ROOT
void draw(bool _update_only=false)
draw the tknucleus chart
void save_as(const char *file_name)
save the nuclear chart in the file file_name
void set_value(int _zz, int _nn, double _val)
set the bin value for a given nucleus
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition: tkstring.h:54
Definition: tklog.cpp:39