|
ACTS
Experiment-independent tracking
|
Variant-like spec of an axis that builds IAxis objects.
More...
#include <Acts/Utilities/AxisSpec.hpp>
Classes | |
| struct | DeferredVariableParams |
| Parameters for a variable axis whose bin edges are relative and scaled onto the range supplied by the consumer. More... | |
| struct | EquidistantParams |
| Parameters for an equidistant axis. More... | |
| struct | VariableParams |
| Parameters for a variable axis with absolute bin edges. More... | |
Public Types | |
| using | Options = AxisSpecOptions |
| Axis properties supplied by the consumer at build time. | |
Public Member Functions | |
| const DeferredVariableParams & | asDeferredVariable () const |
| Get the spec as deferred variable parameters. | |
| const EquidistantParams & | asEquidistant () const |
| Get the spec as equidistant parameters. | |
| const VariableParams & | asVariable () const |
| Get the spec as variable parameters. | |
| std::optional< AxisBoundaryType > | boundaryType () const |
| Get the boundary type of the axis. | |
| std::unique_ptr< IAxis > | buildAxis (const Options &options={}) const |
| Build the axis, filling in the properties the spec leaves open and validating the ones it fixes. | |
| std::optional< AxisDirection > | direction () const |
| Get the direction of the axis. | |
| bool | isDeferred () const |
Check if the spec needs Options to build, i.e. | |
| bool | isDeferredVariable () const |
| Check if the spec holds normalized instead of absolute bin edges. | |
| bool | isEquidistant () const |
| Check if the spec produces an equidistant axis. | |
| bool | isVariable () const |
| Check if the spec produces a variable axis. | |
| std::size_t | nBins () const |
| Get the number of bins. | |
| AxisSpec | toDeferred () const |
| Get the counterpart that leaves every property to the consumer: an equidistant spec keeps only its number of bins, a variable one its edges normalized to [0, 1]. | |
| std::string | toString () const |
| Get a string representation of this spec. | |
| AxisSpec | withDirection (AxisDirection direction) const |
| Get a copy of this spec with the given direction attached. | |
Static Public Member Functions | |
| static AxisSpec | DeferredEquidistant (std::size_t nBins, std::optional< AxisDirection > direction=std::nullopt) |
| Equidistant axis with only the number of bins fixed. | |
| static AxisSpec | DeferredVariable (std::vector< double > normalizedEdges, std::optional< AxisBoundaryType > boundaryType=std::nullopt, std::optional< AxisDirection > direction=std::nullopt) |
| Variable axis whose normalized edges are scaled onto the range supplied by the consumer. | |
| static AxisSpec | Equidistant (std::size_t nBins, std::optional< double > min=std::nullopt, std::optional< double > max=std::nullopt, std::optional< AxisBoundaryType > boundaryType=std::nullopt, std::optional< AxisDirection > direction=std::nullopt) |
| Equidistant axis; every property but the number of bins may be left to the consumer. | |
| static AxisSpec | FromAxis (const IAxis &axis) |
| Capture an existing axis as a fully specified spec. | |
| static AxisSpec | Variable (std::vector< double > edges, std::optional< AxisBoundaryType > boundaryType=std::nullopt, std::optional< AxisDirection > direction=std::nullopt) |
| Variable axis with absolute bin edges. | |
Variant-like spec of an axis that builds IAxis objects.
Every property except the binning structure itself is optional. What the spec leaves open is supplied by the consumer as Options at build time, e.g. from the bounds of the surface the axis is attached to. This models proto material binning, where a configuration may fix the number of bins but not the range, or a range but not whether the axis wraps.
Per property the rule is the same: it has to be given by exactly one side, or by both with the same value. Supplying a property that the spec already fixes therefore validates it instead of overriding it, and a property that neither side gives is an error.
| const DeferredVariableParams & Acts::AxisSpec::asDeferredVariable | ( | ) | const |
Get the spec as deferred variable parameters.
| std::bad_variant_access | if another alternative is held |
| const EquidistantParams & Acts::AxisSpec::asEquidistant | ( | ) | const |
Get the spec as equidistant parameters.
| std::bad_variant_access | if another alternative is held |
| const VariableParams & Acts::AxisSpec::asVariable | ( | ) | const |
Get the spec as variable parameters.
| std::bad_variant_access | if another alternative is held |
| std::optional< AxisBoundaryType > Acts::AxisSpec::boundaryType | ( | ) | const |
Get the boundary type of the axis.
Build the axis, filling in the properties the spec leaves open and validating the ones it fixes.
| options | the properties supplied by the consumer |
| std::domain_error | if a property is given by neither side |
| std::invalid_argument | if a property is given by both sides with different values, or the resulting range is invalid |
|
static |
Equidistant axis with only the number of bins fixed.
| nBins | the number of bins |
| direction | the optional direction of the axis |
| std::invalid_argument | if nBins == 0 |
|
static |
Variable axis whose normalized edges are scaled onto the range supplied by the consumer.
| normalizedEdges | the relative bin edges, strictly increasing, with first value 0 and last value 1 |
| boundaryType | the optional boundary type of the axis |
| direction | the optional direction of the axis |
| std::invalid_argument | if fewer than two values are given, the values are not strictly increasing, or the first and last values are not exactly 0 and 1 |
| std::optional< AxisDirection > Acts::AxisSpec::direction | ( | ) | const |
Get the direction of the axis.
|
static |
Equidistant axis; every property but the number of bins may be left to the consumer.
| nBins | the number of bins |
| min | the optional minimum edge of the axis |
| max | the optional maximum edge of the axis |
| boundaryType | the optional boundary type of the axis |
| direction | the optional direction of the axis |
| std::invalid_argument | if min >= max or nBins == 0 |
|
static |
Capture an existing axis as a fully specified spec.
| axis | the axis to decompose |
| bool Acts::AxisSpec::isDeferred | ( | ) | const |
Check if the spec needs Options to build, i.e.
leaves at least one property to the consumer
| bool Acts::AxisSpec::isDeferredVariable | ( | ) | const |
Check if the spec holds normalized instead of absolute bin edges.
| bool Acts::AxisSpec::isEquidistant | ( | ) | const |
Check if the spec produces an equidistant axis.
| bool Acts::AxisSpec::isVariable | ( | ) | const |
Check if the spec produces a variable axis.
| std::size_t Acts::AxisSpec::nBins | ( | ) | const |
Get the number of bins.
| AxisSpec Acts::AxisSpec::toDeferred | ( | ) | const |
Get the counterpart that leaves every property to the consumer: an equidistant spec keeps only its number of bins, a variable one its edges normalized to [0, 1].
| std::string Acts::AxisSpec::toString | ( | ) | const |
Get a string representation of this spec.
|
static |
Variable axis with absolute bin edges.
| edges | the bin edges, strictly increasing |
| boundaryType | the optional boundary type of the axis |
| direction | the optional direction of the axis |
| std::invalid_argument | if fewer than two edges are given or the edges are not strictly increasing |
| AxisSpec Acts::AxisSpec::withDirection | ( | AxisDirection | direction | ) | const |
Get a copy of this spec with the given direction attached.
| direction | the direction to attach |