5#ifndef VARIABLEBINWIDTHHISTOGRAMBIN_H
6#define VARIABLEBINWIDTHHISTOGRAMBIN_H
46 inline void Set(
double center,
double width,
unsigned int content) {
82 if (new_right < left) {
83 throw std::runtime_error(
84 Form(
"File: %s, Line: %d\nVariableBinwidthHistogramBin::MoveRight() - new right is too small!", __FILE__, __LINE__));
95 double right =
Right();
96 if (new_left > right) {
97 throw std::runtime_error(
98 Form(
"File: %s, Line: %d\nVariableBinwidthHistogramBin::MoveRight() - new left is too small!", __FILE__, __LINE__));
101 m_center = 0.5 * (new_left + right);
bool operator<(const VBHBinPtrSrt &other) const
Operator < for sorting bins by content.
bool operator>(const VBHBinPtrSrt &other) const
Operator > for sorting bins by content.
VBHBinPtrSrt(VariableBinwidthHistogramBin *bin)
initializing constructor
VBHBinPtrSrt()
default constructor
void Initialize(VariableBinwidthHistogramBin *bin)
initialize
VariableBinwidthHistogramBin & Bin()
Get reference to bin.
VariableBinwidthHistogramBin * m_bin
pointer to bin
A bin of a VariableBinwidthHistogram.
void MoveLeft(double new_left)
move left bin boarder
void SetContent(unsigned int n)
set content
double Center() const
Get bin center.
unsigned int Entries() const
Get number of entries in the bin.
VariableBinwidthHistogramBin(double center, double width, unsigned int content)
Initializing constructor.
double Left() const
Get left (lower) bin border.
double Width() const
Get width of the bin.
double Density() const
Get density=Entries()/Width()
VariableBinwidthHistogramBin operator+(unsigned int n)
add to bin content
VariableBinwidthHistogramBin operator+=(unsigned int n)
add to bin content
double Right() const
Get right (upper) bin border.
VariableBinwidthHistogramBin()
Default constructor.
void MoveRight(double new_right)
move right bin boarder
void Set(double center, double width, unsigned int content)
Set bin.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.