ATLAS Offline Software
Loading...
Searching...
No Matches
JemSubBlockV2.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGT1CALOBYTESTREAM_JEMSUBBLOCKV2_H
6#define TRIGT1CALOBYTESTREAM_JEMSUBBLOCKV2_H
7
8#include <stdint.h>
9#include <vector>
10
11#include "L1CaloSubBlock.h"
12
13namespace LVL1BS {
14
15class JemJetElement;
16
24
26
27 public:
30
32 void clear();
33
35 void setJemHeader(int version, int format, int slice, int crate,
36 int module, int timeslices);
38 void fillJetElement(int slice, const JemJetElement& jetEle);
40 void setEnergySubsums(int slice, unsigned int ex,
41 unsigned int ey, unsigned int et);
42
44 JemJetElement jetElement(int slice, int channel) const;
46 unsigned int ex(int slice) const;
48 unsigned int ey(int slice) const;
50 unsigned int et(int slice) const;
52 int timeslices() const;
53
55 bool pack();
57 bool unpack();
58
59 private:
61 static const int s_wordIdVal = 0xc;
63 static const int s_wordLength = 32;
64 // Jet Element data word bit positions and masks
65 static const int s_dataIdBit = 30;
66 static const int s_jeWordId = 0x1;
67 static const uint32_t s_dataIdMask = 0x3;
68 // Energy subsum data bit positions and masks
69 static const uint32_t s_energyWordId = 0x2;
70 static const int s_sourceIdBit = 28;
71 static const uint32_t s_sourceIdMask = 0x3;
72 static const int s_etId = 2;
73 static const int s_exEyId = 3;
74 static const int s_exBit = 0;
75 static const int s_eyBit = 14;
76 static const int s_etBit = 14;
77 static const uint32_t s_exMask = 0x3fff;
78 static const uint32_t s_eyMask = 0x3fff;
79 static const uint32_t s_etMask = 0x3fff;
80 // Neutral format data lengths
81 static const int s_pairsPerPin = 3;
82 static const int s_jetElementBits = 9;
83 static const int s_jePaddingBits = 22;
84 static const int s_energyBits = 14;
85 static const int s_bunchCrossingBits = 12;
86 static const int s_energyPaddingBits = 12;
87 static const int s_glinkBitsPerSlice = 67;
88
89 int sourceId(uint32_t word) const;
90 int dataId(uint32_t word) const;
91 int index(int slice, int channels) const;
92 void resize(std::vector<uint32_t>& vec, int channels);
93
95 bool packNeutral();
97 bool packUncompressed();
99 bool unpackNeutral();
101 bool unpackUncompressed();
102
104 std::vector<uint32_t> m_jeData;
106 std::vector<uint32_t> m_energySubsums;
111
112};
113
114inline int JemSubBlockV2::sourceId(const uint32_t word) const
115{
116 return (word >> s_sourceIdBit) & s_sourceIdMask;
117}
118
119inline int JemSubBlockV2::dataId(const uint32_t word) const
120{
121 return (word >> s_dataIdBit) & s_dataIdMask;
122}
123
124} // end namespace
125
126#endif
std::vector< size_t > vec
JEM jet element dataword class.
static const int s_etId
int timeslices() const
Return number of timeslices.
void fillJetElement(int slice, const JemJetElement &jetEle)
Store jet element data.
void clear()
Clear all data.
static const int s_etBit
std::vector< uint32_t > m_energySubsums
Energy subsum data.
static const int s_dataIdBit
static const int s_jePaddingBits
static const int s_eyBit
static const uint32_t s_eyMask
int dataId(uint32_t word) const
static const int s_energyBits
bool unpack()
Unpack data.
static const uint32_t s_dataIdMask
unsigned int ey(int slice) const
Return energy subsum Ey.
void resize(std::vector< uint32_t > &vec, int channels)
void setEnergySubsums(int slice, unsigned int ex, unsigned int ey, unsigned int et)
Store energy subsum data.
bool unpackNeutral()
Unpack neutral data.
bool packNeutral()
Pack neutral data.
static const int s_energyPaddingBits
unsigned int ex(int slice) const
Return energy subsum Ex.
static const int s_glinkBitsPerSlice
static const uint32_t s_exMask
int m_channels
Number of jet element channels.
static const int s_exEyId
void setJemHeader(int version, int format, int slice, int crate, int module, int timeslices)
Store JEM header.
static const int s_wordLength
Data word length.
static const int s_sourceIdBit
std::vector< uint32_t > m_jeData
Jet element data.
int sourceId(uint32_t word) const
static const int s_bunchCrossingBits
int m_energyWords
Number of energy data words.
static const int s_jeWordId
static const int s_wordIdVal
JEM header word ID.
bool unpackUncompressed()
Unpack uncompressed data.
static const int s_exBit
unsigned int et(int slice) const
Return energy subsum Et.
static const uint32_t s_energyWordId
static const uint32_t s_sourceIdMask
static const uint32_t s_etMask
bool pack()
Pack data.
static const int s_pairsPerPin
bool packUncompressed()
Pack uncompressed data.
static const int s_jetElementBits
JemJetElement jetElement(int slice, int channel) const
Return jet element for given channel.
Definition index.py:1