ATLAS Offline Software
JemSubBlockV2.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_JEMSUBBLOCKV2_H
6 #define TRIGT1CALOBYTESTREAM_JEMSUBBLOCKV2_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 JemSubBlockV2 : public L1CaloSubBlock {
26 
27  public:
28  JemSubBlockV2();
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 setEnergySubsums(int slice, unsigned int ex,
41  unsigned int ey, unsigned int et);
42 
44  JemJetElement jetElement(int slice, int channel) const;
46  unsigned int ex(int slice) const;
48  unsigned int ey(int slice) const;
50  unsigned int et(int slice) const;
52  int timeslices() const;
53 
55  bool pack();
57  bool unpack();
58 
59  private:
61  static const int s_wordIdVal = 0xc;
63  static const int s_wordLength = 32;
64  // Jet Element data word bit positions and masks
65  static const int s_dataIdBit = 30;
66  static const int s_jeWordId = 0x1;
67  static const uint32_t s_dataIdMask = 0x3;
68  // Energy subsum data bit positions and masks
69  static const uint32_t s_energyWordId = 0x2;
70  static const int s_sourceIdBit = 28;
71  static const uint32_t s_sourceIdMask = 0x3;
72  static const int s_etId = 2;
73  static const int s_exEyId = 3;
74  static const int s_exBit = 0;
75  static const int s_eyBit = 14;
76  static const int s_etBit = 14;
77  static const uint32_t s_exMask = 0x3fff;
78  static const uint32_t s_eyMask = 0x3fff;
79  static const uint32_t s_etMask = 0x3fff;
80  // Neutral format data lengths
81  static const int s_pairsPerPin = 3;
82  static const int s_jetElementBits = 9;
83  static const int s_jePaddingBits = 22;
84  static const int s_energyBits = 14;
85  static const int s_bunchCrossingBits = 12;
86  static const int s_energyPaddingBits = 12;
87  static const int s_glinkBitsPerSlice = 67;
88 
89  int sourceId(uint32_t word) const;
90  int dataId(uint32_t word) const;
91  int index(int slice, int channels) const;
92  void resize(std::vector<uint32_t>& vec, int channels);
93 
95  bool packNeutral();
97  bool packUncompressed();
99  bool unpackNeutral();
101  bool unpackUncompressed();
102 
104  std::vector<uint32_t> m_jeData;
106  std::vector<uint32_t> m_energySubsums;
111 
112 };
113 
114 inline int JemSubBlockV2::sourceId(const uint32_t word) const
115 {
116  return (word >> s_sourceIdBit) & s_sourceIdMask;
117 }
118 
119 inline int JemSubBlockV2::dataId(const uint32_t word) const
120 {
121  return (word >> s_dataIdBit) & s_dataIdMask;
122 }
123 
124 } // end namespace
125 
126 #endif
LVL1BS::JemSubBlockV2::jetElement
JemJetElement jetElement(int slice, int channel) const
Return jet element for given channel.
Definition: JemSubBlockV2.cxx:109
et
Extra patterns decribing particle interation process.
LVL1BS::JemJetElement
JEM jet element dataword class.
Definition: JemJetElement.h:20
LVL1BS::JemSubBlockV2::s_wordLength
static const int s_wordLength
Data word length.
Definition: JemSubBlockV2.h:63
LVL1BS::JemSubBlockV2::unpackUncompressed
bool unpackUncompressed()
Unpack uncompressed data.
Definition: JemSubBlockV2.cxx:328
LVL1BS::JemSubBlockV2::s_bunchCrossingBits
static const int s_bunchCrossingBits
Definition: JemSubBlockV2.h:85
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
LVL1BS::JemSubBlockV2::s_exEyId
static const int s_exEyId
Definition: JemSubBlockV2.h:73
LVL1BS::JemSubBlockV2::ey
unsigned int ey(int slice) const
Return energy subsum Ey.
Definition: JemSubBlockV2.cxx:132
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1BS::JemSubBlockV2::unpackNeutral
bool unpackNeutral()
Unpack neutral data.
Definition: JemSubBlockV2.cxx:287
LVL1BS::JemSubBlockV2::clear
void clear()
Clear all data.
Definition: JemSubBlockV2.cxx:52
LVL1BS::JemSubBlockV2::s_jeWordId
static const int s_jeWordId
Definition: JemSubBlockV2.h:66
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
LVL1BS::JemSubBlockV2::m_channels
int m_channels
Number of jet element channels.
Definition: JemSubBlockV2.h:108
LVL1BS::JemSubBlockV2::s_exMask
static const uint32_t s_exMask
Definition: JemSubBlockV2.h:77
LVL1BS::L1CaloSubBlock::slice
int slice() const
Definition: L1CaloSubBlock.h:258
LVL1BS::JemSubBlockV2::s_energyBits
static const int s_energyBits
Definition: JemSubBlockV2.h:84
dq_defect_copy_defect_database.channels
def channels
Definition: dq_defect_copy_defect_database.py:56
LVL1BS::JemSubBlockV2::m_jeData
std::vector< uint32_t > m_jeData
Jet element data.
Definition: JemSubBlockV2.h:104
LVL1BS::L1CaloSubBlock::crate
int crate() const
Definition: L1CaloSubBlock.h:263
LVL1BS::JemSubBlockV2::s_sourceIdMask
static const uint32_t s_sourceIdMask
Definition: JemSubBlockV2.h:71
LVL1BS::JemSubBlockV2::s_etMask
static const uint32_t s_etMask
Definition: JemSubBlockV2.h:79
LVL1BS::JemSubBlockV2::s_glinkBitsPerSlice
static const int s_glinkBitsPerSlice
Definition: JemSubBlockV2.h:87
LVL1BS::JemSubBlockV2::m_energySubsums
std::vector< uint32_t > m_energySubsums
Energy subsum data.
Definition: JemSubBlockV2.h:106
LVL1BS::JemSubBlockV2::~JemSubBlockV2
~JemSubBlockV2()
Definition: JemSubBlockV2.cxx:46
LVL1BS::JemSubBlockV2::dataId
int dataId(uint32_t word) const
Definition: JemSubBlockV2.h:119
LVL1BS::JemSubBlockV2::packNeutral
bool packNeutral()
Pack neutral data.
Definition: JemSubBlockV2.cxx:232
L1CaloSubBlock.h
LVL1BS::JemSubBlockV2::et
unsigned int et(int slice) const
Return energy subsum Et.
Definition: JemSubBlockV2.cxx:143
LVL1BS::L1CaloSubBlock::format
int format() const
Definition: L1CaloSubBlock.h:248
LVL1BS::JemSubBlockV2::s_wordIdVal
static const int s_wordIdVal
JEM header word ID.
Definition: JemSubBlockV2.h:61
LVL1BS::JemSubBlockV2::setEnergySubsums
void setEnergySubsums(int slice, unsigned int ex, unsigned int ey, unsigned int et)
Store energy subsum data.
Definition: JemSubBlockV2.cxx:83
LVL1BS::JemSubBlockV2::s_eyBit
static const int s_eyBit
Definition: JemSubBlockV2.h:75
LVL1BS::JemSubBlockV2::s_dataIdBit
static const int s_dataIdBit
Definition: JemSubBlockV2.h:65
LVL1BS::JemSubBlockV2::s_eyMask
static const uint32_t s_eyMask
Definition: JemSubBlockV2.h:78
LVL1BS::JemSubBlockV2::s_jePaddingBits
static const int s_jePaddingBits
Definition: JemSubBlockV2.h:83
LVL1BS::JemSubBlockV2::s_jetElementBits
static const int s_jetElementBits
Definition: JemSubBlockV2.h:82
LVL1BS::L1CaloSubBlock::version
int version() const
Definition: L1CaloSubBlock.h:243
LVL1BS::JemSubBlockV2::packUncompressed
bool packUncompressed()
Pack uncompressed data.
Definition: JemSubBlockV2.cxx:268
LVL1BS::JemSubBlockV2::s_etId
static const int s_etId
Definition: JemSubBlockV2.h:72
LVL1BS::JemSubBlockV2::ex
unsigned int ex(int slice) const
Return energy subsum Ex.
Definition: JemSubBlockV2.cxx:121
LVL1BS::JemSubBlockV2::m_energyWords
int m_energyWords
Number of energy data words.
Definition: JemSubBlockV2.h:110
LVL1BS::JemSubBlockV2::s_energyPaddingBits
static const int s_energyPaddingBits
Definition: JemSubBlockV2.h:86
LVL1BS::L1CaloSubBlock::module
int module() const
Definition: L1CaloSubBlock.h:268
LVL1BS::JemSubBlockV2
Sub-Block class for JEM data post LS1.
Definition: JemSubBlockV2.h:25
LVL1BS::L1CaloSubBlock
L1Calo Sub-Block base class.
Definition: L1CaloSubBlock.h:24
LVL1BS::JemSubBlockV2::timeslices
int timeslices() const
Return number of timeslices.
Definition: JemSubBlockV2.cxx:154
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
LVL1BS::JemSubBlockV2::s_etBit
static const int s_etBit
Definition: JemSubBlockV2.h:76
LVL1BS::JemSubBlockV2::fillJetElement
void fillJetElement(int slice, const JemJetElement &jetEle)
Store jet element data.
Definition: JemSubBlockV2.cxx:70
LVL1BS::JemSubBlockV2::s_pairsPerPin
static const int s_pairsPerPin
Definition: JemSubBlockV2.h:81
LVL1BS::JemSubBlockV2::pack
bool pack()
Pack data.
Definition: JemSubBlockV2.cxx:166
LVL1BS::JemSubBlockV2::s_exBit
static const int s_exBit
Definition: JemSubBlockV2.h:74
LVL1BS::JemSubBlockV2::setJemHeader
void setJemHeader(int version, int format, int slice, int crate, int module, int timeslices)
Store JEM header.
Definition: JemSubBlockV2.cxx:61
LVL1BS::JemSubBlockV2::resize
void resize(std::vector< uint32_t > &vec, int channels)
Definition: JemSubBlockV2.cxx:221
LVL1BS::JemSubBlockV2::index
int index(int slice, int channels) const
Definition: JemSubBlockV2.cxx:214
LVL1BS::JemSubBlockV2::unpack
bool unpack()
Unpack data.
Definition: JemSubBlockV2.cxx:188
LVL1BS::JemSubBlockV2::s_sourceIdBit
static const int s_sourceIdBit
Definition: JemSubBlockV2.h:70
LVL1BS::JemSubBlockV2::sourceId
int sourceId(uint32_t word) const
Definition: JemSubBlockV2.h:114
LVL1BS::JemSubBlockV2::s_energyWordId
static const uint32_t s_energyWordId
Definition: JemSubBlockV2.h:69
LVL1BS::JemSubBlockV2::s_dataIdMask
static const uint32_t s_dataIdMask
Definition: JemSubBlockV2.h:67
LVL1BS::JemSubBlockV2::JemSubBlockV2
JemSubBlockV2()
Definition: JemSubBlockV2.cxx:42