1#ifndef __TKNUCLEAR_CHART_H
2#define __TKNUCLEAR_CHART_H
6#include "TMultiGraph.h"
27 TMultiGraph mgrn, mgrz;
30 TList linesp1, linesp2, linesp3;
37 double min_val = 9999999.;
38 double max_val = -9999999.;
39 double min_z = 9999999.;
40 double min_n = 9999999.;
41 double max_z = -9999999.;
42 double max_n = -9999999.;
44 bool fset_min_val=
false;
45 double min_val_histo=0.;
49 TPad *p1{}, *p2{}, *p3{}, *p4{};
51 TGaxis* axX{}, *axY{}, *axZz{}, *axZn{};
52 int ndivx, ndivy, ndivz;
55 int even_col = kBlack;
57 TLatex *ftitletex =
nullptr;
59 int fsaved_emptybins_color{};
74 tknuclear_chart(
const char* title,
int type=
kAll,
double _min_val_histo=0,
bool autofit=
false);
78 void set_size(
int _width,
int _height);
81 void set_value(
int _zz,
int _nn,
double _val);
86 void fill(
int _zz,
int _nn,
double _val);
88 void fill(
int _zz,
int _nn) {
fill(_zz,_nn,1.);}
93 void draw(
bool _update_only=
false);
119 void save_as(
const char* file_name);
134 void draw_lines(
int nz);
135 void draw_line(
int nz,
double min,
double max,
bool onx=
true);
138 void set_axis_att(TAxis* _ax,
bool _show_labels=
false);
139 void style_axis(TGaxis *_ax);
141 void calculate_projections();
nuclear chart plot with ROOT
tknuclear_chart(const char *title, int type=kAll, bool autofit=false)
default constructor
void show_empty_bins()
show color on empty bins
void set_title(TString _title)
define the nuclear chart title
void set_odd_color(int _col)
define the color of the projections for odd nuclei
void fill(int _zz, int _nn, double _val)
fill the bin for a given nucleus (increment by _val)
void set_ndivisions_y(int _ndiv)
define the number of tics on the y axis
void set_ndivisions_x(int _ndiv)
define the number of tics on the x axis
void set_line_width(int _width)
set magic numbers lines width
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_ndivisions_z(int _ndiv)
define the number of tics on the z axis
void set_even_color(int _col)
define the color of the projections for even nuclei
virtual ~tknuclear_chart()
void set_value(int _zz, int _nn, double _val)
set the bin value for a given nucleus
void fill(int _zz, int _nn)
fill the bin for a given nucleus (increment by 1)
void set_size(int _width, int _height)
set the canvas size in pixels (default 900x900)
void update()
update the tknucleus chart
double get_value(int _zz, int _nn)
get the bin content for a given nucleus
void reset()
reset the tknuclear chart
TH2 * get_histo()
get the underlying histogram
void set_log_scale(bool _log=true)
print the tknuclear chart in log scale
void set_editables(bool _ed=true)
allow to edit the canvases
void hide_empty_bins()
remove color on empty bins (usefull for plot with negative and positive values)