9#include <analysis/dbobjects/ParticleWeightingAxis.h>
10#include <framework/logging/Logger.h>
22 if ((bin->
first() >= i_bin.second->first()) and (bin->
first() < i_bin.second->second())) {
30 if ((bin->
second() > i_bin.second->first()) and (bin->
second() <= i_bin.second->second())) {
38 if ((bin->
first() < i_bin.second->first()) and (bin->
second() > i_bin.second->second())) {
48 int existing_id = this->
findBin(bin);
53 B2FATAL(
"Attempting to add overlapping or existing bin");
65 if ((bin->
first() == i_bin.second->first()) and (bin->
second() == i_bin.second->second())) {
76 if ((value >= i_bin.second->first()) and (value < i_bin.second->second())) {
87 std::string id_cells =
"";
88 std::string bin_cells =
"";
90 std::string i_id = std::to_string(i_entry.first);
91 int i_id_len = i_id.size();
92 std::string i_ll = std::to_string(i_entry.second->first());
93 int i_ll_len = i_ll.size();
94 std::string i_ul = std::to_string(i_entry.second->second());
95 int i_ul_len = i_ul.size();
96 id_cells +=
"|" + std::string(len,
' ') + i_id + std::string(std::max(1, len - i_id_len + 1),
' ') +
"|";
97 bin_cells +=
"|" + i_ll + std::string(std::max(1, len - i_ll_len),
' ') +
"|" + i_ul + std::string(std::max(1, len - i_ul_len),
void printAxis() const
Prints axis information to the B2INFO stream.
std::string m_axisName
Axis name.
int findBin(ParticleWeightingBinLimits *bin) const
Returns id of bin with given bin limits Returns out-of-range binID if can't find.
BinMap m_unnamedAxis
Named axis with bins.
const int m_outOfRangeBinID
ID of out-of-range bin.
bool isOverlappingBin(ParticleWeightingBinLimits *bin)
Return TRUE if bin exists or overlaps with existing.
int addBin(ParticleWeightingBinLimits *bin)
Check if bin exists and creates it if not.
Just pair of numbers - min and max values of bin border.
double second() const
Highest bin border.
double first() const
Lowest bin border.
Abstract base class for different kinds of events.