Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
mygsl::histogram_pool Class Reference

A pool of histograms. More...

#include <bayeux/mygsl/histogram_pool.h>

Inheritance diagram for mygsl::histogram_pool:
datatools::i_serializable datatools::i_tree_dumpable

Classes

struct  histogram_entry_type
 Simple structure related to histogram attributes. More...
 

Public Types

enum  histogram_dim_type { HISTOGRAM_DIM_UNDEFINED = 0, HISTOGRAM_DIM_1D = 1, HISTOGRAM_DIM_2D = 2 }
 Histogram dimensionality. More...
 
typedef datatools::handle< histogram_1dhh1d_type
 Typedef to handle of 1D histogram. More...
 
typedef datatools::handle< histogram_2dhh2d_type
 Typedef to handle of 2D histogram. More...
 
typedef std::map< std::string, histogram_entry_typedict_type
 Alias to histogram dictionnary. More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Public Member Functions

const std::string & get_description () const
 Return histogram pool description. More...
 
void set_description (const std::string &desc_)
 Set histogram poool description. More...
 
const datatools::propertiesget_auxiliaries () const
 Get a non-mutable reference to auxiliaries. More...
 
datatools::propertiesgrab_auxiliaries ()
 Get a mutable reference to auxiliaries. More...
 
 histogram_pool ()
 Constructor. More...
 
 histogram_pool (const std::string &desc_)
 Constructor with description inside. More...
 
virtual ~histogram_pool ()
 Destructor. More...
 
void load (const std::string &histo_setups_filename_)
 Load histograms given a setup filename. More...
 
void load (const datatools::multi_properties &histo_setups_)
 Load histograms given properties. More...
 
bool is_initialized () const
 Check histogram pool initialization. More...
 
void initialize (const datatools::properties &setup_)
 Initialization. More...
 
void reset ()
 Reset. More...
 
void remove_all ()
 Clen histogram dictionnary. More...
 
bool empty () const
 Check dictionnary emptiness. More...
 
size_t size () const
 Return the number of histrogrmas stored. More...
 
void clear_auxiliaries ()
 Clear auxiliairies. More...
 
bool has (const std::string &name_, int dim_=0) const
 Check histogram presence given an histogram name. More...
 
bool has_1d (const std::string &name_) const
 Check for 1D histogram given its name. More...
 
bool has_2d (const std::string &name_) const
 Check for 2D histogram given its name. More...
 
histogram_1dgrab_1d (const std::string &name_)
 Get a mutable reference to 1D histogram given its name. More...
 
const histogram_1dget_1d (const std::string &name_) const
 Get a non-mutable reference to 1D histogram given its name. More...
 
histogram_2dgrab_2d (const std::string &name_)
 Get a mutable reference to 2D histogram given its name. More...
 
const histogram_2dget_2d (const std::string &name_) const
 Get a non-mutable reference to 2D histogram given its name. More...
 
void remove (const std::string &name_)
 Remove an histogram given its name. More...
 
void rename (const std::string &name_, const std::string &new_name_)
 Rename an histogram. More...
 
void set_title (const std::string &name_, const std::string &title_)
 Set histogram title. More...
 
const std::string & get_title (const std::string &name_) const
 Get histogram title. More...
 
void set_group (const std::string &name_, const std::string &group_)
 Assign a group to an histogram. More...
 
const std::string & get_group (const std::string &name_) const
 Get group of an histogram. More...
 
void names (std::vector< std::string > &names_, const std::string &filter_="", bool reverse_=false) const
 Build an array containing the names of the histograms stored in the pool : More...
 
histogram_1dadd_1d (const std::string &name_, const std::string &title_="", const std::string &group_="")
 Add 1D histogram. More...
 
histogram_2dadd_2d (const std::string &name_, const std::string &title_="", const std::string &group_="")
 Add 2D histogram. More...
 
virtual void tree_dump (std::ostream &out=std::clog, const std::string &title="", const std::string &indent="", bool inherit=false) const
 Smart print. More...
 
void set_logging_priority (datatools::logger::priority)
 Set logging priority. More...
 
datatools::logger::priority get_logging_priority () const
 Get logging priority. More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Static Public Member Functions

static void init_histo_1d (histogram_1d &h1_, const datatools::properties &h1_setups_, const histogram_pool *histo_pool_=0)
 Static method to initialize 1D histogram. More...
 
static void init_histo_2d (histogram_2d &h2_, const datatools::properties &h2_setups_, const histogram_pool *histo_pool_=0)
 Static method to initialize 2D histogram. More...
 
- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 

Detailed Description

A pool of histograms.

Member Typedef Documentation

◆ dict_type

Alias to histogram dictionnary.

◆ hh1d_type

Typedef to handle of 1D histogram.

◆ hh2d_type

Typedef to handle of 2D histogram.

Member Enumeration Documentation

◆ histogram_dim_type

Histogram dimensionality.

Enumerator
HISTOGRAM_DIM_UNDEFINED 
HISTOGRAM_DIM_1D 
HISTOGRAM_DIM_2D 

Constructor & Destructor Documentation

◆ histogram_pool() [1/2]

mygsl::histogram_pool::histogram_pool ( )

Constructor.

◆ histogram_pool() [2/2]

mygsl::histogram_pool::histogram_pool ( const std::string &  desc_)

Constructor with description inside.

◆ ~histogram_pool()

virtual mygsl::histogram_pool::~histogram_pool ( )
virtual

Destructor.

Member Function Documentation

◆ add_1d()

histogram_1d& mygsl::histogram_pool::add_1d ( const std::string &  name_,
const std::string &  title_ = "",
const std::string &  group_ = "" 
)

Add 1D histogram.

◆ add_2d()

histogram_2d& mygsl::histogram_pool::add_2d ( const std::string &  name_,
const std::string &  title_ = "",
const std::string &  group_ = "" 
)

Add 2D histogram.

◆ clear_auxiliaries()

void mygsl::histogram_pool::clear_auxiliaries ( )

Clear auxiliairies.

◆ empty()

bool mygsl::histogram_pool::empty ( ) const

Check dictionnary emptiness.

◆ get_1d()

const histogram_1d& mygsl::histogram_pool::get_1d ( const std::string &  name_) const

Get a non-mutable reference to 1D histogram given its name.

◆ get_2d()

const histogram_2d& mygsl::histogram_pool::get_2d ( const std::string &  name_) const

Get a non-mutable reference to 2D histogram given its name.

◆ get_auxiliaries()

const datatools::properties& mygsl::histogram_pool::get_auxiliaries ( ) const

Get a non-mutable reference to auxiliaries.

◆ get_description()

const std::string& mygsl::histogram_pool::get_description ( ) const

Return histogram pool description.

◆ get_group()

const std::string& mygsl::histogram_pool::get_group ( const std::string &  name_) const

Get group of an histogram.

◆ get_logging_priority()

datatools::logger::priority mygsl::histogram_pool::get_logging_priority ( ) const

Get logging priority.

◆ get_title()

const std::string& mygsl::histogram_pool::get_title ( const std::string &  name_) const

Get histogram title.

◆ grab_1d()

histogram_1d& mygsl::histogram_pool::grab_1d ( const std::string &  name_)

Get a mutable reference to 1D histogram given its name.

◆ grab_2d()

histogram_2d& mygsl::histogram_pool::grab_2d ( const std::string &  name_)

Get a mutable reference to 2D histogram given its name.

◆ grab_auxiliaries()

datatools::properties& mygsl::histogram_pool::grab_auxiliaries ( )

Get a mutable reference to auxiliaries.

◆ has()

bool mygsl::histogram_pool::has ( const std::string &  name_,
int  dim_ = 0 
) const

Check histogram presence given an histogram name.

◆ has_1d()

bool mygsl::histogram_pool::has_1d ( const std::string &  name_) const

Check for 1D histogram given its name.

◆ has_2d()

bool mygsl::histogram_pool::has_2d ( const std::string &  name_) const

Check for 2D histogram given its name.

◆ init_histo_1d()

static void mygsl::histogram_pool::init_histo_1d ( histogram_1d h1_,
const datatools::properties h1_setups_,
const histogram_pool histo_pool_ = 0 
)
static

Static method to initialize 1D histogram.

◆ init_histo_2d()

static void mygsl::histogram_pool::init_histo_2d ( histogram_2d h2_,
const datatools::properties h2_setups_,
const histogram_pool histo_pool_ = 0 
)
static

Static method to initialize 2D histogram.

◆ initialize()

void mygsl::histogram_pool::initialize ( const datatools::properties setup_)

Initialization.

◆ is_initialized()

bool mygsl::histogram_pool::is_initialized ( ) const

Check histogram pool initialization.

◆ load() [1/2]

void mygsl::histogram_pool::load ( const std::string &  histo_setups_filename_)

Load histograms given a setup filename.

◆ load() [2/2]

void mygsl::histogram_pool::load ( const datatools::multi_properties histo_setups_)

Load histograms given properties.

◆ names()

void mygsl::histogram_pool::names ( std::vector< std::string > &  names_,
const std::string &  filter_ = "",
bool  reverse_ = false 
) const

Build an array containing the names of the histograms stored in the pool :

◆ remove()

void mygsl::histogram_pool::remove ( const std::string &  name_)

Remove an histogram given its name.

◆ remove_all()

void mygsl::histogram_pool::remove_all ( )

Clen histogram dictionnary.

◆ rename()

void mygsl::histogram_pool::rename ( const std::string &  name_,
const std::string &  new_name_ 
)

Rename an histogram.

◆ reset()

void mygsl::histogram_pool::reset ( )

Reset.

◆ set_description()

void mygsl::histogram_pool::set_description ( const std::string &  desc_)

Set histogram poool description.

◆ set_group()

void mygsl::histogram_pool::set_group ( const std::string &  name_,
const std::string &  group_ 
)

Assign a group to an histogram.

◆ set_logging_priority()

void mygsl::histogram_pool::set_logging_priority ( datatools::logger::priority  )

Set logging priority.

◆ set_title()

void mygsl::histogram_pool::set_title ( const std::string &  name_,
const std::string &  title_ 
)

Set histogram title.

◆ size()

size_t mygsl::histogram_pool::size ( ) const

Return the number of histrogrmas stored.

◆ tree_dump()

virtual void mygsl::histogram_pool::tree_dump ( std::ostream &  out = std::clog,
const std::string &  title = "",
const std::string &  indent = "",
bool  inherit = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.


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