Class BinningData

Class Documentation

class Acts::BinningData

This class holds all the data necessary for the bin calculation.

phi has a very particular behaviour:

  • there’s the change around +/- PI

  • it can be multiplicative or additive multiplicative : each major bin has the same sub structure i.e. first binnning

structure is equidistant additive : sub structure replaces one bin (and one bin only)

Public Functions

BinningData(BinningValue bValue, float bMin, float bMax)

Constructor for 0D binning.

Parameters
  • bValue: is the binning value: binX, binY, etc.

  • bMin: is the minum value

  • bMax: is the maxmimum value

BinningData(BinningOption bOption, BinningValue bValue, size_t bBins, float bMin, float bMax, std::unique_ptr<const BinningData> sBinData = nullptr, bool sBinAdditive = false)

Constructor for equidistant binning and optional sub structure can be mulitplicative or additive.

Parameters
  • bOption: is the binning option : open, closed

  • bValue: is the binning value: binX, binY, etc.

  • bBins: is number of equidistant bins

  • bMin: is the minum value

  • bMax: is the maxmimum value

  • sBinData: is (optional) sub structure

  • sBinAdditive: is the prescription for the sub structure

BinningData(BinningOption bOption, BinningValue bValue, const std::vector<float> &bBoundaries, std::unique_ptr<const BinningData> sBinData = nullptr)

Constructor for non-equidistant binning.

Parameters
  • bOption: is the binning option : open / closed

  • bValue: is the binning value : binX, binY, etc.

  • bBoundaries: are the bin boundaries

  • sBinData: is (optional) sub structure

BinningData(const BinningData &bdata)

Copy constructor.

Parameters
  • bdata: is the source object

BinningData() = default
~BinningData() = default
size_t bins() const

Return the number of bins - including sub bins.

const std::vector<float> &boundaries() const

Return the boundaries - including sub boundaries.

Return

vector of floats indicating the boundary values

float center(size_t bin) const

Get the center value of a bin.

Return

float value according to the bin center

Parameters
  • bin: is the bin for which the center value is requested

float centerValue(size_t bin) const

access to the center value this uses the bin boundary vector, it also works with sub structure

Return

the center value of the bin is given

Parameters
  • bin: is the bin for which the value is requested, if bin > nbins it is set to max

bool inside(const Vector3 &position) const

Check if bin is inside from Vector3.

Return

boolen if this is inside() method is true

Parameters
  • position: is the search position in global coordinated

bool inside(const Vector2 &lposition) const

Check if bin is inside from Vector2.

Return

boolen if this is inside() method is true

Parameters
  • lposition: is the search position in global coordinated

int nextDirection(const Vector3 &position, const Vector3 &dir) const

Layer next direction is needed.

Parameters
  • position: is the start search position

  • dir: is the direction

Return

integer that indicates which direction to move

BinningData &operator=(const BinningData &bdata)

Assignment operator.

Parameters
  • bdata: is the source object

size_t search(float value) const

Generic search - forwards to correct function pointer.

Return

bin according tot this

Parameters
  • value: is the searchvalue as float

size_t searchGlobal(const Vector3 &position) const

Generic search from a 3D position corresponds to global coordinate schema.

Return

bin according tot this

Parameters
  • position: is the search position in global coordinated

size_t searchLocal(const Vector2 &lposition) const

Generic search from a 2D position corresponds to local coordinate schema.

Return

bin according tot this

Parameters
  • lposition: is the search position in local coordinated

size_t searchWithSubStructure(float value) const

Generic search with sub structure.

  • forwards to correct function pointer

Return

bin according tot this

Parameters
  • value: is the searchvalue as float

float value(const Vector2 &lposition) const

Take the right float value.

Return

float value according to the binning setup

Parameters
  • lposition: assumes the correct local position expression

float value(const Vector3 &position) const

Take the right float value.

Return

float value according to the binning setup

Parameters
  • position: is the global position

float width(size_t bin) const

Get the width of a bin.

Return

float value of width

Parameters
  • bin: is the bin for which the width is requested

Public Members

BinningValue binvalue

binning value: binX, binY, binZ, binR …

float max

maximum value

float min

minimum value

BinningOption option

binning option: open, closed

float step

binning step

bool subBinningAdditive

sub structure: additive or multipicative

std::unique_ptr<const BinningData> subBinningData

sub structure: describe some sub binning

BinningType type

binning type: equidistant, arbitrary

bool zdim

zero dimensional binning : direct access