ATLAS Offline Software
Loading...
Searching...
No Matches
CmmJetSubBlock.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_CMMJETSUBBLOCK_H
6#define TRIGT1CALOBYTESTREAM_CMMJETSUBBLOCK_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_MAIN = 16, LOCAL_MAIN = 17, TOTAL_MAIN = 18,
29
32
34 void clear();
35
37 unsigned int jetHits(int slice, int source) const;
39 int jetHitsError(int slice, int source) const;
41 unsigned int jetEtMap(int slice) const;
42
44 void setJetHits(int slice, int source, unsigned int hits,
45 int error);
47 void setJetEtMap(int slice, unsigned int map);
48
50 bool pack();
52 bool unpack();
53
54 private:
56 static const int s_wordLength = 32;
57 // Jet hit counts bit positions and masks
58 static const int s_threshBit = 0;
59 static const int s_fwdErrorBit = 16;
60 static const int s_etMapBit = 17;
61 static const int s_threshErrorBit = 24;
62 static const int s_sourceIdBit = 25;
63 static const int s_dataWordIdBit = 30;
64 static const int s_dataWordId = 0;
65 static const int s_maxHits = 23;
66 static const uint32_t s_threshMask = 0xffffff;
67 static const uint32_t s_fwdMask = 0xffff;
68 static const uint32_t s_etMapMask = 0xf;
69 static const uint32_t s_errorMask = 0x1;
70 static const uint32_t s_sourceIdMask = 0x1f;
71 // Neutral format
72 static const int s_jetHitsBits = 24;
73 static const int s_jetHitsErrorBits = 1;
74 static const int s_fwdHitsBits = 16;
75 static const int s_bunchCrossingBits = 12;
76 static const int s_paddingBits = 8;
77 static const int s_rightBit = 8;
78 static const int s_fifoOverflowPin = 15;
79
80 int sourceId(uint32_t word) const;
81 int index(int slice, int source) const;
82 void resize();
83
85 bool packNeutral();
87 bool packUncompressed();
89 bool unpackNeutral();
91 bool unpackUncompressed();
92
94 std::vector<uint32_t> m_hitsData;
95
96};
97
98inline int CmmJetSubBlock::sourceId(const uint32_t word) const
99{
100 return (word >> s_sourceIdBit) & s_sourceIdMask;
101}
102
103} // end namespace
104
105#endif
static const int s_paddingBits
unsigned int jetHits(int slice, int source) const
Return jet hit counts for given jem or source ID.
bool unpackUncompressed()
Unpack uncompressed data.
std::vector< uint32_t > m_hitsData
JEM hits and sums data.
static const uint32_t s_etMapMask
bool packNeutral()
Pack neutral data.
static const int s_fwdHitsBits
static const int s_wordLength
Data word length.
static const int s_bunchCrossingBits
int jetHitsError(int slice, int source) const
Return jet hit error for given jem or source ID.
static const int s_threshErrorBit
static const int s_rightBit
bool packUncompressed()
Pack uncompressed data.
static const int s_dataWordId
static const uint32_t s_errorMask
static const int s_fifoOverflowPin
void setJetHits(int slice, int source, unsigned int hits, int error)
Store jet hit counts and error for given jem or source ID.
static const uint32_t s_sourceIdMask
static const uint32_t s_fwdMask
static const int s_fwdErrorBit
static const int s_threshBit
int sourceId(uint32_t word) const
static const int s_maxHits
void setJetEtMap(int slice, unsigned int map)
Store jet ET map.
static const int s_jetHitsBits
static const uint32_t s_threshMask
static const int s_dataWordIdBit
unsigned int jetEtMap(int slice) const
Return jet ET map.
void clear()
Clear all data.
bool unpackNeutral()
Unpack neutral data.
bool unpack()
Unpack data.
static const int s_sourceIdBit
static const int s_jetHitsErrorBits
static const int s_etMapBit
STL class.
Definition index.py:1