3 #ifndef MYGSL_HISTOGRAM_POOL_H 4 #define MYGSL_HISTOGRAM_POOL_H 1 64 virtual void tree_dump(std::ostream & out_ = std::clog,
65 const std::string & title_ =
"",
66 const std::string & indent_ =
"",
67 bool inherit_ =
false)
const;
74 typedef std::map<std::string, histogram_entry_type>
dict_type;
108 void load(
const std::string & histo_setups_filename_);
135 bool has(
const std::string & name_,
int dim_ = 0)
const;
138 bool has_1d(
const std::string & name_)
const ;
141 bool has_2d(
const std::string & name_)
const;
156 void remove(
const std::string & name_);
159 void rename(
const std::string & name_,
const std::string & new_name_);
162 void set_title(
const std::string & name_,
const std::string & title_);
165 const std::string &
get_title(
const std::string & name_)
const;
168 void set_group(
const std::string & name_,
const std::string & group_);
171 const std::string &
get_group(
const std::string & name_)
const;
174 void names(std::vector<std::string> &names_,
const std::string & filter_ =
"",
bool reverse_ =
false)
const;
178 const std::string & title_ =
"",
179 const std::string & group_ =
"");
183 const std::string & title_ =
"",
184 const std::string & group_ =
"");
187 virtual void tree_dump(std::ostream & out = std::clog,
188 const std::string & title =
"",
189 const std::string & indent =
"",
190 bool inherit =
false)
const;
200 static const std::string _INITIALIZED_FLAG_KEY_;
203 std::string _description_;
221 #endif // MYGSL_HISTOGRAM_POOL_H bool is_initialized() const
Check histogram pool initialization.
histogram_pool()
Constructor.
datatools::logger::priority get_logging_priority() const
Get logging priority.
virtual void tree_dump(std::ostream &out=std::clog, const std::string &title="", const std::string &indent="", bool inherit=false) const
Smart print.
void clear_auxiliaries()
Clear auxiliairies.
virtual ~histogram_entry_type()
Destructor.
void rename(const std::string &name_, const std::string &new_name_)
Rename an histogram.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Simple structure related to histogram attributes.
Definition: histogram_pool.h:49
histogram_entry_type()
Constructor.
histogram_2d & add_2d(const std::string &name_, const std::string &title_="", const std::string &group_="")
Add 2D histogram.
std::map< std::string, histogram_entry_type > dict_type
Alias to histogram dictionnary.
Definition: histogram_pool.h:74
const histogram_1d & get_1d(const std::string &name_) const
Get a non-mutable reference to 1D histogram given its name.
std::string name
Definition: histogram_pool.h:51
hh1d_type hh1d
Definition: histogram_pool.h:55
#define DATATOOLS_SERIALIZATION_DECLARATION()
Definition: i_serializable.h:266
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.
void remove_all()
Clen histogram dictionnary.
void set_group(const std::string &name_, const std::string &group_)
Assign a group to an histogram.
bool has(const std::string &name_, int dim_=0) const
Check histogram presence given an histogram name.
void remove(const std::string &name_)
Remove an histogram given its name.
const datatools::properties & get_auxiliaries() const
Get a non-mutable reference to auxiliaries.
const std::string & get_group(const std::string &name_) const
Get group of an histogram.
hh2d_type hh2d
Definition: histogram_pool.h:56
const histogram_2d & get_2d(const std::string &name_) const
Get a non-mutable reference to 2D histogram given its name.
histogram_2d & grab_2d(const std::string &name_)
Get a mutable reference to 2D histogram given its name.
bool has_1d(const std::string &name_) const
Check for 1D histogram given its name.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
void set_logging_priority(datatools::logger::priority)
Set logging priority.
A pool of histograms.
Definition: histogram_pool.h:28
void initialize(const datatools::properties &setup_)
Initialization.
int32_t dimension
Definition: histogram_pool.h:54
datatools::handle< histogram_2d > hh2d_type
Typedef to handle of 2D histogram.
Definition: histogram_pool.h:46
const std::string & get_title(const std::string &name_) const
Get histogram title.
bool has_2d(const std::string &name_) const
Check for 2D histogram given its name.
Definition: histogram_pool.h:37
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.
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 :
datatools::handle< histogram_1d > hh1d_type
Typedef to handle of 1D histogram.
Definition: histogram_pool.h:43
One dimensional histogram.
Definition: histogram.h:30
histogram_1d & grab_1d(const std::string &name_)
Get a mutable reference to 1D histogram given its name.
Definition: histogram_pool.h:38
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
Definition: histogram_pool.h:39
Utilities for logging information.
void set_description(const std::string &desc_)
Set histogram poool description.
void load(const std::string &histo_setups_filename_)
Load histograms given a setup filename.
histogram_dim_type
Histogram dimensionality.
Definition: histogram_pool.h:35
size_t size() const
Return the number of histrogrmas stored.
histogram_1d & add_1d(const std::string &name_, const std::string &title_="", const std::string &group_="")
Add 1D histogram.
virtual ~histogram_pool()
Destructor.
void set_title(const std::string &name_, const std::string &title_)
Set histogram title.
std::string title
Definition: histogram_pool.h:52
datatools::properties & grab_auxiliaries()
Get a mutable reference to auxiliaries.
bool empty() const
Check dictionnary emptiness.
const std::string & get_description() const
Return histogram pool description.
std::string group
Definition: histogram_pool.h:53
Two dimensional histogram.
Definition: histogram_2d.h:29