Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::BinningData Class Reference

#include <acts/blob/sPHENIX/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 >())
 
 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
 
 ~BinningData ()=default
 
bool operator== (const BinningData &bData) const
 
size_t bins () const
 Return the number of bins - including sub bins.
 
const std::vector< float > & boundaries () const
 
float value (const Vector2 &lposition) const
 
float value (const Vector3 &position) const
 
float center (size_t bin) const
 
float width (size_t bin) const
 
bool inside (const Vector3 &position) const
 
bool inside (const Vector2 &lposition) const
 
size_t searchLocal (const Vector2 &lposition) const
 
size_t searchGlobal (const Vector3 &position) const
 
size_t search (float value) const
 
size_t searchWithSubStructure (float value) const
 
int nextDirection (const Vector3 &position, const Vector3 &dir) const
 
float centerValue (size_t bin) const
 
std::string toString (const std::string &indent) 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)
 

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 41 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 41 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 minimum value
bMaxis the maximum value

Definition at line 61 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 61 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 non-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 121 of file BinningData.hpp.

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

References checkSubStructure(), 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 147 of file BinningData.hpp.

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

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

+ Here is the call graph for this function:

Acts::BinningData::BinningData ( )
default
Acts::BinningData::~BinningData ( )
default

Member Function Documentation

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

Return the number of bins - including sub bins.

Definition at line 225 of file BinningData.hpp.

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

References m_totalBins.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::to_json(), and toString().

+ 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 229 of file BinningData.hpp.

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

References m_boundaries, m_totalBoundaries, and subBinningData.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), center(), Acts::isEqual(), ActsExamples::Digitization::Uniform::operator()(), ActsExamples::Digitization::Digital::operator()(), Acts::to_json(), toString(), and width().

+ 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 284 of file BinningData.hpp.

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

References 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 421 of file BinningData.hpp.

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

References m_boundaries, max, min, and zdim.

void Acts::BinningData::checkSubStructure ( )
inlineprivate

function pointer

helper method to set the sub structure

Definition at line 439 of file BinningData.hpp.

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

References Acts::UnitConstants::e, add_histos_bX::ib, m_bins, m_boundaries, m_totalBins, m_totalBoundaries, min, offset, Acts::Experimental::detail::BlueprintHelper::sort(), step, subBinningAdditive, and subBinningData.

Referenced by BinningData(), and m_totalBoundaries().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Check if bin is inside from Vector3

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

Definition at line 309 of file BinningData.hpp.

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

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

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::BinUtility::inside().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Check if bin is inside from Vector2

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

Definition at line 325 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 325 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 >  ())
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 >  ())
inline

Definition at line 103 of file BinningData.hpp.

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

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

+ Here is the call graph for this function:

m_functionPtr Acts::BinningData::max ( bMax  )
m_functionPtr Acts::BinningData::min ( bMin  )
int Acts::BinningData::nextDirection ( const Vector3 position,
const Vector3 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 404 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 404 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 178 of file BinningData.hpp.

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

References 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:

bool Acts::BinningData::operator== ( const BinningData bData) const
inline

Equality operator

Parameters
bDatais the binning data to be checked against
Returns
a boolean indicating if they are the same

Definition at line 214 of file BinningData.hpp.

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

References binvalue, max, min, option, step, subBinningAdditive, subBinningData, type, and zdim.

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 365 of file BinningData.hpp.

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

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

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), ActsExamples::Digitization::Uniform::operator()(), ActsExamples::Digitization::Digital::operator()(), 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 490 of file BinningData.hpp.

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

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

size_t Acts::BinningData::searchGlobal ( const Vector3 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 353 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 353 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 512 of file BinningData.hpp.

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

References Acts::closed, distance(), 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 Vector2 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 341 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 341 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 380 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 380 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)
std::string Acts::BinningData::toString ( const std::string &  indent) const
inline

String screen output method

Parameters
indentthe current indentation
Returns
a string containing the screen information

Definition at line 533 of file BinningData.hpp.

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

References KFPMath::b, bins(), binvalue, boundaries(), Acts::equidistant, max, min, option, step, and type.

+ Here is the call graph for this function:

float Acts::BinningData::value ( const Vector2 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 241 of file BinningData.hpp.

View newest version in sPHENIX GitHub at line 241 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(), searchWithSubStructure(), and width().

+ Here is the caller graph for this function:

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

Take the right float value

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

Definition at line 258 of file BinningData.hpp.

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

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

+ Here is the call graph for this function:

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

Get the width of a bin

Parameters
binis the bin for which the width is requested
Returns
float value of width

Definition at line 297 of file BinningData.hpp.

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

References boundaries(), and value().

+ 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 45 of file BinningData.hpp.

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

Referenced by Acts::isEqual(), operator=(), operator==(), Acts::to_json(), toString(), and value().

size_t Acts::BinningData::m_bins {}
private

number of bins

Definition at line 431 of file BinningData.hpp.

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

Referenced by checkSubStructure(), m_totalBoundaries(), operator=(), searchEquidistantWithBoundary(), and searchInVectorWithBoundary().

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

vector of holding the bin boundaries

Definition at line 432 of file BinningData.hpp.

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

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

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

Definition at line 436 of file BinningData.hpp.

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

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

size_t Acts::BinningData::m_totalBins {}
private

including potential substructure

Definition at line 433 of file BinningData.hpp.

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

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

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

including potential substructure

Definition at line 434 of file BinningData.hpp.

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

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

BinningOption Acts::BinningData::option {}

binning option: open, closed

Definition at line 44 of file BinningData.hpp.

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

Referenced by inside(), Acts::isEqual(), operator=(), operator==(), searchEquidistantWithBoundary(), searchInVectorWithBoundary(), Acts::to_json(), and toString().

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_totalBoundaries(), and operator=().

float Acts::BinningData::step {}

binning step

Definition at line 48 of file BinningData.hpp.

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

Referenced by checkSubStructure(), Acts::isEqual(), m_totalBoundaries(), operator=(), operator==(), searchEquidistantWithBoundary(), and toString().

bool Acts::BinningData::subBinningAdditive {}

sub structure: additive or multipicative

Definition at line 54 of file BinningData.hpp.

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

Referenced by checkSubStructure(), Acts::isEqual(), operator=(), operator==(), searchWithSubStructure(), and Acts::to_json().

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

sub structure: describe some sub binning

Definition at line 52 of file BinningData.hpp.

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

Referenced by BinningData(), boundaries(), checkSubStructure(), Acts::isEqual(), operator=(), operator==(), search(), searchWithSubStructure(), and Acts::to_json().

BinningType Acts::BinningData::type {}

binning type: equidistant, arbitrary

Definition at line 43 of file BinningData.hpp.

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

Referenced by cpp.ast.Parameter::__str__(), BinningData(), Acts::isEqual(), operator=(), operator==(), Acts::to_json(), cpp.ast.VariableDeclaration::ToString(), and toString().

bool Acts::BinningData::zdim {}

zero dimensional binning : direct access

Definition at line 49 of file BinningData.hpp.

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

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


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