1 #ifndef UCTCTP7RawData5BX_HCALFB_hh 2 #define UCTCTP7RawData5BX_HCALFB_hh 14 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"You gave me a nullptr :<";
20 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"You gave me a nullptr :<";
36 size_t getIndex(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n) {
38 if (cType ==
EBEE || cType ==
HBHE) {
40 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"Incorrect iPhi; iPhi = " << iPhi <<
"; should be in [0,3]";
43 if (cEta < 1 || cEta > 28) {
44 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"Incorrect caloEta; cEta = " << cEta <<
"; should be in [1-28]";
54 index = (((cEta - 1) / 2) * (3 + 4) * 5 + ((cEta - 1) % 2)) + 3 * BX_n;
57 index = (((cEta - 1) / 2) * (3 + 4) * 5 + ((cEta - 1) % 2)) + 4 * BX_n;
65 index += (6 * (3 + 4)) * 5;
72 index += ((14 * (3 + 4) + (2 * 4))) * 5;
78 }
else if (cType ==
HF) {
80 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"HF iPhi should be 0 or 1 (for a , b) - invalid iPhi = " << iPhi;
83 if (cEta < 30 || cEta > 41) {
84 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"HF cEta should be between 30 and 41 - invalid cEta = " << cEta;
92 index = 20 * (3 + 4) * 5 + ((cEta - 30) / 4) + 4 * BX_n;
95 index = 20 * (3 + 4) * 5 + 1 * 4 * 5 + ((cEta - 30) / 4) + 4 * BX_n;
100 index = 2 * 14 * (3 + 4) * 5 + 2 * 4 * 5 + ((cEta - 30) / 4) + 4 * BX_n;
103 index = 2 * 14 * (3 + 4) * 5 + 3 * 4 * 5 + ((cEta - 30) / 4) + 4 * BX_n;
107 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"Unknown CaloType " << cType;
110 if (
index >= 220 * 5) {
111 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"Managed to calculate an out-of-bounds index, buyer beware";
118 size_t index =
getIndex(cType, negativeEta, cEta, iPhi, BX_n);
119 if (cType ==
EBEE || cType ==
HBHE) {
122 if (((cEta - 1) % 2) == 0) {
131 }
else if (cType ==
HF) {
141 index += (3 - ((cEta - 30) / 4));
144 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"Managed to calculate an out-of-bounds index, buyer beware";
150 if (
index >= 220 * 5) {
151 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"Managed to calculate an out-of-bounds index, buyer beware";
156 void setET(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t
et, uint32_t BX_n) {
158 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"I was made in read-only mode";
161 size_t index =
getIndex(cType, negativeEta, cEta, iPhi, BX_n);
167 data |= (
et & 0xFF) << 16;
169 data |= (
et & 0xFF) << (((cEta - 30) % 4) * 8);
173 data |= (
et & 0xFF) << (iPhi * 8);
177 uint32_t
getET(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n) {
178 size_t index =
getIndex(cType, negativeEta, cEta, iPhi, BX_n);
180 uint32_t
et = 0xDEADBEEF;
185 et = ((
data >> 16) & 0xFF);
187 et = ((
data >> ((cEta - 30) % 4) * 8) & 0xFF);
190 et = ((
data >> (iPhi * 8)) & 0xFF);
195 void setFB(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb, uint32_t BX_n) {
197 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"I was made in read-only mode";
206 uint32_t
tower = iPhi;
207 if (((cEta - 1) % 2) == 1) {
214 uint32_t
getFB(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n) {
217 if (((cEta - 1) % 2) == 1) {
225 }
else if (cType ==
EBEE) {
227 uint32_t
tower = iPhi;
228 if (((cEta - 1) % 2) == 1) {
231 fb = ((
data & (0x1 <<
tower)) != 0) ? 1 : 0;
233 fb = ((
data >> (iPhi * 6)) & 0x3F);
238 void setHFFeatureBits(
bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb, uint32_t BX_n) {
240 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"I was made in read-only mode";
244 uint32_t
shift = (cEta - 30) * 2;
260 uint32_t
shift = (cEta - 30) * 2;
272 LS = (
data >> 24) & 0xFF;
273 LS |= ((data2 >> 24) & 0xFF) << 8;
281 size_t index = 2 * 14 * (3 + 4) * 5 + 4 * 4 * 5 + (
region / 2) + 4 * BX_n;
284 if (
index >= 220 * 5) {
285 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"Managed to calculate an out-of-bounds index, buyer beware";
292 edm::LogError(
"UCTCTP7RawData5BX_HCALFB") <<
"I was made in read-only mode";
297 data |= (regionData & 0xFFFF) << (16 * (
region % 2));
303 return ((
data >> (16 * (
region % 2))) & 0xFFFF);
323 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
324 uint32_t
tower = iPhi;
332 return ((linkStatus & (0
x1 <<
tower)) != 0);
336 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
337 if (cType ==
EBEE && (cEta == 17 || cEta == 21)) {
338 return ((linkStatus & 0x00000100) != 0);
340 return ((linkStatus & 0x00001000) != 0);
344 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
345 if (cType ==
EBEE && (cEta == 17 || cEta == 21)) {
346 return ((linkStatus & 0x00000200) != 0);
348 return ((linkStatus & 0x00002000) != 0);
352 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
353 if (cType ==
EBEE && (cEta == 17 || cEta == 21)) {
354 return ((linkStatus & 0x00000400) != 0);
356 return ((linkStatus & 0x00004000) != 0);
360 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi, BX_n);
361 if (cType ==
EBEE && (cEta == 17 || cEta == 21)) {
362 return ((linkStatus & 0x00000800) != 0);
364 return ((linkStatus & 0x00008000) != 0);
const uint32_t * myDataPtr
uint32_t getFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
bool getRegionTauVeto(bool negativeEta, uint32_t region, uint32_t BX_n)
size_t getIndex(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)
bool isTowerMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
uint32_t getRegionSummary(bool negativeEta, uint32_t region, uint32_t BX_n)
void setHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb, uint32_t BX_n)
Log< level::Error, false > LogError
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
const UCTCTP7RawData5BX_HCALFB & operator=(const UCTCTP7RawData5BX_HCALFB &i)=delete
bool isLinkMasked(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 getET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
virtual ~UCTCTP7RawData5BX_HCALFB()
bool isLinkMisaligned(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
bool isLinkDown(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
size_t getSummaryIndex(bool negativeEta, uint32_t region, uint32_t BX_n)
uint32_t * myDataWritePtr
uint32_t getRegionET(bool negativeEta, uint32_t region, uint32_t BX_n)
void setET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t et, uint32_t BX_n)
UCTCTP7RawData5BX_HCALFB(uint32_t *d)
void setRegionSummary(bool negativeEta, uint32_t region, uint32_t regionData, uint32_t BX_n)
UCTCTP7RawData5BX_HCALFB(const uint32_t *d)
const uint32_t * dataPtr() const
char data[epos_bytes_allocation]
static unsigned int const shift
bool isLinkInError(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
void setFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb, uint32_t BX_n)
bool getRegionEGVeto(bool negativeEta, uint32_t region, uint32_t BX_n)
uint32_t getRegionHitLocation(bool negativeEta, uint32_t region, uint32_t BX_n)