ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::Extent Class Reference

A class representing the geometric extent of an object in its possible dimensions, these can be all dimensions that are described as AxisDirections. More...

#include <Acts/Geometry/Extent.hpp>

Public Member Functions

 Extent (const ExtentEnvelope &envelope=ExtentEnvelope::Zero())
 Constructor with (optional).
void addConstrain (const Extent &rhs, const ExtentEnvelope &envelope=ExtentEnvelope::Zero())
 Constrain an extent by another one, this is.
bool constrains () const
 Check if this object constrains any direction.
bool constrains (AxisDirection aDir) const
 Check if this object constrains a given direction.
bool contains (const Extent &rhs, std::optional< AxisDirection > aDir=std::nullopt) const
 Contains check.
bool contains (const Vector3 &vtx) const
 Contains check for a single point.
ExtentEnvelopeenvelope ()
 Return the envelope - non-const access.
const ExtentEnvelopeenvelope () const
 Return the envelope - const access.
void extend (const Extent &rhs, const std::vector< AxisDirection > &aDirs=allAxisDirections(), bool applyEnv=true)
 Extend with another geometric extent, usually pushes the current range to the boundaries of the rhs extent, unless the current extent is already bigger.
void extend (const Vector3 &vtx, const std::vector< AxisDirection > &aDirs=allAxisDirections(), bool applyEnv=true, bool fillHistograms=false)
 Extend with a position vertex.
template<typename vector_iterator_t>
void extend (const vector_iterator_t &start, const vector_iterator_t &end, const std::vector< AxisDirection > &aDirs=allAxisDirections(), bool applyEnv=true, bool fillHistograms=false)
 Extend with a set of vectors by iterators.
bool intersects (const Extent &rhs, std::optional< AxisDirection > aDir=std::nullopt) const
 Intersection checks.
