TkN 2.3
Toolkit for Nuclei
Loading...
Searching...
No Matches
tknuclear_chart Class Reference

nuclear chart plot with ROOT More...

Detailed Description

nuclear chart plot with ROOT

Use this class (if TkN compiled with ROOT) to represent values on the neutron-proton plane. It also shown the projection on both axis. They are few example of use in the Examples example section

Definition at line 25 of file tknuclear_chart.h.

#include <tknuclear_chart.h>

Public Types

enum  chart_types { kAll , kEven , kOdd }
 

Public Member Functions

 tknuclear_chart (const char *title, int type=kAll, bool autofit=false)
 default constructor
 
 tknuclear_chart (const char *title, int type=kAll, double _min_val_histo=0, bool autofit=false)
 constructor giving the possibility to give a min limit on the TH2 z axis
 
virtual ~tknuclear_chart ()
 
void draw (bool _update_only=false)
 draw the tknucleus chart
 
void fill (int _zz, int _nn)
 fill the bin for a given nucleus (increment by 1)
 
void fill (int _zz, int _nn, double _val)
 fill the bin for a given nucleus (increment by _val)
 
TH2 * get_histo ()
 get the underlying histogram
 
double get_value (int _zz, int _nn)
 get the bin content for a given nucleus
 
void hide_empty_bins ()
 remove color on empty bins (usefull for plot with negative and positive values)
 
void reset ()
 reset the tknuclear chart
 
void save_as (const char *file_name)
 save the nuclear chart in the file file_name
 
void set_editables (bool _ed=true)
 allow to edit the canvases
 
void set_even_color (int _col)
 define the color of the projections for even nuclei
 
void set_line_width (int _width)
 set magic numbers lines width
 
void set_log_scale (bool _log=true)
 print the tknuclear chart in log scale
 
void set_ndivisions_x (int _ndiv)
 define the number of tics on the x axis
 
void set_ndivisions_y (int _ndiv)
 define the number of tics on the y axis
 
void set_ndivisions_z (int _ndiv)
 define the number of tics on the z axis
 
void set_odd_color (int _col)
 define the color of the projections for odd nuclei
 
void set_size (int _width, int _height)
 set the canvas size in pixels (default 900x900)
 
void set_title (TString _title)
 define the nuclear chart title
 
void set_value (int _zz, int _nn, double _val)
 set the bin value for a given nucleus
 
void show_empty_bins ()
 show color on empty bins
 
void update ()
 update the tknucleus chart
 

Member Enumeration Documentation

◆ chart_types

Enumerator
kAll 
kEven 
kOdd 

Definition at line 65 of file tknuclear_chart.h.

Constructor & Destructor Documentation

◆ tknuclear_chart() [1/2]

tknuclear_chart ( const char * title,
int type = kAll,
bool autofit = false )

default constructor

Definition at line 21 of file tknuclear_chart.cpp.

◆ tknuclear_chart() [2/2]

tknuclear_chart ( const char * title,
int type = kAll,
double _min_val_histo = 0,
bool autofit = false )

constructor giving the possibility to give a min limit on the TH2 z axis

Definition at line 54 of file tknuclear_chart.cpp.

◆ ~tknuclear_chart()

virtual ~tknuclear_chart ( )
inlinevirtual

Definition at line 75 of file tknuclear_chart.h.

Member Function Documentation

◆ draw()

void draw ( bool _update_only = false)

draw the tknucleus chart

Definition at line 142 of file tknuclear_chart.cpp.

◆ fill() [1/2]

void fill ( int _zz,
int _nn )
inline

fill the bin for a given nucleus (increment by 1)

Definition at line 88 of file tknuclear_chart.h.

◆ fill() [2/2]

void fill ( int _zz,
int _nn,
double _val )

fill the bin for a given nucleus (increment by _val)

Definition at line 61 of file tknuclear_chart.cpp.

◆ get_histo()

TH2 * get_histo ( )
inline

get the underlying histogram

Definition at line 131 of file tknuclear_chart.h.

◆ get_value()

double get_value ( int _zz,
int _nn )

get the bin content for a given nucleus

Definition at line 67 of file tknuclear_chart.cpp.

◆ hide_empty_bins()

void hide_empty_bins ( )

remove color on empty bins (usefull for plot with negative and positive values)

Definition at line 482 of file tknuclear_chart.cpp.

◆ reset()

void reset ( )

reset the tknuclear chart

Definition at line 137 of file tknuclear_chart.cpp.

◆ save_as()

void save_as ( const char * file_name)

save the nuclear chart in the file file_name

Definition at line 476 of file tknuclear_chart.cpp.

◆ set_editables()

void set_editables ( bool _ed = true)

allow to edit the canvases

Definition at line 437 of file tknuclear_chart.cpp.

◆ set_even_color()

void set_even_color ( int _col)
inline

define the color of the projections for even nuclei

Definition at line 98 of file tknuclear_chart.h.

◆ set_line_width()

void set_line_width ( int _width)
inline

set magic numbers lines width

Definition at line 128 of file tknuclear_chart.h.

◆ set_log_scale()

void set_log_scale ( bool _log = true)

print the tknuclear chart in log scale

Definition at line 253 of file tknuclear_chart.cpp.

◆ set_ndivisions_x()

void set_ndivisions_x ( int _ndiv)

define the number of tics on the x axis

Definition at line 446 of file tknuclear_chart.cpp.

◆ set_ndivisions_y()

void set_ndivisions_y ( int _ndiv)

define the number of tics on the y axis

Definition at line 455 of file tknuclear_chart.cpp.

◆ set_ndivisions_z()

void set_ndivisions_z ( int _ndiv)

define the number of tics on the z axis

Definition at line 465 of file tknuclear_chart.cpp.

◆ set_odd_color()

void set_odd_color ( int _col)
inline

define the color of the projections for odd nuclei

Definition at line 96 of file tknuclear_chart.h.

◆ set_size()

void set_size ( int _width,
int _height )

set the canvas size in pixels (default 900x900)

Definition at line 314 of file tknuclear_chart.cpp.

◆ set_title()

void set_title ( TString _title)
inline

define the nuclear chart title

Definition at line 116 of file tknuclear_chart.h.

◆ set_value()

void set_value ( int _zz,
int _nn,
double _val )

set the bin value for a given nucleus

Definition at line 72 of file tknuclear_chart.cpp.

◆ show_empty_bins()

void show_empty_bins ( )

show color on empty bins

◆ update()

void update ( )
inline

update the tknucleus chart

Definition at line 91 of file tknuclear_chart.h.


The documentation for this class was generated from the following files: