1 #ifndef UCTCTP7RawData_HCALFB_hh 2 #define UCTCTP7RawData_HCALFB_hh 14 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"You gave me a nullptr :<";
20 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"You gave me a nullptr :<";
38 if (cType ==
EBEE || cType ==
HBHE) {
40 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"Incorrect iPhi; iPhi = " << iPhi <<
"; should be in [0,3]";
43 if (cEta < 1 || cEta > 28) {
44 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"Incorrect caloEta; cEta = " << cEta <<
"; should be in [1-28]";
51 index = (((cEta - 1) / 2) * (3 + 4) + ((cEta - 1) % 2));
58 index += (6 * (3 + 4));
65 index += ((14 * (3 + 4) + (2 * 4)));
71 }
else if (cType ==
HF) {
73 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"HF iPhi should be 0 or 1 (for a , b) - invalid iPhi = " << iPhi;
76 if (cEta < 30 || cEta > 41) {
77 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"HF cEta should be between 30 and 41 - invalid cEta = " << cEta;
85 index = 20 * (3 + 4) + ((cEta - 30) / 4);
88 index = 20 * (3 + 4) + 1 * 4 + ((cEta - 30) / 4);
93 index = 2 * 14 * (3 + 4) + 2 * 4 + ((cEta - 30) / 4);
96 index = 2 * 14 * (3 + 4) + 3 * 4 + ((cEta - 30) / 4);
100 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"Unknown CaloType " << cType;
104 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"Managed to calculate an out-of-bounds index, buyer beware";
112 if (cType ==
EBEE || cType ==
HBHE) {
115 if (((cEta - 1) % 2) == 0) {
124 }
else if (cType ==
HF) {
134 index += (3 - ((cEta - 30) / 4));
137 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"Managed to calculate an out-of-bounds index, buyer beware";
144 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"Managed to calculate an out-of-bounds index, buyer beware";
149 void setET(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t
et) {
151 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"I was made in read-only mode";
160 data |= (
et & 0xFF) << 16;
162 data |= (
et & 0xFF) << (((cEta - 30) % 4) * 8);
166 data |= (
et & 0xFF) << (iPhi * 8);
170 uint32_t
getET(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi) {
173 uint32_t
et = 0xDEADBEEF;
178 et = ((
data >> 16) & 0xFF);
180 et = ((
data >> ((cEta - 30) % 4) * 8) & 0xFF);
183 et = ((
data >> (iPhi * 8)) & 0xFF);
188 void setFB(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb) {
190 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"I was made in read-only mode";
199 uint32_t
tower = iPhi;
200 if (((cEta - 1) % 2) == 1) {
205 int prompt = (fb & 0b10) >> 1;
206 int delay1 = (fb & 0b100) >> 2;
207 int delay2 = (fb & 0b1000) >> 3;
215 uint32_t
getFB(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi) {
218 if (((cEta - 1) % 2) == 1) {
226 }
else if (cType ==
EBEE) {
228 uint32_t
tower = iPhi;
229 if (((cEta - 1) % 2) == 1) {
232 fb = ((
data & (0x1 <<
tower)) != 0) ? 1 : 0;
234 fb = ((
data >> (iPhi * 6)) & 0x3F);
241 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"I was made in read-only mode";
245 uint32_t
shift = (cEta - 30) * 2;
261 uint32_t
shift = (cEta - 30) * 2;
273 LS = (
data >> 24) & 0xFF;
274 LS |= ((data2 >> 24) & 0xFF) << 8;
282 size_t index = 2 * 14 * (3 + 4) + 4 * 4 + (
region / 2);
286 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"Managed to calculate an out-of-bounds index, buyer beware";
293 edm::LogError(
"UCTCTP7RawData_HCALFB") <<
"I was made in read-only mode";
298 data |= (regionData & 0xFFFF) << (16 * (
region % 2));
304 return ((
data >> (16 * (
region % 2))) & 0xFFFF);
318 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
319 uint32_t
tower = iPhi;
327 return ((linkStatus & (0
x1 <<
tower)) != 0);
331 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
332 if (cType ==
EBEE && (cEta == 17 || cEta == 21)) {
333 return ((linkStatus & 0x00000100) != 0);
335 return ((linkStatus & 0x00001000) != 0);
339 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
340 if (cType ==
EBEE && (cEta == 17 || cEta == 21)) {
341 return ((linkStatus & 0x00000200) != 0);
343 return ((linkStatus & 0x00002000) != 0);
347 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
348 if (cType ==
EBEE && (cEta == 17 || cEta == 21)) {
349 return ((linkStatus & 0x00000400) != 0);
351 return ((linkStatus & 0x00004000) != 0);
355 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
356 if (cType ==
EBEE && (cEta == 17 || cEta == 21)) {
357 return ((linkStatus & 0x00000800) != 0);
359 return ((linkStatus & 0x00008000) != 0);
void setHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb)
const UCTCTP7RawData_HCALFB & operator=(const UCTCTP7RawData_HCALFB &i)=delete
virtual ~UCTCTP7RawData_HCALFB()
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
UCTCTP7RawData_HCALFB(const uint32_t *d)
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * dataPtr() const
Log< level::Error, false > LogError
UCTCTP7RawData_HCALFB(uint32_t *d)
bool isTowerMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
void setET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t et)
uint32_t getHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isLinkInError(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * myDataPtr
bool isLinkDown(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isLinkMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
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 * myDataWritePtr
void setRegionSummary(bool negativeEta, uint32_t region, uint32_t regionData)
bool isLinkMisaligned(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t getFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
char data[epos_bytes_allocation]
uint32_t getRegionHitLocation(bool negativeEta, uint32_t region)
static unsigned int const shift
bool getRegionTauVeto(bool negativeEta, uint32_t region)
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t getRegionET(bool negativeEta, uint32_t region)
bool getRegionEGVeto(bool negativeEta, uint32_t region)
size_t getSummaryIndex(bool negativeEta, uint32_t region)
static constexpr float b1
void setFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb)