ATLAS Offline Software
JemSubBlock.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_JEMSUBBLOCK_H
6 #define TRIGT1CALOBYTESTREAM_JEMSUBBLOCK_H
7 
8 #include <stdint.h>
9 #include <vector>
10 
11 #include "L1CaloSubBlock.h"
12 
13 namespace LVL1BS {
14 
15 class JemJetElement;
16 
25 class JemSubBlock : public L1CaloSubBlock {
26 
27  public:
28  JemSubBlock();
29  ~JemSubBlock();
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 
127 inline int JemSubBlock::sourceId(const uint32_t word) const
128 {
129  return (word >> s_sourceIdBit) & s_sourceIdMask;
130 }
131 
132 inline int JemSubBlock::dataId(const uint32_t word) const
133 {
134  return (word >> s_dataIdBit) & s_dataIdMask;
135 }
136 
137 } // end namespace
138 
139 #endif
LVL1BS::JemSubBlock::packNeutral
bool packNeutral()
Pack neutral data.
Definition: JemSubBlock.cxx:263
LVL1BS::JemSubBlock::s_sumIndicator
static const int s_sumIndicator
Definition: JemSubBlock.h:87
LVL1BS::JemSubBlock::s_etMask
static const uint32_t s_etMask
Definition: JemSubBlock.h:91
et
Extra patterns decribing particle interation process.
LVL1BS::JemJetElement
JEM jet element dataword class.
Definition: JemJetElement.h:20
LVL1BS::JemSubBlock::~JemSubBlock
~JemSubBlock()
Definition: JemSubBlock.cxx:55
LVL1BS::JemSubBlock::setEnergySubsums
void setEnergySubsums(int slice, unsigned int ex, unsigned int ey, unsigned int et)
Store energy subsum data.
Definition: JemSubBlock.cxx:111
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
LVL1BS::JemSubBlock::s_hitPaddingBits
static const int s_hitPaddingBits
Definition: JemSubBlock.h:99
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
LVL1BS::JemSubBlock::jetElement
JemJetElement jetElement(int slice, int channel) const
Return jet element for given channel.
Definition: JemSubBlock.cxx:129
LVL1BS::JemSubBlock::s_sourceIdMask
static const uint32_t s_sourceIdMask
Definition: JemSubBlock.h:81
LVL1BS::JemSubBlock::JemSubBlock
JemSubBlock()
Definition: JemSubBlock.cxx:51
LVL1BS::JemSubBlock::s_mainFwdThreshId
static const int s_mainFwdThreshId
Definition: JemSubBlock.h:78
LVL1BS::JemSubBlock::s_threshBit
static const int s_threshBit
Definition: JemSubBlock.h:73
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1BS::JemSubBlock::s_jeWordId
static const int s_jeWordId
Definition: JemSubBlock.h:70
LVL1BS::JemSubBlock::s_jetElementBits
static const int s_jetElementBits
Definition: JemSubBlock.h:94
LVL1BS::JemSubBlock::jetHits
unsigned int jetHits(int slice) const
Return jet hit counts.
Definition: JemSubBlock.cxx:141
LVL1BS::JemSubBlock::packUncompressed
bool packUncompressed()
Pack uncompressed data.
Definition: JemSubBlock.cxx:306
LVL1BS::JemSubBlock::timeslices
int timeslices() const
Return number of timeslices.
Definition: JemSubBlock.cxx:185
LVL1BS::JemSubBlock::s_bunchCrossingBits
static const int s_bunchCrossingBits
Definition: JemSubBlock.h:98
LVL1BS::JemSubBlock
Sub-Block class for JEM data.
Definition: JemSubBlock.h:25
LVL1BS::JemSubBlock::dataId
int dataId(uint32_t word) const
Definition: JemSubBlock.h:132
LVL1BS::JemSubBlock::s_exBit
static const int s_exBit
Definition: JemSubBlock.h:83
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
LVL1BS::JemSubBlock::s_eyBit
static const int s_eyBit
Definition: JemSubBlock.h:84
LVL1BS::JemSubBlock::s_dataIdMask
static const uint32_t s_dataIdMask
Definition: JemSubBlock.h:71
LVL1BS::L1CaloSubBlock::slice
int slice() const
Definition: L1CaloSubBlock.h:258
LVL1BS::JemSubBlock::resize
void resize(std::vector< uint32_t > &vec, int channels=1)
Definition: JemSubBlock.cxx:252
LVL1BS::JemSubBlock::s_sourceIdBit
static const int s_sourceIdBit
Definition: JemSubBlock.h:74
dq_defect_copy_defect_database.channels
def channels
Definition: dq_defect_copy_defect_database.py:56
LVL1BS::JemSubBlock::s_wordIdVal
static const int s_wordIdVal
JEM header word ID.
Definition: JemSubBlock.h:65
LVL1BS::L1CaloSubBlock::crate
int crate() const
Definition: L1CaloSubBlock.h:263
LVL1BS::JemSubBlock::m_jetHits
std::vector< uint32_t > m_jetHits
Jet hit counts.
Definition: JemSubBlock.h:119
LVL1BS::JemSubBlock::s_threshWordId
static const uint32_t s_threshWordId
Definition: JemSubBlock.h:79
LVL1BS::JemSubBlock::setJetHits
void setJetHits(int slice, unsigned int hits)
Store jet hit counts.
Definition: JemSubBlock.cxx:93
LVL1BS::JemSubBlock::s_etBit
static const int s_etBit
Definition: JemSubBlock.h:85
L1CaloSubBlock.h
LVL1BS::JemSubBlock::index
int index(int slice) const
Definition: JemSubBlock.cxx:245
LVL1BS::JemSubBlock::m_channels
int m_channels
Number of jet element channels.
Definition: JemSubBlock.h:123
LVL1BS::JemSubBlock::unpackNeutral
bool unpackNeutral()
Unpack neutral data.
Definition: JemSubBlock.cxx:325
LVL1BS::L1CaloSubBlock::format
int format() const
Definition: L1CaloSubBlock.h:248
LVL1BS::JemSubBlock::m_jeData
std::vector< uint32_t > m_jeData
Jet element data.
Definition: JemSubBlock.h:117
LVL1BS::JemSubBlock::s_dataIdBit
static const int s_dataIdBit
Definition: JemSubBlock.h:69
LVL1BS::JemSubBlock::s_eyMask
static const uint32_t s_eyMask
Definition: JemSubBlock.h:90
LVL1BS::JemSubBlock::s_wordLength
static const int s_wordLength
Data word length.
Definition: JemSubBlock.h:67
LVL1BS::JemSubBlock::unpackUncompressed
bool unpackUncompressed()
Unpack uncompressed data.
Definition: JemSubBlock.cxx:370
LVL1BS::L1CaloSubBlock::version
int version() const
Definition: L1CaloSubBlock.h:243
LVL1BS::JemSubBlock::s_jePaddingBits
static const int s_jePaddingBits
Definition: JemSubBlock.h:95
LVL1BS::JemSubBlock::s_jetHitsBits
static const int s_jetHitsBits
Definition: JemSubBlock.h:96
LVL1BS::JemSubBlock::et
unsigned int et(int slice) const
Return energy subsum Et.
Definition: JemSubBlock.cxx:174
LVL1BS::L1CaloSubBlock::module
int module() const
Definition: L1CaloSubBlock.h:268
LVL1BS::JemSubBlock::s_jetIndicatorBit
static const int s_jetIndicatorBit
Definition: JemSubBlock.h:75
LVL1BS::L1CaloSubBlock
L1Calo Sub-Block base class.
Definition: L1CaloSubBlock.h:24
LVL1BS::JemSubBlock::sourceId
int sourceId(uint32_t word) const
Definition: JemSubBlock.h:127
LVL1BS::JemSubBlock::setJemHeader
void setJemHeader(int version, int format, int slice, int crate, int module, int timeslices)
Store JEM header.
Definition: JemSubBlock.cxx:71
LVL1BS::JemSubBlock::m_energySubsums
std::vector< uint32_t > m_energySubsums
Energy subsum data.
Definition: JemSubBlock.h:121
LVL1BS::JemSubBlock::s_sumIndicatorBit
static const int s_sumIndicatorBit
Definition: JemSubBlock.h:86
LVL1BS::JemSubBlock::unpack
bool unpack()
Unpack data.
Definition: JemSubBlock.cxx:219
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
LVL1BS::JemSubBlock::clear
void clear()
Clear all data.
Definition: JemSubBlock.cxx:61
LVL1BS::JemSubBlock::ex
unsigned int ex(int slice) const
Return energy subsum Ex.
Definition: JemSubBlock.cxx:152
LVL1BS::JemSubBlock::s_jetIndicator
static const int s_jetIndicator
Definition: JemSubBlock.h:76
LVL1BS::JemSubBlock::ey
unsigned int ey(int slice) const
Return energy subsum Ey.
Definition: JemSubBlock.cxx:163
LVL1BS::JemSubBlock::s_threshMask
static const uint32_t s_threshMask
Definition: JemSubBlock.h:80
LVL1BS::JemSubBlock::s_glinkBitsPerSlice
static const int s_glinkBitsPerSlice
Definition: JemSubBlock.h:100
LVL1BS::JemSubBlock::s_subsumId
static const int s_subsumId
Definition: JemSubBlock.h:88
LVL1BS::JemSubBlock::s_mainThreshId
static const int s_mainThreshId
Definition: JemSubBlock.h:77
LVL1BS::JemSubBlock::s_pairsPerPin
static const int s_pairsPerPin
Definition: JemSubBlock.h:93
LVL1BS::JemSubBlock::pack
bool pack()
Pack data.
Definition: JemSubBlock.cxx:197
LVL1BS::JemSubBlock::s_energyBits
static const int s_energyBits
Definition: JemSubBlock.h:97
LVL1BS::JemSubBlock::fillJetElement
void fillJetElement(int slice, const JemJetElement &jetEle)
Store jet element data.
Definition: JemSubBlock.cxx:80
LVL1BS::JemSubBlock::s_exMask
static const uint32_t s_exMask
Definition: JemSubBlock.h:89