ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::BinningData Class Reference

#include <acts/blob/master/Core/include/Acts/Utilities/BinningData.hpp>

+ Collaboration diagram for Acts::BinningData:

Public Member Functions

 BinningData (BinningValue bValue, float bMin, float bMax)
 
 m_totalBins (1)
 
 m_totalBoundaries (std::vector< float >())
 
m_functionPtr option (bOption)
 
m_functionPtr binvalue (bValue)
 
m_functionPtr min (bMin)
 
m_functionPtr max (bMax)
 
m_functionPtr step ((bMax-bMin)/bBins)
 
m_functionPtr zdim (bBins==1?true:false)
 
m_functionPtr subBinningData (std::move(sBinData))
 
m_functionPtr subBinningAdditive (sBinAdditive)
 
m_functionPtr m_bins (bBins)
 
m_functionPtr m_boundaries (std::vector< float >())
 
m_functionPtr m_totalBins (bBins)
 
m_functionPtr m_totalBoundaries (std::vector< float >())
 
m_functionPtr m_functionPtr (nullptr)
 
 BinningData (BinningOption bOption, BinningValue bValue, const std::vector< float > &bBoundaries, std::unique_ptr< const BinningData > sBinData=nullptr)
 
 BinningData (const BinningData &bdata)
 
BinningDataoperator= (const BinningData &bdata)
 
 ~BinningData ()=default
 Destructor.
 
size_t bins () const
 Return the number of bins - including sub bins.
 
bool decrement (size_t &bin) const
 
bool increment (size_t &bin) const
 
const std::vector< float > & boundaries () const
 
float value (const Vector2D &lposition) const
 
float value (const Vector3D &position) const
 
float center (size_t bin) const
 
bool inside (const Vector3D &position) const
 
bool inside (const Vector2D &lposition) const
 
size_t searchLocal (const Vector2D &lposition) const
 
size_t searchGlobal (const Vector3D &position) const
 
size_t search (float value) const
 
size_t searchWithSubStructure (float value) const
 
int nextDirection (const Vector3D &position, const Vector3D &dir) const
 
float centerValue (size_t bin) const
 
std::vector< size_t > neighbourRange (size_t bin) const
 

Public Attributes

BinningType type
 binning type: equidistant, arbitrary
 
BinningOption option
 binning option: open, closed
 
BinningValue binvalue
 binning value: binX, binY, binZ, binR ...
 
float min
 minimum value
 
float max
 maximum value
 
float step
 binning step
 
bool zdim
 zero dimensional binning : direct access
 
std::unique_ptr< const
BinningData
subBinningData
 sub structure: describe some sub binning
 
bool subBinningAdditive
 sub structure: additive or multipicative
 
m_functionPtr searchEquidistantWithBoundary
 

Private Member Functions

void checkSubStructure ()
 function pointer
 

Static Private Member Functions

static size_t searchEquidistantWithBoundary (float value, const BinningData &bData)
 
static size_t searchInVectorWithBoundary (float value, const BinningData &bData)
 
static size_t binarySearchWithBoundary (float value, const BinningData &bData)
 

Private Attributes

size_t m_bins
 number of bins
 
std::vector< float > m_boundaries
 vector of holding the bin boundaries
 
size_t m_totalBins
 including potential substructure
 
std::vector< float > m_totalBoundaries
 including potential substructure
 
size_t(* m_functionPtr )(float, const BinningData &)
 

Detailed Description

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)

Definition at line 40 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 40 of file BinningData.hpp

Constructor & Destructor Documentation

Acts::BinningData::BinningData ( BinningValue  bValue,
float  bMin,
float  bMax 
)
inline

Constructor for 0D binning

Parameters
bValueis the binning value: binX, binY, etc.
bMinis the minum value
bMaxis the maxmimum value

Definition at line 60 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 60 of file BinningData.hpp

References max, and min.

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

Constructor for equidistant binning

Parameters
bOptionis the binning option : open / closed
bValueis the binning value : binX, binY, etc.
bBoundariesare the bin boundaries
sBinDatais (optional) sub structure

Definition at line 122 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 122 of file BinningData.hpp

References binarySearchWithBoundary(), checkSubStructure(), m_bins, m_boundaries, m_functionPtr, max, min, searchInVectorWithBoundary(), and throw_assert.

