ATLAS Offline Software
Loading...
Searching...
No Matches
columnar::ColumnarModeArray Struct Reference

#include <ColumnarDef.h>

Collaboration diagram for columnar::ColumnarModeArray:

Public Types

using LinkIndexType = std::size_t
 the type used for columns that represent element links
using LinkKeyType = std::uint8_t
 the type used for the key column

Static Public Member Functions

static LinkKeyType getLinkKey (LinkIndexType link)
 get the key value from a link value
static LinkIndexType getLinkIndex (LinkIndexType link)
 get the index value from a link value
static LinkIndexType mergeLinkKeyIndex (LinkIndexType key, LinkIndexType index)
 merge a key and index value into a link value

Static Public Attributes

static constexpr bool isXAOD = false
 Whether this is the xAOD mode.
static constexpr bool inPlaceReplace = false
 Whether for this columnar mode decorators that replace the original column will also refer to the input column.
static constexpr LinkIndexType invalidLinkValue = static_cast<LinkIndexType>(-1)
 the value used for an invalid link (a.k.a. empty/null link)
static constexpr unsigned linkKeyBits = 8
 the number of bits used for the key inside the link
static constexpr unsigned linkIndexBits = 8 * sizeof(LinkIndexType) - linkKeyBits
 various helper definitions
static constexpr LinkIndexType linkIndexMask = (static_cast<LinkIndexType>(1) << linkIndexBits) - 1

Detailed Description

Definition at line 32 of file ColumnarDef.h.

Member Typedef Documentation

◆ LinkIndexType

the type used for columns that represent element links

Element Link Definition

In general links are just represented by an integer index into the target container. However, for variant links (i.e. links pointing into one of multiple containers) we need to be able to identify the target container. This happens by using the top couple of bits of the index to identify the target container.

For variant links there is also an additional column that contains the keys for the target containers for each link, in the order the tool defined. If there are multiple accessors for the same variant link column, they will share the same key column and as such need to define the variant in the same way.

There are a couple of configurable aspects to this, like the exact types involved, as well as the number of bits used for the key, all of which can be configured through the columnar mode. Beyond that there are also a couple of helper functions and convenience definitions to avoid bit packing/unpacking code being repeated in multiple places.

Definition at line 68 of file ColumnarDef.h.

◆ LinkKeyType

the type used for the key column

Definition at line 77 of file ColumnarDef.h.

Member Function Documentation

◆ getLinkIndex()

LinkIndexType columnar::ColumnarModeArray::getLinkIndex ( LinkIndexType link)
inlinestatic

get the index value from a link value

Definition at line 91 of file ColumnarDef.h.

91 {
92 return link & linkIndexMask;
93 }
static constexpr LinkIndexType linkIndexMask
Definition ColumnarDef.h:83

◆ getLinkKey()

LinkKeyType columnar::ColumnarModeArray::getLinkKey ( LinkIndexType link)
inlinestatic

get the key value from a link value

Definition at line 86 of file ColumnarDef.h.

86 {
87 return link >> linkIndexBits;
88 }
static constexpr unsigned linkIndexBits
various helper definitions
Definition ColumnarDef.h:82

◆ mergeLinkKeyIndex()

LinkIndexType columnar::ColumnarModeArray::mergeLinkKeyIndex ( LinkIndexType key,
LinkIndexType index )
inlinestatic

merge a key and index value into a link value

Definition at line 96 of file ColumnarDef.h.

96 {
97 if (key >= (static_cast<LinkIndexType>(1) << linkKeyBits))
98 throw std::runtime_error ("link key too large to fit in link: " + std::to_string(key));
99 if (index & ~linkIndexMask)
100 throw std::runtime_error ("index too large to fit in link: " + std::to_string(index));
101 return index | (key << linkIndexBits);
102 }
str index
Definition DeMoScan.py:362
static constexpr unsigned linkKeyBits
the number of bits used for the key inside the link
Definition ColumnarDef.h:74
std::size_t LinkIndexType
the type used for columns that represent element links
Definition ColumnarDef.h:68

Member Data Documentation

◆ inPlaceReplace

bool columnar::ColumnarModeArray::inPlaceReplace = false
staticconstexpr

Whether for this columnar mode decorators that replace the original column will also refer to the input column.

This is very obscure, but can be queried if it avoids copying over the input column in the tool first.

Definition at line 42 of file ColumnarDef.h.

◆ invalidLinkValue

LinkIndexType columnar::ColumnarModeArray::invalidLinkValue = static_cast<LinkIndexType>(-1)
staticconstexpr

the value used for an invalid link (a.k.a. empty/null link)

Definition at line 71 of file ColumnarDef.h.

◆ isXAOD

bool columnar::ColumnarModeArray::isXAOD = false
staticconstexpr

Whether this is the xAOD mode.

Definition at line 35 of file ColumnarDef.h.

◆ linkIndexBits

unsigned columnar::ColumnarModeArray::linkIndexBits = 8 * sizeof(LinkIndexType) - linkKeyBits
staticconstexpr

various helper definitions

Definition at line 82 of file ColumnarDef.h.

◆ linkIndexMask

LinkIndexType columnar::ColumnarModeArray::linkIndexMask = (static_cast<LinkIndexType>(1) << linkIndexBits) - 1
staticconstexpr

Definition at line 83 of file ColumnarDef.h.

◆ linkKeyBits

unsigned columnar::ColumnarModeArray::linkKeyBits = 8
staticconstexpr

the number of bits used for the key inside the link

Definition at line 74 of file ColumnarDef.h.


The documentation for this struct was generated from the following file: