ATLAS Offline Software
Loading...
Searching...
No Matches
PhaseIIPixelRawDataContainer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4#ifndef PHASEII_PIXELRAWDATACONTAINER_H
5#define PHASEII_PIXELRAWDATACONTAINER_H
6
10
11#include <vector>
12#include <cstdint>
13
14namespace PhaseII {
15
19 protected:
20 // helper constatnts to unpack the bit packed information from the data word.
21 // To extract the data the bits are shifted first and then the mask is applied
22 static constexpr std::uint32_t MASK_TOT = 0xFF;
23 static constexpr unsigned int SHIFT_TOT = 0;
24 static constexpr std::uint32_t MASK_BCID = 0xFF;
25 static constexpr unsigned int SHIFT_BCID = 8;
26 static constexpr std::uint32_t MASK_LVL1D = 0xFF;
27 static constexpr unsigned int SHIFT_LVL1D = 16;
28 static constexpr std::uint32_t MASK_LVL1A = 0xF;
29 static constexpr unsigned int SHIFT_LVL1A = 24;
30
31 private:
32 // an addtional error container which will be filled by the bytestream converter.
33 // It will container first one value per module for module specific errors, then
34 // one value per module times max. number of front-ends for front-end specific
35 // errors.
36 // @TODO Currently just follows the same design of IDCInDetBSErrContainer, but it should get an interface.
37 std::vector<std::uint64_t> m_errors;
38
39 public:
40 // convenience methods to interpret the data word.
41 static int getToT(std::uint32_t dataWord) { return unpack(MASK_TOT, SHIFT_TOT, dataWord); }
42 static int getBCID(std::uint32_t dataWord) { return unpack(MASK_BCID, SHIFT_BCID, dataWord); }
43 static int getLVL1A(std::uint32_t dataWord) { return unpack(MASK_LVL1A, SHIFT_LVL1A, dataWord); }
44 static int getLVL1ID(std::uint32_t dataWord) { return unpack(MASK_LVL1D, SHIFT_LVL1D, dataWord); }
45
46 // create the bit packed data word.
47 static std::uint32_t makeWord( int tot, int bcid, int lvl1a, int lvl1d) {
48 return pack(MASK_TOT, SHIFT_TOT, tot)
49 | pack(MASK_BCID, SHIFT_BCID, bcid)
50 | pack(MASK_LVL1A, SHIFT_LVL1A, lvl1a)
51 | pack(MASK_LVL1D, SHIFT_LVL1D, lvl1d);
52 }
53
54 // get the associated error container which can be empty or has one element per module + module * max. number of front-ends/per-module.
55 const std::vector<std::uint64_t> &errors() const { return m_errors; }
56 // get the associated error container which can be empty or should have one element per module + module * max. number of front-ends/per-module (read/write).
57 std::vector<std::uint64_t> &errors() { return m_errors; }
58 };
59
61 template <AccessPolicy accessPolicy=AccessPolicy::ReadOnly>
62 class PixelRawDataProxy : public RawDataProxyBase<PhaseII::PixelRawDataContainer, accessPolicy >
63 {
64 public:
66 using BASE::BASE;
67
68 int getToT() const { return PixelRawDataContainer::getToT(this->dataWord()); }
69 int getBCID() const { return PixelRawDataContainer::getBCID(this->dataWord()); }
70 int getLVL1A() const { return PixelRawDataContainer::getLVL1A(this->dataWord()); }
71 int getLVL1ID() const { return PixelRawDataContainer::getLVL1ID(this->dataWord()); }
72 };
73
74 // provide means to RawDataCollectionProxies to discover the RDO proxy type to be used for a certain i.e. pixel RDO container.
75 namespace RawData {
76 namespace details {
77 template <>
79 template <AccessPolicy accessPolicy>
81 };
82 }
83 }
84
85 // Define all the proxies for read only access of the pixel raw data
86 template <AccessPolicy accessPolicy=AccessPolicy::ReadOnly>
88}
89
90// Pool converter do not like namespaces
92
94#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
declare to which family the container belongs as far as its indexing policy is concerned
PhaseII::PixelRawDataContainerCollectionTypes<>::ContainerCollection PhaseIIPixelRawDataContainer
Base raw data container which provides coordinates of a certain dimension and a data word per RDO (ra...
static constexpr int unpack(std::uint32_t mask, unsigned int shift, unsigned int word)
static constexpr std::uint32_t pack(std::uint32_t mask, unsigned int shift, int input)
const std::uint32_t & dataWord(unsigned int index) const
The container for pixel RDOs The base class is the InDetRawDataContainer with a coordinate dimension ...
static constexpr std::uint32_t MASK_LVL1A
static constexpr std::uint32_t MASK_LVL1D
static constexpr unsigned int SHIFT_TOT
static std::uint32_t makeWord(int tot, int bcid, int lvl1a, int lvl1d)
static constexpr unsigned int SHIFT_LVL1D
static int getToT(std::uint32_t dataWord)
std::vector< std::uint64_t > & errors()
static constexpr unsigned int SHIFT_BCID
static int getLVL1A(std::uint32_t dataWord)
static constexpr std::uint32_t MASK_TOT
static int getLVL1ID(std::uint32_t dataWord)
static constexpr std::uint32_t MASK_BCID
static constexpr unsigned int SHIFT_LVL1A
static int getBCID(std::uint32_t dataWord)
const std::vector< std::uint64_t > & errors() const
A proxy for a pixel RDO which adds convenience methods to interpret the data word to the base proxy.
RawDataProxyBase< PhaseII::PixelRawDataContainer, accessPolicy > BASE
typename ContainerProxyBase< PhaseII::PixelRawDataContainer, unsigned int, accessPolicy >::template ElementProxyBase< accessPolicy > BASE
RawDataCollectionTypes< PixelRawDataContainer, accessPolicy > PixelRawDataContainerCollectionTypes
helper class to define all the proxies for a RDO container.
PhaseII::IndexedRanges< PixelRawDataContainer, std::atomic< PhaseII::DataRange > > ContainerCollection