 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #ifndef COLUMNAR_CORE_COLUMN_ACCESSOR_H
9 #define COLUMNAR_CORE_COLUMN_ACCESSOR_H
20 #include <type_traits>
81 template<ContainerIdConcept CI,
typename CT,ColumnAccessMode CAM,
typename CM>
class AccessorTemplate;
94 template<
typename CT,
typename CM>
103 template<
typename CT,
typename CM>
104 requires ((std::is_integral_v<CT> || std::is_floating_point_v<CT>) && !std::is_same_v<CT,bool>)
107 using ColumnType =
CT;
108 static constexpr
bool isNativeType =
true;
109 static constexpr
bool useConvertInput =
false;
110 static constexpr
bool useConvertWithDataInput =
false;
121 template<
typename CT,
typename CM>
139 static_assert (!std::is_const_v<CT>,
"CT must not be const");
140 static_assert (!std::is_const_v<UT>,
"UT must not be const");
143 template<
typename UT,
typename CT,
typename CM>
158 template<ContainerIdConcept CI,
typename CT,
typename CM>
183 return m_base.isAvailable (
id);
188 if (
m_base.isAvailable (
id))
209 template<ContainerIdConcept CI,
typename CT,ColumnAccessMode CAM,
typename CM>
212 accessor = AccessorTemplate<CI,CT,CAM,CM> (columnBase,
name, std::move (
info));
const InDetSimData * getData(const InDetSimDataCollection &coll, const Identifier &id)
static constexpr bool useConvertWithDataInput
static constexpr bool useConvertInput
a type wrapper to make AccessorTemplate convert the underlying column type to a different type
static ColumnInfo & updateColumnInfo(ColumnarTool< CM > &, ColumnInfo &info)
bool const RAWDATA *ch2 const
std::map< std::string, HypoJetVector >::const_iterator CI
static UT convertInput(const CT &value)
std::optional< UserType > getOptional(ObjectId< CI, CM > id) const
a struct that contains meta-information about each column that's needed to interface the column with ...
AccessorTemplate()=default
static ColumnInfo & updateColumnInfo(ColumnarTool< CM > &, ColumnInfo &info)
ColumnAccessMode
an enum for the different access modes for a column
static constexpr bool isNativeType
a class representing a single object (electron, muons, etc.)
bool isAvailable(ObjectId< CI, CM > id) const noexcept
a type wrapper to force AccessorTemplate to treat the type as native
Helper class to provide type-safe access to aux data.
static ColumnInfo & updateColumnInfo(ColumnarTool< CM > &, ColumnInfo &info)
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
AccessorTemplate< CI, ColumnType, ColumnAccessMode::input, CM > m_base
a trait class to provide information about the column type
the raw column accessor template class
Helper class to provide constant type-safe access to aux data.
void resetAccessor(AccessorTemplate< CI, CT, CAM, CM > &accessor, ColumnarTool< CM > &columnBase, const std::string &name, ColumnInfo &&info={})
reset a column accessor to point to a new column
typename ColumnTypeTraits< CT, CM >::UserType UserType
decltype(auto) operator()(ObjectId< CI, CM > id) const noexcept
Helper class to provide type-safe access to aux data.