File BinningData.hpp¶
-
namespace Acts
Note
This file is foreseen for the
Geometry
module to replaceExtent
-
class BinningData
- #include <Acts/Utilities/BinningData.hpp>
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
-
inline 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
-
inline 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
-
inline 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
-
inline BinningData(const BinningData &bdata)
Copy constructor.
- Parameters
bdata – is the source object
-
BinningData() = default
-
~BinningData() = default
-
inline size_t bins() const
Return the number of bins - including sub bins.
-
inline const std::vector<float> &boundaries() const
Return the boundaries - including sub boundaries.
- Returns
vector of floats indicating the boundary values
-
inline float center(size_t bin) const
Get the center value of a bin.
- Parameters
bin – is the bin for which the center value is requested
- Returns
float value according to the bin center
-
inline float centerValue(size_t bin) const
access to the center value this uses the bin boundary vector, it also works with sub structure
- Parameters
bin – is the bin for which the value is requested, if bin > nbins it is set to max
- Returns
the center value of the bin is given
-
inline bool inside(const Vector3 &position) const
Check if bin is inside from Vector3.
- Parameters
position – is the search position in global coordinated
- Returns
boolen if this is inside() method is true
-
inline bool inside(const Vector2 &lposition) const
Check if bin is inside from Vector2.
- Parameters
lposition – is the search position in global coordinated
- Returns
boolen if this is inside() method is true
-
inline 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
- Returns
integer that indicates which direction to move
-
inline BinningData &operator=(const BinningData &bdata)
Assignment operator.
- Parameters
bdata – is the source object
-
inline bool operator==(const BinningData &bData) const
Equality operator.
- Parameters
bData – is the binning data to be checked against
- Returns
a boolean indicating if they are the same
-
inline size_t search(float value) const
Generic search - forwards to correct function pointer.
- Parameters
value – is the searchvalue as float
- Returns
bin according tot this
-
inline size_t searchGlobal(const Vector3 &position) const
Generic search from a 3D position — corresponds to global coordinate schema.
- Parameters
position – is the search position in global coordinated
- Returns
bin according tot this
-
inline size_t searchLocal(const Vector2 &lposition) const
Generic search from a 2D position — corresponds to local coordinate schema.
- Parameters
lposition – is the search position in local coordinated
- Returns
bin according tot this
-
inline size_t searchWithSubStructure(float value) const
Generic search with sub structure.
forwards to correct function pointer
- Parameters
value – is the searchvalue as float
- Returns
bin according tot this
-
inline std::string toString(const std::string &indent) const
String screen output methd.
- Parameters
indent – the current indentation
- Returns
a string containing the screen information
-
inline float value(const Vector2 &lposition) const
Take the right float value.
- Parameters
lposition – assumes the correct local position expression
- Returns
float value according to the binning setup
-
inline float value(const Vector3 &position) const
Take the right float value.
- Parameters
position – is the global position
- Returns
float value according to the binning setup
-
inline float width(size_t bin) const
Get the width of a bin.
- Parameters
bin – is the bin for which the width is requested
- Returns
float value of width
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
Private Functions
-
inline void checkSubStructure()¶
function pointer
helper method to set the sub structure
Private Members
-
size_t m_bins = {}¶
number of bins
-
std::vector<float> m_boundaries¶
vector of holding the bin boundaries
-
size_t (*m_functionPtr)(float, const BinningData&)¶
-
size_t m_totalBins = {}¶
including potential substructure
-
std::vector<float> m_totalBoundaries¶
including potential substructure
Private Static Functions
-
static inline size_t searchEquidistantWithBoundary(float value, const BinningData &bData)¶
-
static inline size_t searchInVectorWithBoundary(float value, const BinningData &bData)¶
-
class BinningData