10 const set<double> &cut_vals):
21 double xmin,
double xmax,
24 const set<double> &cut_vals):
34 return bins_.size()-1;
54 if(
bins_.size() < 2)
return 0.;
67 vector<double> edges(nbins+1);
69 double delta = (xmax-xmin)/nbins;
70 for(
size_t i = 0; i < nbins+1; ++i){
71 edges.at(i) = i*delta + xmin;
83 auto p1 =
title_.rfind(
'[');
84 auto p2 =
title_.rfind(
']');
85 if(p1 >= p2 || p2 == string::npos)
return;
88 while(
title_.back() ==
' '){
Axis(const std::vector< double > &bins, const NamedFunc &var, const std::string &title="", const std::set< double > &cut_vals={})
std::string Title() const
std::string units_
Units of Axis::var_.
double AvgBinWidth() const
Combines a callable function taking a Baby and returning a scalar or vector with its string represent...
static std::vector< double > GetEdges(std::size_t nbins, double xmin, double xmax)
std::string title_
Axis title without units.
NamedFunc var_
Variable to be plotted.
std::size_t Nbins() const
std::vector< double > bins_
List of bin edges.
std::set< double > cut_vals_
Values of HistoDef::var_ for which to plot a line.
const std::vector< double > & Bins() const