2#ifndef RIVET_BINNEDHISTOGRAM_HH
3#define RIVET_BINNEDHISTOGRAM_HH
9#include "Rivet/Config/RivetCommon.hh"
10#include "Rivet/Tools/RivetYODA.hh"
31 assert(edges.size() ==
histos.size()+1);
32 for (
size_t i = 0; i <
histos.size(); ++i)
44 void fill(
double binval,
double val,
double weight = 1.0);
49 const Histo1DPtr
histo(
double binval)
const;
52 Histo1DPtr
histo(
double binval);
55 const vector<Histo1DPtr>&
histos()
const {
return _histos; }
57 vector<Histo1DPtr>&
histos() {
return _histos; }
68 map<double, Histo1DPtr> _histosByUpperBound, _histosByLowerBound;
69 vector<Histo1DPtr> _histos;
70 map<Histo1DPtr, double> _binWidths;
This is the base class of all analysis classes in Rivet.
Definition Analysis.hh:65
A set of booked Histo1DPtr, each in a bin of a second variable.
Definition BinnedHistogram.hh:23
vector< Histo1DPtr > & histos()
Get the contained histograms.
Definition BinnedHistogram.hh:57
const BinnedHistogram & add(double binMin, double binMax, Histo1DPtr histo)
Add a histogram in the T bin between binMin and binMax.
BinnedHistogram()=default
Create a new empty BinnedHistogram.
BinnedHistogram(const vector< double > &edges, const vector< Histo1DPtr > &histos)
Create a new BinnedHistogram with the given bin edges and contents.
Definition BinnedHistogram.hh:30
const Histo1DPtr histo(double binval) const
Get the histogram in the same bin as binval (const)
const vector< Histo1DPtr > & histos() const
Get the contained histograms (const)
Definition BinnedHistogram.hh:55
void scale(double scale, Analysis *ana)
Histo1DPtr histo(double binval)
Get the histogram in the same bin as binval.
void fill(double binval, double val, double weight=1.0)
Fill the histogram in the same bin as binval with value val and weight weight.
Definition MC_Cent_pPb.hh:10