 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #ifndef COLUMNAR_VARIANT_VARIANT_OPT_OBJECT_ID_H
9 #define COLUMNAR_VARIANT_VARIANT_OPT_OBJECT_ID_H
33 : m_object (&val_object.getXAODObjectNoexcept())
37 : m_object (val_object)
40 template<ContainerIdConcept CI2>
46 template<ContainerIdConcept CI2>
57 return m_object !=
nullptr;}
60 return m_object !=
nullptr;}
63 if (m_object ==
nullptr)
64 throw std::bad_optional_access();
72 if (m_object ==
nullptr)
73 throw std::bad_optional_access();
84 return m_object == that.m_object;}
98 return str << &
obj.getXAODObjectNoexcept() <<
"/" <<
obj.getXAODObjectNoexcept().index();
104 return &lhs.getXAODObjectNoexcept() == &rhs.getXAODObjectNoexcept();
110 return &lhs.getXAODObjectNoexcept() != &rhs.getXAODObjectNoexcept();
125 static constexpr std::size_t invalidVariantIndex = CI::numVariants;
132 :
m_data (val_object.getData()), m_variantIndex (val_object.getVariantIndex()), m_objectIndex (val_object.getObjectIndex())
135 template<ContainerIdConcept CI2>
141 template<ContainerIdConcept CI2>
146 if (val_object.has_value())
149 m_objectIndex = val_object.getIndex();
152 m_variantIndex = invalidVariantIndex;
163 throw std::logic_error (
"can't call xAOD function in columnar mode");
175 throw std::logic_error (
"can't call xAOD function in columnar mode");}
178 return m_variantIndex != invalidVariantIndex;}
181 return m_variantIndex != invalidVariantIndex;}
184 if (m_variantIndex == invalidVariantIndex)
185 throw std::bad_optional_access();
189 if (m_variantIndex == invalidVariantIndex)
190 throw std::bad_optional_access();
195 return m_variantIndex == that.m_variantIndex && m_objectIndex == that.m_objectIndex;
204 explicit OptObjectId (
void **val_data, std::size_t val_variantIndex, std::size_t val_objectIndex) noexcept
205 :
m_data (val_data), m_variantIndex (val_variantIndex), m_objectIndex (val_objectIndex)
209 return m_variantIndex;}
212 return m_objectIndex;}
224 std::size_t m_variantIndex = invalidVariantIndex;
232 return str << CI::idNameArray.at(
obj.getVariantIndex()) <<
"/" <<
obj.getObjectIndex();
238 return lhs.getVariantIndex() == rhs.getVariantIndex() && lhs.getObjectIndex() == rhs.getObjectIndex();
244 return lhs.getVariantIndex() != rhs.getVariantIndex() || lhs.getObjectIndex() != rhs.getObjectIndex();
xAODObject * getXAODObject() const
const InDetSimData * getData(const InDetSimDataCollection &coll, const Identifier &id)
xAODObject * getXAODObject() const noexcept
std::size_t getVariantIndex() const noexcept
xAODObject * getXAODObjectNoexcept() const noexcept
OptObjectId(const OptObjectId< CI, ColumnarModeArray > &that) noexcept=default
xAODContainer & getXAODObjectNoexcept() const noexcept
a class representing a single optional object (electron, muons, etc.)
AccessorTemplate & operator=(AccessorTemplate &&that)
requires(CI::template isValidContainer< CI2 >()) OptObjectId(OptObjectId< CI2
typename CI::xAODObjectIdType xAODObject
bool const RAWDATA *ch2 const
OptObjectId(const ObjectId< CI, ColumnarModeXAOD > &val_object) noexcept
std::map< std::string, HypoJetVector >::const_iterator CI
bool operator==(const ObjectId< CI, ColumnarModeXAOD > &lhs, const ObjectId< CI, ColumnarModeXAOD > &rhs)
OptObjectId() noexcept=default
typename CIBase::xAODObjectIdType xAODObjectIdType
the xAOD type to use with ObjectId
bool operator!=(const ObjectId< CI, ColumnarModeXAOD > &lhs, const ObjectId< CI, ColumnarModeXAOD > &rhs)
bool has_value() const noexcept
SiLocalPosition operator*(const SiLocalPosition &position, const double factor)
OptObjectId() noexcept=default
bool has_value() const noexcept
OptObjectId(xAODObject *)
ObjectId< CI, ColumnarModeXAOD > value() const
requires(CI::template isValidContainer< CI2 >()) OptObjectId(ObjectId< CI2
std::size_t getObjectIndex() const noexcept
ObjectId< CI, ColumnarModeArray > value() const
OptObjectId(ObjectId< CI, ColumnarModeArray > val_object) noexcept
a class representing a single object (electron, muons, etc.)
constexpr ColumnarOffsetType invalidObjectIndex
the value for an invalid element index
void ** getData() const noexcept
concept ContainerIdConcept
concept for a container id
requires(CI::template isValidContainer< CI2 >()) OptObjectId(ObjectId< CI2
OptObjectId(void **val_data, std::size_t val_variantIndex, std::size_t val_objectIndex) noexcept
typename CI::xAODObjectIdType xAODObject
#define ATLAS_THREAD_SAFE
setBGCode setTAP setLVL2ErrorBits bool
OptObjectId(xAODObject *val_object) noexcept
std::ostream & operator<<(std::ostream &str, const ObjectId< CI, ColumnarModeXAOD > &obj)