ATLAS Offline Software
CmmEnergySubBlock.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_CMMENERGYSUBBLOCK_H
6 #define TRIGT1CALOBYTESTREAM_CMMENERGYSUBBLOCK_H
7 
8 #include <stdint.h>
9 #include <vector>
10 
11 #include "CmmSubBlock.h"
12 
13 namespace LVL1BS {
14 
24 
25  public:
26  enum SourceId { REMOTE = 20, LOCAL = 23, TOTAL = 26, MAX_SOURCE_ID };
27 
30 
32  void clear();
33 
35  unsigned int ex(int slice, int source) const;
37  unsigned int ey(int slice, int source) const;
39  unsigned int et(int slice, int source) const;
41  int exError(int slice, int source) const;
43  int eyError(int slice, int source) const;
45  int etError(int slice, int source) const;
47  unsigned int missingEtHits(int slice) const;
49  unsigned int sumEtHits(int slice) const;
51  unsigned int missingEtSigHits(int slice) const;
52 
54  void setSubsums(int slice, int source, unsigned int ex,
55  unsigned int ey, unsigned int et,
56  int exError, int eyError, int etError);
58  void setMissingEtHits(int slice, unsigned int map);
60  void setSumEtHits(int slice, unsigned int map);
62  void setMissingEtSigHits(int slice, unsigned int map);
63 
65  bool pack();
67  bool unpack();
68 
69  private:
71  static const int s_wordLength = 32;
72  // Energy subsums bit positions and masks
73  static const int s_exBit = 0;
74  static const int s_eyBit = 8;
75  static const int s_etBit = 16;
76  static const int s_jemErrorBit = 24;
77  static const int s_errorBit = 15;
78  static const int s_etMissBit = 16;
79  static const int s_etHitsBit = 16;
80  static const int s_etMissSigBit = 16;
81  static const int s_sourceIdBit = 25;
82  static const int s_dataWordIdBit = 30;
83  static const int s_dataWordId = 0;
84  static const int s_maxSums = 29;
85  static const int s_maxJems = 16;
86  static const uint32_t s_exMask = 0xff;
87  static const uint32_t s_eyMask = 0xff;
88  static const uint32_t s_etMask = 0xff;
89  static const uint32_t s_errorMask = 0x1;
90  static const uint32_t s_remoteErrorMask = 0x3;
91  static const uint32_t s_etMissMask = 0xff;
92  static const uint32_t s_etHitsMask = 0xff;
93  static const uint32_t s_etHitsMaskV1 = 0xf;
94  static const uint32_t s_etMissSigMask = 0xff;
95  static const uint32_t s_sumsMask = 0x7fff;
96  static const uint32_t s_sourceIdMask = 0x1f;
97  // Neutral format
98  static const int s_jemSumBits = 8;
99  static const int s_sumBits = 15;
100  static const int s_bunchCrossingBits = 12;
101  static const int s_paddingBits = 8;
102  static const int s_fifoOverflowPin = 15;
103 
104  int sourceId(uint32_t word) const;
105  int index(int slice, int source) const;
106  void resize();
107 
109  bool packNeutral();
111  bool packUncompressed();
113  bool unpackNeutral();
115  bool unpackUncompressed();
116 
118  std::vector<uint32_t> m_sumsData;
119 
120 };
121 
122 inline int CmmEnergySubBlock::sourceId(const uint32_t word) const
123 {
124  return (word >> s_sourceIdBit) & s_sourceIdMask;
125 }
126 
127 } // end namespace
128 
129 #endif
LVL1BS::CmmEnergySubBlock::s_eyBit
static const int s_eyBit
Definition: CmmEnergySubBlock.h:74
LVL1BS::CmmEnergySubBlock::missingEtSigHits
unsigned int missingEtSigHits(int slice) const
Return Missing-ET-Sig Hits map.
Definition: CmmEnergySubBlock.cxx:187
LVL1BS::CmmEnergySubBlock::setSumEtHits
void setSumEtHits(int slice, unsigned int map)
Store Sum-Et Hits map.
Definition: CmmEnergySubBlock.cxx:263
LVL1BS::CmmEnergySubBlock::exError
int exError(int slice, int source) const
Return Ex subsum error for given JEM or source ID.
Definition: CmmEnergySubBlock.cxx:110
LVL1BS::CmmEnergySubBlock::s_etHitsBit
static const int s_etHitsBit
Definition: CmmEnergySubBlock.h:79
et
Extra patterns decribing particle interation process.
LVL1BS::CmmEnergySubBlock::s_dataWordIdBit
static const int s_dataWordIdBit
Definition: CmmEnergySubBlock.h:82
LVL1BS::CmmEnergySubBlock::et
unsigned int et(int slice, int source) const
Return Et subsum for given JEM or source ID.
Definition: CmmEnergySubBlock.cxx:95
LVL1BS::CmmEnergySubBlock::s_paddingBits
static const int s_paddingBits
Definition: CmmEnergySubBlock.h:101
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1BS::CmmEnergySubBlock::s_etBit
static const int s_etBit
Definition: CmmEnergySubBlock.h:75
LVL1BS::CmmEnergySubBlock::CmmEnergySubBlock
CmmEnergySubBlock()
Definition: CmmEnergySubBlock.cxx:47
LVL1BS::CmmEnergySubBlock::~CmmEnergySubBlock
~CmmEnergySubBlock()
Definition: CmmEnergySubBlock.cxx:51
LVL1BS::CmmEnergySubBlock::s_maxSums
static const int s_maxSums
Definition: CmmEnergySubBlock.h:84
LVL1BS::CmmEnergySubBlock::s_eyMask
static const uint32_t s_eyMask
Definition: CmmEnergySubBlock.h:87
LVL1BS::CmmEnergySubBlock::s_dataWordId
static const int s_dataWordId
Definition: CmmEnergySubBlock.h:83
LVL1BS::CmmEnergySubBlock::missingEtHits
unsigned int missingEtHits(int slice) const
Return Missing-ET Hits map.
Definition: CmmEnergySubBlock.cxx:164
LVL1BS::CmmEnergySubBlock::resize
void resize()
Definition: CmmEnergySubBlock.cxx:353
LVL1BS::CmmEnergySubBlock::s_etMissSigMask
static const uint32_t s_etMissSigMask
Definition: CmmEnergySubBlock.h:94
LVL1BS::CmmEnergySubBlock::s_errorMask
static const uint32_t s_errorMask
Definition: CmmEnergySubBlock.h:89
LVL1BS::CmmSubBlock
Sub-Block class for CMM data.
Definition: CmmSubBlock.h:22
LVL1BS::CmmEnergySubBlock::s_etMask
static const uint32_t s_etMask
Definition: CmmEnergySubBlock.h:88
LVL1BS::L1CaloSubBlock::slice
int slice() const
Definition: L1CaloSubBlock.h:258
LVL1BS::CmmEnergySubBlock::SourceId
SourceId
Definition: CmmEnergySubBlock.h:26
LVL1BS::CmmEnergySubBlock::eyError
int eyError(int slice, int source) const
Return Ey subsum error for given JEM or source ID.
Definition: CmmEnergySubBlock.cxx:128
LVL1BS::CmmEnergySubBlock::TOTAL
@ TOTAL
Definition: CmmEnergySubBlock.h:26
LVL1BS::CmmEnergySubBlock::REMOTE
@ REMOTE
Definition: CmmEnergySubBlock.h:26
LVL1BS::CmmEnergySubBlock::s_errorBit
static const int s_errorBit
Definition: CmmEnergySubBlock.h:77
LVL1BS::CmmEnergySubBlock::clear
void clear()
Clear all data.
Definition: CmmEnergySubBlock.cxx:57
LVL1BS::CmmEnergySubBlock::s_exBit
static const int s_exBit
Definition: CmmEnergySubBlock.h:73
LVL1BS::CmmEnergySubBlock::unpackNeutral
bool unpackNeutral()
Unpack neutral data.
Definition: CmmEnergySubBlock.cxx:435
CmmSubBlock.h
LVL1BS::CmmEnergySubBlock::setMissingEtSigHits
void setMissingEtSigHits(int slice, unsigned int map)
Store Missing-ET-Sig Hits map.
Definition: CmmEnergySubBlock.cxx:279
LVL1BS::CmmEnergySubBlock::s_bunchCrossingBits
static const int s_bunchCrossingBits
Definition: CmmEnergySubBlock.h:100
LVL1BS::CmmEnergySubBlock::index
int index(int slice, int source) const
Definition: CmmEnergySubBlock.cxx:344
LVL1BS::CmmEnergySubBlock::pack
bool pack()
Pack data.
Definition: CmmEnergySubBlock.cxx:295
LVL1BS::CmmEnergySubBlock::s_wordLength
static const int s_wordLength
Data word length.
Definition: CmmEnergySubBlock.h:71
LVL1BS::CmmEnergySubBlock::sumEtHits
unsigned int sumEtHits(int slice) const
Return Sum-Et Hits map.
Definition: CmmEnergySubBlock.cxx:175
LVL1BS::CmmEnergySubBlock::etError
int etError(int slice, int source) const
Return Et subsum error for given JEM or source ID.
Definition: CmmEnergySubBlock.cxx:146
LVL1BS::CmmEnergySubBlock::s_exMask
static const uint32_t s_exMask
Definition: CmmEnergySubBlock.h:86
LVL1BS::CmmEnergySubBlock::sourceId
int sourceId(uint32_t word) const
Definition: CmmEnergySubBlock.h:122
LVL1BS::CmmEnergySubBlock::s_etHitsMask
static const uint32_t s_etHitsMask
Definition: CmmEnergySubBlock.h:92
LVL1BS::CmmEnergySubBlock::unpackUncompressed
bool unpackUncompressed()
Unpack uncompressed data.
Definition: CmmEnergySubBlock.cxx:516
LVL1BS::CmmEnergySubBlock::ex
unsigned int ex(int slice, int source) const
Return Ex subsum for given JEM or source ID.
Definition: CmmEnergySubBlock.cxx:65
LVL1BS::CmmEnergySubBlock::s_maxJems
static const int s_maxJems
Definition: CmmEnergySubBlock.h:85
LVL1BS::CmmEnergySubBlock::s_sumsMask
static const uint32_t s_sumsMask
Definition: CmmEnergySubBlock.h:95
LVL1BS::CmmEnergySubBlock::LOCAL
@ LOCAL
Definition: CmmEnergySubBlock.h:26
LVL1BS::CmmEnergySubBlock::s_etMissMask
static const uint32_t s_etMissMask
Definition: CmmEnergySubBlock.h:91
LVL1BS::CmmEnergySubBlock::s_etMissBit
static const int s_etMissBit
Definition: CmmEnergySubBlock.h:78
LVL1BS::CmmEnergySubBlock::unpack
bool unpack()
Unpack data.
Definition: CmmEnergySubBlock.cxx:317
LVL1BS::CmmEnergySubBlock::setSubsums
void setSubsums(int slice, int source, unsigned int ex, unsigned int ey, unsigned int et, int exError, int eyError, int etError)
Store energy subsums and errors for given JEM or source ID.
Definition: CmmEnergySubBlock.cxx:199
LVL1BS::CmmEnergySubBlock::s_etMissSigBit
static const int s_etMissSigBit
Definition: CmmEnergySubBlock.h:80
LVL1BS::CmmEnergySubBlock::s_sourceIdMask
static const uint32_t s_sourceIdMask
Definition: CmmEnergySubBlock.h:96
LVL1BS::CmmEnergySubBlock::s_sourceIdBit
static const int s_sourceIdBit
Definition: CmmEnergySubBlock.h:81
LVL1BS::CmmEnergySubBlock::s_remoteErrorMask
static const uint32_t s_remoteErrorMask
Definition: CmmEnergySubBlock.h:90
LVL1BS::CmmEnergySubBlock::packUncompressed
bool packUncompressed()
Pack uncompressed data.
Definition: CmmEnergySubBlock.cxx:423
LVL1BS::CmmEnergySubBlock::s_fifoOverflowPin
static const int s_fifoOverflowPin
Definition: CmmEnergySubBlock.h:102
LVL1BS::CmmEnergySubBlock::ey
unsigned int ey(int slice, int source) const
Return Ey subsum for given JEM or source ID.
Definition: CmmEnergySubBlock.cxx:80
LVL1BS
Definition: ZdcModifySlices.h:10
LVL1BS::CmmEnergySubBlock::MAX_SOURCE_ID
@ MAX_SOURCE_ID
Definition: CmmEnergySubBlock.h:26
copySelective.source
string source
Definition: copySelective.py:32
LVL1BS::CmmEnergySubBlock
Sub-Block class for CMM-Energy data.
Definition: CmmEnergySubBlock.h:23
LVL1BS::CmmEnergySubBlock::packNeutral
bool packNeutral()
Pack neutral data.
Definition: CmmEnergySubBlock.cxx:364
LVL1BS::CmmEnergySubBlock::setMissingEtHits
void setMissingEtHits(int slice, unsigned int map)
Store Missing-ET Hits map.
Definition: CmmEnergySubBlock.cxx:247
LVL1BS::CmmEnergySubBlock::s_etHitsMaskV1
static const uint32_t s_etHitsMaskV1
Definition: CmmEnergySubBlock.h:93
LVL1BS::CmmEnergySubBlock::s_jemSumBits
static const int s_jemSumBits
Definition: CmmEnergySubBlock.h:98
LVL1BS::CmmEnergySubBlock::s_sumBits
static const int s_sumBits
Definition: CmmEnergySubBlock.h:99
LVL1BS::CmmEnergySubBlock::m_sumsData
std::vector< uint32_t > m_sumsData
Energy subsums data.
Definition: CmmEnergySubBlock.h:118
LVL1BS::CmmEnergySubBlock::s_jemErrorBit
static const int s_jemErrorBit
Definition: CmmEnergySubBlock.h:76