double interval (AxisDirection aDir) const
 Access the parameter interval (i.e.
double max (AxisDirection aDir) const
 Access the maximum parameter.
double medium (AxisDirection aDir) const
 Access the midpoint.
double min (AxisDirection aDir) const
 Access the minimum parameter.
bool operator== (const Extent &e) const
 Define a comparison operator.
const RangeXD< numAxisDirections(), double > & range () const
 Return the N-dimension range.
auto range (AxisDirection aDir)
 Return the individual 1-dimensional range.
Range1D< double > range (AxisDirection aDir) const
 Return the individual 1-dimensional range.
template<unsigned int kSUBDIM>
RangeXD< kSUBDIM, double > range (const std::array< AxisDirection, kSUBDIM > &axisDirections) const
 Return an D-dimensional sub range according to the the given binvalues.
void set (AxisDirection aDir, double min, double max)
 Set a range for a dedicated binning value.
void setEnvelope (const ExtentEnvelope &envelope=ExtentEnvelope::Zero())
 (re-)Set the envelope
void setMax (AxisDirection aDir, double max)
 Set a max value for a dedicated binning value.
void setMin (AxisDirection aDir, double min)
 Set a min value for a dedicated binning value.
std::string toString (const std::string &indent="") const
 Convert to output stream for screen output.
const std::array< std::vector< double >, numAxisDirections()> & valueHistograms () const
 Return the histogram store.

Detailed Description

A class representing the geometric extent of an object in its possible dimensions, these can be all dimensions that are described as AxisDirections.

The extent object can have an optional envelope in all of those values

Note
that the consistency of the different envelopes is not checked

Constructor & Destructor Documentation

◆ Extent()

Acts::Extent::Extent ( const ExtentEnvelope & envelope = ExtentEnvelope::Zero())
explicit

Constructor with (optional).

Parameters
envelope

Member Function Documentation

◆ addConstrain()

void Acts::Extent::addConstrain ( const Extent & rhs,
const ExtentEnvelope & envelope = ExtentEnvelope::Zero() )

Constrain an extent by another one, this is.

  • values that are already constrained are not touched
  • values not constrained by
    Parameters
    rhsare not touched
  • values that are constrained by the external one, but not by the current one, are touched
Parameters
envelopean envelope applied to the constrained value

◆ constrains() [1/2]

bool Acts::Extent::constrains ( ) const

Check if this object constrains any direction.

Returns
True if any axis direction is constrained, false otherwise

◆ constrains() [2/2]

bool Acts::Extent::constrains ( AxisDirection aDir) const

Check if this object constrains a given direction.

Parameters
aDiris the axis direction
Returns
True if the specified axis direction is constrained, false otherwise

◆ contains() [1/2]

bool Acts::Extent::contains ( const Extent & rhs,
std::optional< AxisDirection > aDir = std::nullopt ) const

Contains check.

Parameters
rhsthe extent that is check if it is contained
aDiris the axis direction, if set to nullopt the check on all is done
Returns
true if the rhs is contained

◆ contains() [2/2]

bool Acts::Extent::contains ( const Vector3 & vtx) const

Contains check for a single point.

Parameters
vtxthe point that is check if it is contained
Returns
true if the rhs is contained

◆ envelope() [1/2]

ExtentEnvelope & Acts::Extent::envelope ( )

Return the envelope - non-const access.

Returns
Reference to the envelope for modification

◆ envelope() [2/2]

const ExtentEnvelope & Acts::Extent::envelope ( ) const

Return the envelope - const access.

Returns
Const reference to the envelope

◆ extend() [1/3]

void Acts::Extent::extend ( const Extent & rhs,
const std::vector< AxisDirection > & aDirs = allAxisDirections(),
bool applyEnv = true )

Extend with another geometric extent, usually pushes the current range to the boundaries of the rhs extent, unless the current extent is already bigger.

Note
the extent can also simply set an envelope which then is applied to the current one
Parameters
rhsis the other source Extent
aDirsthe axis directions
applyEnvboolean to steer if envelope should be applied on the constraint values, if only an envelope is given but the value not constraint, then it is always applied
Note
that the histogram values can not be filled in this call

◆ extend() [2/3]

void Acts::Extent::extend ( const Vector3 & vtx,
const std::vector< AxisDirection > & aDirs = allAxisDirections(),
bool applyEnv = true,
bool fillHistograms = false )

Extend with a position vertex.

Parameters
vtxthe vertex to be used for extending
aDirsthe axis directions
applyEnvboolean to steer if envelope should be applied
fillHistogramsis a boolean flag to steer whether the values to fill this extent should be stored

◆ extend() [3/3]

template<typename vector_iterator_t>
void Acts::Extent::extend ( const vector_iterator_t & start,
const vector_iterator_t & end,
const std::vector< AxisDirection > & aDirs = allAxisDirections(),
bool applyEnv = true,
bool fillHistograms = false )

Extend with a set of vectors by iterators.

Parameters
startthe start iterator of the loop
endthe end iterator of the loop
aDirsthe axis directions
applyEnvboolean to steer if envelope should be applied
fillHistogramsis a boolean flag to steer whether the values to fill this extent should be stored

◆ intersects()

bool Acts::Extent::intersects ( const Extent & rhs,
std::optional< AxisDirection > aDir = std::nullopt ) const

Intersection checks.

Parameters
rhsthe extent that is check for intersection
aDiris the axis direction, if set to nulloptr the check on all is done
Returns
true if the rhs intersects

◆ interval()

double Acts::Extent::interval ( AxisDirection aDir) const

Access the parameter interval (i.e.

the range span)

Parameters
aDirthe axis direction
Returns
Interval size along the specified axis direction

◆ max()

double Acts::Extent::max ( AxisDirection aDir) const

Access the maximum parameter.

Parameters
aDirthe axis direction
Returns
Maximum value along the specified axis direction

◆ medium()

double Acts::Extent::medium ( AxisDirection aDir) const

Access the midpoint.

Parameters
aDirthe axis direction
Returns
Midpoint value along the specified axis direction

◆ min()

double Acts::Extent::min ( AxisDirection aDir) const

Access the minimum parameter.

Parameters
aDirthe axis direction
Returns
Minimum value along the specified axis direction

◆ operator==()

bool Acts::Extent::operator== ( const Extent & e) const

Define a comparison operator.

Parameters
eThe extent to compare with
Returns
True if the extents are equal, false otherwise

◆ range() [1/4]

const RangeXD< numAxisDirections(), double > & Acts::Extent::range ( ) const

Return the N-dimension range.

Returns
Reference to the complete multi-dimensional range

◆ range() [2/4]

auto Acts::Extent::range ( AxisDirection aDir)

Return the individual 1-dimensional range.

Parameters
aDiris the axis direction to be returned
Returns
a one dimensional arrange

◆ range() [3/4]

Range1D< double > Acts::Extent::range ( AxisDirection aDir) const

Return the individual 1-dimensional range.

Parameters
aDiris the axis direction to be returned
Returns
a one dimensional arrange

◆ range() [4/4]

template<unsigned int kSUBDIM>
RangeXD< kSUBDIM, double > Acts::Extent::range ( const std::array< AxisDirection, kSUBDIM > & axisDirections) const

Return an D-dimensional sub range according to the the given binvalues.

Template Parameters
kSUBDIMthe number of sub dimensions
Parameters
axisDirectionsthe axis directions
Returns
the sub range

◆ set()

void Acts::Extent::set ( AxisDirection aDir,
double min,
double max )

Set a range for a dedicated binning value.

Parameters
aDirthe axis direction
minthe minimum parameter
maxthe maximum parameter

◆ setEnvelope()

void Acts::Extent::setEnvelope ( const ExtentEnvelope & envelope = ExtentEnvelope::Zero())

(re-)Set the envelope

Parameters
envelopenew envelope to be set

◆ setMax()

void Acts::Extent::setMax ( AxisDirection aDir,
double max )

Set a max value for a dedicated binning value.

Parameters
aDirthe axis direction
maxthe maximum parameter

◆ setMin()

void Acts::Extent::setMin ( AxisDirection aDir,
double min )

Set a min value for a dedicated binning value.

Parameters
aDirthe axis direction
minthe minimum parameter

◆ toString()

std::string Acts::Extent::toString ( const std::string & indent = "") const

Convert to output stream for screen output.

Parameters
indentindentation for the screen display
Returns
String representation of the extent

◆ valueHistograms()

const std::array< std::vector< double >, numAxisDirections()> & Acts::Extent::valueHistograms ( ) const

Return the histogram store.

Return the value histograms.

The histogram store can be used for automated binning detection

Returns
Reference to the value histograms array