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)
 
size_t getFeatureIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_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)
 
size_t getIndex (CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
 
uint32_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 (uint32_t *d)
 
 UCTCTP7RawData (const 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

uint32_t * myDataPtr
 
const uint32_t * myDataPtr
 

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 11 of file UCTCTP7RawData.h.

Constructor & Destructor Documentation

UCTCTP7RawData::UCTCTP7RawData ( uint32_t *  d)
inline

Definition at line 12 of file UCTCTP7RawData.h.

References myDataPtr.

Referenced by isLinkMasked().

12  : myDataPtr(d) {
13  // Yes this ptr is read-write, you better be damn sure it is size 192 or else...
14  if(myDataPtr == nullptr) {
15  edm::LogError("UCTCTP7RawData") << "You gave me a nullptr :<";
16  }
17  }
uint32_t * myDataPtr
virtual UCTCTP7RawData::~UCTCTP7RawData ( )
inlinevirtual

Definition at line 19 of file UCTCTP7RawData.h.

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

Definition at line 13 of file UCTCTP7RawData.h.

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

Definition at line 21 of file UCTCTP7RawData.h.

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

Member Function Documentation

uint32_t UCTCTP7RawData::caloLinkBXID ( )
inline

Definition at line 29 of file UCTCTP7RawData.h.

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

Definition at line 23 of file UCTCTP7RawData.h.

References myDataPtr.

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

Definition at line 25 of file UCTCTP7RawData.h.

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

Definition at line 143 of file UCTCTP7RawData.h.

References data, stringResolutionProvider_cfi::et, and diffTreeTool::index.

143  {
144  uint32_t index = getIndex(cType, negativeEta, cEta, iPhi);
145  const uint32_t data = myDataPtr[index];
146  uint32_t et = 0xDEADBEEF;
147  if(cType == HF) {
148  // Pick out the correct 8-bits for the iEta chosen
149  // Note that cEta = 41 is special, it only occurs for iPhi == 1 and shares cEta = 40 position
150  if(cEta == 41) et = ((data >> 16) & 0xFF);
151  else et = ((data >> ((cEta - 30) % 4) * 8) & 0xFF);
152  }
153  else {
154  // Pick out the correct 8-bits for the iPhi chosen
155  et = ((data >> (iPhi * 8)) & 0xFF);
156  }
157  return et;
158  }
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 166 of file UCTCTP7RawData.h.

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

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

166  {
167  size_t index = getIndex(cType, negativeEta, cEta, iPhi);
168  const uint32_t data = myDataPtr[index];
169  uint32_t et = 0xDEADBEEF;
170  if(cType == HF) {
171  // Pick out the correct 8-bits for the iEta chosen
172  // Note that cEta = 41 is special, it only occurs for iPhi == 1 and shares cEta = 40 position
173  if(cEta == 41) et = ((data >> 16) & 0xFF);
174  else et = ((data >> ((cEta - 30) % 4) * 8) & 0xFF);
175  }
176  else {
177  // Pick out the correct 8-bits for the iPhi chosen
178  et = ((data >> (iPhi * 8)) & 0xFF);
179  }
180  return et;
181  }
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 160 of file UCTCTP7RawData.h.

References data, benchmark_cfg::fb, and diffTreeTool::index.

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

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

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

199  {
200  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
201  const uint32_t data = myDataPtr[index];
202  uint32_t fb = 0;
203  if(cType == HF) {
204  fb = getHFFeatureBits(negativeEta, cEta, iPhi);
205  }
206  else {
207  // Pick out the correct bit for the tower chosen
208  uint32_t tower = iPhi;
209  if(((cEta - 1) % 2) == 1) {
210  tower += 4;
211  }
212  fb = ((data & (0x1 << tower)) != 0) ? 1 : 0;
213  }
214  return fb;
215  }
uint32_t getHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi)
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
size_t UCTCTP7RawData::getFeatureIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 105 of file UCTCTP7RawData.h.

References EBEE, getIndex(), HBHE, and diffTreeTool::index.

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

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

Definition at line 108 of file UCTCTP7RawData.h.

References diffTreeTool::index.

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

References data, diffTreeTool::index, and edm::shift.

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

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

Referenced by getFB().

230  {
231  size_t index = getFeatureIndex(HF, negativeEta, cEta, iPhi);
232  // Stitch together the top 8 bits from previous 32-bit word and bottom 14 bits from this word
233  const uint32_t data = ((myDataPtr[index] & 0x3FFF) << 8) + (myDataPtr[index - 1] >> 24);
234  uint32_t shift = (cEta - 30) * 2;
235  if(cEta == 41) shift = 20; // 41 occurs on b-fiber but shares the position of 40
236  return ((data >> shift) & 0x3);
237  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t * myDataPtr
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static unsigned int const shift
size_t UCTCTP7RawData::getIndex ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 27 of file UCTCTP7RawData.h.

References EBEE, HBHE, and diffTreeTool::index.

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

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

Definition at line 33 of file UCTCTP7RawData.h.

References diffTreeTool::index.

33  {
34  uint32_t index = 0xDEADBEEF;
35  if(cType == EBEE || cType == HBHE) {
36  if(iPhi > 3) {
37  LogError("UCTCTP7RawData") << "Incorrect iPhi; iPhi = " << iPhi << "; should be in [0,3]" << std::endl;
38  return 0xDEADBEEF;
39  }
40  if(cEta < 1 || cEta > 28) {
41  LogError("UCTCTP7RawData") << "Incorrect caloEta; cEta = " << cEta << "; should be in [1-28]" << std::endl;
42  return 0xDEADBEEF;
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 = 2 + ( ((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  LogError("UCTCTP7RawData") << "HF iPhi should be 0 or 1 (for a , b) - invalid iPhi = " << iPhi << std::endl;
72  return 0xDEADBEEF;
73  }
74  if(cEta < 30 || cEta > 41) {
75  LogError("UCTCTP7RawData") << "HF cEta should be between 30 and 41 - invalid cEta = " << cEta << std::endl;
76  return 0xDEADBEEF;
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 = 2 + 20 * (3 + 3) + ((cEta - 30) / 4);
84  }
85  else {
86  // Additional HF a fragment offset for HF b channel
87  index = 2 + 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 + 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 + 2 * 14 * (3 + 3) + 3 * 4 + ((cEta - 30) / 4);
98  }
99  }
100  }
101  else {
102  LogError("UCTCTP7RawData") << "Unknown CaloType " << cType << std::endl;
103  return 0xDEADBEEF;
104  }
105  return index;
106  }
uint32_t UCTCTP7RawData::getLinkStatus ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 187 of file UCTCTP7RawData.h.

References data, and diffTreeTool::index.

187  {
188  uint32_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
189  const uint32_t data = myDataPtr[index];
190  return (data >> 16);
191  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
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 239 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), diffTreeTool::index, and myDataPtr.

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

239  {
240  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
241  const uint32_t data = myDataPtr[index];
242  return (data >> 16);
243  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
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 209 of file UCTCTP7RawData.h.

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

Definition at line 270 of file UCTCTP7RawData.h.

References getRegionSummary().

270  {
271  return (getRegionSummary(negativeEta, region) & 0x0400);
272  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getRegionET ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 205 of file UCTCTP7RawData.h.

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

Definition at line 266 of file UCTCTP7RawData.h.

References getRegionSummary().

266  {
267  return (getRegionSummary(negativeEta, region) & 0x3FF);
268  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getRegionHitLocation ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 217 of file UCTCTP7RawData.h.

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

Definition at line 278 of file UCTCTP7RawData.h.

References getRegionSummary().

278  {
279  return ((getRegionSummary(negativeEta, region) & 0xF000) >> 12);
280  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getRegionSummary ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 199 of file UCTCTP7RawData.h.

References data, and diffTreeTool::index.

199  {
200  uint32_t index = getSummaryIndex(negativeEta, region);
201  const uint32_t data = myDataPtr[index];
202  return ((data >> (16 * (region % 2))) & 0xFFFF);
203  }
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 260 of file UCTCTP7RawData.h.

References data, getSummaryIndex(), diffTreeTool::index, and myDataPtr.

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

260  {
261  size_t index = getSummaryIndex(negativeEta, region);
262  const uint32_t data = myDataPtr[index];
263  return ((data >> (16 * (region % 2))) & 0xFFFF);
264  }
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 213 of file UCTCTP7RawData.h.

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

Definition at line 274 of file UCTCTP7RawData.h.

References getRegionSummary().

274  {
275  return (getRegionSummary(negativeEta, region) & 0x0800);
276  }
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t UCTCTP7RawData::getSummaryIndex ( bool  negativeEta,
uint32_t  region 
)
inline

Definition at line 193 of file UCTCTP7RawData.h.

References diffTreeTool::index.

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

Definition at line 245 of file UCTCTP7RawData.h.

References diffTreeTool::index.

Referenced by getRegionSummary(), and setRegionSummary().

245  {
246  size_t index = 2 * 14 * (3 + 3) + 4 * 4 + (region / 2);
247  if(negativeEta) index += 4;
248  if ( index >= 192 ) {
249  edm::LogError("UCTCTP7RawData") << "Managed to calculate an out-of-bounds index, buyer beware";
250  }
251  return index;
252  }
bool UCTCTP7RawData::isLinkDown ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi 
)
inline

Definition at line 248 of file UCTCTP7RawData.h.

248  {
249  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
250  if ( cType == EBEE && (cEta==17||cEta==21) ) {
251  return ((linkStatus & 0x00000400) != 0);
252  }
253  return ((linkStatus & 0x00004000) != 0);
254  }
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 309 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().

309  {
310  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
311  if ( cType == EBEE && (cEta==17||cEta==21) ) {
312  return ((linkStatus & 0x00000400) != 0);
313  }
314  return ((linkStatus & 0x00004000) != 0);
315  }
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 240 of file UCTCTP7RawData.h.

240  {
241  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
242  if ( cType == EBEE && (cEta==17||cEta==21) ) {
243  return ((linkStatus & 0x00000200) != 0);
244  }
245  return ((linkStatus & 0x00002000) != 0);
246  }
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 301 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().

301  {
302  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
303  if ( cType == EBEE && (cEta==17||cEta==21) ) {
304  return ((linkStatus & 0x00000200) != 0);
305  }
306  return ((linkStatus & 0x00002000) != 0);
307  }
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 256 of file UCTCTP7RawData.h.

256  {
257  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
258  if ( cType == EBEE && (cEta==17||cEta==21) ) {
259  return ((linkStatus & 0x00000800) != 0);
260  }
261  return ((linkStatus & 0x00008000) != 0);
262  }
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 317 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().

317  {
318  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
319  if ( cType == EBEE && (cEta==17||cEta==21) ) {
320  return ((linkStatus & 0x00000800) != 0);
321  }
322  return ((linkStatus & 0x00008000) != 0);
323  }
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 232 of file UCTCTP7RawData.h.

232  {
233  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
234  if ( cType == EBEE && (cEta==17||cEta==21) ) {
235  return ((linkStatus & 0x00000100) != 0);
236  }
237  return ((linkStatus & 0x00001000) != 0);
238  }
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 293 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().

293  {
294  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
295  if ( cType == EBEE && (cEta==17||cEta==21) ) {
296  return ((linkStatus & 0x00000100) != 0);
297  }
298  return ((linkStatus & 0x00001000) != 0);
299  }
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 221 of file UCTCTP7RawData.h.

References globals_cff::x1.

221  {
222  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
223  uint32_t tower = iPhi;
224  if(((cEta - 1) % 2) == 1) tower += 4;
225  if(cType == HF) {
226  tower = (cEta - 30);
227  if(cEta == 41) tower = 10;
228  }
229  return ((linkStatus & (0x1 << tower)) != 0);
230  }
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 282 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().

282  {
283  uint32_t linkStatus = getLinkStatus(cType, negativeEta, cEta, iPhi);
284  uint32_t tower = iPhi;
285  if( (cEta %2) == 0 ) tower += 4;
286  if(cType == HF) {
287  tower = (cEta - 30);
288  if(cEta == 41) tower = 10;
289  }
290  return ((linkStatus & (0x1 << tower)) != 0);
291  }
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t UCTCTP7RawData::nBXPerL1A ( )
inline

Definition at line 31 of file UCTCTP7RawData.h.

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

Referenced by isLinkMasked().

const UCTCTP7RawData& UCTCTP7RawData::operator= ( const UCTCTP7RawData i)
privatedelete
void UCTCTP7RawData::print ( void  )
inline

Definition at line 264 of file UCTCTP7RawData.h.

References TauDecayModes::dec, edm::first(), hcaldqm::constants::HF, and mps_fire::i.

Referenced by L1TCaloLayer1RawToDigi::produce().

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

References data, getIndex(), diffTreeTool::index, and myDataPtr.

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

148  {
149  size_t index = getIndex(cType, negativeEta, cEta, iPhi);
150  uint32_t & data = myDataPtr[index];
151  if(cType == HF) {
152  // Pick out the correct 8-bits for the iEta chosen
153  // Note that cEta = 41 is special, it only occurs for iPhi == 1 and shares cEta = 40 position
154  if(cEta == 41) {
155  data |= (et & 0xFF) << 16;
156  } else {
157  data |= (et & 0xFF) << (((cEta - 30) % 4) * 8);
158  }
159  }
160  else {
161  // Pick out the correct 8-bits for the iPhi chosen
162  data |= (et & 0xFF) << (iPhi * 8);
163  }
164  }
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)
void UCTCTP7RawData::setFB ( CaloType  cType,
bool  negativeEta,
uint32_t  cEta,
uint32_t  iPhi,
uint32_t  fb 
)
inline

Definition at line 183 of file UCTCTP7RawData.h.

References data, getFeatureIndex(), diffTreeTool::index, myDataPtr, and setHFFeatureBits().

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

183  {
184  if(cType == HF) {
185  setHFFeatureBits(negativeEta, cEta, iPhi, fb);
186  }
187  else {
188  size_t index = getFeatureIndex(cType, negativeEta, cEta, iPhi);
189  uint32_t & data = myDataPtr[index];
190 
191  uint32_t tower = iPhi;
192  if(((cEta - 1) % 2) == 1) {
193  tower += 4;
194  }
195  data |= (fb&0x1) << tower;
196  }
197  }
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)
uint32_t * myDataPtr
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 217 of file UCTCTP7RawData.h.

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

Referenced by setFB().

217  {
218  size_t index = getFeatureIndex(HF, negativeEta, cEta, iPhi);
219  uint32_t shift = (cEta - 30) * 2;
220  if(cEta == 41) shift = 20; // 41 occurs on b-fiber but shares the position of 40
221  if ( shift >= 8 ) {
222  uint32_t & data = myDataPtr[index];
223  data |= (fb & 0x3) << (shift-8);
224  } else {
225  uint32_t & data = myDataPtr[index-1];
226  data |= (fb & 0x3) << (shift+24);
227  }
228  }
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t * myDataPtr
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 254 of file UCTCTP7RawData.h.

References data, getSummaryIndex(), diffTreeTool::index, and myDataPtr.

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

254  {
255  size_t index = getSummaryIndex(negativeEta, region);
256  uint32_t & data = myDataPtr[index];
257  data |= (regionData & 0xFFFF) << (16 * (region % 2));
258  }
uint32_t * myDataPtr
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 25 of file UCTCTP7RawData.h.

References myDataPtr.

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

Definition at line 27 of file UCTCTP7RawData.h.

27 {return myDataPtr[0];}
uint32_t * myDataPtr

Member Data Documentation

uint32_t* UCTCTP7RawData::myDataPtr
private
const uint32_t* UCTCTP7RawData::myDataPtr
private

Definition at line 346 of file UCTCTP7RawData.h.