ATLAS Offline Software
Loading...
Searching...
No Matches
JemSubBlockV1.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_JEMSUBBLOCKV1_H
6#define TRIGT1CALOBYTESTREAM_JEMSUBBLOCKV1_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 setJetHits(int slice, unsigned int hits);
42 void setEnergySubsums(int slice, unsigned int ex,
43 unsigned int ey, unsigned int et);
44
46 JemJetElement jetElement(int slice, int channel) const;
48 unsigned int jetHits(int slice) const;
50 unsigned int ex(int slice) const;
52 unsigned int ey(int slice) const;
54 unsigned int et(int slice) const;
56 int timeslices() const;
57
59 bool pack();
61 bool unpack();
62
63 private:
65 static const int s_wordIdVal = 0xc;
67 static const int s_wordLength = 32;
68 // Jet Element data word bit positions and masks
69 static const int s_dataIdBit = 30;
70 static const int s_jeWordId = 0x1;
71 static const uint32_t s_dataIdMask = 0x3;
72 // Jet hit counts bit positions and masks
73 static const int s_threshBit = 0;
74 static const int s_sourceIdBit = 25;
75 static const int s_jetIndicatorBit = 24;
76 static const int s_jetIndicator = 0x0;
77 static const int s_mainThreshId = 20;
78 static const int s_mainFwdThreshId = 21;
79 static const uint32_t s_threshWordId = 0x2;
80 static const uint32_t s_threshMask = 0xffffff;
81 static const uint32_t s_sourceIdMask = 0x1f;
82 // Energy subsum data bit positions and masks
83 static const int s_exBit = 0;
84 static const int s_eyBit = 8;
85 static const int s_etBit = 16;
86 static const int s_sumIndicatorBit = 24;
87 static const int s_sumIndicator = 0x1;
88 static const int s_subsumId = 22;
89 static const uint32_t s_exMask = 0xff;
90 static const uint32_t s_eyMask = 0xff;
91 static const uint32_t s_etMask = 0xff;
92 // Neutral format data lengths
93 static const int s_pairsPerPin = 3;
94 static const int s_jetElementBits = 9;
95 static const int s_jePaddingBits = 22;
96 static const int s_jetHitsBits = 24;
97 static const int s_energyBits = 8;
98 static const int s_bunchCrossingBits = 12;
99 static const int s_hitPaddingBits = 4;
100 static const int s_glinkBitsPerSlice = 67;
101
102 int sourceId(uint32_t word) const;
103 int dataId(uint32_t word) const;
104 int index(int slice) const;
105 void resize(std::vector<uint32_t>& vec, int channels = 1);
106
108 bool packNeutral();
110 bool packUncompressed();
112 bool unpackNeutral();
114 bool unpackUncompressed();
115
117 std::vector<uint32_t> m_jeData;
119 std::vector<uint32_t> m_jetHits;
121 std::vector<uint32_t> m_energySubsums;
124
125};
126
127inline int JemSubBlockV1::sourceId(const uint32_t word) const
128{
129 return (word >> s_sourceIdBit) & s_sourceIdMask;
130}
131
132inline int JemSubBlockV1::dataId(const uint32_t word) const
133{
134 return (word >> s_dataIdBit) & s_dataIdMask;
135}
136
137} // end namespace
138
139#endif
std::vector< size_t > vec
JEM jet element dataword class.
std::vector< uint32_t > m_energySubsums
Energy subsum data.
static const int s_sumIndicator
static const int s_glinkBitsPerSlice
std::vector< uint32_t > m_jetHits
Jet hit counts.
int timeslices() const
Return number of timeslices.
bool packNeutral()
Pack neutral data.
static const int s_mainThreshId
static const int s_pairsPerPin
void clear()
Clear all data.
void fillJetElement(int slice, const JemJetElement &jetEle)
Store jet element data.
static const uint32_t s_threshWordId
std::vector< uint32_t > m_jeData
Jet element data.
bool pack()
Pack data.
void setJemHeader(int version, int format, int slice, int crate, int module, int timeslices)
Store JEM header.
unsigned int et(int slice) const
Return energy subsum Et.
static const int s_jetIndicator
static const int s_mainFwdThreshId
static const int s_jetIndicatorBit
static const int s_jeWordId
unsigned int jetHits(int slice) const
Return jet hit counts.
int sourceId(uint32_t word) const
static const int s_sourceIdBit
void resize(std::vector< uint32_t > &vec, int channels=1)
static const uint32_t s_eyMask
static const int s_exBit
static const int s_wordIdVal
JEM header word ID.
static const uint32_t s_sourceIdMask
bool unpackUncompressed()
Unpack uncompressed data.
static const uint32_t s_etMask
static const int s_jetElementBits
static const uint32_t s_exMask
static const int s_wordLength
Data word length.
bool packUncompressed()
Pack uncompressed data.
static const int s_hitPaddingBits
bool unpackNeutral()
Unpack neutral data.
JemJetElement jetElement(int slice, int channel) const
Return jet element for given channel.
static const uint32_t s_threshMask
static const int s_energyBits
static const int s_jePaddingBits
static const int s_jetHitsBits
static const int s_eyBit
static const int s_etBit
static const int s_bunchCrossingBits
unsigned int ex(int slice) const
Return energy subsum Ex.
static const int s_dataIdBit
static const int s_subsumId
int m_channels
Number of jet element channels.
bool unpack()
Unpack data.
void setJetHits(int slice, unsigned int hits)
Store jet hit counts.
static const uint32_t s_dataIdMask
static const int s_sumIndicatorBit
void setEnergySubsums(int slice, unsigned int ex, unsigned int ey, unsigned int et)
Store energy subsum data.
int dataId(uint32_t word) const
static const int s_threshBit
unsigned int ey(int slice) const
Return energy subsum Ey.
Definition index.py:1