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 regularColumnAccessorArray = true;
116
118 static constexpr bool isMutable = false;
119
121 static constexpr bool perEventRange = true;
122
124 static constexpr bool perEventId = false;
125
128
130 using xAODObjectRangeType = const ContainerType;
131
133 using xAODElementLinkType = ContainerType;
134 };
135
143 template<typename CI>
144 requires (CI::isContainerId && CI::regularObjectId)
145 struct mutableCI : public CI
146 {
147 static constexpr bool isMutable = true;
148 using constId = CI;
149
151 using xAODObjectIdType = std::remove_const_t<typename CI::xAODObjectIdType>;
152
154 using xAODObjectRangeType = std::remove_const_t<typename CI::xAODObjectRangeType>;
155 };
156
157 // including this here, since everyone needs EventContextId/EventContextRange
158 struct eventContext : regularCIBase<EventContext,EventContext>
159 {
160 static constexpr std::string_view idName = "eventContext";
161
162 // disable retrieve as either ObjectId or ObjectRange, the event
163 // context will always be passed into tool code by the caller
164 static constexpr bool perEventRange = false;
165 static constexpr bool perEventId = false;
166 };
167 }
168
170 template<typename CI>
171 concept ContainerIdConcept = CI::isContainerId;
172 template<typename CI>
173 concept RegularContainerIdConcept = CI::isContainerId && CI::regularObjectId;
174
175 // forward declarations of columnar core classes for which I often
176 // provide specific aliases for different container ids.
177 template<ContainerIdConcept CI,typename CM = ColumnarModeDefault> class ObjectRange;
178 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectId;
179 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class OptObjectId;
180 template<ContainerIdConcept CI, typename CM = ColumnarModeDefault> class ObjectLink;
181 template<ContainerIdConcept CI,typename CT,ColumnAccessMode CAM,typename CM = ColumnarModeDefault> class AccessorTemplate;
182
183
186}
187
188#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
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