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#include <xAODCore/CLASS_DEF.h>
15
16class EventContext;
17
18namespace columnar
19{
92
93 namespace detail
94 {
100 template<typename T>
102 {
103#ifdef __CLING__
104 return 0;
105#else
106 return ClassID_traits<T>::ID();
107#endif
108 }
109 }
110
111
120 template<typename ObjectType,typename ContainerType>
122 {
124 static constexpr bool isContainerId = true;
125
127 static constexpr bool regularObjectId = true;
128
130 static constexpr bool variantObjectId = false;
131
133 static constexpr bool regularColumnAccessorArray = true;
134
136 static constexpr bool isMutable = false;
137
139 static constexpr bool perEventRange = true;
140
142 static constexpr bool perEventId = false;
143
146
148 using xAODObjectRangeType = const ContainerType;
149
151 using xAODElementLinkType = ContainerType;
152
159 {
161 }
162 };
163
171 template<typename CI>
172 requires (CI::isContainerId && CI::regularObjectId)
173 struct MutableContainerId : public CI
174 {
175 static constexpr bool isMutable = true;
176 using constId = CI;
177
179 using xAODObjectIdType = std::remove_const_t<typename CI::xAODObjectIdType>;
180
182 using xAODObjectRangeType = std::remove_const_t<typename CI::xAODObjectRangeType>;
183 };
184
185 // including this here, since everyone needs EventContextId/EventContextRange
186 struct EventContextDef : RegularContainerId<EventContext,EventContext>
187 {
188 static constexpr std::string_view idName = eventContextCIName;
189
190 // disable retrieve as either ObjectId or ObjectRange, the event
191 // context will always be passed into tool code by the caller
192 static constexpr bool perEventRange = false;
193 static constexpr bool perEventId = false;
194 };
195
197 template<typename CI>
198 concept ContainerIdConcept = CI::isContainerId;
199 template<typename CI>
200 concept RegularContainerIdConcept = CI::isContainerId && CI::regularObjectId;
201
202 // forward declarations of columnar core classes for which I often
203 // provide specific aliases for different container ids.
204 template<ContainerIdConcept CI,typename CM = ColumnarModeDefault> class ObjectRange;
205 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectId;
206 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class OptObjectId;
207 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectLink;
208 template<ContainerIdConcept CI,typename CT,ColumnAccessMode CAM,typename CM = ColumnarModeDefault> class AccessorTemplate;
209
210
213}
214
215#endif
ObjectType
Definition BaseObject.h:11
File providing the different SG_BASE macros.
uint32_t CLID
The Class ID type.
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
Container id definitions for the columnar infrastructure.
CLID clidForType()
the CLID of a container type, or 0 when it cannot be determined
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
a template that provides a base definition of container id for a regular container
ContainerType xAODElementLinkType
the xAOD type to use with ElementLink
static constexpr bool regularObjectId
whether to use the regular ObjectId/ObjectRange
static CLID containerClid()
the CLID of the xAOD container type (from its CLASS_DEF)
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