+ Here is the call graph for this function:

Acts::BinningData::BinningData ( const BinningData bdata)
inline

Copy constructor

Parameters
bdatais the source object

Definition at line 153 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 153 of file BinningData.hpp

References binarySearchWithBoundary(), Acts::equidistant, m_bins, m_functionPtr, searchEquidistantWithBoundary, searchInVectorWithBoundary(), subBinningData, and type.

+ Here is the call graph for this function:

Acts::BinningData::~BinningData ( )
default

Destructor.

Member Function Documentation

static size_t Acts::BinningData::binarySearchWithBoundary ( float  value,
const BinningData bData 
)
inlinestaticprivate

Definition at line 560 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 560 of file BinningData.hpp

References Acts::closed, m_bins, m_boundaries, max, and option.

Referenced by BinningData(), and operator=().

+ Here is the caller graph for this function:

size_t Acts::BinningData::bins ( ) const
inline

Return the number of bins - including sub bins.

Definition at line 219 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 219 of file BinningData.hpp

References m_totalBins.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

m_functionPtr Acts::BinningData::binvalue ( bValue  )
const std::vector<float>& Acts::BinningData::boundaries ( ) const
inline

Return the boundaries - including sub boundaries

Returns
vector of floats indicating the boundary values

Definition at line 243 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 243 of file BinningData.hpp

References m_boundaries, m_totalBoundaries, and subBinningData.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and center().

+ Here is the caller graph for this function:

float Acts::BinningData::center ( size_t  bin) const
inline

Get the center value of a bin

Parameters
binis the bin for which the center value is requested
Returns
float value according to the bin center

Definition at line 298 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 298 of file BinningData.hpp

References bin, boundaries(), and value().

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float Acts::BinningData::centerValue ( size_t  bin) const
inline

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

Parameters
binis 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

Definition at line 422 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 422 of file BinningData.hpp

References bin, m_boundaries, max, min, and zdim.

void Acts::BinningData::checkSubStructure ( )
inlineprivate

function pointer

helper method to set the sub structure

Definition at line 463 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 463 of file BinningData.hpp

References kdfinder::abs(), e, m_bins, m_boundaries, m_totalBins, m_totalBoundaries, min, offset, step, subBinningAdditive, and subBinningData.

Referenced by BinningData(), and m_functionPtr().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Acts::BinningData::decrement ( size_t &  bin) const
inline

Decrement the bin

  • boolean indicates if decrement actually worked
Parameters
binis the bin to be decremented

Definition at line 225 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 225 of file BinningData.hpp

References bin, m_bins, Acts::open, and option.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and neighbourRange().

+ Here is the caller graph for this function:

bool Acts::BinningData::increment ( size_t &  bin) const
inline

Increment the bin

  • boolean indicates if decrement actually worked
Parameters
binthe bin to be incremented

Definition at line 235 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 235 of file BinningData.hpp

References bin, m_bins, Acts::open, and option.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and neighbourRange().

+ Here is the caller graph for this function:

bool Acts::BinningData::inside ( const Vector3D position) const
inline

Check if bin is inside from Vector3D

Parameters
positionis the search position in global coordinated
Returns
boolen if this is inside() method is true

Definition at line 310 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 310 of file BinningData.hpp

References Acts::closed, max, min, option, and value().

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Acts::BinningData::inside ( const Vector2D lposition) const
inline

Check if bin is inside from Vector2D

Parameters
lpositionis the search position in global coordinated
Returns
boolen if this is inside() method is true

Definition at line 326 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 326 of file BinningData.hpp

References Acts::closed, max, min, option, and value().

+ Here is the call graph for this function:

m_functionPtr Acts::BinningData::m_bins ( bBins  )
m_functionPtr Acts::BinningData::m_boundaries ( std::vector< float >  ())
m_functionPtr Acts::BinningData::m_functionPtr ( nullptr  )
inline

Definition at line 104 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 104 of file BinningData.hpp

References checkSubStructure(), m_bins, m_boundaries, m_functionPtr, min, searchEquidistantWithBoundary, and step.

+ Here is the call graph for this function:

