ATLAS Offline Software
Loading...
Searching...
No Matches
ContainerId.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef COLUMNAR_CORE_CONTAINER_ID_H
9#define COLUMNAR_CORE_CONTAINER_ID_H
10
14
15class EventContext;
16
17namespace columnar
18{
91
100 template<typename ObjectType,typename ContainerType>
102 {
104 static constexpr bool isContainerId = true;
105
107 static constexpr bool regularObjectId = true;
108
110 static constexpr bool variantObjectId = false;
111
113 static constexpr bool regularColumnAccessorArray = true;
114
116 static constexpr bool isMutable = false;
117
119 static constexpr bool perEventRange = true;
120
122 static constexpr bool perEventId = false;
123
126
128 using xAODObjectRangeType = const ContainerType;
129
131 using xAODElementLinkType = ContainerType;
132 };
133
141 template<typename CI>
142 requires (CI::isContainerId && CI::regularObjectId)
143 struct MutableContainerId : public CI
144 {
145 static constexpr bool isMutable = true;
146 using constId = CI;
147
149 using xAODObjectIdType = std::remove_const_t<typename CI::xAODObjectIdType>;
150
152 using xAODObjectRangeType = std::remove_const_t<typename CI::xAODObjectRangeType>;
153 };
154
155 // including this here, since everyone needs EventContextId/EventContextRange
156 struct EventContextDef : RegularContainerId<EventContext,EventContext>
157 {
158 static constexpr std::string_view idName = eventContextCIName;
159
160 // disable retrieve as either ObjectId or ObjectRange, the event
161 // context will always be passed into tool code by the caller
162 static constexpr bool perEventRange = false;
163 static constexpr bool perEventId = false;
164 };
165
167 template<typename CI>
168 concept ContainerIdConcept = CI::isContainerId;
169 template<typename CI>
170 concept RegularContainerIdConcept = CI::isContainerId && CI::regularObjectId;
171
172 // forward declarations of columnar core classes for which I often
173 // provide specific aliases for different container ids.
174 template<ContainerIdConcept CI,typename CM = ColumnarModeDefault> class ObjectRange;
175 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectId;
176 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class OptObjectId;
177 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectLink;
178 template<ContainerIdConcept CI,typename CT,ColumnAccessMode CAM,typename CM = ColumnarModeDefault> class AccessorTemplate;
179
180
183}
184
185#endif
ObjectType
Definition BaseObject.h:11
the raw column accessor template class
a class representing a single object (electron, muons, etc.)
a class representing a continuous sequence of objects (a.k.a. a container)
a class representing a single optional object (electron, muons, etc.)
concept for a container id
ObjectRange< EventContextDef > EventContextRange
ObjectId< EventContextDef > EventContextId
constexpr std::string_view eventContextCIName
the name for the event context container id
static constexpr bool perEventId
static constexpr bool perEventRange
static constexpr std::string_view idName
a template to define a mutable version of a given container id
std::remove_const_t< typename CI::xAODObjectIdType > xAODObjectIdType
the xAOD type to use with ObjectId
std::remove_const_t< typename CI::xAODObjectRangeType > xAODObjectRangeType
the xAOD type to use with ObjectRange
Container id definitions for the columnar infrastructure.
ContainerType xAODElementLinkType
the xAOD type to use with ElementLink
static constexpr bool regularObjectId
whether to use the regular ObjectId/ObjectRange
static constexpr bool isMutable
whether this is a non-const container
static constexpr bool perEventId
whether this can be retrieved as a single object per event
const ContainerType xAODObjectRangeType
the xAOD type to use with ObjectRange
static constexpr bool isContainerId
identify this as a container id definition
static constexpr bool perEventRange
whether this can be retrieved as a range per event
static constexpr bool regularColumnAccessorArray
whether to use a regular column accessor in array mode
static constexpr bool variantObjectId
whether to use a variant ObjectId
const ObjectType xAODObjectIdType
the xAOD type to use with ObjectId
std::map< std::string, HypoJetVector >::const_iterator CI