CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private 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 ()
 
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)
 
virtual ~UCTCTP7RawData ()
 
virtual ~UCTCTP7RawData ()
 

Private Member Functions

const UCTCTP7RawDataoperator= (const UCTCTP7RawData &i)=delete
 
const UCTCTP7RawDataoperator= (const UCTCTP7RawData &i)=delete
 
 UCTCTP7RawData (const UCTCTP7RawData &)=delete
 
 UCTCTP7RawData (const UCTCTP7RawData &)=delete
 

Private Attributes

const uint32_t * myDataPtr
 
uint32_t * myDataWritePtr = 0
 

Detailed Description

Definition at line 7 of file UCTCTP7RawData.h.

Member Enumeration Documentation

Enumerator
EBEE 
HBHE 
HF 
EBEE 
HBHE 
HF 

Definition at line 10 of file UCTCTP7RawData.h.

Enumerator
EBEE 
HBHE 
HF 
EBEE 
HBHE 
HF 

Definition at line 10 of file UCTCTP7RawData.h.

Constructor & Destructor Documentation

UCTCTP7RawData::UCTCTP7RawData ( const uint32_t *  d)
inline

Definition at line 13 of file UCTCTP7RawData.h.

References myDataPtr.

Referenced by isLinkMasked(), and print().

13  : myDataPtr(d) {
14  if(myDataPtr == nullptr) {
15  edm::LogError("UCTCTP7RawData") << "You gave me a nullptr :<";
16  }
17  }
const uint32_t * myDataPtr
UCTCTP7RawData::UCTCTP7RawData ( uint32_t *  d)
inline

Definition at line 19 of file UCTCTP7RawData.h.

References myDataPtr.

20  if(myDataPtr == nullptr) {
21  edm::LogError("UCTCTP7RawData") << "You gave me a nullptr :<";
22  }
23  }
uint32_t * myDataWritePtr
const uint32_t * myDataPtr
virtual UCTCTP7RawData::~UCTCTP7RawData ( )
inlinevirtual

Definition at line 25 of file UCTCTP7RawData.h.

25 {;}
UCTCTP7RawData::UCTCTP7RawData ( const UCTCTP7RawData )
privatedelete
UCTCTP7RawData::UCTCTP7RawData ( const uint32_t *  d)
inline

Definition at line 12 of file UCTCTP7RawData.h.

References myDataPtr, and sof().

12  : myDataPtr(d) {
13  if(myDataPtr != nullptr) {
14  if(sof() != 0xA110CA7E) {
15  edm::LogError("UCTCTP7RawData") << "Failed to see 0xA110CA7E at start - but continuing" << std::endl;
16  }
17  }
18  }
uint32_t sof()
const uint32_t * myDataPtr
virtual UCTCTP7RawData::~UCTCTP7RawData ( )
inlinevirtual

Definition at line 20 of file UCTCTP7RawData.h.

20 {;}
UCTCTP7RawData::UCTCTP7RawData ( const UCTCTP7RawData )
privatedelete

Member Function Documentation

uint32_t UCTCTP7RawData::caloLinkBXID ( )
inline

Definition at line 28 of file UCTCTP7RawData.h.

References myDataPtr.

Referenced by print().

28 {return (myDataPtr[1] & 0x00000FFF);}
const uint32_t * myDataPtr
const uint32_t* UCTCTP7RawData::dataPtr ( ) const
inline

Definition at line 24 of file UCTCTP7RawData.h.

References myDataPtr.

24 {return myDataPtr;}
const uint32_t * myDataPtr
const uint32_t* UCTCTP7RawData::dataPtr ( ) const
inline

Definition at line 29 of file UCTCTP7RawData.h.

References myDataPtr.

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

Definition at line 142 of file UCTCTP7RawData.h.

References data, stringResolutionProvider_cfi::et, getIndex(), and myDataPtr.

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

Definition at line 176 of file UCTCTP7RawData.h.

References data, stringResolutionProvider_cfi::et, getIndex(), and myDataPtr.

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

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

Definition at line 159 of file UCTCTP7RawData.h.

References data, benchmark_cfg::fb, getFeatureIndex(), getHFFeatureBits(), and myDataPtr.

159  {
160  uint32_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
161  const uint32_t data = myDataPtr[index];
162  uint32_t fb = 0;
163  if(cType == HF) {
164  fb = getHFFeatureBits(negativeEta, cEta, iPhi);
165  }
166  else {
167  // Pick out the correct bit for the tower chosen
168  uint32_t tower = iPhi;
169  if(((cEta - 1) % 2) == 1) {
170  tower += 4;
171  }
172  fb = ((data & (0x1 << tower)) != 0) ? 1 : 0;
173  }
174  return fb;
175  }
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:82
uint32_t UCTCTP7RawData::getFB ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 213 of file UCTCTP7RawData.h.

References data, benchmark_cfg::fb, getFeatureIndex(), getHFFeatureBits(), and myDataPtr.

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

213  {
214  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
215  const uint32_t data = myDataPtr[index];
216  uint32_t fb = 0;
217  if(cType == HF) {
218  fb = getHFFeatureBits(negativeEta, cEta, iPhi);
219  }
220  else {
221  // Pick out the correct bit for the tower chosen
222  uint32_t tower = iPhi;
223  if(((cEta - 1) % 2) == 1) {
224  tower += 4;
225  }
226  fb = ((data & (0x1 << tower)) != 0) ? 1 : 0;
227  }
228  return fb;
229  }
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:82
uint32_t UCTCTP7RawData::getFeatureIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 107 of file UCTCTP7RawData.h.

References EBEE, getIndex(), and HBHE.

107  {
108  // Get index into the data words for the tower
109  uint32_t index = getIndex(cType, negativeEta, cEta, iPhi);
110  if(cType == EBEE || cType == HBHE) {
111  // Two 32-bit words contain ET, so we should offset the index to
112  // to the feature and link status bits
113  if(((cEta - 1) % 2) == 0) {
114  // [index] is offset to ET of first four towers (0 - 3)
115  // [index + 2] is where the feature and link status bits are
116  index += 2;
117  }
118  else {
119  // In this case [index] is offset to ET of second four towers (4 - 7)
120  // [index + 1] is where the feature and link status bits are
121  index += 1;
122  }
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  }
136  else {
137  return 0xDEADBEEF;
138  }
139  return index;
140  }
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
size_t UCTCTP7RawData::getFeatureIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 111 of file UCTCTP7RawData.h.

References EBEE, getIndex(), and HBHE.

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

Definition at line 177 of file UCTCTP7RawData.h.

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

177  {
178  uint32_t index = getFeatureIndex(HF, negativeEta, cEta, iPhi);
179  // Stitch together the top 8 bits from previous 32-bit word and bottom 14 bits from this word
180  const uint32_t data = ((myDataPtr[index] & 0x3FFF) << 8) + (myDataPtr[index - 1] >> 24);
181  uint32_t shift = (cEta - 30) * 2;
182  if(cEta == 41) shift = 20; // 41 occurs on b-fiber but shares the position of 40
183  return ((data >> shift) & 0x3);
184  }
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:82
static unsigned int const shift
uint32_t UCTCTP7RawData::getHFFeatureBits ( bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 248 of file UCTCTP7RawData.h.

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

Referenced by getFB(), and print().

248  {
249  size_t index = getFeatureIndex(HF, negativeEta, cEta, iPhi);
250  // Stitch together the top 8 bits from previous 32-bit word and bottom 14 bits from this word
251  const uint32_t data = ((myDataPtr[index] & 0x3FFF) << 8) + (myDataPtr[index - 1] >> 24);
252  uint32_t shift = (cEta - 30) * 2;
253  if(cEta == 41) shift = 20; // 41 occurs on b-fiber but shares the position of 40
254  return ((data >> shift) & 0x3);
255  }
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:82
static unsigned int const shift
uint32_t UCTCTP7RawData::getIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 32 of file UCTCTP7RawData.h.

References EBEE, and HBHE.

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

Definition at line 33 of file UCTCTP7RawData.h.

References EBEE, and HBHE.

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

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

Definition at line 186 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), and myDataPtr.

186  {
187  uint32_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
188  const uint32_t data = myDataPtr[index];
189  return (data >> 16);
190  }
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:82
uint32_t UCTCTP7RawData::getLinkStatus ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 257 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), and myDataPtr.

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

257  {
258  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
259  const uint32_t data = myDataPtr[index];
260  return (data >> 16);
261  }
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:82
bool UCTCTP7RawData::getRegionEGVeto ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 208 of file UCTCTP7RawData.h.

References getRegionSummary().

208  {
209  return (getRegionSummary(negativeEta, region) & 0x0400);
210  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
bool UCTCTP7RawData::getRegionEGVeto ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 292 of file UCTCTP7RawData.h.

References getRegionSummary().

Referenced by print().

292  {
293  return (getRegionSummary(negativeEta, region) & 0x0400);
294  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getRegionET ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 204 of file UCTCTP7RawData.h.

References getRegionSummary().

204  {
205  return (getRegionSummary(negativeEta, region) & 0x3FF);
206  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getRegionET ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 288 of file UCTCTP7RawData.h.

References getRegionSummary().

Referenced by print().

288  {
289  return (getRegionSummary(negativeEta, region) & 0x3FF);
290  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getRegionHitLocation ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 216 of file UCTCTP7RawData.h.

References getRegionSummary().

216  {
217  return ((getRegionSummary(negativeEta, region) & 0xF000) >> 12);
218  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getRegionHitLocation ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 300 of file UCTCTP7RawData.h.

References getRegionSummary().

Referenced by print().

300  {
301  return ((getRegionSummary(negativeEta, region) & 0xF000) >> 12);
302  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getRegionSummary ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 198 of file UCTCTP7RawData.h.

References data, getSummaryIndex(), and myDataPtr.

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

Definition at line 282 of file UCTCTP7RawData.h.

References data, getSummaryIndex(), and myDataPtr.

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

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

Definition at line 212 of file UCTCTP7RawData.h.

References getRegionSummary().

212  {
213  return (getRegionSummary(negativeEta, region) & 0x0800);
214  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
bool UCTCTP7RawData::getRegionTauVeto ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 296 of file UCTCTP7RawData.h.

References getRegionSummary().

Referenced by print().

296  {
297  return (getRegionSummary(negativeEta, region) & 0x0800);
298  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getSummaryIndex ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 192 of file UCTCTP7RawData.h.

192  {
193  uint32_t index = 2 + 2 * 14 * (3 + 3) + 4 * 4 + (region / 2);
194  if(negativeEta) index += 4;
195  return index;
196  }
size_t UCTCTP7RawData::getSummaryIndex ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 263 of file UCTCTP7RawData.h.

Referenced by getRegionSummary(), and setRegionSummary().

263  {
264  size_t index = 2 * 14 * (3 + 3) + 4 * 4 + (region / 2);
265  if(negativeEta) index += 4;
266  if ( index >= 192 ) {
267  edm::LogError("UCTCTP7RawData") << "Managed to calculate an out-of-bounds index, buyer beware";
268  }
269  return index;
270  }
bool UCTCTP7RawData::isLinkDown ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 247 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

247  {
248  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
249  if ( cType == EBEE && (cEta==17||cEta==21) ) {
250  return ((linkStatus & 0x00000400) != 0);
251  }
252  return ((linkStatus & 0x00004000) != 0);
253  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
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)
bool UCTCTP7RawData::isLinkInError ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 239 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

239  {
240  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
241  if ( cType == EBEE && (cEta==17||cEta==21) ) {
242  return ((linkStatus & 0x00000200) != 0);
243  }
244  return ((linkStatus & 0x00002000) != 0);
245  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
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)
bool UCTCTP7RawData::isLinkMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 255 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

255  {
256  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
257  if ( cType == EBEE && (cEta==17||cEta==21) ) {
258  return ((linkStatus & 0x00000800) != 0);
259  }
260  return ((linkStatus & 0x00008000) != 0);
261  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool UCTCTP7RawData::isLinkMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 339 of file UCTCTP7RawData.h.

References EBEE, getLinkStatus(), mps_fire::i, operator=(), and UCTCTP7RawData().

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)
bool UCTCTP7RawData::isLinkMisaligned ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 231 of file UCTCTP7RawData.h.

References EBEE, and getLinkStatus().

231  {
232  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
233  if ( cType == EBEE && (cEta==17||cEta==21) ) {
234  return ((linkStatus & 0x00000100) != 0);
235  }
236  return ((linkStatus & 0x00001000) != 0);
237  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
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)
bool UCTCTP7RawData::isTowerMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 220 of file UCTCTP7RawData.h.

References getLinkStatus(), and globals_cff::x1.

220  {
221  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
222  uint32_t tower = iPhi;
223  if(((cEta - 1) % 2) == 1) tower += 4;
224  if(cType == HF) {
225  tower = (cEta - 30);
226  if(cEta == 41) tower = 10;
227  }
228  return ((linkStatus & (0x1 << tower)) != 0);
229  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool UCTCTP7RawData::isTowerMasked ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 304 of file UCTCTP7RawData.h.

References getLinkStatus(), and globals_cff::x1.

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

304  {
305  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
306  uint32_t tower = iPhi;
307  if( (cEta %2) == 0 ) tower += 4;
308  if(cType == HF) {
309  tower = (cEta - 30);
310  if(cEta == 41) 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 UCTCTP7RawData::nBXPerL1A ( )
inline

Definition at line 30 of file UCTCTP7RawData.h.

References myDataPtr.

Referenced by print().

30 {return ((myDataPtr[1] & 0x000F0000) >> 16);}
const uint32_t * myDataPtr
const UCTCTP7RawData& UCTCTP7RawData::operator= ( const UCTCTP7RawData i)
privatedelete
const UCTCTP7RawData& UCTCTP7RawData::operator= ( const UCTCTP7RawData i)
privatedelete

Referenced by isLinkMasked(), and print().

void UCTCTP7RawData::print ( void  )
inline

Definition at line 263 of file UCTCTP7RawData.h.

References caloLinkBXID(), TauDecayModes::dec, EBEE, plotBeamSpotDB::first, getET(), getFB(), getHFFeatureBits(), getIndex(), getLinkStatus(), getRegionEGVeto(), getRegionET(), getRegionHitLocation(), getRegionTauVeto(), HBHE, HF, mps_fire::i, myDataPtr, nBXPerL1A(), operator=(), and UCTCTP7RawData().

Referenced by L1TCaloLayer1RawToDigi::produce().

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

Definition at line 154 of file UCTCTP7RawData.h.

References data, getIndex(), and myDataWritePtr.

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

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

Definition at line 193 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), myDataWritePtr, and setHFFeatureBits().

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

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

Definition at line 231 of file UCTCTP7RawData.h.

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

Referenced by setFB().

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

Definition at line 272 of file UCTCTP7RawData.h.

References data, getSummaryIndex(), and myDataWritePtr.

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

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

Definition at line 26 of file UCTCTP7RawData.h.

References myDataPtr.

26 {return myDataPtr[0];}
const uint32_t * myDataPtr
uint32_t UCTCTP7RawData::sof ( )
inline

Definition at line 31 of file UCTCTP7RawData.h.

References myDataPtr.

Referenced by UCTCTP7RawData().

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

Member Data Documentation

const uint32_t * UCTCTP7RawData::myDataPtr
private
uint32_t* UCTCTP7RawData::myDataWritePtr = 0
private

Definition at line 358 of file UCTCTP7RawData.h.

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