1 #ifndef UCTCTP7RawData_hh 2 #define UCTCTP7RawData_hh 14 if(
sof() != 0xA110CA7E) {
15 edm::LogError(
"UCTCTP7RawData") <<
"Failed to see 0xA110CA7E at start - but continuing" << std::endl;
33 uint32_t
index = 0xDEADBEEF;
36 edm::LogError(
"UCTCTP7RawData") <<
"Incorrect iPhi; iPhi = " << iPhi <<
"; should be in [0,3]" << std::endl;
39 if(cEta < 1 || cEta > 28) {
40 edm::LogError(
"UCTCTP7RawData") <<
"Incorrect caloEta; cEta = " << cEta <<
"; should be in [1-28]" << std::endl;
47 index = 2 + ( ((cEta - 1) / 2) * (3 + 3) + ((cEta - 1) % 2) );
54 index += (6 * (3 + 3));
62 index += ((14 * (3 + 3) + (2 * 4)));
66 if(cType ==
HBHE) index += 3;
68 else if(cType == HF) {
70 edm::LogError(
"UCTCTP7RawData") <<
"HF iPhi should be 0 or 1 (for a , b) - invalid iPhi = " << iPhi << std::endl;
73 if(cEta < 30 || cEta > 41) {
74 edm::LogError(
"UCTCTP7RawData") <<
"HF cEta should be between 30 and 41 - invalid cEta = " << cEta << std::endl;
82 index = 2 + 20 * (3 + 3) + ((cEta - 30) / 4);
86 index = 2 + 20 * (3 + 3) + 1 * 4 + ((cEta - 30) / 4);
92 index = 2 + 2 * 14 * (3 + 3) + 2 * 4 + ((cEta - 30) / 4);
96 index = 2 + 2 * 14 * (3 + 3) + 3 * 4 + ((cEta - 30) / 4);
101 edm::LogError(
"UCTCTP7RawData") <<
"Unknown CaloType " << cType << std::endl;
110 if(cType ==
EBEE || cType ==
HBHE) {
113 if(((cEta - 1) % 2) == 0) {
124 else if(cType == HF) {
134 index += (3 - ((cEta - 30) / 4));
142 uint32_t
getET(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi) {
145 uint32_t
et = 0xDEADBEEF;
149 if(cEta == 41) et = ((data >> 16) & 0xFF);
150 else et = ((data >> ((cEta - 30) % 4) * 8) & 0xFF);
154 et = ((data >> (iPhi * 8)) & 0xFF);
159 uint32_t
getFB(
CaloType cType,
bool negativeEta, uint32_t cEta, uint32_t iPhi) {
168 uint32_t tower = iPhi;
169 if(((cEta - 1) % 2) == 1) {
172 fb = ((data & (0x1 << tower)) != 0) ? 1 : 0;
181 uint32_t
shift = (cEta - 30) * 2;
182 if(cEta == 41) shift = 20;
183 return ((data >> shift) & 0x3);
193 uint32_t
index = 2 + 2 * 14 * (3 + 3) + 4 * 4 + (region / 2);
194 if(negativeEta) index += 4;
201 return ((data >> (16 * (region % 2))) & 0xFFFF);
221 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
222 uint32_t tower = iPhi;
223 if(((cEta - 1) % 2) == 1) tower += 4;
226 if(cEta == 41) tower = 10;
228 return ((linkStatus & (0
x1 << tower)) != 0);
232 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
233 if ( cType ==
EBEE && (cEta==17||cEta==21) ) {
234 return ((linkStatus & 0x00000100) != 0);
236 return ((linkStatus & 0x00001000) != 0);
240 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
241 if ( cType ==
EBEE && (cEta==17||cEta==21) ) {
242 return ((linkStatus & 0x00000200) != 0);
244 return ((linkStatus & 0x00002000) != 0);
248 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
249 if ( cType ==
EBEE && (cEta==17||cEta==21) ) {
250 return ((linkStatus & 0x00000400) != 0);
252 return ((linkStatus & 0x00004000) != 0);
256 uint32_t linkStatus =
getLinkStatus(cType, negativeEta, cEta, iPhi);
257 if ( cType ==
EBEE && (cEta==17||cEta==21) ) {
258 return ((linkStatus & 0x00000800) != 0);
260 return ((linkStatus & 0x00008000) != 0);
265 edm::LogError(
"UCTCTP7RawData") <<
"CTP7 Payload Header:" << endl;
269 bool negativeEta =
false;
271 for(uint32_t
i = 0;
i < 2;
i++) {
272 if(
i != 0) negativeEta =
true;
275 for(uint32_t cEta = 1; cEta <= 28; cEta++) {
276 for(uint32_t iPhi = 0; iPhi < 4; iPhi++) {
278 getET(cType, negativeEta, cEta, iPhi) != 0) {
279 if(first)
edm::LogError(
"UCTCTP7RawData") <<
"EcalET FG LinkStatus" << endl;
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 <<
")" 291 for(uint32_t cEta = 1; cEta <= 28; cEta++) {
292 for(uint32_t iPhi = 0; iPhi < 4; iPhi++) {
294 getET(cType, negativeEta, cEta, iPhi) != 0) {
295 if(first)
edm::LogError(
"UCTCTP7RawData") <<
"HcalET Feature LinkStatus" << endl;
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 <<
")" 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;
311 getET(cType, negativeEta, cEta, iPhi) != 0) {
312 if(first)
edm::LogError(
"UCTCTP7RawData") <<
"HF-ET Feature LinkStatus" << endl;
314 edm::LogError(
"UCTCTP7RawData") <<
dec << setfill(
' ') << setw(6) <<
getET(cType, 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 <<
")" 323 for(uint32_t region = 0; region < 7; region++) {
324 if(first)
edm::LogError(
"UCTCTP7RawData") <<
"Region ET EGVeto TauVeto HitLocation" << endl;
327 <<
" " << hex << showbase <<
internal << setfill(
'0') << setw(6) <<
getRegionET(negativeEta, region) <<
dec 330 <<
" " << showbase <<
internal << setfill(
'0') << setw(3) << hex <<
getRegionHitLocation(negativeEta, region)
uint32_t getFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool getRegionTauVeto(bool negativeEta, uint32_t region)
uint32_t getSummaryIndex(bool negativeEta, uint32_t region)
uint32_t getHFFeatureBits(bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isLinkMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
size_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const UCTCTP7RawData & operator=(const UCTCTP7RawData &i)=delete
bool isLinkDown(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool getRegionEGVeto(bool negativeEta, uint32_t region)
bool isLinkInError(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isTowerMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * myDataPtr
uint32_t getLinkStatus(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
uint32_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
UCTCTP7RawData(const uint32_t *d)
size_t getSummaryIndex(bool negativeEta, uint32_t region)
et
define resolution functions of each parameter
uint32_t getRegionET(bool negativeEta, uint32_t region)
uint32_t getET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
char data[epos_bytes_allocation]
size_t getIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const uint32_t * dataPtr() const
static unsigned int const shift
virtual ~UCTCTP7RawData()
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
uint32_t getRegionHitLocation(bool negativeEta, uint32_t region)
uint32_t getFeatureIndex(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isLinkMisaligned(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)