ATLAS Offline Software
Loading...
Searching...
No Matches
JemJetElement.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_JEMJETELEMENT_H
6#define TRIGT1CALOBYTESTREAM_JEMJETELEMENT_H
7
8#include <stdint.h>
9
10namespace LVL1BS {
11
19
21
22 public:
23 JemJetElement(uint32_t word);
24 JemJetElement(int chan, int emDat, int hadDat,
25 int emParErr, int hadParErr, int linkErr);
26
27 // Return jet element data
28 int channel() const;
29 int emData() const;
30 int hadData() const;
31 int emParity() const;
32 int hadParity() const;
33 int linkError() const;
34 int pair() const;
35 int pin() const;
36 int wordId() const;
37 uint32_t data() const;
38
39 private:
40 // Jet Element data word bit positions and masks
41 static const int s_emDataBit = 0;
42 static const int s_emParityBit = 9;
43 static const int s_hadDataBit = 10;
44 static const int s_hadParityBit = 19;
45 static const int s_linkErrorBit = 20;
46 static const int s_pairBit = 23;
47 static const int s_pinBit = 25;
48 static const int s_wordIdBit = 30;
49 static const int s_jeWordId = 0x1;
50 static const int s_pairsPerPin = 3;
51 static const int s_pairOffset = 1;
52 static const uint32_t s_emDataMask = 0x1ff;
53 static const uint32_t s_emParityMask = 0x1;
54 static const uint32_t s_hadDataMask = 0x1ff;
55 static const uint32_t s_hadParityMask = 0x1;
56 static const uint32_t s_linkErrorMask = 0x3;
57 static const uint32_t s_pairMask = 0x3;
58 static const uint32_t s_pinMask = 0x1f;
59 static const uint32_t s_wordIdMask = 0x3;
60
62 uint32_t m_data;
63
64};
65
66inline int JemJetElement::channel() const
67{
68 return s_pairsPerPin * pin() + pair() - s_pairOffset;
69}
70
71inline int JemJetElement::emData() const
72{
73 return (m_data >> s_emDataBit) & s_emDataMask;
74}
75
76inline int JemJetElement::hadData() const
77{
78 return (m_data >> s_hadDataBit) & s_hadDataMask;
79}
80
81inline int JemJetElement::emParity() const
82{
84}
85
86inline int JemJetElement::hadParity() const
87{
89}
90
91inline int JemJetElement::linkError() const
92{
94}
95
96inline int JemJetElement::pair() const
97{
98 return (m_data >> s_pairBit) & s_pairMask;
99}
100
101inline int JemJetElement::pin() const
102{
103 return (m_data >> s_pinBit) & s_pinMask;
104}
105
106inline int JemJetElement::wordId() const
107{
108 return (m_data >> s_wordIdBit) & s_wordIdMask;
109}
110
111inline uint32_t JemJetElement::data() const
112{
113 return m_data;
114}
115
116} // end namespace
117
118#endif
static const uint32_t s_hadParityMask
static const uint32_t s_emParityMask
static const int s_hadDataBit
static const int s_jeWordId
uint32_t data() const
static const int s_emParityBit
static const int s_pairOffset
uint32_t m_data
Jet element data.
static const uint32_t s_linkErrorMask
static const uint32_t s_emDataMask
static const int s_linkErrorBit
static const uint32_t s_pairMask
static const int s_pairBit
static const int s_hadParityBit
static const int s_pairsPerPin
static const uint32_t s_wordIdMask
static const int s_wordIdBit
static const int s_pinBit
static const uint32_t s_pinMask
JemJetElement(uint32_t word)
static const int s_emDataBit
static const uint32_t s_hadDataMask