ATLAS Offline Software
Loading...
Searching...
No Matches
CmmEnergySubBlock.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGT1CALOBYTESTREAM_CMMENERGYSUBBLOCK_H
6#define TRIGT1CALOBYTESTREAM_CMMENERGYSUBBLOCK_H
7
8#include <stdint.h>
9#include <vector>
10
11#include "CmmSubBlock.h"
12
13namespace LVL1BS {
14
22
24
25 public:
26 enum SourceId { REMOTE = 20, LOCAL = 23, TOTAL = 26, MAX_SOURCE_ID };
27
30
32 void clear();
33
35 unsigned int ex(int slice, int source) const;
37 unsigned int ey(int slice, int source) const;
39 unsigned int et(int slice, int source) const;
41 int exError(int slice, int source) const;
43 int eyError(int slice, int source) const;
45 int etError(int slice, int source) const;
47 unsigned int missingEtHits(int slice) const;
49 unsigned int sumEtHits(int slice) const;
51 unsigned int missingEtSigHits(int slice) const;
52
54 void setSubsums(int slice, int source, unsigned int ex,
55 unsigned int ey, unsigned int et,
56 int exError, int eyError, int etError);
58 void setMissingEtHits(int slice, unsigned int map);
60 void setSumEtHits(int slice, unsigned int map);
62 void setMissingEtSigHits(int slice, unsigned int map);
63
65 bool pack();
67 bool unpack();
68
69 private:
71 static const int s_wordLength = 32;
72 // Energy subsums bit positions and masks
73 static const int s_exBit = 0;
74 static const int s_eyBit = 8;
75 static const int s_etBit = 16;
76 static const int s_jemErrorBit = 24;
77 static const int s_errorBit = 15;
78 static const int s_etMissBit = 16;
79 static const int s_etHitsBit = 16;
80 static const int s_etMissSigBit = 16;
81 static const int s_sourceIdBit = 25;
82 static const int s_dataWordIdBit = 30;
83 static const int s_dataWordId = 0;
84 static const int s_maxSums = 29;
85 static const int s_maxJems = 16;
86 static const uint32_t s_exMask = 0xff;
87 static const uint32_t s_eyMask = 0xff;
88 static const uint32_t s_etMask = 0xff;
89 static const uint32_t s_errorMask = 0x1;
90 static const uint32_t s_remoteErrorMask = 0x3;
91 static const uint32_t s_etMissMask = 0xff;
92 static const uint32_t s_etHitsMask = 0xff;
93 static const uint32_t s_etHitsMaskV1 = 0xf;
94 static const uint32_t s_etMissSigMask = 0xff;
95 static const uint32_t s_sumsMask = 0x7fff;
96 static const uint32_t s_sourceIdMask = 0x1f;
97 // Neutral format
98 static const int s_jemSumBits = 8;
99 static const int s_sumBits = 15;
100 static const int s_bunchCrossingBits = 12;
101 static const int s_paddingBits = 8;
102 static const int s_fifoOverflowPin = 15;
103
104 int sourceId(uint32_t word) const;
105 int index(int slice, int source) const;
106 void resize();
107
109 bool packNeutral();
111 bool packUncompressed();
113 bool unpackNeutral();
115 bool unpackUncompressed();
116
118 std::vector<uint32_t> m_sumsData;
119
120};
121
122inline int CmmEnergySubBlock::sourceId(const uint32_t word) const
123{
124 return (word >> s_sourceIdBit) & s_sourceIdMask;
125}
126
127} // end namespace
128
129#endif
int exError(int slice, int source) const
Return Ex subsum error for given JEM or source ID.
static const uint32_t s_exMask
void setMissingEtSigHits(int slice, unsigned int map)
Store Missing-ET-Sig Hits map.
bool unpackUncompressed()
Unpack uncompressed data.
static const int s_fifoOverflowPin
static const uint32_t s_remoteErrorMask
static const uint32_t s_etHitsMask
unsigned int ey(int slice, int source) const
Return Ey subsum for given JEM or source ID.
unsigned int et(int slice, int source) const
Return Et subsum for given JEM or source ID.
std::vector< uint32_t > m_sumsData
Energy subsums data.
static const uint32_t s_errorMask
void setSumEtHits(int slice, unsigned int map)
Store Sum-Et Hits map.
bool packNeutral()
Pack neutral data.
static const uint32_t s_etHitsMaskV1
static const int s_wordLength
Data word length.
void clear()
Clear all data.
static const int s_dataWordIdBit
bool packUncompressed()
Pack uncompressed data.
static const int s_etMissSigBit
bool unpackNeutral()
Unpack neutral data.
static const uint32_t s_etMissSigMask
unsigned int sumEtHits(int slice) const
Return Sum-Et Hits map.
int eyError(int slice, int source) const
Return Ey subsum error for given JEM or source ID.
unsigned int missingEtSigHits(int slice) const
Return Missing-ET-Sig Hits map.
static const uint32_t s_eyMask
static const uint32_t s_etMissMask
void setSubsums(int slice, int source, unsigned int ex, unsigned int ey, unsigned int et, int exError, int eyError, int etError)
Store energy subsums and errors for given JEM or source ID.
int sourceId(uint32_t word) const
static const int s_bunchCrossingBits
unsigned int missingEtHits(int slice) const
Return Missing-ET Hits map.
int etError(int slice, int source) const
Return Et subsum error for given JEM or source ID.
void setMissingEtHits(int slice, unsigned int map)
Store Missing-ET Hits map.
static const uint32_t s_etMask
static const uint32_t s_sumsMask
static const uint32_t s_sourceIdMask
unsigned int ex(int slice, int source) const
Return Ex subsum for given JEM or source ID.
STL class.
Definition index.py:1
Extra patterns decribing particle interation process.