34 printf(
"TCustomBinning - Maximum already defined\n");
37 fSteps.insert(std::pair<double, double>(maximum, binwidth));
46 std::vector<double> keys;
47 for(
auto it :
fSteps) keys.push_back(it.first);
48 std::sort(keys.begin(), keys.end(), std::less<double>());
49 std::map<double, double> sortedsteps;
51 sortedsteps.insert(std::pair<double, double>(it, fSteps.find(it)->second));
54 std::vector<double> tmpedges;
56 tmpedges.push_back(currentmin);
57 for(
auto range : sortedsteps){
58 while((currentmin < range.first) && (TMath::Abs(currentmin - range.first) > DBL_EPSILON)){
59 currentmin += range.second;
60 tmpedges.push_back(currentmin);
64 binedges.Set(tmpedges.size());
66 for(
auto binedge : tmpedges) binedges[bincounter++] = binedge;
void AddStep(Double_t max, Double_t binwidth)
Interface for binnings used by the histogram handler.
std::map< double, double > fSteps
List of ranges with common bin width.
Double_t fMinimum
Minimum of the binning.
virtual void CreateBinEdges(TArrayD &edges) const
Exception thrown in case the minimum is not set.
Bool_t fMinimumSet
Define whether minimum is set. Attention: Bin edges will not be created without minimum.