10#include <tracking/trackFindingCDC/varsets/BaseVarSet.h>
12#include <tracking/trackFindingCDC/varsets/FixedSizeNamedFloatTuple.h>
24 namespace TrackFindingCDC {
35 template<
class AVarNames>
48 static const size_t nVars = AVarNames::nVars;
64 MayBePtr<Float_t>
find(
const std::string& varName)
override
78 constexpr static int named(
const char* name)
80 return index<nVars>(AVarNames::getName, name);
87 static_assert(I <
nVars,
"Requested variable index exceeds number of variables.");
95 static_assert(I <
nVars,
"Requested variable index exceeds number of variables.");
100 template<
typename AFloat>
118 if (not std::isfinite(value)) {
119 m_value = std::copysign(std::numeric_limits<AFloat>::max(), value);
132 static_assert(I <
nVars,
"Requested variable index exceeds number of variables.");
Generic class that generates some named float values from a given object.
AObject Object
Object type from which variables shall be extracted.
Generic class that contains a fixed number of named float values.
Float_t get() const
Getter for the ith value. Static index version.
std::vector< Named< Float_t * > > getNamedVariables(std::string prefix="")
Getter for named references to the variables in this tuple.
virtual MayBePtr< Float_t > find(std::string name)
Getter for a pointer to the value with the given name.
Generic class that generates some named float values from a given object.
AssignFinite< Float_t > finitevar()
Reference getter for the value of the ith variable. Transforms non-finite values to finite value.
static constexpr int named(const char *name)
Getter for the index from the name.
Float_t & var()
Reference getter for the value of the ith variable. Static version.
typename Super::Object Object
Type from which variables should be extracted.
static const size_t nVars
Number of floating point values represented by this class.
Float_t get() const
Getter for the value of the ith variable. Static version.
FixedSizeNamedFloatTuple< AVarNames > m_variables
Memory for nVars floating point values.
std::vector< Named< Float_t * > > getNamedVariables(const std::string &prefix) override
Getter for the named references to the individual variables Base implementation returns empty vector.
MayBePtr< Float_t > find(const std::string &varName) override
Pointer to the variable with the given name.
Abstract base class for different kinds of events.
Helper construct to assign a finite value to float variables.
void operator=(const AFloat value)
Assign value replacing infinite values with the maximum value possible.
AssignFinite(AFloat &value)
Setup the assignment to a variable.
AFloat & m_value
Reference to the variable to be assigned.