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
13
14class EventContext;
15
16namespace columnar
17{
94
95 namespace ContainerId
96 {
105 template<typename ObjectType,typename ContainerType>
107 {
109 static constexpr bool isContainerId = true;
110
112 static constexpr bool regularObjectId = true;
113
115 static constexpr bool variantObjectId = false;
116
118 static constexpr bool regularColumnAccessorArray = true;
119
121 static constexpr bool isMutable = false;
122
124 static constexpr bool perEventRange = true;
125
127 static constexpr bool perEventId = false;
128
131
133 using xAODObjectRangeType = const ContainerType;
134
136 using xAODElementLinkType = ContainerType;
137 };
138
146 template<typename CI>
147 requires (CI::isContainerId && CI::regularObjectId)
148 struct mutableCI : public CI
149 {
150 static constexpr bool isMutable = true;
151 using constId = CI;
152
154 using xAODObjectIdType = std::remove_const_t<typename CI::xAODObjectIdType>;
155
157 using xAODObjectRangeType = std::remove_const_t<typename CI::xAODObjectRangeType>;
158 };
159
160 // including this here, since everyone needs EventContextId/EventContextRange
161 struct eventContext : regularCIBase<EventContext,EventContext>
162 {
163 static constexpr std::string_view idName = "eventContext";
164
165 // disable retrieve as either ObjectId or ObjectRange, the event
166 // context will always be passed into tool code by the caller
167 static constexpr bool perEventRange = false;
168 static constexpr bool perEventId = false;
169 };
170 }
171
173 template<typename CI>
174 concept ContainerIdConcept = CI::isContainerId;
175 template<typename CI>
176 concept RegularContainerIdConcept = CI::isContainerId && CI::regularObjectId;
177
178 // forward declarations of columnar core classes for which I often
179 // provide specific aliases for different container ids.
180 template<ContainerIdConcept CI,typename CM = ColumnarModeDefault> class ObjectRange;
181 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectId;
182 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class OptObjectId;
183 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectLink;
184 template<ContainerIdConcept CI,typename CT,ColumnAccessMode CAM,typename CM = ColumnarModeDefault> class AccessorTemplate;
185
186
189}
190
191#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
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