CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
UCTCTP7RawData Class Reference

#include <UCTCTP7RawData.h>

Public Types

enum  CaloType {
  EBEE = 0, HBHE, HF, EBEE = 0,
  HBHE, HF
}
 
enum  CaloType {
  EBEE = 0, HBHE, HF, EBEE = 0,
  HBHE, HF
}
 

Public Member Functions

uint32_t caloLinkBXID ()
 
const uint32_t * dataPtr () const
 
const uint32_t * dataPtr () const
 
uint32_t getET (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getET (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getFB (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getFB (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getFeatureIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
size_t getFeatureIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getHFFeatureBits (bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getHFFeatureBits (bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
size_t getIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getLinkStatus (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getLinkStatus (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool getRegionEGVeto (bool negativeEta, uint32_t region)
 
bool getRegionEGVeto (bool negativeEta, uint32_t region)
 
uint32_t getRegionET (bool negativeEta, uint32_t region)
 
uint32_t getRegionET (bool negativeEta, uint32_t region)
 
uint32_t getRegionHitLocation (bool negativeEta, uint32_t region)
 
uint32_t getRegionHitLocation (bool negativeEta, uint32_t region)
 
uint32_t getRegionSummary (bool negativeEta, uint32_t region)
 
uint32_t getRegionSummary (bool negativeEta, uint32_t region)
 
bool getRegionTauVeto (bool negativeEta, uint32_t region)
 
bool getRegionTauVeto (bool negativeEta, uint32_t region)
 
uint32_t getSummaryIndex (bool negativeEta, uint32_t region)
 
size_t getSummaryIndex (bool negativeEta, uint32_t region)
 
bool isLinkDown (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isLinkDown (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isLinkInError (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isLinkInError (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isLinkMasked (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isLinkMasked (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isLinkMisaligned (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isLinkMisaligned (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isTowerMasked (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
bool isTowerMasked (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t nBXPerL1A ()
 
const UCTCTP7RawDataoperator= (const UCTCTP7RawData &i)=delete
 
const UCTCTP7RawDataoperator= (const UCTCTP7RawData &i)=delete
 
void print ()
 
void setET (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t et)
 
void setFB (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb)
 
void setHFFeatureBits (bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb)
 
void setRegionSummary (bool negativeEta, uint32_t region, uint32_t regionData)
 
uint32_t sof ()
 
uint32_t sof ()
 
 UCTCTP7RawData (const uint32_t *d)
 
 UCTCTP7RawData (const uint32_t *d)
 
 UCTCTP7RawData (uint32_t *d)
 
 UCTCTP7RawData (const UCTCTP7RawData &)=delete
 
 UCTCTP7RawData (const UCTCTP7RawData &)=delete
 
virtual ~UCTCTP7RawData ()
 
virtual ~UCTCTP7RawData ()
 

Private Attributes

const uint32_t * myDataPtr
 
uint32_t * myDataWritePtr = nullptr
 

Detailed Description

Definition at line 7 of file UCTCTP7RawData.h.

Member Enumeration Documentation

◆ CaloType [1/2]

Enumerator
EBEE 
HBHE 
HF 
EBEE 
HBHE 
HF 

Definition at line 9 of file UCTCTP7RawData.h.

◆ CaloType [2/2]

Enumerator
EBEE 
HBHE 
HF 
EBEE 
HBHE 
HF 

Definition at line 9 of file UCTCTP7RawData.h.

Constructor & Destructor Documentation

◆ UCTCTP7RawData() [1/5]

UCTCTP7RawData::UCTCTP7RawData ( const uint32_t *  d)
inline

Definition at line 12 of file UCTCTP7RawData.h.

References myDataPtr.

12  : myDataPtr(d) {
13  if (myDataPtr == nullptr) {
14  edm::LogError("UCTCTP7RawData") << "You gave me a nullptr :<";
15  }
16  }
Log< level::Error, false > LogError
d
Definition: ztail.py:151
const uint32_t * myDataPtr

◆ UCTCTP7RawData() [2/5]

UCTCTP7RawData::UCTCTP7RawData ( uint32_t *  d)
inline

Definition at line 18 of file UCTCTP7RawData.h.

References myDataPtr.

19  if (myDataPtr == nullptr) {
20  edm::LogError("UCTCTP7RawData") << "You gave me a nullptr :<";
21  }
22  }
uint32_t * myDataWritePtr
Log< level::Error, false > LogError
d
Definition: ztail.py:151
const uint32_t * myDataPtr

◆ UCTCTP7RawData() [3/5]

UCTCTP7RawData::UCTCTP7RawData ( const UCTCTP7RawData )
delete

◆ ~UCTCTP7RawData() [1/2]

virtual UCTCTP7RawData::~UCTCTP7RawData ( )
inlinevirtual

Definition at line 28 of file UCTCTP7RawData.h.

28 { ; }

◆ UCTCTP7RawData() [4/5]

UCTCTP7RawData::UCTCTP7RawData ( const uint32_t *  d)
inline

Definition at line 11 of file UCTCTP7RawData.h.

References myDataPtr, and sof().

11  : myDataPtr(d) {
12  if (myDataPtr != nullptr) {
13  if (sof() != 0xA110CA7E) {
14  edm::LogError("UCTCTP7RawData") << "Failed to see 0xA110CA7E at start - but continuing" << std::endl;
15  }
16  }
17  }
uint32_t sof()
Log< level::Error, false > LogError
d
Definition: ztail.py:151
const uint32_t * myDataPtr

◆ UCTCTP7RawData() [5/5]

UCTCTP7RawData::UCTCTP7RawData ( const UCTCTP7RawData )
delete

◆ ~UCTCTP7RawData() [2/2]

virtual UCTCTP7RawData::~UCTCTP7RawData ( )
inlinevirtual

Definition at line 23 of file UCTCTP7RawData.h.

23 { ; }

Member Function Documentation

◆ caloLinkBXID()

uint32_t UCTCTP7RawData::caloLinkBXID ( )
inline

Definition at line 31 of file UCTCTP7RawData.h.

References myDataPtr.

Referenced by print().

31 { return (myDataPtr[1] & 0x00000FFF); }
const uint32_t * myDataPtr

◆ dataPtr() [1/2]

const uint32_t* UCTCTP7RawData::dataPtr ( ) const
inline

Definition at line 27 of file UCTCTP7RawData.h.

References myDataPtr.

27 { return myDataPtr; }
const uint32_t * myDataPtr

◆ dataPtr() [2/2]

const uint32_t* UCTCTP7RawData::dataPtr ( ) const
inline

Definition at line 32 of file UCTCTP7RawData.h.

References myDataPtr.

32 { return myDataPtr; }
const uint32_t * myDataPtr

◆ getET() [1/2]

uint32_t UCTCTP7RawData::getET ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 138 of file UCTCTP7RawData.h.

References data, EgHLTOffHistBins_cfi::et, getIndex(), HF, and myDataPtr.

138  {
139  uint32_t index = getIndex(cType, negativeEta, cEta, iPhi);
140  const uint32_t data = myDataPtr[index];
141  uint32_t et = 0xDEADBEEF;
142  if (cType == HF) {
143  // Pick out the correct 8-bits for the iEta chosen
144  // Note that cEta = 41 is special, it only occurs for iPhi == 1 and shares cEta = 40 position
145  if (cEta == 41)
146  et = ((data >> 16) & 0xFF);
147  else
148  et = ((data >> ((cEta - 30) % 4) * 8) & 0xFF);
149  } else {
150  // Pick out the correct 8-bits for the iPhi chosen
151  et = ((data >> (iPhi * 8)) & 0xFF);
152  }
153  return et;
154  }
const uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ getET() [2/2]

uint32_t UCTCTP7RawData::getET ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 170 of file UCTCTP7RawData.h.

References data, EgHLTOffHistBins_cfi::et, getIndex(), HF, and myDataPtr.

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs(), L1TCaloLayer1RawToDigi::makeECalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs(), L1TCaloLayer1RawToDigi::makeHCalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHFTPGs(), L1TCaloLayer1RawToDigi::makeHFTPGs(), and print().

170  {
171  size_t index = getIndex(cType, negativeEta, cEta, iPhi);
172  const uint32_t data = myDataPtr[index];
173  uint32_t et = 0xDEADBEEF;
174  if (cType == HF) {
175  // Pick out the correct 8-bits for the iEta chosen
176  // Note that cEta = 41 is special, it only occurs for iPhi == 1 and shares cEta = 40 position
177  if (cEta == 41)
178  et = ((data >> 16) & 0xFF);
179  else
180  et = ((data >> ((cEta - 30) % 4) * 8) & 0xFF);
181  } else {
182  // Pick out the correct 8-bits for the iPhi chosen
183  et = ((data >> (iPhi * 8)) & 0xFF);
184  }
185  return et;
186  }
const uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ getFB() [1/2]

uint32_t UCTCTP7RawData::getFB ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 156 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), getHFFeatureBits(), HF, myDataPtr, and l1tHGCalTowerProducer_cfi::tower.

156  {
157  uint32_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
158  const uint32_t data = myDataPtr[index];
159  uint32_t fb = 0;
160  if (cType == HF) {
161  fb = getHFFeatureBits(negativeEta, cEta, iPhi);
162  } else {
163  // Pick out the correct bit for the tower chosen
164  uint32_t tower = iPhi;
165  if (((cEta - 1) % 2) == 1) {
166  tower += 4;
167  }
168  fb = ((data & (0x1 << tower)) != 0) ? 1 : 0;
169  }
170  return fb;
171  }
uint32_t getHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi)
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ getFB() [2/2]

uint32_t UCTCTP7RawData::getFB ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 215 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), getHFFeatureBits(), HF, myDataPtr, and l1tHGCalTowerProducer_cfi::tower.

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs(), L1TCaloLayer1RawToDigi::makeECalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs(), L1TCaloLayer1RawToDigi::makeHCalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHFTPGs(), L1TCaloLayer1RawToDigi::makeHFTPGs(), and print().

215  {
216  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
217  const uint32_t data = myDataPtr[index];
218  uint32_t fb = 0;
219  if (cType == HF) {
220  fb = getHFFeatureBits(negativeEta, cEta, iPhi);
221  } else {
222  // Pick out the correct bit for the tower chosen
223  uint32_t tower = iPhi;
224  if (((cEta - 1) % 2) == 1) {
225  tower += 4;
226  }
227  fb = ((data & (0x1 << tower)) != 0) ? 1 : 0;
228  }
229  return fb;
230  }
uint32_t getHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi)
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ getFeatureIndex() [1/2]

uint32_t UCTCTP7RawData::getFeatureIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 106 of file UCTCTP7RawData.h.

References EBEE, getIndex(), HBHE, and HF.

106  {
107  // Get index into the data words for the tower
108  uint32_t index = getIndex(cType, negativeEta, cEta, iPhi);
109  if (cType == EBEE || cType == HBHE) {
110  // Two 32-bit words contain ET, so we should offset the index to
111  // to the feature and link status bits
112  if (((cEta - 1) % 2) == 0) {
113  // [index] is offset to ET of first four towers (0 - 3)
114  // [index + 2] is where the feature and link status bits are
115  index += 2;
116  } else {
117  // In this case [index] is offset to ET of second four towers (4 - 7)
118  // [index + 1] is where the feature and link status bits are
119  index += 1;
120  }
121  } else if (cType == HF) {
122  // HF Fragment has different structure than EBEE and HBHE fragments
123  // First three 32-bit words have ETs for 11 objects (yes, 11 not 12)
124  // cEta = 40 / 41 are double in eta and flop bettween a and b HF fragments
125  // Further the remaining upper byte of the third word actually has feature
126  // bits. This feature index will point to the 4th 32-bit word. It is
127  // expected that the top byte from 3rd 32-bit word will be patched in within
128  // the feature bit access function.
129  // Since there are three instead of if block as above for EBEE, HBHE
130  // I wrote here a more compact implementation of index computation.
131  index += (3 - ((cEta - 30) / 4));
132  } else {
133  return 0xDEADBEEF;
134  }
135  return index;
136  }
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ getFeatureIndex() [2/2]

size_t UCTCTP7RawData::getFeatureIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 109 of file UCTCTP7RawData.h.

References EBEE, getIndex(), HBHE, and HF.

Referenced by getFB(), getHFFeatureBits(), getLinkStatus(), setFB(), and setHFFeatureBits().

109  {
110  // Get index into the data words for the tower
111  size_t index = getIndex(cType, negativeEta, cEta, iPhi);
112  if (cType == EBEE || cType == HBHE) {
113  // Two 32-bit words contain ET, so we should offset the index to
114  // to the feature and link status bits
115  if (((cEta - 1) % 2) == 0) {
116  // [index] is offset to ET of first four towers (0 - 3)
117  // [index + 2] is where the feature and link status bits are
118  index += 2;
119  } else {
120  // In this case [index] is offset to ET of second four towers (4 - 7)
121  // [index + 1] is where the feature and link status bits are
122  index += 1;
123  }
124  } else if (cType == HF) {
125  // HF Fragment has different structure than EBEE and HBHE fragments
126  // First three 32-bit words have ETs for 11 objects (yes, 11 not 12)
127  // cEta = 40 / 41 are double in eta and flop bettween a and b HF fragments
128  // Further the remaining upper byte of the third word actually has feature
129  // bits. This feature index will point to the 4th 32-bit word. It is
130  // expected that the top byte from 3rd 32-bit word will be patched in within
131  // the feature bit access function.
132  // Since there are three instead of if block as above for EBEE, HBHE
133  // I wrote here a more compact implementation of index computation.
134  index += (3 - ((cEta - 30) / 4));
135  if (index == 0) {
136  // Since we sticth index-1, zero is also illegal
137  edm::LogError("UCTCTP7RawData") << "Managed to calculate an out-of-bounds index, buyer beware";
138  }
139  } else {
140  // Unknown calotype error already generated in getIndex()
141  return 0;
142  }
143  if (index >= 192) {
144  edm::LogError("UCTCTP7RawData") << "Managed to calculate an out-of-bounds index, buyer beware";
145  }
146  return index;
147  }
Log< level::Error, false > LogError
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ getHFFeatureBits() [1/2]

uint32_t UCTCTP7RawData::getHFFeatureBits ( bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 173 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), HF, myDataPtr, and edm::shift.

173  {
174  uint32_t index = getFeatureIndex(HF, negativeEta, cEta, iPhi);
175  // Stitch together the top 8 bits from previous 32-bit word and bottom 14 bits from this word
176  const uint32_t data = ((myDataPtr[index] & 0x3FFF) << 8) + (myDataPtr[index - 1] >> 24);
177  uint32_t shift = (cEta - 30) * 2;
178  if (cEta == 41)
179  shift = 20; // 41 occurs on b-fiber but shares the position of 40
180  return ((data >> shift) & 0x3);
181  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static unsigned int const shift

◆ getHFFeatureBits() [2/2]

uint32_t UCTCTP7RawData::getHFFeatureBits ( bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 250 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), HF, myDataPtr, and edm::shift.

Referenced by getFB(), and print().

250  {
251  size_t index = getFeatureIndex(HF, negativeEta, cEta, iPhi);
252  // Stitch together the top 8 bits from previous 32-bit word and bottom 14 bits from this word
253  const uint32_t data = ((myDataPtr[index] & 0x3FFF) << 8) + (myDataPtr[index - 1] >> 24);
254  uint32_t shift = (cEta - 30) * 2;
255  if (cEta == 41)
256  shift = 20; // 41 occurs on b-fiber but shares the position of 40
257  return ((data >> shift) & 0x3);
258  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static unsigned int const shift

◆ getIndex() [1/2]

uint32_t UCTCTP7RawData::getIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 35 of file UCTCTP7RawData.h.

References EBEE, HBHE, and HF.

35  {
36  uint32_t index = 0xDEADBEEF;
37  if (cType == EBEE || cType == HBHE) {
38  if (iPhi > 3) {
39  edm::LogError("UCTCTP7RawData") << "Incorrect iPhi; iPhi = " << iPhi << "; should be in [0,3]" << std::endl;
40  return 0xDEADBEEF;
41  }
42  if (cEta < 1 || cEta > 28) {
43  edm::LogError("UCTCTP7RawData") << "Incorrect caloEta; cEta = " << cEta << "; should be in [1-28]" << std::endl;
44  return 0xDEADBEEF;
45  }
46  // ECAL/HB+HE fragment size is 3 32-bit words
47  // Each fragment covers 2 eta and 4 phi towers
48  // All four phi towers are in one 32-bit word
49  // Even and odd eta are in neighboring 32-bit words
50  index = 2 + (((cEta - 1) / 2) * (3 + 3) + ((cEta - 1) % 2));
51  // But, towers are arranged in a peculiar order for firmware
52  // convenience - the index needs to be computing with these
53  // if statements. This is brittle code that one should be
54  // very careful with.
55  if (negativeEta) {
56  // Add offset for 6 ECAL and 6 HCAL fragments
57  index += (6 * (3 + 3));
58  } else {
59  if (cEta > 12) {
60  // Add offset for 14 ECAL, 14 HB+HE and 2 HF fragments
61  // Note that first six are included in the definition of
62  // the variable - index
63  // Note also that HF fragments are larger at 4 32-bit words
64  index += ((14 * (3 + 3) + (2 * 4)));
65  }
66  }
67  // Data starts with ECAL towers so offset by 3 additional 32-bit words
68  if (cType == HBHE)
69  index += 3;
70  } else if (cType == HF) {
71  if (iPhi > 1) {
72  edm::LogError("UCTCTP7RawData") << "HF iPhi should be 0 or 1 (for a , b) - invalid iPhi = " << iPhi
73  << std::endl;
74  return 0xDEADBEEF;
75  }
76  if (cEta < 30 || cEta > 41) {
77  edm::LogError("UCTCTP7RawData") << "HF cEta should be between 30 and 41 - invalid cEta = " << cEta << std::endl;
78  return 0xDEADBEEF;
79  }
80  if (negativeEta) {
81  if (iPhi == 0) {
82  // Offset by 6 positive eta and 14 negative eta EBEE/HBHE fragments (each 3 32-bit words)
83  // There are four HF cEta towers packed in each 32-bit word
84  // Add additional offset of 1 for (34-37) and 2 for (38-41)
85  index = 2 + 20 * (3 + 3) + ((cEta - 30) / 4);
86  } else {
87  // Additional HF a fragment offset for HF b channel
88  index = 2 + 20 * (3 + 3) + 1 * 4 + ((cEta - 30) / 4);
89  }
90  } else {
91  if (iPhi == 0) {
92  // Offset by all EBEE/HBHE and two HF fragments (4 32-bit words)
93  index = 2 + 2 * 14 * (3 + 3) + 2 * 4 + ((cEta - 30) / 4);
94  } else {
95  // Additional HF a fragment offset for HF b channel
96  index = 2 + 2 * 14 * (3 + 3) + 3 * 4 + ((cEta - 30) / 4);
97  }
98  }
99  } else {
100  edm::LogError("UCTCTP7RawData") << "Unknown CaloType " << cType << std::endl;
101  return 0xDEADBEEF;
102  }
103  return index;
104  }
Log< level::Error, false > LogError

◆ getIndex() [2/2]

size_t UCTCTP7RawData::getIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 36 of file UCTCTP7RawData.h.

References EBEE, HBHE, and HF.

Referenced by getET(), getFeatureIndex(), print(), and setET().

36  {
37  size_t index = 0;
38  if (cType == EBEE || cType == HBHE) {
39  if (iPhi > 3) {
40  edm::LogError("UCTCTP7RawData") << "Incorrect iPhi; iPhi = " << iPhi << "; should be in [0,3]";
41  return index;
42  }
43  if (cEta < 1 || cEta > 28) {
44  edm::LogError("UCTCTP7RawData") << "Incorrect caloEta; cEta = " << cEta << "; should be in [1-28]";
45  return index;
46  }
47  // ECAL/HB+HE fragment size is 3 32-bit words
48  // Each fragment covers 2 eta and 4 phi towers
49  // All four phi towers are in one 32-bit word
50  // Even and odd eta are in neighboring 32-bit words
51  index = (((cEta - 1) / 2) * (3 + 3) + ((cEta - 1) % 2));
52  // But, towers are arranged in a peculiar order for firmware
53  // convenience - the index needs to be computing with these
54  // if statements. This is brittle code that one should be
55  // very careful with.
56  if (negativeEta) {
57  // Add offset for 6 ECAL and 6 HCAL fragments
58  index += (6 * (3 + 3));
59  } else {
60  if (cEta > 12) {
61  // Add offset for 14 ECAL, 14 HB+HE and 2 HF fragments
62  // Note that first six are included in the definition of
63  // the variable - index
64  // Note also that HF fragments are larger at 4 32-bit words
65  index += ((14 * (3 + 3) + (2 * 4)));
66  }
67  }
68  // Data starts with ECAL towers so offset by 3 additional 32-bit words
69  if (cType == HBHE)
70  index += 3;
71  } else if (cType == HF) {
72  if (iPhi > 1) {
73  edm::LogError("UCTCTP7RawData") << "HF iPhi should be 0 or 1 (for a , b) - invalid iPhi = " << iPhi;
74  return index;
75  }
76  if (cEta < 30 || cEta > 41) {
77  edm::LogError("UCTCTP7RawData") << "HF cEta should be between 30 and 41 - invalid cEta = " << cEta;
78  return index;
79  }
80  if (negativeEta) {
81  if (iPhi == 0) {
82  // Offset by 6 positive eta and 14 negative eta EBEE/HBHE fragments (each 3 32-bit words)
83  // There are four HF cEta towers packed in each 32-bit word
84  // Add additional offset of 1 for (34-37) and 2 for (38-41)
85  index = 20 * (3 + 3) + ((cEta - 30) / 4);
86  } else {
87  // Additional HF a fragment offset for HF b channel
88  index = 20 * (3 + 3) + 1 * 4 + ((cEta - 30) / 4);
89  }
90  } else {
91  if (iPhi == 0) {
92  // Offset by all EBEE/HBHE and two HF fragments (4 32-bit words)
93  index = 2 * 14 * (3 + 3) + 2 * 4 + ((cEta - 30) / 4);
94  } else {
95  // Additional HF a fragment offset for HF b channel
96  index = 2 * 14 * (3 + 3) + 3 * 4 + ((cEta - 30) / 4);
97  }
98  }
99  } else {
100  edm::LogError("UCTCTP7RawData") << "Unknown CaloType " << cType;
101  return index;
102  }
103  if (index >= 192) {
104  edm::LogError("UCTCTP7RawData") << "Managed to calculate an out-of-bounds index, buyer beware";
105  }
106  return index;
107  }
Log< level::Error, false > LogError

◆ getLinkStatus() [1/2]

uint32_t UCTCTP7RawData::getLinkStatus ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 183 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), and myDataPtr.

183  {
184  uint32_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
185  const uint32_t data = myDataPtr[index];
186  return (data >> 16);
187  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ getLinkStatus() [2/2]

uint32_t UCTCTP7RawData::getLinkStatus ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 260 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), and myDataPtr.

Referenced by isLinkDown(), isLinkInError(), isLinkMasked(), isLinkMisaligned(), isTowerMasked(), and print().

260  {
261  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
262  const uint32_t data = myDataPtr[index];
263  return (data >> 16);
264  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ getRegionEGVeto() [1/2]

bool UCTCTP7RawData::getRegionEGVeto ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 204 of file UCTCTP7RawData.h.

References getRegionSummary(), and HLT_2022v15_cff::region.

204 { return (getRegionSummary(negativeEta, region) & 0x0400); }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getRegionEGVeto() [2/2]

bool UCTCTP7RawData::getRegionEGVeto ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 294 of file UCTCTP7RawData.h.

References getRegionSummary(), and HLT_2022v15_cff::region.

Referenced by print().

294 { return (getRegionSummary(negativeEta, region) & 0x0400); }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getRegionET() [1/2]

uint32_t UCTCTP7RawData::getRegionET ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 202 of file UCTCTP7RawData.h.

References getRegionSummary(), and HLT_2022v15_cff::region.

202 { return (getRegionSummary(negativeEta, region) & 0x3FF); }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getRegionET() [2/2]

uint32_t UCTCTP7RawData::getRegionET ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 292 of file UCTCTP7RawData.h.

References getRegionSummary(), and HLT_2022v15_cff::region.

Referenced by print().

292 { return (getRegionSummary(negativeEta, region) & 0x3FF); }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getRegionHitLocation() [1/2]

uint32_t UCTCTP7RawData::getRegionHitLocation ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 208 of file UCTCTP7RawData.h.

References getRegionSummary(), and HLT_2022v15_cff::region.

208  {
209  return ((getRegionSummary(negativeEta, region) & 0xF000) >> 12);
210  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getRegionHitLocation() [2/2]

uint32_t UCTCTP7RawData::getRegionHitLocation ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 298 of file UCTCTP7RawData.h.

References getRegionSummary(), and HLT_2022v15_cff::region.

Referenced by print().

298  {
299  return ((getRegionSummary(negativeEta, region) & 0xF000) >> 12);
300  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getRegionSummary() [1/2]

uint32_t UCTCTP7RawData::getRegionSummary ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 196 of file UCTCTP7RawData.h.

References data, getSummaryIndex(), myDataPtr, and HLT_2022v15_cff::region.

196  {
197  uint32_t index = getSummaryIndex(negativeEta, region);
198  const uint32_t data = myDataPtr[index];
199  return ((data >> (16 * (region % 2))) & 0xFFFF);
200  }
const uint32_t * myDataPtr
size_t getSummaryIndex(bool negativeEta, uint32_t region)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ getRegionSummary() [2/2]

uint32_t UCTCTP7RawData::getRegionSummary ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 286 of file UCTCTP7RawData.h.

References data, getSummaryIndex(), myDataPtr, and HLT_2022v15_cff::region.

Referenced by getRegionEGVeto(), getRegionET(), getRegionHitLocation(), getRegionTauVeto(), l1t::stage2::CaloLayer1Unpacker::makeRegions(), and L1TCaloLayer1RawToDigi::makeRegions().

286  {
287  size_t index = getSummaryIndex(negativeEta, region);
288  const uint32_t data = myDataPtr[index];
289  return ((data >> (16 * (region % 2))) & 0xFFFF);
290  }
const uint32_t * myDataPtr
size_t getSummaryIndex(bool negativeEta, uint32_t region)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ getRegionTauVeto() [1/2]

bool UCTCTP7RawData::getRegionTauVeto ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 206 of file UCTCTP7RawData.h.

References getRegionSummary(), and HLT_2022v15_cff::region.

206 { return (getRegionSummary(negativeEta, region) & 0x0800); }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getRegionTauVeto() [2/2]

bool UCTCTP7RawData::getRegionTauVeto ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 296 of file UCTCTP7RawData.h.

References getRegionSummary(), and HLT_2022v15_cff::region.

Referenced by print().

296 { return (getRegionSummary(negativeEta, region) & 0x0800); }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getSummaryIndex() [1/2]

uint32_t UCTCTP7RawData::getSummaryIndex ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 189 of file UCTCTP7RawData.h.

References HLT_2022v15_cff::region.

189  {
190  uint32_t index = 2 + 2 * 14 * (3 + 3) + 4 * 4 + (region / 2);
191  if (negativeEta)
192  index += 4;
193  return index;
194  }

◆ getSummaryIndex() [2/2]

size_t UCTCTP7RawData::getSummaryIndex ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 266 of file UCTCTP7RawData.h.

References HLT_2022v15_cff::region.

Referenced by getRegionSummary(), and setRegionSummary().

266  {
267  size_t index = 2 * 14 * (3 + 3) + 4 * 4 + (region / 2);
268  if (negativeEta)
269  index += 4;
270  if (index >= 192) {
271  edm::LogError("UCTCTP7RawData") << "Managed to calculate an out-of-bounds index, buyer beware";
272  }
273  return index;
274  }
Log< level::Error, false > LogError

◆ isLinkDown() [1/2]

bool UCTCTP7RawData::isLinkDown ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 241 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

241  {
242  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
243  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
244  return ((linkStatus & 0x00000400) != 0);
245  }
246  return ((linkStatus & 0x00004000) != 0);
247  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkDown() [2/2]

bool UCTCTP7RawData::isLinkDown ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 331 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs(), L1TCaloLayer1RawToDigi::makeECalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs(), L1TCaloLayer1RawToDigi::makeHCalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHFTPGs(), and L1TCaloLayer1RawToDigi::makeHFTPGs().

331  {
332  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
333  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
334  return ((linkStatus & 0x00000400) != 0);
335  }
336  return ((linkStatus & 0x00004000) != 0);
337  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkInError() [1/2]

bool UCTCTP7RawData::isLinkInError ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 233 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

233  {
234  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
235  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
236  return ((linkStatus & 0x00000200) != 0);
237  }
238  return ((linkStatus & 0x00002000) != 0);
239  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkInError() [2/2]

bool UCTCTP7RawData::isLinkInError ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 323 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs(), L1TCaloLayer1RawToDigi::makeECalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs(), L1TCaloLayer1RawToDigi::makeHCalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHFTPGs(), and L1TCaloLayer1RawToDigi::makeHFTPGs().

323  {
324  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
325  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
326  return ((linkStatus & 0x00000200) != 0);
327  }
328  return ((linkStatus & 0x00002000) != 0);
329  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkMasked() [1/2]

bool UCTCTP7RawData::isLinkMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 249 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

249  {
250  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
251  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
252  return ((linkStatus & 0x00000800) != 0);
253  }
254  return ((linkStatus & 0x00008000) != 0);
255  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkMasked() [2/2]

bool UCTCTP7RawData::isLinkMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 339 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs(), L1TCaloLayer1RawToDigi::makeECalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs(), L1TCaloLayer1RawToDigi::makeHCalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHFTPGs(), and L1TCaloLayer1RawToDigi::makeHFTPGs().

339  {
340  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
341  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
342  return ((linkStatus & 0x00000800) != 0);
343  }
344  return ((linkStatus & 0x00008000) != 0);
345  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkMisaligned() [1/2]

bool UCTCTP7RawData::isLinkMisaligned ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 225 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

225  {
226  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
227  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
228  return ((linkStatus & 0x00000100) != 0);
229  }
230  return ((linkStatus & 0x00001000) != 0);
231  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkMisaligned() [2/2]

bool UCTCTP7RawData::isLinkMisaligned ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 315 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs(), L1TCaloLayer1RawToDigi::makeECalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs(), L1TCaloLayer1RawToDigi::makeHCalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHFTPGs(), and L1TCaloLayer1RawToDigi::makeHFTPGs().

315  {
316  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
317  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
318  return ((linkStatus & 0x00000100) != 0);
319  }
320  return ((linkStatus & 0x00001000) != 0);
321  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isTowerMasked() [1/2]

bool UCTCTP7RawData::isTowerMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 212 of file UCTCTP7RawData.h.

References getLinkStatus(), HF, l1tHGCalTowerProducer_cfi::tower, and testProducerWithPsetDescEmpty_cfi::x1.

212  {
213  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
214  uint32_t tower = iPhi;
215  if (((cEta - 1) % 2) == 1)
216  tower += 4;
217  if (cType == HF) {
218  tower = (cEta - 30);
219  if (cEta == 41)
220  tower = 10;
221  }
222  return ((linkStatus & (0x1 << tower)) != 0);
223  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isTowerMasked() [2/2]

bool UCTCTP7RawData::isTowerMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 302 of file UCTCTP7RawData.h.

References getLinkStatus(), HF, l1tHGCalTowerProducer_cfi::tower, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs(), L1TCaloLayer1RawToDigi::makeECalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs(), L1TCaloLayer1RawToDigi::makeHCalTPGs(), l1t::stage2::CaloLayer1Unpacker::makeHFTPGs(), and L1TCaloLayer1RawToDigi::makeHFTPGs().

302  {
303  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
304  uint32_t tower = iPhi;
305  if ((cEta % 2) == 0)
306  tower += 4;
307  if (cType == HF) {
308  tower = (cEta - 30);
309  if (cEta == 41)
310  tower = 10;
311  }
312  return ((linkStatus & (0x1 << tower)) != 0);
313  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ nBXPerL1A()

uint32_t UCTCTP7RawData::nBXPerL1A ( )
inline

Definition at line 33 of file UCTCTP7RawData.h.

References myDataPtr.

Referenced by print().

33 { return ((myDataPtr[1] & 0x000F0000) >> 16); }
const uint32_t * myDataPtr

◆ operator=() [1/2]

const UCTCTP7RawData& UCTCTP7RawData::operator= ( const UCTCTP7RawData i)
delete

◆ operator=() [2/2]

const UCTCTP7RawData& UCTCTP7RawData::operator= ( const UCTCTP7RawData i)
delete

◆ print()

void UCTCTP7RawData::print ( void  )
inline

Definition at line 257 of file UCTCTP7RawData.h.

References caloLinkBXID(), TauDecayModes::dec, EBEE, dqmdumpme::first, getET(), getFB(), getHFFeatureBits(), getIndex(), getLinkStatus(), getRegionEGVeto(), getRegionET(), getRegionHitLocation(), getRegionTauVeto(), HBHE, HF, mps_fire::i, nBXPerL1A(), and HLT_2022v15_cff::region.

Referenced by L1TCaloLayer1RawToDigi::produce().

257  {
258  using namespace std;
259  edm::LogError("UCTCTP7RawData") << "CTP7 Payload Header:" << endl;
260  edm::LogError("UCTCTP7RawData") << "No BX per L1A = " << dec << nBXPerL1A() << endl;
261  edm::LogError("UCTCTP7RawData") << "Calo BX ID = " << dec << caloLinkBXID() << endl;
262  CaloType cType = EBEE;
263  bool negativeEta = false;
264  bool first = true;
265  for (uint32_t i = 0; i < 2; i++) {
266  if (i != 0)
267  negativeEta = true;
268  first = true;
269  cType = EBEE;
270  for (uint32_t cEta = 1; cEta <= 28; cEta++) {
271  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) {
272  if (getLinkStatus(cType, negativeEta, cEta, iPhi) != 0 || getET(cType, negativeEta, cEta, iPhi) != 0) {
273  if (first)
274  edm::LogError("UCTCTP7RawData") << "EcalET FG LinkStatus" << endl;
275  first = false;
276  edm::LogError("UCTCTP7RawData")
277  << dec << setfill(' ') << setw(6) << getET(cType, negativeEta, cEta, iPhi) << " "
278  << getFB(cType, negativeEta, cEta, iPhi) << " " << showbase << internal << setfill('0') << setw(10)
279  << hex << getLinkStatus(cType, negativeEta, cEta, iPhi) << " (" << dec
280  << getIndex(cType, negativeEta, cEta, iPhi) << ", " << negativeEta << ", " << cEta << ", " << iPhi
281  << ")" << endl;
282  }
283  }
284  }
285  first = true;
286  cType = HBHE;
287  for (uint32_t cEta = 1; cEta <= 28; cEta++) {
288  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) {
289  if (getLinkStatus(cType, negativeEta, cEta, iPhi) != 0 || getET(cType, negativeEta, cEta, iPhi) != 0) {
290  if (first)
291  edm::LogError("UCTCTP7RawData") << "HcalET Feature LinkStatus" << endl;
292  first = false;
293  edm::LogError("UCTCTP7RawData")
294  << dec << setfill(' ') << setw(6) << getET(cType, negativeEta, cEta, iPhi) << " "
295  << getFB(cType, negativeEta, cEta, iPhi) << " " << showbase << internal << setfill('0') << setw(10)
296  << hex << getLinkStatus(cType, negativeEta, cEta, iPhi) << " (" << dec
297  << getIndex(cType, negativeEta, cEta, iPhi) << ", " << negativeEta << ", " << cEta << ", " << iPhi
298  << ")" << endl;
299  }
300  }
301  }
302  first = true;
303  cType = HF;
304  for (uint32_t cEta = 30; cEta <= 40; cEta++) {
305  for (uint32_t iPhi = 0; iPhi < 2; iPhi++) {
306  if (iPhi == 1 && cEta == 40)
307  cEta = 41;
308  if (getLinkStatus(cType, negativeEta, cEta, iPhi) != 0 || getET(cType, negativeEta, cEta, iPhi) != 0) {
309  if (first)
310  edm::LogError("UCTCTP7RawData") << "HF-ET Feature LinkStatus" << endl;
311  first = false;
312  edm::LogError("UCTCTP7RawData")
313  << dec << setfill(' ') << setw(6) << getET(cType, negativeEta, cEta, iPhi) << " " << dec
314  << setfill(' ') << setw(2) << getHFFeatureBits(negativeEta, cEta, iPhi) << " " << showbase << internal
315  << setfill('0') << setw(10) << hex << getLinkStatus(cType, negativeEta, cEta, iPhi) << " (" << dec
316  << getIndex(cType, negativeEta, cEta, iPhi) << ", " << negativeEta << ", " << cEta << ", " << iPhi
317  << ")" << endl;
318  }
319  }
320  }
321  first = true;
322  for (uint32_t region = 0; region < 7; region++) {
323  if (first)
324  edm::LogError("UCTCTP7RawData") << "Region ET EGVeto TauVeto HitLocation" << endl;
325  first = false;
326  edm::LogError("UCTCTP7RawData") << dec << setfill(' ') << setw(6) << region << " " << hex << showbase
327  << internal << setfill('0') << setw(6) << getRegionET(negativeEta, region)
328  << dec << " " << getRegionEGVeto(negativeEta, region) << " "
329  << getRegionTauVeto(negativeEta, region) << " " << showbase << internal
330  << setfill('0') << setw(3) << hex << getRegionHitLocation(negativeEta, region)
331  << endl;
332  }
333  }
334  }
uint32_t getFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool getRegionTauVeto(bool negativeEta, uint32_t region)
uint32_t getHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t caloLinkBXID()
Log< level::Error, false > LogError
bool getRegionEGVeto(bool negativeEta, uint32_t region)
uint32_t nBXPerL1A()
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t getRegionET(bool negativeEta, uint32_t region)
uint32_t getET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t getRegionHitLocation(bool negativeEta, uint32_t region)

◆ setET()

void UCTCTP7RawData::setET ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  et 
)
inline

Definition at line 149 of file UCTCTP7RawData.h.

References data, EgHLTOffHistBins_cfi::et, getIndex(), HF, and myDataWritePtr.

Referenced by l1t::stage2::CaloLayer1Packer::makeECalTPGs(), l1t::stage2::CaloLayer1Packer::makeHCalTPGs(), and l1t::stage2::CaloLayer1Packer::makeHFTPGs().

149  {
150  if (myDataWritePtr == nullptr) {
151  edm::LogError("UCTCTP7RawData") << "I was made in read-only mode";
152  return;
153  }
154  size_t index = getIndex(cType, negativeEta, cEta, iPhi);
155  uint32_t& data = myDataWritePtr[index];
156  if (cType == HF) {
157  // Pick out the correct 8-bits for the iEta chosen
158  // Note that cEta = 41 is special, it only occurs for iPhi == 1 and shares cEta = 40 position
159  if (cEta == 41) {
160  data |= (et & 0xFF) << 16;
161  } else {
162  data |= (et & 0xFF) << (((cEta - 30) % 4) * 8);
163  }
164  } else {
165  // Pick out the correct 8-bits for the iPhi chosen
166  data |= (et & 0xFF) << (iPhi * 8);
167  }
168  }
uint32_t * myDataWritePtr
Log< level::Error, false > LogError
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ setFB()

void UCTCTP7RawData::setFB ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  fb 
)
inline

Definition at line 188 of file UCTCTP7RawData.h.

References b1, data, LEDCalibrationChannels::depth, getFeatureIndex(), HBHE, HF, myDataWritePtr, setHFFeatureBits(), and l1tHGCalTowerProducer_cfi::tower.

Referenced by l1t::stage2::CaloLayer1Packer::makeECalTPGs(), l1t::stage2::CaloLayer1Packer::makeHCalTPGs(), and l1t::stage2::CaloLayer1Packer::makeHFTPGs().

188  {
189  if (myDataWritePtr == nullptr) {
190  edm::LogError("UCTCTP7RawData") << "I was made in read-only mode";
191  return;
192  }
193  if (cType == HF) {
194  setHFFeatureBits(negativeEta, cEta, iPhi, fb);
195  } else {
196  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
197  uint32_t& data = myDataWritePtr[index];
198 
199  uint32_t tower = iPhi;
200  if (((cEta - 1) % 2) == 1) {
201  tower += 4;
202  }
203  if (cType == HBHE) {
204  int depth = fb & 0b1;
205  int prompt = (fb & 0b10) >> 1;
206  int delay1 = (fb & 0b100) >> 2;
207  int delay2 = (fb & 0b1000) >> 3;
208  if (cEta < 16)
209  data |= (depth | ((!prompt) & (delay1 | delay2))) << tower; // bit[0] | (!bit[1] & (bit[2] | bit[3]))
210  } else
211  data |= (fb & 0x1) << tower;
212  }
213  }
weight_default_t b1[25]
Definition: b1.h:9
uint32_t * myDataWritePtr
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
Log< level::Error, false > LogError
void setHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ setHFFeatureBits()

void UCTCTP7RawData::setHFFeatureBits ( bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  fb 
)
inline

Definition at line 232 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), HF, myDataWritePtr, and edm::shift.

Referenced by setFB().

232  {
233  if (myDataWritePtr == nullptr) {
234  edm::LogError("UCTCTP7RawData") << "I was made in read-only mode";
235  return;
236  }
237  size_t index = getFeatureIndex(HF, negativeEta, cEta, iPhi);
238  uint32_t shift = (cEta - 30) * 2;
239  if (cEta == 41)
240  shift = 20; // 41 occurs on b-fiber but shares the position of 40
241  if (shift >= 8) {
242  uint32_t& data = myDataWritePtr[index];
243  data |= (fb & 0x3) << (shift - 8);
244  } else {
245  uint32_t& data = myDataWritePtr[index - 1];
246  data |= (fb & 0x3) << (shift + 24);
247  }
248  }
uint32_t * myDataWritePtr
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
Log< level::Error, false > LogError
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static unsigned int const shift

◆ setRegionSummary()

void UCTCTP7RawData::setRegionSummary ( bool  negativeEta,
uint32_t  region,
uint32_t  regionData 
)
inline

Definition at line 276 of file UCTCTP7RawData.h.

References data, getSummaryIndex(), myDataWritePtr, and HLT_2022v15_cff::region.

Referenced by l1t::stage2::CaloLayer1Packer::makeRegions().

276  {
277  if (myDataWritePtr == nullptr) {
278  edm::LogError("UCTCTP7RawData") << "I was made in read-only mode";
279  return;
280  }
281  size_t index = getSummaryIndex(negativeEta, region);
282  uint32_t& data = myDataWritePtr[index];
283  data |= (regionData & 0xFFFF) << (16 * (region % 2));
284  }
uint32_t * myDataWritePtr
Log< level::Error, false > LogError
size_t getSummaryIndex(bool negativeEta, uint32_t region)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ sof() [1/2]

uint32_t UCTCTP7RawData::sof ( )
inline

Definition at line 29 of file UCTCTP7RawData.h.

References myDataPtr.

29 { return myDataPtr[0]; }
const uint32_t * myDataPtr

◆ sof() [2/2]

uint32_t UCTCTP7RawData::sof ( )
inline

Definition at line 34 of file UCTCTP7RawData.h.

References myDataPtr.

Referenced by UCTCTP7RawData().

34 { return myDataPtr[0]; }
const uint32_t * myDataPtr

Member Data Documentation

◆ myDataPtr

const uint32_t * UCTCTP7RawData::myDataPtr
private

◆ myDataWritePtr

uint32_t* UCTCTP7RawData::myDataWritePtr = nullptr
private

Definition at line 352 of file UCTCTP7RawData.h.

Referenced by setET(), setFB(), setHFFeatureBits(), and setRegionSummary().