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