ATLAS Offline Software
Loading...
Searching...
No Matches
VariantLinkColumn.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef COLUMNAR_VARIANT_VARIANT_LINK_COLUMN_H
9#define COLUMNAR_VARIANT_VARIANT_LINK_COLUMN_H
10
15
16#include <vector>
17
18namespace columnar
19{
39
40 template<ContainerIdConcept CIBase,ContainerIdConcept... CIList>
41 class ObjectLink<VariantContainerId<CIBase,CIList...>,ColumnarModeXAOD> final
42 {
45 public:
46
47 using CI = VariantContainerId<CIBase,CIList...>;
49
51
52 ObjectLink (const LinkType* val_link)
53 : m_link (val_link)
54 {}
55
56 const typename CI::xAODObjectIdType* getXAODObject () const
57 {
58 if (m_link->isValid())
59 {
60 return **m_link;
61 } else
62 {
63 return nullptr;
64 }
65 }
66
68 explicit operator bool () const
69 {
70 return m_link->isValid();
71 }
72
74 [[nodiscard]] bool has_value () const
75 {
76 return m_link->isValid();
77 }
78
80 [[nodiscard]] OptObjectId<CI,CM> opt_value () const
81 {
83 }
84
90 template<ContainerIdConcept CI2>
91 [[nodiscard]] bool isContainer () const
92 {
93 static constexpr unsigned variantIndex = CI::template getVariantIndex<CI2>();
94 static_assert (variantIndex < CI::numVariants, "invalid container id");
95 return m_link->isValid() && dynamic_cast<typename CI2::xAODObjectRangeType*>(m_link->getStorableObjectPointer());
96 }
97
99 template<ContainerIdConcept CI2>
100 [[nodiscard]] bool operator == (ObjectId<CI2,CM> id) const
101 {
102 static constexpr unsigned variantIndex = CI::template getVariantIndex<CI2>();
103 static_assert (variantIndex < CI::numVariants, "invalid container id");
104 return m_link->isValid() && (**m_link) == &id.getXAODObject();
105 }
106
108 [[nodiscard]] bool operator == (const ObjectLink<CI,CM>& obj) const
109 {
110 return getXAODObject() == obj.getXAODObject();
111 }
112
114 template<ContainerIdConcept CI2>
115 [[nodiscard]] OptObjectId<CI2,CM> tryGetVariant () const
116 {
117 static constexpr unsigned variantIndex = CI::template getVariantIndex<CI2>();
118 static_assert (variantIndex < CI::numVariants, "invalid container id");
119 if (m_link->isValid())
120 {
121 return OptObjectId<CI2,CM> (dynamic_cast<const typename CI2::xAODObjectIdType*>(**m_link));
122 } else
123 return OptObjectId<CI2,CM> ();
124 }
125
128 private:
129
130 const LinkType* m_link = nullptr;
131 };
132 template<typename... CIList>
134 {
135 return str << obj.getXAODObject() << "/" << obj.getXAODObject()->type();
136 }
137
138 namespace detail
139 {
140 // in xAOD mode we can do a fairly straightforward conversion from
141 // ElementLink as the logic is inside ObjectLink
142 template<ContainerIdConcept CIBase,typename... CIList>
144 {
147 public:
148
149 using CI = VariantContainerId<CIBase,CIList...>;
151 static constexpr bool isDefined = true;
152 static constexpr bool viewIsReference = false;
153 static constexpr bool hasSetter = true;
155
156 [[nodiscard]] static auto makeViewer (void**)
157 {
158 return [] (const ElementLink<typename CI::xAODElementLinkType>& value) {
159 return ObjectLink<VariantContainerId<CIBase,CIList...>,ColumnarModeXAOD> (&value);
160 };
161 }
162
163 struct Setter final
164 {
165 template<ContainerIdConcept CI2>
166 requires (CI::template isValidContainer<CI2>())
167 auto operator() (MemoryType& link, const ObjectId<CI2,ColumnarModeXAOD>& obj) const
168 {
169 auto* container = static_cast<const typename CIBase::xAODElementLinkType*>(obj.getXAODObjectNoexcept().container());
170 link = MemoryType(*container, obj.getXAODObjectNoexcept().index());
171 }
172 };
173 [[nodiscard]] static auto makeSetter (void**)
174 {
175 return Setter{};
176 }
177 };
178 }
179
180
181
182 namespace detail
183 {
188 template<unsigned numVariants>
190 {
191 std::string columnName;
192 std::array<unsigned,numVariants> offsetIndices {};
193 std::array<std::unique_ptr<ColumnAccessorDataArray>,numVariants> offsetData;
194 };
195
202 [[noreturn]] [[gnu::cold]] [[gnu::noinline]] inline void throwVariantLinkUnknownKey (const std::string& columnName, SG::sgkey_t key, ColumnarOffsetType event)
203 {
204 throw std::runtime_error ("link key does not match any known container for column " + columnName + ": read key " + std::to_string (key) + " in event " + std::to_string (event));
205 }
206
212 [[noreturn]] [[gnu::cold]] [[gnu::noinline]] inline void throwVariantLinkOutsideEvent (const std::string& columnName, std::size_t objectIndex, ColumnarOffsetType event)
213 {
214 throw std::runtime_error ("link target not in the same event as the link for column " + columnName + ": object " + std::to_string (objectIndex) + " is outside the range of event " + std::to_string (event));
215 }
216 }
217
218
219
226 template<ContainerIdConcept CIBase,ContainerIdConcept... CIList,ContainerIdConcept ELT,ContainerIdConcept... ExtraELT>
227 struct LinkCastColumn<VariantContainerId<CIBase,CIList...>,ELT,ExtraELT...>
228 {
229 static_assert ((requires { ExtraELT::containerClid(); } && ...),
230 "the extra link types of a LinkCastColumn only add keys, so they need to provide a CLID");
231
233 };
234
235
236
240 requires (CM::useKeyIndexAsLink)
242 {
245 public:
246
247 using CI = VariantContainerId<CIBase,CIList...>;
248 using KeyArray = std::array<std::vector<typename CM::LinkKeyColumnType>,CI::numVariants>;
250
251 ObjectLink (typename CM::LinkKeyColumnType val_key, typename CM::LinkIndexColumnType val_index, ColumnarOffsetType val_event, const KeyArray* val_keys, const Targets* val_targets, void** val_dataArea)
252 : m_key (val_key), m_index (val_index), m_event (val_event), m_keys (val_keys), m_targets (val_targets), m_dataArea (val_dataArea)
253 {}
254
255 const typename CI::xAODObjectIdType* getXAODObject () const
256 {
257 throw std::logic_error ("can't call xAOD function in columnar mode");
258 }
259
261 explicit operator bool () const noexcept
262 {
263 return has_value();
264 }
265
267 [[nodiscard]] bool has_value () const noexcept
268 {
270 }
271
273 [[nodiscard]] OptObjectId<CI,CM> opt_value () const
274 {
275 if (!has_value())
276 return OptObjectId<CI,CM> ();
277 const unsigned variant = findVariant();
278 if (variant != CI::numVariants)
279 return OptObjectId<CI,CM> (m_dataArea, variant, resolveIndex (variant));
280 // not sure whether we should throw here or return a nullopt, but
281 // throwing is probably the safer default. if it becomes an issue
282 // we can revisit this.
284 }
285
291 template<ContainerIdConcept CI2>
292 [[nodiscard]] bool isContainer () const
293 {
294 static constexpr unsigned variantIndex = CI::template getVariantIndex<CI2>();
295 static_assert (variantIndex < CI::numVariants, "invalid container id");
296 return has_value() && detail::isLinkKey ((*m_keys)[variantIndex], m_key);
297 }
298
300 template<ContainerIdConcept CI2>
301 [[nodiscard]] bool operator == (ObjectId<CI2,CM> id) const
302 {
303 static constexpr unsigned variantIndex = CI::template getVariantIndex<CI2>();
304 static_assert (variantIndex < CI::numVariants, "invalid container id");
305 return isContainer<CI2>() && resolveIndex (variantIndex) == id.getIndex();
306 }
307
318 [[nodiscard]] bool operator == (const ObjectLink<CI,CM>& obj) const noexcept
319 {
320 if (!has_value() || !obj.has_value())
321 return has_value() == obj.has_value();
322 if (m_index != obj.m_index || m_event != obj.m_event)
323 return false;
324 if (m_key == obj.m_key)
325 return true;
326 // note: I'm slightly worried about the cost of this operation,
327 // should it be called in a tight loop, with a lot of variants or
328 // a lot of possible target containers. If that happens, we can
329 // move the variant lookup into a flat hash map, preresolve it, or
330 // do something else. For now the assumption is that we don't
331 // really use this operation.
332 //
333 // The main reason for this to be this involved is that multiple
334 // variants can be the same container, and at the same time, the
335 // same variant can have multiple keys (corresponding to links
336 // registered with different CLIDs). That is probably rare, but it
337 // technically can happen.
338 const unsigned variant = findVariant();
339 if (variant != obj.findVariant())
340 return false;
341 return variant != CI::numVariants;
342 }
343
345 template<ContainerIdConcept CI2>
346 [[nodiscard]] OptObjectId<CI2,CM> tryGetVariant () const
347 {
348 static constexpr unsigned variantIndex = CI::template getVariantIndex<CI2>();
349 static_assert (variantIndex < CI::numVariants, "invalid container id");
350 if (isContainer<CI2>())
351 return OptObjectId<CI2,CM> (m_dataArea, resolveIndex (variantIndex));
352 else
353 return OptObjectId<CI2,CM> ();
354 }
355
356 [[nodiscard]] auto getLinkIndex () const noexcept
357 {
358 return m_index;
359 }
360
361 [[nodiscard]] auto getLinkKey () const noexcept
362 {
363 return m_key;
364 }
365
368 private:
369
370 typename CM::LinkKeyColumnType m_key = CM::nullLinkKey;
371 typename CM::LinkIndexColumnType m_index = CM::nullLinkIndex;
373 const KeyArray* m_keys = nullptr;
374 const Targets* m_targets = nullptr;
375 void** m_dataArea = nullptr;
376
379 [[nodiscard]] unsigned findVariant () const noexcept
380 {
381 for (unsigned i = 0; i < CI::numVariants; ++ i)
382 {
383 if (detail::isLinkKey ((*m_keys)[i], m_key))
384 return i;
385 }
386 return CI::numVariants;
387 }
388
389 [[nodiscard]] std::size_t resolveIndex (unsigned variantIndex) const
390 {
391 return detail::resolveLinkIndex<CM> (m_dataArea, m_targets->offsetIndices[variantIndex], m_event, m_index, m_targets->columnName);
392 }
393 };
394 template<typename... CIList, ColumnarArrayModeConcept CM>
395 requires (CM::useKeyIndexAsLink)
396 std::ostream& operator<< (std::ostream& str, const ObjectLink<VariantContainerId<CIList...>,CM>& obj)
397 {
398 return str << obj.getLinkKey() << "/" << obj.getLinkIndex();
399 }
400
401
402
403 namespace detail
404 {
405 // in array mode the link consists of the key and index columns as
406 // found in the input file, together with the event-index column
407 // (for the offset map of the link column) and the offset maps of
408 // all the target containers.
409 //
410 // As the links are typed, this is defined for LinkCastColumn
411 // directly, and the ObjectLink accessor redirects to it (see
412 // below), same as for regular links.
413 //
414 // It also calculates the keys it accepts for the target containers,
415 // i.e. the StoreGate keys calculated from the container names and
416 // the CLIDs of the targets and the link types. All targets accept
417 // the CLIDs of all the variants, as e.g. a generic particle target
418 // can contain any of the other types. The keys are shared with the
419 // columnar tool, which updates them whenever the link target names
420 // get set or change.
421 template<ColumnAccessMode CAM,ContainerIdConcept CIBase,ContainerIdConcept... CIList,ContainerIdConcept ELT,ContainerIdConcept... ExtraELT,ColumnarArrayModeConcept CM>
422 requires (CM::useKeyIndexAsLink)
424 {
427 public:
428
429 using VariantCI = VariantContainerId<CIBase,CIList...>;
431 static constexpr std::array containerIdNames = {CIList::idName...};
432
433 static constexpr bool isDefined = true;
434 static constexpr unsigned internalOffsetColumns = 0;
435
437
438 ContainerFreeAccessor (ColumnarTool<CM>& columnarTool, ColumnAccessorOptions&& options, ColumnAccessorOptionsArray&& optionsArray)
439 {
440 m_targetKeys = std::make_shared<typename Link::KeyArray> ();
441 m_targets = std::make_unique<typename Link::Targets> ();
442 m_targets->columnName = optionsArray.baseName;
443 const std::array<CLID,VariantCI::numVariants> memberClids = {linkTargetClid<CIList>()...};
444 for (unsigned i = 0; i < VariantCI::numVariants; ++ i)
445 {
446 std::vector<CLID> clids;
447 addLinkClid (clids, memberClids[i]);
448 for (CLID clid : memberClids)
449 addLinkClid (clids, clid);
451 (addLinkClid (clids, linkTargetClid<ExtraELT>()), ...);
452 // until the target name is known the keys are all the null
453 // key, which no (non-null) link can match, see the regular
454 // links for details.
455 (*m_targetKeys)[i].assign (clids.size(), CM::nullLinkKey);
456 columnarTool.watchLinkTargetName (containerIdNames[i], [keys = m_targetKeys, i, clids = std::move (clids)] (const std::string& name)
457 {
458 fillLinkKeys ((*keys)[i], name, clids);
459 });
460
461 ColumnInfo targetInfo;
462 targetInfo.offsetName = eventContextCIName;
463 targetInfo.isOffset = true;
464 targetInfo.isOptional = options.isOptional;
466 m_targets->offsetData[i] = std::make_unique<ColumnAccessorDataArray> (&m_targets->offsetIndices[i], &m_targets->offsetData[i], &typeid (ColumnarOffsetType), ColumnAccessMode::input);
467 columnarTool.addColumn (std::string (containerIdNames[i]), m_targets->offsetData[i].get(), std::move (targetInfo));
468 }
469
470 auto keyInfo = options.makeColumnInfo();
471 keyInfo.offsetName = optionsArray.offsetName;
473 m_keyData = std::make_unique<ColumnAccessorDataArray> (&m_keyIndex, &m_keyData, &typeid (typename CM::LinkKeyColumnType), CAM);
474 columnarTool.addColumn (optionsArray.baseName + "." + std::string (CM::linkKeyColumnName), m_keyData.get(), std::move (keyInfo));
475
476 auto indexInfo = options.makeColumnInfo();
477 indexInfo.offsetName = optionsArray.offsetName;
479 m_indexData = std::make_unique<ColumnAccessorDataArray> (&m_indexIndex, &m_indexData, &typeid (typename CM::LinkIndexColumnType), CAM);
480 columnarTool.addColumn (optionsArray.baseName + "." + std::string (CM::linkIndexColumnName), m_indexData.get(), std::move (indexInfo));
481
482 // the event-index column is shared by all columns using the
483 // same offset map, i.e. it is named after the container for
484 // scalar links, and after the vector for links inside vectors
485 std::string eventName = optionsArray.numOffsets == 0u ? std::string (optionsArray.offsetName) : optionsArray.baseName;
486 eventName += ".";
487 eventName += CM::eventIndexColumnName;
488 ColumnInfo eventInfo;
489 eventInfo.offsetName = optionsArray.offsetName;
490 eventInfo.isOptional = options.isOptional;
491 eventInfo.isEventIndex = true;
493 m_eventData = std::make_unique<ColumnAccessorDataArray> (&m_eventIndex, &m_eventData, &typeid (ColumnarOffsetType), ColumnAccessMode::input);
494 columnarTool.addColumn (eventName, m_eventData.get(), std::move (eventInfo));
495 }
496
498 : m_targetKeys (std::move (that.m_targetKeys)), m_targets (std::move (that.m_targets))
499 {
500 moveAccessor (m_keyIndex, m_keyData, that.m_keyIndex, that.m_keyData);
501 moveAccessor (m_indexIndex, m_indexData, that.m_indexIndex, that.m_indexData);
502 moveAccessor (m_eventIndex, m_eventData, that.m_eventIndex, that.m_eventData);
503 }
504
506 {
507 if (this != &that)
508 {
509 moveAccessor (m_keyIndex, m_keyData, that.m_keyIndex, that.m_keyData);
510 moveAccessor (m_indexIndex, m_indexData, that.m_indexIndex, that.m_indexData);
511 moveAccessor (m_eventIndex, m_eventData, that.m_eventIndex, that.m_eventData);
512 m_targetKeys = std::move (that.m_targetKeys);
513 m_targets = std::move (that.m_targets);
514 }
515 return *this;
516 }
517
518 auto operator () (void** dataArea, std::size_t index) const
519 requires (CAM == ColumnAccessMode::input)
520 {
521 return link (dataArea, index).opt_value();
522 }
523
524 auto operator () (void** dataArea, std::size_t beginIndex, std::size_t endIndex) const
525 requires (CAM == ColumnAccessMode::input)
526 {
527 return VectorConvertView ([] (const Link& link) {return link.opt_value();},
528 links (dataArea, beginIndex, endIndex));
529 }
530
532 [[nodiscard]] auto link (void** dataArea, std::size_t index) const noexcept
533 requires (CAM == ColumnAccessMode::input)
534 {
535 auto *keys = static_cast<const typename CM::LinkKeyColumnType*>(dataArea[m_keyIndex]);
536 auto *indices = static_cast<const typename CM::LinkIndexColumnType*>(dataArea[m_indexIndex]);
537 auto *events = static_cast<const ColumnarOffsetType*>(dataArea[m_eventIndex]);
538 return Link (keys[index], indices[index], events[index], m_targetKeys.get(), m_targets.get(), dataArea);
539 }
540
542 [[nodiscard]] auto links (void** dataArea, std::size_t beginIndex, std::size_t endIndex) const noexcept
543 requires (CAM == ColumnAccessMode::input)
544 {
545 return detail::VectorConvertView ([this,dataArea] (std::size_t index) {return link (dataArea, index);},
546 std::views::iota (beginIndex, endIndex));
547 }
548
549 template<ContainerIdConcept CI2>
550 requires (CAM == ColumnAccessMode::output && VariantCI::template isValidContainer<CI2>())
551 void set (void** dataArea, std::size_t index, ObjectId<CI2,CM> obj) const
552 {
553 static constexpr unsigned variantIndex = VariantCI::template getVariantIndex<CI2>();
554 const auto event = static_cast<const ColumnarOffsetType*>(dataArea[m_eventIndex])[index];
555 auto *offsets = static_cast<const ColumnarOffsetType*>(dataArea[m_targets->offsetIndices[variantIndex]]);
556 if constexpr (!CM::skipLinkValidation)
557 {
558 if (obj.getIndex() < offsets[event] || obj.getIndex() >= offsets[event+1])
559 detail::throwVariantLinkOutsideEvent (m_targets->columnName, obj.getIndex(), event);
560 }
561 static_cast<typename CM::LinkKeyColumnType*>(dataArea[m_keyIndex])[index] = (*m_targetKeys)[variantIndex].front();
562 static_cast<typename CM::LinkIndexColumnType*>(dataArea[m_indexIndex])[index] = obj.getIndex() - offsets[event];
563 }
564
565 [[nodiscard]] bool isAvailable (void** dataArea) const noexcept
566 {
567 if (dataArea[m_keyIndex] == nullptr || dataArea[m_indexIndex] == nullptr || dataArea[m_eventIndex] == nullptr)
568 return false;
569 for (unsigned offsetIndex : m_targets->offsetIndices)
570 {
571 if (dataArea[offsetIndex] == nullptr)
572 return false;
573 }
574 return true;
575 }
576
579 [[nodiscard]] auto targetKeys () const noexcept
580 {
581 std::array<typename CM::LinkKeyColumnType,VariantCI::numVariants> result {};
582 for (unsigned i = 0; i < VariantCI::numVariants; ++ i)
583 result[i] = (*m_targetKeys)[i].front();
584 return result;
585 }
586
589 [[nodiscard]] const auto& allTargetKeys () const noexcept
590 {
591 return *m_targetKeys;
592 }
593
594
595
598 private:
599
600 std::shared_ptr<typename Link::KeyArray> m_targetKeys;
601 std::unique_ptr<typename Link::Targets> m_targets;
602 unsigned m_keyIndex = 0u;
603 std::unique_ptr<ColumnAccessorDataArray> m_keyData;
604 unsigned m_indexIndex = 0u;
605 std::unique_ptr<ColumnAccessorDataArray> m_indexData;
606 unsigned m_eventIndex = 0u;
607 std::unique_ptr<ColumnAccessorDataArray> m_eventData;
608 };
609
610
611
612 // the links with the implicit types redirect to the typed links
614 requires (CM::useKeyIndexAsLink)
616 {
619 public:
620
621 using VariantCI = VariantContainerId<CIBase,CIList...>;
623
624 static constexpr bool isDefined = true;
625 static constexpr unsigned internalOffsetColumns = BaseAccessor::internalOffsetColumns;
626
628
629 ContainerFreeAccessor (ColumnarTool<CM>& columnarTool, ColumnAccessorOptions&& options, ColumnAccessorOptionsArray&& optionsArray)
630 : m_accessor (columnarTool, std::move (options), std::move (optionsArray))
631 {}
632
633 auto operator () (void** dataArea, std::size_t index) const noexcept
634 requires (CAM == ColumnAccessMode::input)
635 {
636 return m_accessor.link (dataArea, index);
637 }
638
639 [[nodiscard]] auto operator () (void** dataArea, std::size_t beginIndex, std::size_t endIndex) const noexcept
640 requires (CAM == ColumnAccessMode::input)
641 {
642 return m_accessor.links (dataArea, beginIndex, endIndex);
643 }
644
645 template<ContainerIdConcept CI2>
646 requires (CAM == ColumnAccessMode::output && VariantCI::template isValidContainer<CI2>())
647 void set (void** dataArea, std::size_t index, ObjectId<CI2,CM> obj) const
648 {
649 m_accessor.set (dataArea, index, obj);
650 }
651
652 [[nodiscard]] bool isAvailable (void** dataArea) const noexcept
653 {
654 return m_accessor.isAvailable (dataArea);
655 }
656
659 [[nodiscard]] auto targetKeys () const noexcept
660 {
661 return m_accessor.targetKeys ();
662 }
663
666 [[nodiscard]] const auto& allTargetKeys () const noexcept
667 {
668 return m_accessor.allTargetKeys ();
669 }
670
673 private:
674
676 };
677 }
678}
679
680#endif
uint32_t CLID
The Class ID type.
std::vector< std::vector< int64_t > > indices
void operator()(T1)
the base class for all columnar components
a class representing a single object (electron, muons, etc.)
a class representing a single optional object (electron, muons, etc.)
auto link(void **dataArea, std::size_t index) const noexcept
get the ObjectLink for the given index
auto targetKeys() const noexcept
the keys of the target containers based on their own types, in the order of the variants
ContainerFreeAccessor(ColumnarTool< CM > &columnarTool, ColumnAccessorOptions &&options, ColumnAccessorOptionsArray &&optionsArray)
auto links(void **dataArea, std::size_t beginIndex, std::size_t endIndex) const noexcept
get the ObjectLink objects for the given index range
const auto & allTargetKeys() const noexcept
all the keys accepted for the target containers, in the order of the variants
a help implementation of AccessorTemplate that handles type conversions
concept for a container id
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition sgkey_t.h:32
bool isNullLink(typename CM::LinkKeyColumnType key, typename CM::LinkIndexColumnType index) noexcept
whether the given key and index represent a null link
Definition LinkColumn.h:181
std::size_t resolveLinkIndex(void **dataArea, unsigned targetOffsetsIndex, ColumnarOffsetType event, std::size_t index, const std::string &columnName)
convert the event-relative index of a link into an index into the target column, checking it is insid...
Definition LinkColumn.h:232
void addLinkClid(std::vector< CLID > &clids, CLID clid)
add a CLID to the list of CLIDs a link accepts
Definition LinkColumn.h:190
void throwVariantLinkUnknownKey(const std::string &columnName, SG::sgkey_t key, ColumnarOffsetType event)
throw the exception for a link key that doesn't match any of the variants
void fillLinkKeys(std::vector< SG::sgkey_t > &keys, const std::string &name, const std::vector< CLID > &clids)
calculate the keys a link accepts for the given container name
Definition LinkColumn.h:197
VectorConvertView(FunctionType &&, ViewType &&) -> VectorConvertView< std::decay_t< FunctionType >, std::decay_t< ViewType > >
bool isLinkKey(const std::vector< SG::sgkey_t > &keys, SG::sgkey_t key) noexcept
whether the given key is in the list of accepted keys
Definition LinkColumn.h:205
typename LinkClidTypeImp< CI >::type LinkClidType
Definition LinkColumn.h:41
void throwVariantLinkOutsideEvent(const std::string &columnName, std::size_t objectIndex, ColumnarOffsetType event)
throw the exception for a link target that is not in the same event as the link
CLID linkTargetClid()
the CLID of the xAOD container a link column targets, or 0 if the container id does not provide one
Definition LinkColumn.h:117
void moveAccessor(unsigned &dataIndex, std::unique_ptr< ColumnAccessorDataArray > &accessorData, unsigned &sourceIndex, std::unique_ptr< ColumnAccessorDataArray > &sourceData)
bool operator==(const ObjectId< CI, ColumnarModeXAOD > &lhs, const ObjectId< CI, ColumnarModeXAOD > &rhs)
Definition ObjectId.h:82
constexpr std::string_view eventContextCIName
the name for the event context container id
ColumnAccessMode
an enum for the different access modes for a column
Definition ColumnInfo.h:20
@ output
an output column
Definition ColumnInfo.h:25
@ input
an input column
Definition ColumnInfo.h:22
void setColumnType(ColumnInfo &info) noexcept
set the type information in the ColumnInfo for the given C++ type
Definition ColumnInfo.h:227
std::size_t ColumnarOffsetType
the type used for the size and offsets in the columnar data
std::ostream & operator<<(std::ostream &str, const ObjectId< CI, ColumnarModeXAOD > &obj)
Definition ObjectId.h:76
Definition index.py:1
STL namespace.
a struct that contains meta-information about each column that's needed to interface the column with ...
Definition ColumnInfo.h:73
std::string offsetName
the name of the offset column used for this column (or empty string for none)
Definition ColumnInfo.h:120
bool isOptional
whether this column is optional
Definition ColumnInfo.h:167
bool isEventIndex
whether this is the index of the event for each entry
Definition ColumnInfo.h:182
bool isOffset
whether this is an offset column
Definition ColumnInfo.h:138
a special column type that behaves like an OptObjectId, but applies an internal cast in xAOD mode
Definition LinkColumn.h:95
a "variant" ContainerId
Definition VariantDef.h:98
typename CIBase::xAODObjectIdType xAODObjectIdType
Definition VariantDef.h:120
the number of distinct types in a list of types, ignoring void
Definition LinkColumn.h:49
the offset maps of the targets of a key+index variant link
std::array< std::unique_ptr< ColumnAccessorDataArray >, numVariants > offsetData