ATLAS Offline Software
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 
14 class EventContext;
15 
16 namespace 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
columnar::ContainerId::eventContext::perEventId
static constexpr bool perEventId
Definition: ContainerId.h:165
columnar::ContainerId::regularCIBase::regularColumnAccessorArray
static constexpr bool regularColumnAccessorArray
whether to use a regular column accessor in array mode
Definition: ContainerId.h:115
ObjectType
ObjectType
Definition: BaseObject.h:11
columnar::ContainerId::eventContext::idName
static constexpr std::string_view idName
Definition: ContainerId.h:160
columnar::ContainerId::eventContext::perEventRange
static constexpr bool perEventRange
Definition: ContainerId.h:164
columnar::OptObjectId
a class representing a single optional object (electron, muons, etc.)
Definition: ContainerId.h:179
columnar::ObjectRange
a class representing a continuous sequence of objects (a.k.a. a container)
Definition: ContainerId.h:177
CI
std::map< std::string, HypoJetVector >::const_iterator CI
Definition: xAODJetCollector.h:18
columnar::ContainerId::regularCIBase::isMutable
static constexpr bool isMutable
whether this is a non-const container
Definition: ContainerId.h:118
columnar::ContainerId::regularCIBase::regularObjectId
static constexpr bool regularObjectId
whether to use the regular ObjectId/ObjectRange
Definition: ContainerId.h:112
columnar::RegularContainerIdConcept
concept RegularContainerIdConcept
Definition: ContainerId.h:173
ColumnarDef.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
columnar::ObjectId
a class representing a single object (electron, muons, etc.)
Definition: ContainerId.h:178
columnar::ContainerId::eventContext
a template to define a mutable version of a given container id
Definition: ContainerId.h:159
columnar::ContainerId::regularCIBase::perEventRange
static constexpr bool perEventRange
whether this can be retrieved as a range per event
Definition: ContainerId.h:121
columnar::ContainerIdConcept
concept ContainerIdConcept
concept for a container id
Definition: ContainerId.h:171
xAOD::Photon_v1
Definition: Photon_v1.h:37
columnar
Definition: ClusterDef.h:16
columnar::ContainerId::regularCIBase::isContainerId
static constexpr bool isContainerId
identify this as a container id definition
Definition: ContainerId.h:109
columnar::ContainerId::regularCIBase
a template that provides a base definition of container id for a regular container
Definition: ContainerId.h:107
columnar::requires
requires requires
Definition: VariantAccessor.h:22
columnar::AccessorTemplate
the raw column accessor template class
Definition: ColumnAccessor.h:81
ColumnInfo.h
columnar::ContainerId::regularCIBase::perEventId
static constexpr bool perEventId
whether this can be retrieved as a single object per event
Definition: ContainerId.h:124