Skip to content

Commit

Permalink
flatten directory structure and add docstring for VectorVectorElement…
Browse files Browse the repository at this point in the history
…Link
  • Loading branch information
nikoladze committed Nov 8, 2024
1 parent f02b67e commit bfca8f6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
8 changes: 6 additions & 2 deletions src/uproot/interpretation/known_forth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE

"""
This module defines known forth code for types it is known a priori.
This module provides known forth code and awkward forms for types where it is known a priori.
See :doc:`uproot.interpretation.known_forth.known_forth_of` for the function
that provides the lookup of known forth codes and :doc:`uproot.interpretation.known_forth.atlas.VectorVectorElementLink` for an
implementation used in ATLAS (D)AODs.
"""
from __future__ import annotations

import uproot
from uproot.interpretation.known_forth.atlas.element_link import VectorVectorElementLink
from uproot.interpretation.known_forth.atlas import VectorVectorElementLink

KNOWN_FORTH_DICT = {
"std::vector<std::vector<ElementLink<DataVector<xAOD::CaloCluster_v1>>>>": VectorVectorElementLink,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE

"""
This module defines known forth code for some ElementLink data types in ATLAS (D)AODs
This module defines ATLAS specific known forth code
"""

from __future__ import annotations
Expand All @@ -10,6 +10,23 @@


class VectorVectorElementLink:
"""
Known forth and awkward form for ``std::vector<std::vector<ElementLink<T>>`` types in ATLAS (D)AODs
The forth code was adjusted from what was provided in
``branch._complete_forth_code`` after running ``.array()`` once.
The binary data of one vector<vector<ElementLink<T>> looks as follows:
* 6 bytes header for the outer vector
* 4 bytes big endian uint for the size of the outer vector (node1)
* for each outer vector element:
* 4 bytes big endian uint for the size of the inner vector (node2)
* for each inner vector element:
* 20 bytes header for the ElementLink object
* 4 bytes big endian uint for the ``m_persKey`` member (node3)
* 4 bytes big endian uint for the ``m_persIndex`` member (node4)
"""

forth_code = """
input stream
Expand Down
5 changes: 0 additions & 5 deletions src/uproot/interpretation/known_forth/atlas/__init__.py

This file was deleted.

0 comments on commit bfca8f6

Please sign in to comment.