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{
95
96 namespace ContainerId
97 {
106 template<typename ObjectType,typename ContainerType>
108 {
110 static constexpr bool isContainerId = true;
111
113 static constexpr bool regularObjectId = true;
114
116 static constexpr bool variantObjectId = false;
117
119 static constexpr bool regularColumnAccessorArray = true;
120
122 static constexpr bool isMutable = false;
123
125 static constexpr bool perEventRange = true;
126
128 static constexpr bool perEventId = false;
129
132
134 using xAODObjectRangeType = const ContainerType;
135
137 using xAODElementLinkType = ContainerType;
138 };
139
147 template<typename CI>
148 requires (CI::isContainerId && CI::regularObjectId)
149 struct mutableCI : public CI
150 {
151 static constexpr bool isMutable = true;
152 using constId = CI;
153
155 using xAODObjectIdType = std::remove_const_t<typename CI::xAODObjectIdType>;
156
158 using xAODObjectRangeType = std::remove_const_t<typename CI::xAODObjectRangeType>;
159 };
160
161 // including this here, since everyone needs EventContextId/EventContextRange
162 struct eventContext : regularCIBase<EventContext,EventContext>
163 {
164 static constexpr std::string_view idName = eventContextCIName;
165
166 // disable retrieve as either ObjectId or ObjectRange, the event
167 // context will always be passed into tool code by the caller
168 static constexpr bool perEventRange = false;
169 static constexpr bool perEventId = false;
170 };
171 }
172
174 template<typename CI>
175 concept ContainerIdConcept = CI::isContainerId;
176 template<typename CI>
177 concept RegularContainerIdConcept = CI::isContainerId && CI::regularObjectId;
178
179 // forward declarations of columnar core classes for which I often
180 // provide specific aliases for different container ids.
181 template<ContainerIdConcept CI,typename CM = ColumnarModeDefault> class ObjectRange;
182 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectId;
183 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class OptObjectId;
184 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectLink;
185 template<ContainerIdConcept CI,typename CT,ColumnAccessMode CAM,typename CM = ColumnarModeDefault> class AccessorTemplate;
186
187
190}
191
192#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
a namespace for holding the ids for the different "virtual" containers
Definition ClusterDef.h:18
ObjectRange< ContainerId::eventContext > EventContextRange
ObjectId< ContainerId::eventContext > EventContextId
constexpr std::string_view eventContextCIName
the ContainerId::name for the event context
static constexpr std::string_view idName
static constexpr bool perEventId
static constexpr bool perEventRange
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
static constexpr bool regularColumnAccessorArray
whether to use a regular column accessor in array mode
ContainerType xAODElementLinkType
the xAOD type to use with ElementLink
static constexpr bool regularObjectId
whether to use the regular ObjectId/ObjectRange
static constexpr bool variantObjectId
whether to use a variant ObjectId
const ContainerType xAODObjectRangeType
the xAOD type to use with ObjectRange
static constexpr bool isMutable
whether this is a non-const container
static constexpr bool perEventRange
whether this can be retrieved as a range per event
const ObjectType xAODObjectIdType
the xAOD type to use with ObjectId
static constexpr bool perEventId
whether this can be retrieved as a single object per event
static constexpr bool isContainerId
identify this as a container id definition
std::map< std::string, HypoJetVector >::const_iterator CI