Acts::BinningData::m_totalBins ( )
m_functionPtr Acts::BinningData::m_totalBins ( bBins  )
Acts::BinningData::m_totalBoundaries ( std::vector< float >  ())
m_functionPtr Acts::BinningData::m_totalBoundaries ( std::vector< float >  ())
m_functionPtr Acts::BinningData::max ( bMax  )
m_functionPtr Acts::BinningData::min ( bMin  )
std::vector<size_t> Acts::BinningData::neighbourRange ( size_t  bin) const
inline

access to lower/higher bins

takes a bin entry and returns the lower/higher bound respecting open/closed

Returns
low/high bounds

Definition at line 436 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 436 of file BinningData.hpp

References bin, decrement(), and increment().

+ Here is the call graph for this function:

int Acts::BinningData::nextDirection ( const Vector3D position,
const Vector3D dir 
) const
inline

Layer next direction is needed

Parameters
positionis the start search position
diris the direction
Returns
integer that indicates which direction to move

Definition at line 405 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 405 of file BinningData.hpp

References value(), and zdim.

+ Here is the call graph for this function:

BinningData& Acts::BinningData::operator= ( const BinningData bdata)
inline

Assignment operator

Parameters
bdatais the source object

Definition at line 186 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 186 of file BinningData.hpp

References binarySearchWithBoundary(), binvalue, Acts::equidistant, m_bins, m_boundaries, m_functionPtr, m_totalBins, m_totalBoundaries, max, min, option, searchEquidistantWithBoundary, searchInVectorWithBoundary(), step, subBinningAdditive, subBinningData, type, and zdim.

+ Here is the call graph for this function:

m_functionPtr Acts::BinningData::option ( bOption  )
size_t Acts::BinningData::search ( float  value) const
inline

Generic search - forwards to correct function pointer

Parameters
valueis the searchvalue as float
Returns
bin according tot this

Definition at line 366 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 366 of file BinningData.hpp

References m_functionPtr, searchWithSubStructure(), subBinningData, value(), and zdim.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), searchGlobal(), and searchLocal().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static size_t Acts::BinningData::searchEquidistantWithBoundary ( float  value,
const BinningData bData 
)
inlinestaticprivate

Definition at line 514 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 514 of file BinningData.hpp

References bin, Acts::closed, m_bins, max, min, Acts::open, option, and step.

size_t Acts::BinningData::searchGlobal ( const Vector3D position) const
inline

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

Parameters
positionis the search position in global coordinated
Returns
bin according tot this

Definition at line 354 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 354 of file BinningData.hpp

References search(), value(), and zdim.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static size_t Acts::BinningData::searchInVectorWithBoundary ( float  value,
const BinningData bData 
)
inlinestaticprivate

Definition at line 537 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 537 of file BinningData.hpp

References bin, Acts::closed, m_bins, m_boundaries, max, option, and value().

Referenced by BinningData(), and operator=().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t Acts::BinningData::searchLocal ( const Vector2D lposition) const
inline

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

Parameters
lpositionis the search position in local coordinated
Returns
bin according tot this

Definition at line 342 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 342 of file BinningData.hpp

References search(), value(), and zdim.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t Acts::BinningData::searchWithSubStructure ( float  value) const
inline

Generic search with sub structure

  • forwards to correct function pointer
Parameters
valueis the searchvalue as float
Returns
bin according tot this

Definition at line 381 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 381 of file BinningData.hpp

References subBinningAdditive, subBinningData, and value().

Referenced by search().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

m_functionPtr Acts::BinningData::step ( (bMax-bMin)/  bBins)
m_functionPtr Acts::BinningData::subBinningAdditive ( sBinAdditive  )
m_functionPtr Acts::BinningData::subBinningData ( std::  movesBinData)
float Acts::BinningData::value ( const Vector2D lposition) const
inline

Take the right float value

Parameters
lpositionassumes the correct local position expression
Returns
float value according to the binning setup

Definition at line 255 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 255 of file BinningData.hpp

References Acts::binH, Acts::binPhi, Acts::binR, Acts::binRPhi, binvalue, and Acts::binX.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), center(), inside(), nextDirection(), search(), searchGlobal(), searchInVectorWithBoundary(), searchLocal(), and searchWithSubStructure().

+ Here is the caller graph for this function:

float Acts::BinningData::value ( const Vector3D position) const
inline

Take the right float value

Parameters
positionis the global position
Returns
float value according to the binning setup

Definition at line 272 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 272 of file BinningData.hpp

References Acts::binEta, Acts::binH, Acts::binR, Acts::binRPhi, binvalue, Acts::VectorHelpers::eta(), Acts::VectorHelpers::perp(), Acts::VectorHelpers::phi(), and phi.

+ Here is the call graph for this function:

m_functionPtr Acts::BinningData::zdim ( bBins  = = 1 ? true : false)

Member Data Documentation

BinningValue Acts::BinningData::binvalue

binning value: binX, binY, binZ, binR ...

Definition at line 44 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 44 of file BinningData.hpp

Referenced by operator=(), and value().

size_t Acts::BinningData::m_bins
private

number of bins

Definition at line 455 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 455 of file BinningData.hpp

Referenced by binarySearchWithBoundary(), BinningData(), checkSubStructure(), decrement(), increment(), m_functionPtr(), operator=(), searchEquidistantWithBoundary(), and searchInVectorWithBoundary().

std::vector<float> Acts::BinningData::m_boundaries
private

vector of holding the bin boundaries

Definition at line 456 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 456 of file BinningData.hpp

Referenced by binarySearchWithBoundary(), BinningData(), boundaries(), centerValue(), checkSubStructure(), m_functionPtr(), operator=(), and searchInVectorWithBoundary().

size_t(* Acts::BinningData::m_functionPtr)(float, const BinningData &)
private

Definition at line 460 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 460 of file BinningData.hpp

Referenced by BinningData(), m_functionPtr(), operator=(), and search().

size_t Acts::BinningData::m_totalBins
private

including potential substructure

Definition at line 457 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 457 of file BinningData.hpp

Referenced by bins(), checkSubStructure(), and operator=().

std::vector<float> Acts::BinningData::m_totalBoundaries
private

including potential substructure

Definition at line 458 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 458 of file BinningData.hpp

Referenced by boundaries(), checkSubStructure(), and operator=().

float Acts::BinningData::max

maximum value

Definition at line 46 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 46 of file BinningData.hpp

Referenced by binarySearchWithBoundary(), BinningData(), centerValue(), inside(), operator=(), searchEquidistantWithBoundary(), and searchInVectorWithBoundary().

float Acts::BinningData::min

minimum value

Definition at line 45 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 45 of file BinningData.hpp

Referenced by BinningData(), centerValue(), checkSubStructure(), inside(), m_functionPtr(), operator=(), and searchEquidistantWithBoundary().

BinningOption Acts::BinningData::option

binning option: open, closed

Definition at line 43 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 43 of file BinningData.hpp

Referenced by binarySearchWithBoundary(), decrement(), increment(), inside(), operator=(), searchEquidistantWithBoundary(), and searchInVectorWithBoundary().

m_functionPtr Acts::BinningData::searchEquidistantWithBoundary
Initial value:
{}
BinningData(BinningOption bOption, BinningValue bValue, size_t bBins,
float bMin, float bMax,
std::unique_ptr<const BinningData> sBinData = nullptr,
bool sBinAdditive = false)

Definition at line 74 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 74 of file BinningData.hpp

Referenced by BinningData(), m_functionPtr(), and operator=().

float Acts::BinningData::step

binning step

Definition at line 47 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 47 of file BinningData.hpp

Referenced by checkSubStructure(), m_functionPtr(), operator=(), and searchEquidistantWithBoundary().

bool Acts::BinningData::subBinningAdditive

sub structure: additive or multipicative

Definition at line 53 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 53 of file BinningData.hpp

Referenced by checkSubStructure(), operator=(), and searchWithSubStructure().

std::unique_ptr<const BinningData> Acts::BinningData::subBinningData

sub structure: describe some sub binning

Definition at line 51 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 51 of file BinningData.hpp

Referenced by BinningData(), boundaries(), checkSubStructure(), operator=(), search(), and searchWithSubStructure().

BinningType Acts::BinningData::type

binning type: equidistant, arbitrary

Definition at line 42 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 42 of file BinningData.hpp

Referenced by BinningData(), and operator=().

bool Acts::BinningData::zdim

zero dimensional binning : direct access

Definition at line 48 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 48 of file BinningData.hpp

Referenced by centerValue(), nextDirection(), operator=(), search(), searchGlobal(), and searchLocal().


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