ATLAS Offline Software
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
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 More...
 
using LinkKeyType = std::uint8_t
 the type used for the key column More...
 

Static Public Member Functions

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

Static Public Attributes

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

static 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  }

◆ getLinkKey()

static 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  }

◆ mergeLinkKeyIndex()

static 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  }

Member Data Documentation

◆ inPlaceReplace

constexpr 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

constexpr 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

constexpr bool columnar::ColumnarModeArray::isXAOD = false
staticconstexpr

Whether this is the xAOD mode.

Definition at line 35 of file ColumnarDef.h.

◆ linkIndexBits

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

various helper definitions

Definition at line 82 of file ColumnarDef.h.

◆ linkIndexMask

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

Definition at line 83 of file ColumnarDef.h.

◆ linkKeyBits

constexpr 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:
index
Definition: index.py:1
columnar::ColumnarModeArray::linkIndexMask
static constexpr LinkIndexType linkIndexMask
Definition: ColumnarDef.h:83
columnar::ColumnarModeArray::linkIndexBits
static constexpr unsigned linkIndexBits
various helper definitions
Definition: ColumnarDef.h:82
columnar::ColumnarModeArray::LinkIndexType
std::size_t LinkIndexType
the type used for columns that represent element links
Definition: ColumnarDef.h:68
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
columnar::ColumnarModeArray::linkKeyBits
static constexpr unsigned linkKeyBits
the number of bits used for the key inside the link
Definition: ColumnarDef.h:74
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37