#include <UniformBinning.h>
HyperPlot, Author: Sam Harnew, sam.h.nosp@m.arne.nosp@m.w@gma.nosp@m.il.c.nosp@m.om , Date: Dec 2015
Uniform binning
Definition at line 44 of file UniformBinning.h.
◆ UniformBinning() [1/2]
UniformBinning::UniformBinning |
( |
HyperCuboid |
limits, |
|
|
int |
nLocalBins |
|
) |
| |
The only constructor.
Definition at line 5 of file UniformBinning.cpp.
12 WELCOME_LOG <<
"Hello from the UniformBinning() Constructor";
virtual void setDimension(int dimension)
const int & getDimension() const
void setBinningType(TString binningType)
◆ UniformBinning() [2/2]
UniformBinning::UniformBinning |
( |
HyperCuboid |
limits, |
|
|
std::vector< int > |
nLocalBins |
|
) |
| |
Definition at line 16 of file UniformBinning.cpp.
23 WELCOME_LOG <<
"Hello from the UniformBinning() Constructor";
virtual void setDimension(int dimension)
const int & getDimension() const
void setBinningType(TString binningType)
◆ ~UniformBinning()
UniformBinning::~UniformBinning |
( |
| ) |
|
|
virtual |
◆ clone()
◆ getAverageBinWidth()
HyperPoint UniformBinning::getAverageBinWidth |
( |
| ) |
const |
|
virtual |
Implements BinningBase.
Definition at line 189 of file UniformBinning.cpp.
const HyperPoint & getHighCorner() const
const int & getDimension() const
const double & at(int i) const
const HyperPoint & getLowCorner() const
◆ getBinHyperVolume()
HyperVolume UniformBinning::getBinHyperVolume |
( |
int |
binNumber | ) |
const |
|
virtual |
◆ getBinNum()
int UniformBinning::getBinNum |
( |
const HyperPoint & |
coords | ) |
const |
|
virtual |
◆ getGlobalBinNumber()
int UniformBinning::getGlobalBinNumber |
( |
std::vector< int > |
localBinNumbers | ) |
const |
Definition at line 41 of file UniformBinning.cpp.
48 for (
int i = 0; i < dimension; i++){
49 binNumber += localBinNumbers.at(i)*multiplier;
const int & getDimension() const
◆ getHighBinEdgeLocal()
double UniformBinning::getHighBinEdgeLocal |
( |
int |
dim, |
|
|
int |
localBinNum |
|
) |
| const |
Definition at line 97 of file UniformBinning.cpp.
102 double width = (high - low)/nbins;
104 return low + width*(localBinNum + 1.0);
const HyperPoint & getHighCorner() const
const double & at(int i) const
const HyperPoint & getLowCorner() const
◆ getHighCorner()
HyperPoint UniformBinning::getHighCorner |
( |
int |
globalBinNum | ) |
const |
◆ getLimits()
◆ getLocalBinNumber()
int UniformBinning::getLocalBinNumber |
( |
int |
dim, |
|
|
double |
val |
|
) |
| const |
Definition at line 153 of file UniformBinning.cpp.
158 double width = (high - low)/nbins;
160 return floor( val - low )/width;
const HyperPoint & getHighCorner() const
const double & at(int i) const
const HyperPoint & getLowCorner() const
◆ getLocalBinNumbers() [1/2]
std::vector< int > UniformBinning::getLocalBinNumbers |
( |
int |
globalBinNumber | ) |
const |
Definition at line 57 of file UniformBinning.cpp.
61 if ( globalBinNumber >= nBins || globalBinNumber < 0 ){
62 ERROR_LOG <<
"UniformBinning::getLocalBinNumbers - The global bin number you have given is out of range = " << globalBinNumber << std::endl;
67 std::vector<int> localBinNums(dimension, -1.0);
69 int multiplier = nBins;
71 for (
int i = dimension - 1; i >= 0; i--){
75 int localBinNum = floor(
double(globalBinNumber)/
double(multiplier));
77 globalBinNumber -= multiplier*localBinNum;
79 localBinNums.at(i) = localBinNum;
const int & getDimension() const
◆ getLocalBinNumbers() [2/2]
std::vector< int > UniformBinning::getLocalBinNumbers |
( |
const HyperPoint & |
coords | ) |
const |
Definition at line 164 of file UniformBinning.cpp.
const int & getDimension() const
const double & at(int i) const
◆ getLowBinEdgeLocal()
double UniformBinning::getLowBinEdgeLocal |
( |
int |
dim, |
|
|
int |
localBinNum |
|
) |
| const |
Definition at line 86 of file UniformBinning.cpp.
91 double width = (high - low)/nbins;
93 return low + width*localBinNum;
const HyperPoint & getHighCorner() const
const double & at(int i) const
const HyperPoint & getLowCorner() const
◆ getLowCorner()
HyperPoint UniformBinning::getLowCorner |
( |
int |
globalBinNum | ) |
const |
◆ getNumBins()
int UniformBinning::getNumBins |
( |
| ) |
const |
|
virtual |
◆ getNumLocalBins()
int UniformBinning::getNumLocalBins |
( |
int |
dimension | ) |
const |
◆ load()
void UniformBinning::load |
( |
TString |
filename, |
|
|
TString |
option = "READ" |
|
) |
| |
|
virtual |
◆ mergeBinnings()
void UniformBinning::mergeBinnings |
( |
const BinningBase & |
other | ) |
|
|
virtual |
◆ save() [1/2]
void UniformBinning::save |
( |
TString |
filename | ) |
const |
|
virtual |
◆ save() [2/2]
void UniformBinning::save |
( |
| ) |
const |
|
virtual |
◆ _limits
◆ _nLocalBins
std::vector<int> UniformBinning::_nLocalBins |
|
private |
The documentation for this class was generated from the following files: