CMS 3D CMS Logo

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

#include <UCTCTP7RawData_HCALFB.h>

Public Types

enum  CaloType { EBEE = 0, HBHE, HF }
 

Public Member Functions

const uint32_t * dataPtr () const
 
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)
 
size_t getFeatureIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_t getHFFeatureBits (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)
 
bool getRegionEGVeto (bool negativeEta, uint32_t region)
 
uint32_t getRegionET (bool negativeEta, uint32_t region)
 
uint32_t getRegionHitLocation (bool negativeEta, uint32_t region)
 
uint32_t getRegionSummary (bool negativeEta, uint32_t region)
 
bool getRegionTauVeto (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 isLinkInError (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 isTowerMasked (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
const UCTCTP7RawData_HCALFBoperator= (const UCTCTP7RawData_HCALFB &i)=delete
 
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 ()
 
 UCTCTP7RawData_HCALFB (const uint32_t *d)
 
 UCTCTP7RawData_HCALFB (uint32_t *d)
 
 UCTCTP7RawData_HCALFB (const UCTCTP7RawData_HCALFB &)=delete
 
virtual ~UCTCTP7RawData_HCALFB ()
 

Private Attributes

const uint32_t * myDataPtr
 
uint32_t * myDataWritePtr = nullptr
 

Detailed Description

Definition at line 7 of file UCTCTP7RawData_HCALFB.h.

Member Enumeration Documentation

◆ CaloType

Constructor & Destructor Documentation

◆ UCTCTP7RawData_HCALFB() [1/3]

UCTCTP7RawData_HCALFB::UCTCTP7RawData_HCALFB ( const uint32_t *  d)
inline

Definition at line 12 of file UCTCTP7RawData_HCALFB.h.

References myDataPtr.

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

◆ UCTCTP7RawData_HCALFB() [2/3]

UCTCTP7RawData_HCALFB::UCTCTP7RawData_HCALFB ( uint32_t *  d)
inline

Definition at line 18 of file UCTCTP7RawData_HCALFB.h.

References myDataPtr.

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

◆ UCTCTP7RawData_HCALFB() [3/3]

UCTCTP7RawData_HCALFB::UCTCTP7RawData_HCALFB ( const UCTCTP7RawData_HCALFB )
delete

◆ ~UCTCTP7RawData_HCALFB()

virtual UCTCTP7RawData_HCALFB::~UCTCTP7RawData_HCALFB ( )
inlinevirtual

Definition at line 28 of file UCTCTP7RawData_HCALFB.h.

28 { ; }

Member Function Documentation

◆ dataPtr()

const uint32_t* UCTCTP7RawData_HCALFB::dataPtr ( ) const
inline

Definition at line 32 of file UCTCTP7RawData_HCALFB.h.

References myDataPtr.

32 { return myDataPtr; }

◆ getET()

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

Definition at line 170 of file UCTCTP7RawData_HCALFB.h.

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

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs_HCALFB(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs_HCALFB(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs_HCALFB().

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  }
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ getFB()

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

Definition at line 215 of file UCTCTP7RawData_HCALFB.h.

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

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs_HCALFB(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs_HCALFB(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs_HCALFB().

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

◆ getFeatureIndex()

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

Definition at line 109 of file UCTCTP7RawData_HCALFB.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_HCALFB") << "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 >= 220) {
144  edm::LogError("UCTCTP7RawData_HCALFB") << "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()

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

Definition at line 257 of file UCTCTP7RawData_HCALFB.h.

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

Referenced by getFB().

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

◆ getIndex()

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

Definition at line 36 of file UCTCTP7RawData_HCALFB.h.

References EBEE, HBHE, and HF.

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

36  {
37  size_t index = 0;
38  if (cType == EBEE || cType == HBHE) {
39  if (iPhi > 3) {
40  edm::LogError("UCTCTP7RawData_HCALFB") << "Incorrect iPhi; iPhi = " << iPhi << "; should be in [0,3]";
41  return index;
42  }
43  if (cEta < 1 || cEta > 28) {
44  edm::LogError("UCTCTP7RawData_HCALFB") << "Incorrect caloEta; cEta = " << cEta << "; should be in [1-28]";
45  return index;
46  }
47  // ECAL/HB+HE fragment size is 3/4 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 + 4) + ((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 + 4));
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 + 4) + (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_HCALFB") << "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_HCALFB") << "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/4 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 + 4) + ((cEta - 30) / 4);
86  } else {
87  // Additional HF a fragment offset for HF b channel
88  index = 20 * (3 + 4) + 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 + 4) + 2 * 4 + ((cEta - 30) / 4);
94  } else {
95  // Additional HF a fragment offset for HF b channel
96  index = 2 * 14 * (3 + 4) + 3 * 4 + ((cEta - 30) / 4);
97  }
98  }
99  } else {
100  edm::LogError("UCTCTP7RawData_HCALFB") << "Unknown CaloType " << cType;
101  return index;
102  }
103  if (index >= 220) {
104  edm::LogError("UCTCTP7RawData_HCALFB") << "Managed to calculate an out-of-bounds index, buyer beware";
105  }
106  return index;
107  }
Log< level::Error, false > LogError

◆ getLinkStatus()

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

Definition at line 267 of file UCTCTP7RawData_HCALFB.h.

References data, getFeatureIndex(), HBHE, and myDataPtr.

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

267  {
268  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
269  const uint32_t data = myDataPtr[index];
270  const uint32_t data2 = myDataPtr[index + 1];
271  uint32_t LS = 0;
272  if (cType == HBHE) {
273  LS = (data >> 24) & 0xFF;
274  LS |= ((data2 >> 24) & 0xFF) << 8;
275  } else {
276  LS = (data >> 16);
277  }
278  return LS;
279  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ getRegionEGVeto()

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

Definition at line 309 of file UCTCTP7RawData_HCALFB.h.

References getRegionSummary(), and nano_mu_digi_cff::region.

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

◆ getRegionET()

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

Definition at line 307 of file UCTCTP7RawData_HCALFB.h.

References getRegionSummary(), and nano_mu_digi_cff::region.

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

◆ getRegionHitLocation()

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

Definition at line 313 of file UCTCTP7RawData_HCALFB.h.

References getRegionSummary(), and nano_mu_digi_cff::region.

313  {
314  return ((getRegionSummary(negativeEta, region) & 0xF000) >> 12);
315  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)

◆ getRegionSummary()

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

Definition at line 301 of file UCTCTP7RawData_HCALFB.h.

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

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

301  {
302  size_t index = getSummaryIndex(negativeEta, region);
303  const uint32_t data = myDataPtr[index];
304  return ((data >> (16 * (region % 2))) & 0xFFFF);
305  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
size_t getSummaryIndex(bool negativeEta, uint32_t region)

◆ getRegionTauVeto()

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

Definition at line 311 of file UCTCTP7RawData_HCALFB.h.

References getRegionSummary(), and nano_mu_digi_cff::region.

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

◆ getSummaryIndex()

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

Definition at line 281 of file UCTCTP7RawData_HCALFB.h.

References nano_mu_digi_cff::region.

Referenced by getRegionSummary(), and setRegionSummary().

281  {
282  size_t index = 2 * 14 * (3 + 4) + 4 * 4 + (region / 2);
283  if (negativeEta)
284  index += 4;
285  if (index >= 220) {
286  edm::LogError("UCTCTP7RawData_HCALFB") << "Managed to calculate an out-of-bounds index, buyer beware";
287  }
288  return index;
289  }
Log< level::Error, false > LogError

◆ isLinkDown()

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

Definition at line 346 of file UCTCTP7RawData_HCALFB.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs_HCALFB(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs_HCALFB(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs_HCALFB().

346  {
347  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
348  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
349  return ((linkStatus & 0x00000400) != 0);
350  }
351  return ((linkStatus & 0x00004000) != 0);
352  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkInError()

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

Definition at line 338 of file UCTCTP7RawData_HCALFB.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs_HCALFB(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs_HCALFB(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs_HCALFB().

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

◆ isLinkMasked()

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

Definition at line 354 of file UCTCTP7RawData_HCALFB.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs_HCALFB(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs_HCALFB(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs_HCALFB().

354  {
355  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
356  if (cType == EBEE && (cEta == 17 || cEta == 21)) {
357  return ((linkStatus & 0x00000800) != 0);
358  }
359  return ((linkStatus & 0x00008000) != 0);
360  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ isLinkMisaligned()

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

Definition at line 330 of file UCTCTP7RawData_HCALFB.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs_HCALFB(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs_HCALFB(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs_HCALFB().

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

◆ isTowerMasked()

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

Definition at line 317 of file UCTCTP7RawData_HCALFB.h.

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

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs_HCALFB(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs_HCALFB(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs_HCALFB().

317  {
318  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
319  uint32_t tower = iPhi;
320  if ((cEta % 2) == 0)
321  tower += 4;
322  if (cType == HF) {
323  tower = (cEta - 30);
324  if (cEta == 41)
325  tower = 10;
326  }
327  return ((linkStatus & (0x1 << tower)) != 0);
328  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)

◆ operator=()

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

◆ setET()

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

Definition at line 149 of file UCTCTP7RawData_HCALFB.h.

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

149  {
150  if (myDataWritePtr == nullptr) {
151  edm::LogError("UCTCTP7RawData_HCALFB") << "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  }
Log< level::Error, false > LogError
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ setFB()

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

Definition at line 188 of file UCTCTP7RawData_HCALFB.h.

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

188  {
189  if (myDataWritePtr == nullptr) {
190  edm::LogError("UCTCTP7RawData_HCALFB") << "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  }
void setHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb)
Log< level::Error, false > LogError
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
static constexpr float b1

◆ setHFFeatureBits()

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

Definition at line 239 of file UCTCTP7RawData_HCALFB.h.

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

Referenced by setFB().

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

◆ setRegionSummary()

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

Definition at line 291 of file UCTCTP7RawData_HCALFB.h.

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

291  {
292  if (myDataWritePtr == nullptr) {
293  edm::LogError("UCTCTP7RawData_HCALFB") << "I was made in read-only mode";
294  return;
295  }
296  size_t index = getSummaryIndex(negativeEta, region);
297  uint32_t& data = myDataWritePtr[index];
298  data |= (regionData & 0xFFFF) << (16 * (region % 2));
299  }
Log< level::Error, false > LogError
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
size_t getSummaryIndex(bool negativeEta, uint32_t region)

◆ sof()

uint32_t UCTCTP7RawData_HCALFB::sof ( )
inline

Definition at line 34 of file UCTCTP7RawData_HCALFB.h.

References myDataPtr.

34 { return myDataPtr[0]; }

Member Data Documentation

◆ myDataPtr

const uint32_t* UCTCTP7RawData_HCALFB::myDataPtr
private

◆ myDataWritePtr

uint32_t* UCTCTP7RawData_HCALFB::myDataWritePtr = nullptr
private

Definition at line 367 of file UCTCTP7RawData_HCALFB.h.

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