CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Attributes
UCTCTP7RawData5BX Class Reference

#include <UCTCTP7RawData5BX.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 BX_n)
 
uint32_t getFB (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
size_t getFeatureIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
uint32_t getHFFeatureBits (bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
size_t getIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
uint32_t getLinkStatus (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
bool getRegionEGVeto (bool negativeEta, uint32_t region, uint32_t BX_n)
 
uint32_t getRegionET (bool negativeEta, uint32_t region, uint32_t BX_n)
 
uint32_t getRegionHitLocation (bool negativeEta, uint32_t region, uint32_t BX_n)
 
uint32_t getRegionSummary (bool negativeEta, uint32_t region, uint32_t BX_n)
 
bool getRegionTauVeto (bool negativeEta, uint32_t region, uint32_t BX_n)
 
size_t getSummaryIndex (bool negativeEta, uint32_t region, uint32_t BX_n)
 
bool isLinkDown (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
bool isLinkInError (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
bool isLinkMasked (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
bool isLinkMisaligned (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
bool isTowerMasked (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
 
const UCTCTP7RawData5BXoperator= (const UCTCTP7RawData5BX &i)=delete
 
void setET (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t et, uint32_t BX_n)
 
void setFB (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb, uint32_t BX_n)
 
void setHFFeatureBits (bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb, uint32_t BX_n)
 
void setRegionSummary (bool negativeEta, uint32_t region, uint32_t regionData, uint32_t BX_n)
 
uint32_t sof ()
 
 UCTCTP7RawData5BX (const uint32_t *d)
 
 UCTCTP7RawData5BX (uint32_t *d)
 
 UCTCTP7RawData5BX (const UCTCTP7RawData5BX &)=delete
 
virtual ~UCTCTP7RawData5BX ()
 

Private Attributes

const uint32_t * myDataPtr
 
uint32_t * myDataWritePtr = nullptr
 

Detailed Description

Definition at line 7 of file UCTCTP7RawData5BX.h.

Member Enumeration Documentation

Enumerator
EBEE 
HBHE 
HF 

Definition at line 9 of file UCTCTP7RawData5BX.h.

Constructor & Destructor Documentation

UCTCTP7RawData5BX::UCTCTP7RawData5BX ( const uint32_t *  d)
inline

Definition at line 12 of file UCTCTP7RawData5BX.h.

References myDataPtr.

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

Definition at line 18 of file UCTCTP7RawData5BX.h.

References myDataPtr.

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

Definition at line 28 of file UCTCTP7RawData5BX.h.

28 { ; }

Member Function Documentation

const uint32_t* UCTCTP7RawData5BX::dataPtr ( ) const
inline

Definition at line 32 of file UCTCTP7RawData5BX.h.

References myDataPtr.

32 { return myDataPtr; }
const uint32_t * myDataPtr
uint32_t UCTCTP7RawData5BX::getET ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  BX_n 
)
inline

Definition at line 172 of file UCTCTP7RawData5BX.h.

References data, getIndex(), HF, and myDataPtr.

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs5BX(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs5BX(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs5BX().

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

Definition at line 209 of file UCTCTP7RawData5BX.h.

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

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs5BX(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs5BX(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs5BX().

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

Definition at line 111 of file UCTCTP7RawData5BX.h.

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

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

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

Definition at line 244 of file UCTCTP7RawData5BX.h.

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

Referenced by getFB().

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

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

Definition at line 254 of file UCTCTP7RawData5BX.h.

References data, getFeatureIndex(), and myDataPtr.

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

254  {
255  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi, BX_n);
256  const uint32_t data = myDataPtr[index];
257  return (data >> 16);
258  }
const uint32_t * myDataPtr
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
bool UCTCTP7RawData5BX::getRegionEGVeto ( bool  negativeEta,
uint32_t  region,
uint32_t  BX_n 
)
inline

Definition at line 290 of file UCTCTP7RawData5BX.h.

References getRegionSummary().

290  {
291  return (getRegionSummary(negativeEta, region, BX_n) & 0x0400);
292  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region, uint32_t BX_n)
uint32_t UCTCTP7RawData5BX::getRegionET ( bool  negativeEta,
uint32_t  region,
uint32_t  BX_n 
)
inline

Definition at line 286 of file UCTCTP7RawData5BX.h.

References getRegionSummary().

286  {
287  return (getRegionSummary(negativeEta, region, BX_n) & 0x3FF);
288  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region, uint32_t BX_n)
uint32_t UCTCTP7RawData5BX::getRegionHitLocation ( bool  negativeEta,
uint32_t  region,
uint32_t  BX_n 
)
inline

Definition at line 298 of file UCTCTP7RawData5BX.h.

References getRegionSummary().

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

Definition at line 280 of file UCTCTP7RawData5BX.h.

References data, getSummaryIndex(), and myDataPtr.

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

280  {
281  size_t index = getSummaryIndex(negativeEta, region, BX_n);
282  const uint32_t data = myDataPtr[index];
283  return ((data >> (16 * (region % 2))) & 0xFFFF);
284  }
const uint32_t * myDataPtr
size_t getSummaryIndex(bool negativeEta, uint32_t region, uint32_t BX_n)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
bool UCTCTP7RawData5BX::getRegionTauVeto ( bool  negativeEta,
uint32_t  region,
uint32_t  BX_n 
)
inline

Definition at line 294 of file UCTCTP7RawData5BX.h.

References getRegionSummary().

294  {
295  return (getRegionSummary(negativeEta, region, BX_n) & 0x0800);
296  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region, uint32_t BX_n)
size_t UCTCTP7RawData5BX::getSummaryIndex ( bool  negativeEta,
uint32_t  region,
uint32_t  BX_n 
)
inline

Definition at line 260 of file UCTCTP7RawData5BX.h.

Referenced by getRegionSummary(), and setRegionSummary().

260  {
261  size_t index = 2 * 14 * (3 + 3) * 5 + 4 * 4 * 5 + (region / 2) + 4 * BX_n;
262  if (negativeEta)
263  index += 4 * 5;
264  if (index >= 192 * 5) {
265  edm::LogError("UCTCTP7RawData5BX") << "Managed to calculate an out-of-bounds index, buyer beware";
266  }
267  return index;
268  }
Log< level::Error, false > LogError
bool UCTCTP7RawData5BX::isLinkDown ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  BX_n 
)
inline

Definition at line 331 of file UCTCTP7RawData5BX.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs5BX(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs5BX(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs5BX().

331  {
332  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
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, uint32_t BX_n)
bool UCTCTP7RawData5BX::isLinkInError ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  BX_n 
)
inline

Definition at line 323 of file UCTCTP7RawData5BX.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs5BX(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs5BX(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs5BX().

323  {
324  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
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, uint32_t BX_n)
bool UCTCTP7RawData5BX::isLinkMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  BX_n 
)
inline

Definition at line 339 of file UCTCTP7RawData5BX.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs5BX(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs5BX(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs5BX().

339  {
340  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
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, uint32_t BX_n)
bool UCTCTP7RawData5BX::isLinkMisaligned ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  BX_n 
)
inline

Definition at line 315 of file UCTCTP7RawData5BX.h.

References EBEE, and getLinkStatus().

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs5BX(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs5BX(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs5BX().

315  {
316  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
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, uint32_t BX_n)
bool UCTCTP7RawData5BX::isTowerMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  BX_n 
)
inline

Definition at line 302 of file UCTCTP7RawData5BX.h.

References getLinkStatus(), HF, and hgcalTowerProducer_cfi::tower.

Referenced by l1t::stage2::CaloLayer1Unpacker::makeECalTPGs5BX(), l1t::stage2::CaloLayer1Unpacker::makeHCalTPGs5BX(), and l1t::stage2::CaloLayer1Unpacker::makeHFTPGs5BX().

302  {
303  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
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, uint32_t BX_n)
const UCTCTP7RawData5BX& UCTCTP7RawData5BX::operator= ( const UCTCTP7RawData5BX i)
delete
void UCTCTP7RawData5BX::setET ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  et,
uint32_t  BX_n 
)
inline

Definition at line 151 of file UCTCTP7RawData5BX.h.

References data, getIndex(), HF, and myDataWritePtr.

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

Definition at line 190 of file UCTCTP7RawData5BX.h.

References data, getFeatureIndex(), HF, myDataWritePtr, setHFFeatureBits(), and hgcalTowerProducer_cfi::tower.

190  {
191  if (myDataWritePtr == nullptr) {
192  edm::LogError("UCTCTP7RawData5BX") << "I was made in read-only mode";
193  return;
194  }
195  if (cType == HF) {
196  setHFFeatureBits(negativeEta, cEta, iPhi, fb, BX_n);
197  } else {
198  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi, BX_n);
199  uint32_t& data = myDataWritePtr[index];
200 
201  uint32_t tower = iPhi;
202  if (((cEta - 1) % 2) == 1) {
203  tower += 4;
204  }
205  data |= (fb & 0x1) << tower;
206  }
207  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
Log< level::Error, false > LogError
void setHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb, uint32_t BX_n)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void UCTCTP7RawData5BX::setHFFeatureBits ( bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  fb,
uint32_t  BX_n 
)
inline

Definition at line 226 of file UCTCTP7RawData5BX.h.

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

Referenced by setFB().

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

Definition at line 270 of file UCTCTP7RawData5BX.h.

References data, getSummaryIndex(), and myDataWritePtr.

270  {
271  if (myDataWritePtr == nullptr) {
272  edm::LogError("UCTCTP7RawData5BX") << "I was made in read-only mode";
273  return;
274  }
275  size_t index = getSummaryIndex(negativeEta, region, BX_n);
276  uint32_t& data = myDataWritePtr[index];
277  data |= (regionData & 0xFFFF) << (16 * (region % 2));
278  }
Log< level::Error, false > LogError
size_t getSummaryIndex(bool negativeEta, uint32_t region, uint32_t BX_n)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uint32_t UCTCTP7RawData5BX::sof ( )
inline

Definition at line 34 of file UCTCTP7RawData5BX.h.

References myDataPtr.

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

Member Data Documentation

const uint32_t* UCTCTP7RawData5BX::myDataPtr
private
uint32_t* UCTCTP7RawData5BX::myDataWritePtr = nullptr
private

Definition at line 352 of file UCTCTP7RawData5BX.h.

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