6#include "TMultiGraph.h"
14 gROOT->SetStyle(
"tkn-histo");
16 auto *canvas =
new TCanvas();
18 vector<tkstring> xrays_names {
"Kalpha1",
"Kalpha2",
"Kbeta1" ,
"Lalpha1",
"Lalpha2" ,
"Lbeta1" ,
"Lbeta2" ,
"Lgamma1" ,
"Malpha1"};
19 vector<int> xrays_colors{ kAzure , kAzure-2, kAzure-4, kViolet , kViolet-2, kViolet-4, kViolet-6, kViolet-8, kRed };
20 vector<int> xrays_style { 20 , 21 , 22 , 20 , 21 , 22 , 23 , 29 , 20 };
22 map<tkstring,TGraph*> xrays_graphs;
24 TMultiGraph *multigraph =
new TMultiGraph(
"draw_xrays",
"draw_xrays");
25 multigraph->GetXaxis()->SetTitle(
"Charge");
26 multigraph->GetYaxis()->SetTitle(
"X-Ray energy (keV)");
27 for(
size_t i=0 ; i<xrays_names.size() ; i++) {
28 TGraph *g =
new TGraph;
29 g->SetNameTitle(xrays_names.at(i).data(),xrays_names.at(i).data());
30 g->SetMarkerStyle(xrays_style.at(i));
32 g->SetMarkerColor(xrays_colors.at(i));
33 g->GetXaxis()->SetTitle(
"Charge");
34 g->GetYaxis()->SetTitle(
"X-Ray energy (keV)");
35 xrays_graphs[xrays_names.at(i)] = g;
36 multigraph->Add(g,
"lp");
39 for(
const auto &znucs : gmanager->get_map_of_nuclei_per_z()) {
41 auto xrays = nuc.get_xrays();
42 for(
const auto &xray: xrays) {
43 TGraph *g = xrays_graphs[xray->get_type().copy().remove_all(
"XRay_")];
44 g->AddPoint(nuc.get_z(),xray->get_value());
48 multigraph->Draw(
"apl");
50 canvas->BuildLegend(0.20903,0.477895,0.419732,0.932632,
"",
"p");
51 canvas->SaveAs(
"draw_xrays.png");
A nucleus made of Z protons and N neutrons.