ATLAS Offline Software
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 
13 namespace LVL1BS {
14 
23 class CmmJetSubBlock : public CmmSubBlock {
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 
98 inline int CmmJetSubBlock::sourceId(const uint32_t word) const
99 {
100  return (word >> s_sourceIdBit) & s_sourceIdMask;
101 }
102 
103 } // end namespace
104 
105 #endif
LVL1BS::CmmJetSubBlock::TOTAL_MAIN
@ TOTAL_MAIN
Definition: CmmJetSubBlock.h:26
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
LVL1BS::CmmJetSubBlock::s_rightBit
static const int s_rightBit
Definition: CmmJetSubBlock.h:77
LVL1BS::CmmJetSubBlock::s_threshBit
static const int s_threshBit
Definition: CmmJetSubBlock.h:58
LVL1BS::CmmJetSubBlock::index
int index(int slice, int source) const
Definition: CmmJetSubBlock.cxx:183
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1BS::CmmJetSubBlock::s_etMapBit
static const int s_etMapBit
Definition: CmmJetSubBlock.h:60
LVL1BS::CmmJetSubBlock::sourceId
int sourceId(uint32_t word) const
Definition: CmmJetSubBlock.h:98
LVL1BS::CmmJetSubBlock::jetEtMap
unsigned int jetEtMap(int slice) const
Return jet ET map.
Definition: CmmJetSubBlock.cxx:88
LVL1BS::CmmJetSubBlock::CmmJetSubBlock
CmmJetSubBlock()
Definition: CmmJetSubBlock.cxx:37
LVL1BS::CmmJetSubBlock::SourceId
SourceId
Definition: CmmJetSubBlock.h:26
LVL1BS::CmmJetSubBlock::packNeutral
bool packNeutral()
Pack neutral data.
Definition: CmmJetSubBlock.cxx:203
LVL1BS::CmmSubBlock
Sub-Block class for CMM data.
Definition: CmmSubBlock.h:22
LVL1BS::CmmJetSubBlock::m_hitsData
std::vector< uint32_t > m_hitsData
JEM hits and sums data.
Definition: CmmJetSubBlock.h:94
LVL1BS::L1CaloSubBlock::slice
int slice() const
Definition: L1CaloSubBlock.h:258
LVL1BS::CmmJetSubBlock::unpackNeutral
bool unpackNeutral()
Unpack neutral data.
Definition: CmmJetSubBlock.cxx:254
LVL1BS::CmmJetSubBlock::LOCAL_FORWARD
@ LOCAL_FORWARD
Definition: CmmJetSubBlock.h:27
LVL1BS::CmmJetSubBlock::s_errorMask
static const uint32_t s_errorMask
Definition: CmmJetSubBlock.h:69
LVL1BS::CmmJetSubBlock::s_dataWordIdBit
static const int s_dataWordIdBit
Definition: CmmJetSubBlock.h:63
LVL1BS::CmmJetSubBlock::s_jetHitsErrorBits
static const int s_jetHitsErrorBits
Definition: CmmJetSubBlock.h:73
LVL1BS::CmmJetSubBlock::REMOTE_FORWARD
@ REMOTE_FORWARD
Definition: CmmJetSubBlock.h:27
LVL1BS::CmmJetSubBlock::clear
void clear()
Clear all data.
Definition: CmmJetSubBlock.cxx:47
LVL1BS::CmmJetSubBlock::LOCAL_MAIN
@ LOCAL_MAIN
Definition: CmmJetSubBlock.h:26
LVL1BS::CmmJetSubBlock::packUncompressed
bool packUncompressed()
Pack uncompressed data.
Definition: CmmJetSubBlock.cxx:242
CmmSubBlock.h
LVL1BS::CmmJetSubBlock::s_fwdHitsBits
static const int s_fwdHitsBits
Definition: CmmJetSubBlock.h:74
LVL1BS::CmmJetSubBlock::s_sourceIdBit
static const int s_sourceIdBit
Definition: CmmJetSubBlock.h:62
LVL1BS::CmmJetSubBlock::s_paddingBits
static const int s_paddingBits
Definition: CmmJetSubBlock.h:76
LVL1BS::CmmJetSubBlock::jetHits
unsigned int jetHits(int slice, int source) const
Return jet hit counts for given jem or source ID.
Definition: CmmJetSubBlock.cxx:55
LVL1BS::CmmJetSubBlock::s_maxHits
static const int s_maxHits
Definition: CmmJetSubBlock.h:65
LVL1BS::CmmJetSubBlock::s_dataWordId
static const int s_dataWordId
Definition: CmmJetSubBlock.h:64
LVL1BS::CmmJetSubBlock::s_threshMask
static const uint32_t s_threshMask
Definition: CmmJetSubBlock.h:66
LVL1BS::CmmJetSubBlock::TOTAL_FORWARD
@ TOTAL_FORWARD
Definition: CmmJetSubBlock.h:27
LVL1BS::CmmJetSubBlock::s_fifoOverflowPin
static const int s_fifoOverflowPin
Definition: CmmJetSubBlock.h:78
LVL1BS::CmmJetSubBlock::unpack
bool unpack()
Unpack data.
Definition: CmmJetSubBlock.cxx:157
LVL1BS::CmmJetSubBlock::s_wordLength
static const int s_wordLength
Data word length.
Definition: CmmJetSubBlock.h:56
LVL1BS::CmmJetSubBlock::setJetHits
void setJetHits(int slice, int source, unsigned int hits, int error)
Store jet hit counts and error for given jem or source ID.
Definition: CmmJetSubBlock.cxx:99
LVL1BS::CmmJetSubBlock::s_sourceIdMask
static const uint32_t s_sourceIdMask
Definition: CmmJetSubBlock.h:70
LVL1BS::CmmJetSubBlock::setJetEtMap
void setJetEtMap(int slice, unsigned int map)
Store jet ET map.
Definition: CmmJetSubBlock.cxx:121
LVL1BS::CmmJetSubBlock::unpackUncompressed
bool unpackUncompressed()
Unpack uncompressed data.
Definition: CmmJetSubBlock.cxx:308
LVL1BS::CmmJetSubBlock
Sub-Block class for CMM-Jet data.
Definition: CmmJetSubBlock.h:23
LVL1BS::CmmJetSubBlock::MAX_SOURCE_ID
@ MAX_SOURCE_ID
Definition: CmmJetSubBlock.h:28
LVL1BS::CmmJetSubBlock::s_fwdErrorBit
static const int s_fwdErrorBit
Definition: CmmJetSubBlock.h:59
LVL1BS::CmmJetSubBlock::s_jetHitsBits
static const int s_jetHitsBits
Definition: CmmJetSubBlock.h:72
LVL1BS::CmmJetSubBlock::s_threshErrorBit
static const int s_threshErrorBit
Definition: CmmJetSubBlock.h:61
LVL1BS
Definition: ZdcModifySlices.h:10
LVL1BS::CmmJetSubBlock::s_bunchCrossingBits
static const int s_bunchCrossingBits
Definition: CmmJetSubBlock.h:75
copySelective.source
string source
Definition: copySelective.py:32
LVL1BS::CmmJetSubBlock::REMOTE_MAIN
@ REMOTE_MAIN
Definition: CmmJetSubBlock.h:26
LVL1BS::CmmJetSubBlock::s_fwdMask
static const uint32_t s_fwdMask
Definition: CmmJetSubBlock.h:67
LVL1BS::CmmJetSubBlock::~CmmJetSubBlock
~CmmJetSubBlock()
Definition: CmmJetSubBlock.cxx:41
error
Definition: IImpactPoint3dEstimator.h:70
LVL1BS::CmmJetSubBlock::resize
void resize()
Definition: CmmJetSubBlock.cxx:192
LVL1BS::CmmJetSubBlock::s_etMapMask
static const uint32_t s_etMapMask
Definition: CmmJetSubBlock.h:68
LVL1BS::CmmJetSubBlock::pack
bool pack()
Pack data.
Definition: CmmJetSubBlock.cxx:135
LVL1BS::CmmJetSubBlock::jetHitsError
int jetHitsError(int slice, int source) const
Return jet hit error for given jem or source ID.
Definition: CmmJetSubBlock.cxx:71