MINT2
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
BinningBase Class Referenceabstract

#include <BinningBase.h>

Inheritance diagram for BinningBase:
HyperBinning UniformBinning HyperBinningDiskRes HyperBinningMemRes

Public Member Functions

 BinningBase ()
 
void setNames (HyperName names)
 
HyperName getNames () const
 
const int & getDimension () const
 
double getMin (int dimension) const
 
double getMax (int dimension) const
 
TString getBinningType () const
 
bool isSameBinningType (const BinningBase &other) const
 
virtual bool isDiskResident () const
 
virtual TString filename () const
 
virtual ~BinningBase ()
 
virtual void load (TString filename, TString option="READ")=0
 
virtual void save (TString filename) const =0
 
virtual void save () const =0
 
virtual BinningBaseclone () const =0
 
virtual int getNumBins () const =0
 
virtual int getBinNum (const HyperPoint &coords) const =0
 
virtual HyperVolume getBinHyperVolume (int binNumber) const =0
 
virtual void mergeBinnings (const BinningBase &other)=0
 
virtual HyperPoint getAverageBinWidth () const =0
 
virtual HyperCuboid getLimits () const =0
 
virtual void reserveCapacity (int nElements)
 
virtual std::vector< int > getBinNum (const HyperPointSet &coords) const
 

Protected Member Functions

virtual void setDimension (int dimension)
 
void setBinningType (TString binningType)
 

Private Attributes

int _dimension
 
HyperName _axisNames
 
TString _binningType
 

Detailed Description

HyperPlot, Author: Sam Harnew, sam.h.nosp@m.arne.nosp@m.w@gma.nosp@m.il.c.nosp@m.om , Date: Dec 2015

The base class for any Binning object

Definition at line 27 of file BinningBase.h.

Constructor & Destructor Documentation

◆ BinningBase()

BinningBase::BinningBase ( )

Definition at line 3 of file BinningBase.cpp.

3  :
4  _dimension (0 ),
5  _axisNames (0 ),
6  _binningType("")
7 {
8 
9 
10 }
int _dimension
Definition: BinningBase.h:31
TString _binningType
Definition: BinningBase.h:41
HyperName _axisNames
Definition: BinningBase.h:36

◆ ~BinningBase()

BinningBase::~BinningBase ( )
virtual

Definition at line 76 of file BinningBase.cpp.

76  {
77 
78 }

Member Function Documentation

◆ clone()

virtual BinningBase* BinningBase::clone ( ) const
pure virtual

◆ filename()

TString BinningBase::filename ( ) const
virtual

Reimplemented in HyperBinningDiskRes.

Definition at line 57 of file BinningBase.cpp.

57  {
58  return "";
59 }

◆ getAverageBinWidth()

virtual HyperPoint BinningBase::getAverageBinWidth ( ) const
pure virtual

Implemented in HyperBinning, and UniformBinning.

◆ getBinHyperVolume()

virtual HyperVolume BinningBase::getBinHyperVolume ( int  binNumber) const
pure virtual

Implemented in HyperBinning, and UniformBinning.

◆ getBinningType()

TString BinningBase::getBinningType ( ) const

Definition at line 50 of file BinningBase.cpp.

50  {
51  return _binningType;
52 }
TString _binningType
Definition: BinningBase.h:41

◆ getBinNum() [1/2]

virtual int BinningBase::getBinNum ( const HyperPoint coords) const
pure virtual

Implemented in HyperBinning, and UniformBinning.

◆ getBinNum() [2/2]

std::vector< int > BinningBase::getBinNum ( const HyperPointSet coords) const
virtual

Reimplemented in HyperBinning.

Definition at line 65 of file BinningBase.cpp.

65  {
66  std::vector<int> binNums;
67  binNums.reserve(coords.size());
68 
69  for (unsigned i = 0; i < coords.size(); i++){
70  binNums.push_back( getBinNum(coords.at(i)) );
71  }
72  return binNums;
73 }
const HyperPoint & at(int i) const
virtual int getBinNum(const HyperPoint &coords) const =0
unsigned int size() const

◆ getDimension()

const int & BinningBase::getDimension ( ) const

get the dimensionality of the binning

Definition at line 30 of file BinningBase.cpp.

30  {
31  return _dimension;
32 }
int _dimension
Definition: BinningBase.h:31

◆ getLimits()

virtual HyperCuboid BinningBase::getLimits ( ) const
pure virtual

Implemented in HyperBinning, and UniformBinning.

◆ getMax()

double BinningBase::getMax ( int  dimension) const

Definition at line 46 of file BinningBase.cpp.

46  {
47  return getLimits().getHighCorner().at(dimension);
48 }
const HyperPoint & getHighCorner() const
Definition: HyperCuboid.h:89
const double & at(int i) const
Definition: HyperPoint.cpp:433
virtual HyperCuboid getLimits() const =0

◆ getMin()

double BinningBase::getMin ( int  dimension) const

Definition at line 42 of file BinningBase.cpp.

42  {
43  return getLimits().getLowCorner().at(dimension);
44 }
const double & at(int i) const
Definition: HyperPoint.cpp:433
const HyperPoint & getLowCorner() const
Definition: HyperCuboid.h:87
virtual HyperCuboid getLimits() const =0

◆ getNames()

HyperName BinningBase::getNames ( ) const

get the a names for each dimension

Definition at line 25 of file BinningBase.cpp.

25  {
26  return _axisNames;
27 }
HyperName _axisNames
Definition: BinningBase.h:36

◆ getNumBins()

virtual int BinningBase::getNumBins ( ) const
pure virtual

Implemented in HyperBinning, and UniformBinning.

◆ isDiskResident()

bool BinningBase::isDiskResident ( ) const
virtual

Reimplemented in HyperBinningDiskRes.

Definition at line 54 of file BinningBase.cpp.

54  {
55  return false;
56 }

◆ isSameBinningType()

bool BinningBase::isSameBinningType ( const BinningBase other) const

Definition at line 12 of file BinningBase.cpp.

12  {
13  return (other._binningType == _binningType);
14 }
TString _binningType
Definition: BinningBase.h:41

◆ load()

virtual void BinningBase::load ( TString  filename,
TString  option = "READ" 
)
pure virtual

◆ mergeBinnings()

virtual void BinningBase::mergeBinnings ( const BinningBase other)
pure virtual

Implemented in HyperBinning, and UniformBinning.

◆ reserveCapacity()

void BinningBase::reserveCapacity ( int  nElements)
virtual

Reimplemented in HyperBinning, HyperBinningMemRes, and HyperBinningDiskRes.

Definition at line 61 of file BinningBase.cpp.

61  {
62  nElements++;
63 }

◆ save() [1/2]

virtual void BinningBase::save ( TString  filename) const
pure virtual

Implemented in HyperBinning, and UniformBinning.

◆ save() [2/2]

virtual void BinningBase::save ( ) const
pure virtual

Implemented in HyperBinning, and UniformBinning.

◆ setBinningType()

void BinningBase::setBinningType ( TString  binningType)
protected

Definition at line 16 of file BinningBase.cpp.

16  {
17  _binningType = binningType;
18 }
TString _binningType
Definition: BinningBase.h:41

◆ setDimension()

void BinningBase::setDimension ( int  dimension)
protectedvirtual

set the dimensionality of the binning

Reimplemented in HyperBinning, HyperBinningMemRes, and HyperBinningDiskRes.

Definition at line 34 of file BinningBase.cpp.

34  {
35  if (_dimension == 0){
36  _dimension = dimension;
37  _axisNames = HyperName (dimension);
38  }
39 }
int _dimension
Definition: BinningBase.h:31
HyperName _axisNames
Definition: BinningBase.h:36

◆ setNames()

void BinningBase::setNames ( HyperName  names)

set the a name for each dimension

Definition at line 21 of file BinningBase.cpp.

21  {
22  _axisNames = names;
23 }
HyperName _axisNames
Definition: BinningBase.h:36

Member Data Documentation

◆ _axisNames

HyperName BinningBase::_axisNames
private

Possible to assign names to each dimension, which will be used for plotting etc

Definition at line 36 of file BinningBase.h.

◆ _binningType

TString BinningBase::_binningType
private

Useful to know what kind of binning this actually is (will be set by derrived type)

Definition at line 41 of file BinningBase.h.

◆ _dimension

int BinningBase::_dimension
private

Dimensionality of the binning. Can only be set ONCE with setDimension();

Definition at line 31 of file BinningBase.h.


The documentation for this class was generated from the following files: