Class BinUtility

Class Documentation

class Acts::BinUtility

The BinUtility class that translated global and local position into a bins of a BinnedArray, most performant is equidistant binning without a transform, however, optionally a transform can be provided, e.g.

for binning on shifted object, the transform is usually shared with the geometric object the Array is defined on, for performance reasons, also the inverse transform is stored.

Public Functions

BinUtility()

Constructor for equidistant.

BinUtility(const Transform3 &tForm)

Constructor with only a Transform3.

Parameters
  • tForm: is the local to global transform

BinUtility(const BinningData &bData, const Transform3 &tForm = Transform3::Identity())

Constructor from BinningData directly.

Parameters
  • bData: is the provided binning data

  • tForm: is the (optional) transform

BinUtility(size_t bins, float min, float max, BinningOption opt = open, BinningValue value = binX, const Transform3 &tForm = Transform3::Identity())

Constructor for equidistant.

Parameters
  • bins: is the number of bins

  • min: in the minimal value

  • max: is the maximal value

  • opt: is the binning option : open, closed

  • value: is the binninb value : binX, binY, binZ, etc.

  • tForm: is the (optional) transform

BinUtility(std::vector<float> &bValues, BinningOption opt = open, BinningValue value = binPhi, const Transform3 &tForm = Transform3::Identity())

Constructor for arbitrary.

Parameters
  • bValues: is the boundary values of the binning

  • opt: is the binning option : open, closed

  • value: is the binninb value : binX, binY, binZ, etc.

  • tForm: is the (optional) transform

BinUtility(const BinUtility &sbu)

Copy constructor.

Parameters
  • sbu: is the source bin utility

~BinUtility() = default

Virtual Destructor.

size_t bin(const Vector3 &position, size_t ba = 0) const

Bin from a 3D vector (already in binning frame)

Return

is the bin value

Parameters
  • position: is the 3D position to be evaluated

  • ba: is the bin dimension

size_t bin(const Vector2 &lposition, size_t ba = 0) const

Bin from a 2D vector (following local parameters defintitions)

  • no optional transform applied

  • USE WITH CARE !!

You need to make sure that the local position is actually in the binning frame of the BinUtility

Return

bin calculated from local

Parameters
  • lposition: is the local position to be set

  • ba: is the bin dimension

const std::vector<BinningData> &binningData() const

Return the binning data vector.

BinningValue binningValue(size_t ba = 0) const

The type/value of the binning.

Return

the binning value of the accessor entry

Parameters
  • ba: is the binaccessor

size_t bins() const

Return the total number of bins.

size_t bins(size_t ba) const

Number of bins.

Return

size_t is the bins of the accessor entry

Parameters
  • ba: is the binaccessor

std::array<size_t, 3> binTriple(const Vector3 &position) const

Bin-triple fast access.

  • calculate the bin triple with one transform

Return

is the bin value in 3D

Parameters
  • position: is the 3D position to be evaluated

size_t dimensions() const

First bin maximal value.

Return

the dimenstion of the binning data

bool inside(const Vector3 &position) const

Check if bin is inside from Vector2 - optional transform applied.

Return

is a boolean check

Parameters
  • position: is the global position to be evaluated

bool inside(const Vector2 &lposition) const

Check if bin is inside from Vector2 - no optional transform applied.

Return

is a boolean check

Parameters
  • lposition: is the local position to be evaluated

size_t max(size_t ba = 0) const

First bin maximal value.

Return

size_t is the maximal bin of the accessor entry

Parameters
  • ba: is the binaccessor

int nextDirection(const Vector3 &position, const Vector3 &direction, size_t ba = 0) const

Return the oder direction for fast interlinking.

Parameters
  • position: is the global position for the next search

  • direction: is the global position for the next search

  • ba: is the bin accessor

Return

the next bin

BinUtility &operator+=(const BinUtility &gbu)

Operator++ to make multidimensional BinUtility.

Parameters
  • gbu: is the additional BinUtility to be chosen

BinUtility &operator=(const BinUtility &sbu)

Assignment operator.

Parameters
  • sbu: is the source bin utility

size_t serialize(const std::array<size_t, 3> &bin) const

Serialize the bin triple.

  • this creates a simple size_t from a triple object

Parameters
  • bin: is the bin to be serialized

std::ostream &toStream(std::ostream &sl) const

Output Method for std::ostream, to be overloaded by child classes.

Parameters
  • sl: is the ostream to be dumped into

const Transform3 &transform() const

Transform applied to global positions before lookup.

Return

Shared pointer to transform