CMS 3D CMS Logo

CaloLayer1Unpacker.cc
Go to the documentation of this file.
3 
4 #include "CaloLayer1Unpacker.h"
5 
6 using namespace edm;
7 
8 namespace l1t {
9  namespace stage2 {
10 
11  // max_iEta_HcalTP = 41; // barrel <= 16, endcap <= 29, hf <= 41
12  // there are two TT29’s: one in HE readout in TT28 and another in HF readout in TT30
13  // max_iPhi_HcalTP = 72;
14 
16  LogDebug("L1T") << "Block size = " << block.header().getSize();
17  LogDebug("L1T") << "Board ID = " << block.amc().getBoardID();
18 
19  auto res = static_cast<CaloLayer1Collections*>(coll);
20 
21  auto ctp7_phi = block.amc().getBoardID();
22  const uint32_t* ptr = block.payload().data();
23 
24  int N_BX = (block.header().getFlags() >> 16) & 0xf;
25  // std::cout << " N_BX calculated " << N_BX << std::endl;
26 
27  int HCALFB = (block.header().getFlags() >> 15) & 0x1;
28 
29  if (N_BX == 1) {
30  if (HCALFB == 0) {
31  UCTCTP7RawData ctp7Data(ptr);
32  makeECalTPGs(ctp7_phi, ctp7Data, res->getEcalDigis());
33  makeHCalTPGs(ctp7_phi, ctp7Data, res->getHcalDigis());
34  makeHFTPGs(ctp7_phi, ctp7Data, res->getHcalDigis());
35  makeRegions(ctp7_phi, ctp7Data, res->getRegions());
36  }
37  if (HCALFB == 1) {
38  UCTCTP7RawData_HCALFB ctp7Data_HCALFB(ptr);
39  makeECalTPGs_HCALFB(ctp7_phi, ctp7Data_HCALFB, res->getEcalDigis());
40  makeHCalTPGs_HCALFB(ctp7_phi, ctp7Data_HCALFB, res->getHcalDigis());
41  makeHFTPGs_HCALFB(ctp7_phi, ctp7Data_HCALFB, res->getHcalDigis());
42  makeRegions_HCALFB(ctp7_phi, ctp7Data_HCALFB, res->getRegions());
43  }
44  } else if (N_BX == 5) {
45  if (HCALFB == 0) {
46  UCTCTP7RawData5BX ctp7Data5BX(ptr);
47  // BX_n = 0, 1, 2, 3, 4, where 2 is nominal
48  makeECalTPGs5BX(ctp7_phi, ctp7Data5BX, res->getEcalDigis(), 2);
49  makeHCalTPGs5BX(ctp7_phi, ctp7Data5BX, res->getHcalDigis(), 2);
50  makeHFTPGs5BX(ctp7_phi, ctp7Data5BX, res->getHcalDigis(), 2);
51  makeRegions5BX(ctp7_phi, ctp7Data5BX, res->getRegions(), 2);
52  for (int i = 0; i < 5; i++) {
53  makeECalTPGs5BX(ctp7_phi, ctp7Data5BX, res->getEcalDigisBx(i), i);
54  }
55  }
56  if (HCALFB == 1) {
57  UCTCTP7RawData5BX_HCALFB ctp7Data5BX_HCALFB(ptr);
58  // BX_n = 0, 1, 2, 3, 4, where 2 is nominal
59  makeECalTPGs5BX_HCALFB(ctp7_phi, ctp7Data5BX_HCALFB, res->getEcalDigis(), 2);
60  makeHCalTPGs5BX_HCALFB(ctp7_phi, ctp7Data5BX_HCALFB, res->getHcalDigis(), 2);
61  makeHFTPGs5BX_HCALFB(ctp7_phi, ctp7Data5BX_HCALFB, res->getHcalDigis(), 2);
62  makeRegions5BX_HCALFB(ctp7_phi, ctp7Data5BX_HCALFB, res->getRegions(), 2);
63  for (int i = 0; i < 5; i++) {
64  makeECalTPGs5BX_HCALFB(ctp7_phi, ctp7Data5BX_HCALFB, res->getEcalDigisBx(i), i);
65  }
66  }
67  } else {
68  LogError("CaloLayer1Unpacker") << "Number of BXs to unpack is not 1 or 5, stop here !!! " << N_BX << std::endl;
69  return false;
70  }
71 
72  return true;
73  }
74 
75  void CaloLayer1Unpacker::makeECalTPGs(uint32_t lPhi,
76  UCTCTP7RawData& ctp7Data,
77  EcalTrigPrimDigiCollection* ecalTPGs) {
79  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) { // Loop over all four phi divisions on card
80  int cPhi = -1 + lPhi * 4 + iPhi; // Calorimeter phi index
81  if (cPhi == 0)
82  cPhi = 72;
83  else if (cPhi == -1)
84  cPhi = 71;
85  else if (cPhi < -1) {
86  LogError("CaloLayer1Unpacker") << "Major error in makeECalTPGs" << std::endl;
87  return;
88  }
89  for (int cEta = -28; cEta <= 28; cEta++) { // Calorimeter Eta indices (HB/HE for now)
90  if (cEta != 0) { // Calorimeter eta = 0 is invalid
91  bool negativeEta = false;
92  if (cEta < 0)
93  negativeEta = true;
94  uint32_t iEta = abs(cEta);
95  // This code is fragile! Note that towerDatum is packed as is done in EcalTriggerPrimitiveSample
96  // Bottom 8-bits are ET
97  // Then finegrain feature bit
98  // Then three bits have ttBits, which I have no clue about (not available on ECAL links so not set)
99  // Then there is a spare FG Veto bit, which is used for L1 spike detection (not available on ECAL links so not set)
100  // Top three bits seem to be unused. So, we steal those to set the tower masking, link masking and link status information
101  // To decode these custom three bits use ((EcalTriggerPrimitiveSample::raw() >> 13) & 0x7)
102  uint32_t towerDatum = ctp7Data.getET(cType, negativeEta, iEta, iPhi);
103  if (ctp7Data.getFB(cType, negativeEta, iEta, iPhi) != 0)
104  towerDatum |= 0x0100;
105  if (ctp7Data.isTowerMasked(cType, negativeEta, iEta, iPhi))
106  towerDatum |= 0x2000;
107  if (ctp7Data.isLinkMasked(cType, negativeEta, iEta, iPhi))
108  towerDatum |= 0x4000;
109  if (ctp7Data.isLinkMisaligned(cType, negativeEta, iEta, iPhi) ||
110  ctp7Data.isLinkInError(cType, negativeEta, iEta, iPhi) ||
111  ctp7Data.isLinkDown(cType, negativeEta, iEta, iPhi))
112  towerDatum |= 0x8000;
114  int zSide = cEta / ((int)iEta);
115  // As far as I can tell, the ECal unpacker only uses barrel and endcap IDs, never EcalTriggerTower
116  const EcalSubdetector ecalTriggerTower =
118  EcalTrigTowerDetId id(zSide, ecalTriggerTower, iEta, cPhi);
119  EcalTriggerPrimitiveDigi tpg(id);
120  tpg.setSize(1);
121  tpg.setSample(0, sample);
122  ecalTPGs->push_back(tpg);
123  }
124  }
125  }
126  }
127 
128  void CaloLayer1Unpacker::makeHCalTPGs(uint32_t lPhi,
129  UCTCTP7RawData& ctp7Data,
130  HcalTrigPrimDigiCollection* hcalTPGs) {
132  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) { // Loop over all four phi divisions on card
133  int cPhi = -1 + lPhi * 4 + iPhi; // Calorimeter phi index
134  if (cPhi == 0)
135  cPhi = 72;
136  else if (cPhi == -1)
137  cPhi = 71;
138  else if (cPhi < -1) {
139  LogError("CaloLayer1Unpacker") << "Major error in makeHCalTPGs" << std::endl;
140  return;
141  }
142  for (int cEta = -28; cEta <= 28; cEta++) { // Calorimeter Eta indices (HB/HE for now)
143  if (cEta != 0) { // Calorimeter eta = 0 is invalid
144  bool negativeEta = false;
145  if (cEta < 0)
146  negativeEta = true;
147  uint32_t iEta = abs(cEta);
148  // This code is fragile! Note that towerDatum is packed as is done in HcalTriggerPrimitiveSample
149  // Bottom 8-bits are ET
150  // Then feature bit
151  // The remaining bits are undefined presently
152  // We use next three bits for link details, which we did not have room in EcalTriggerPrimitiveSample case
153  // We use next three bits to set the tower masking, link masking and link status information as done for Ecal
154  // To decode these custom six bits use ((EcalTriggerPrimitiveSample::raw() >> 9) & 0x77)
155  uint32_t towerDatum = ctp7Data.getET(cType, negativeEta, iEta, iPhi);
156  if (ctp7Data.getFB(cType, negativeEta, iEta, iPhi) != 0)
157  towerDatum |= 0x0100;
158  if (ctp7Data.isLinkMisaligned(cType, negativeEta, iEta, iPhi))
159  towerDatum |= 0x0200;
160  if (ctp7Data.isLinkInError(cType, negativeEta, iEta, iPhi))
161  towerDatum |= 0x0400;
162  if (ctp7Data.isLinkDown(cType, negativeEta, iEta, iPhi))
163  towerDatum |= 0x0800;
164  if (ctp7Data.isTowerMasked(cType, negativeEta, iEta, iPhi))
165  towerDatum |= 0x2000;
166  if (ctp7Data.isLinkMasked(cType, negativeEta, iEta, iPhi))
167  towerDatum |= 0x4000;
168  if (ctp7Data.isLinkMisaligned(cType, negativeEta, iEta, iPhi) ||
169  ctp7Data.isLinkInError(cType, negativeEta, iEta, iPhi) ||
170  ctp7Data.isLinkDown(cType, negativeEta, iEta, iPhi))
171  towerDatum |= 0x8000;
173  HcalTrigTowerDetId id(cEta, cPhi);
174  HcalTriggerPrimitiveDigi tpg(id);
175  tpg.setSize(1);
176  tpg.setSample(0, sample);
177  hcalTPGs->push_back(tpg);
178  }
179  }
180  }
181  }
182 
183  void CaloLayer1Unpacker::makeHFTPGs(uint32_t lPhi, UCTCTP7RawData& ctp7Data, HcalTrigPrimDigiCollection* hcalTPGs) {
185  for (uint32_t side = 0; side <= 1; side++) {
186  bool negativeEta = false;
187  if (side == 0)
188  negativeEta = true;
189  for (uint32_t iEta = 30; iEta <= 40; iEta++) {
190  for (uint32_t iPhi = 0; iPhi < 2; iPhi++) {
191  if (iPhi == 1 && iEta == 40)
192  iEta = 41;
193  int cPhi = 1 + lPhi * 4 + iPhi * 2; // Calorimeter phi index: 1, 3, 5, ... 71
194  if (iEta == 41)
195  cPhi -= 2; // Last two HF are 3, 7, 11, ...
196  cPhi = (cPhi + 69) % 72 + 1; // cPhi -= 2 mod 72
197  int cEta = iEta;
198  if (negativeEta)
199  cEta = -iEta;
200  // This code is fragile! Note that towerDatum is packed as is done in HcalTriggerPrimitiveSample
201  // Bottom 8-bits are ET
202  // Then feature bit
203  // Then minBias ADC count bit
204  // The remaining bits are undefined presently
205  // We use next three bits for link details, which we did not have room in EcalTriggerPrimitiveSample case
206  // We use next three bits to set the tower masking, link masking and link status information as done for Ecal
207  // To decode these custom six bits use ((EcalTriggerPrimitiveSample::raw() >> 9) & 0x77)
208  uint32_t towerDatum = ctp7Data.getET(cType, negativeEta, iEta, iPhi);
209  towerDatum |= ctp7Data.getFB(cType, negativeEta, iEta, iPhi) << 8;
210  if (ctp7Data.isLinkMisaligned(cType, negativeEta, iEta, iPhi))
211  towerDatum |= 0x0400;
212  if (ctp7Data.isLinkInError(cType, negativeEta, iEta, iPhi))
213  towerDatum |= 0x0800;
214  if (ctp7Data.isLinkDown(cType, negativeEta, iEta, iPhi))
215  towerDatum |= 0x1000;
216  if (ctp7Data.isTowerMasked(cType, negativeEta, iEta, iPhi))
217  towerDatum |= 0x2000;
218  if (ctp7Data.isLinkMasked(cType, negativeEta, iEta, iPhi))
219  towerDatum |= 0x4000;
220  if (ctp7Data.isLinkMisaligned(cType, negativeEta, iEta, iPhi) ||
221  ctp7Data.isLinkInError(cType, negativeEta, iEta, iPhi) ||
222  ctp7Data.isLinkDown(cType, negativeEta, iEta, iPhi))
223  towerDatum |= 0x8000;
225  HcalTrigTowerDetId id(cEta, cPhi);
226  id.setVersion(1); // To not process these 1x1 HF TPGs with RCT
227  HcalTriggerPrimitiveDigi tpg(id);
228  tpg.setSize(1);
229  tpg.setSample(0, sample);
230  hcalTPGs->push_back(tpg);
231  }
232  }
233  }
234  }
235 
236  void CaloLayer1Unpacker::makeRegions(uint32_t lPhi, UCTCTP7RawData& ctp7Data, L1CaloRegionCollection* regions) {
237  for (uint32_t side = 0; side <= 1; side++) {
238  bool negativeEta = false;
239  if (side == 0)
240  negativeEta = true;
241  for (uint32_t region = 0; region <= 6; region++) {
242  uint32_t regionData = ctp7Data.getRegionSummary(negativeEta, region);
243  uint32_t lEta = 10 - region; // GCT eta goes 0-21, 0-3 -HF, 4-10 -B/E, 11-17 +B/E, 18-21 +HF
244  if (!negativeEta)
245  lEta = region + 11;
246  regions->push_back(L1CaloRegion((uint16_t)regionData, (unsigned)lEta, (unsigned)lPhi, (int16_t)0));
247  }
248  }
249  }
250 
251  // For additional HCAL FB implementation
252  void CaloLayer1Unpacker::makeECalTPGs_HCALFB(uint32_t lPhi,
253  UCTCTP7RawData_HCALFB& ctp7Data_HCALFB,
254  EcalTrigPrimDigiCollection* ecalTPGs) {
256  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) { // Loop over all four phi divisions on card
257  int cPhi = -1 + lPhi * 4 + iPhi; // Calorimeter phi index
258  if (cPhi == 0)
259  cPhi = 72;
260  else if (cPhi == -1)
261  cPhi = 71;
262  else if (cPhi < -1) {
263  LogError("CaloLayer1Unpacker") << "Major error in makeECalTPGs_HCALFB" << std::endl;
264  return;
265  }
266  for (int cEta = -28; cEta <= 28; cEta++) { // Calorimeter Eta indices (HB/HE for now)
267  if (cEta != 0) { // Calorimeter eta = 0 is invalid
268  bool negativeEta = false;
269  if (cEta < 0)
270  negativeEta = true;
271  uint32_t iEta = abs(cEta);
272  // This code is fragile! Note that towerDatum is packed as is done in EcalTriggerPrimitiveSample
273  // Bottom 8-bits are ET
274  // Then finegrain feature bit
275  // Then three bits have ttBits, which I have no clue about (not available on ECAL links so not set)
276  // Then there is a spare FG Veto bit, which is used for L1 spike detection (not available on ECAL links so not set)
277  // Top three bits seem to be unused. So, we steal those to set the tower masking, link masking and link status information
278  // To decode these custom three bits use ((EcalTriggerPrimitiveSample::raw() >> 13) & 0x7)
279  uint32_t towerDatum = ctp7Data_HCALFB.getET(cType, negativeEta, iEta, iPhi);
280  if (ctp7Data_HCALFB.getFB(cType, negativeEta, iEta, iPhi) != 0)
281  towerDatum |= 0x0100;
282  if (ctp7Data_HCALFB.isTowerMasked(cType, negativeEta, iEta, iPhi))
283  towerDatum |= 0x2000;
284  if (ctp7Data_HCALFB.isLinkMasked(cType, negativeEta, iEta, iPhi))
285  towerDatum |= 0x4000;
286  if (ctp7Data_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi) ||
287  ctp7Data_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi) ||
288  ctp7Data_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi))
289  towerDatum |= 0x8000;
291  int zSide = cEta / ((int)iEta);
292  // As far as I can tell, the ECal unpacker only uses barrel and endcap IDs, never EcalTriggerTower
293  const EcalSubdetector ecalTriggerTower =
295  EcalTrigTowerDetId id(zSide, ecalTriggerTower, iEta, cPhi);
296  EcalTriggerPrimitiveDigi tpg(id);
297  tpg.setSize(1);
298  tpg.setSample(0, sample);
299  ecalTPGs->push_back(tpg);
300  }
301  }
302  }
303  }
304 
305  void CaloLayer1Unpacker::makeHCalTPGs_HCALFB(uint32_t lPhi,
306  UCTCTP7RawData_HCALFB& ctp7Data_HCALFB,
307  HcalTrigPrimDigiCollection* hcalTPGs) {
309  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) { // Loop over all four phi divisions on card
310  int cPhi = -1 + lPhi * 4 + iPhi; // Calorimeter phi index
311  if (cPhi == 0)
312  cPhi = 72;
313  else if (cPhi == -1)
314  cPhi = 71;
315  else if (cPhi < -1) {
316  LogError("CaloLayer1Unpacker") << "Major error in makeHCalTPGs_HCALFB" << std::endl;
317  return;
318  }
319  for (int cEta = -28; cEta <= 28; cEta++) { // Calorimeter Eta indices (HB/HE for now)
320  if (cEta != 0) { // Calorimeter eta = 0 is invalid
321  bool negativeEta = false;
322  if (cEta < 0)
323  negativeEta = true;
324  uint32_t iEta = abs(cEta);
325  // This code is fragile! Note that towerDatum is packed as is done in HcalTriggerPrimitiveSample
326  // Bottom 8-bits are ET
327  // Then feature bit
328  // The remaining bits are undefined presently
329  // We use next three bits for link details, which we did not have room in EcalTriggerPrimitiveSample case
330  // We use next three bits to set the tower masking, link masking and link status information as done for Ecal
331  // To decode these custom six bits use ((EcalTriggerPrimitiveSample::raw() >> 9) & 0x77)
332  uint32_t towerDatum = ctp7Data_HCALFB.getET(cType, negativeEta, iEta, iPhi);
333  uint32_t fb = ctp7Data_HCALFB.getFB(cType, negativeEta, iEta, iPhi);
334  towerDatum |= ((fb & 0x1) << 8);
335  uint32_t towerDatum2 = ((fb & 0x3E) >> 1);
336  if (ctp7Data_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi))
337  towerDatum |= 0x0200;
338  if (ctp7Data_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi))
339  towerDatum |= 0x0400;
340  if (ctp7Data_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi))
341  towerDatum |= 0x0800;
342  if (ctp7Data_HCALFB.isTowerMasked(cType, negativeEta, iEta, iPhi))
343  towerDatum |= 0x2000;
344  if (ctp7Data_HCALFB.isLinkMasked(cType, negativeEta, iEta, iPhi))
345  towerDatum |= 0x4000;
346  if (ctp7Data_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi) ||
347  ctp7Data_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi) ||
348  ctp7Data_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi))
349  towerDatum |= 0x8000;
351  HcalTriggerPrimitiveSample sample2(towerDatum2);
352  HcalTrigTowerDetId id(cEta, cPhi);
353  HcalTriggerPrimitiveDigi tpg(id);
354  tpg.setSize(2);
355  tpg.setSample(0, sample);
356  tpg.setSample(1, sample2);
357  hcalTPGs->push_back(tpg);
358  }
359  }
360  }
361  }
362 
363  void CaloLayer1Unpacker::makeHFTPGs_HCALFB(uint32_t lPhi,
364  UCTCTP7RawData_HCALFB& ctp7Data_HCALFB,
365  HcalTrigPrimDigiCollection* hcalTPGs) {
367  for (uint32_t side = 0; side <= 1; side++) {
368  bool negativeEta = false;
369  if (side == 0)
370  negativeEta = true;
371  for (uint32_t iEta = 30; iEta <= 40; iEta++) {
372  for (uint32_t iPhi = 0; iPhi < 2; iPhi++) {
373  if (iPhi == 1 && iEta == 40)
374  iEta = 41;
375  int cPhi = 1 + lPhi * 4 + iPhi * 2; // Calorimeter phi index: 1, 3, 5, ... 71
376  if (iEta == 41)
377  cPhi -= 2; // Last two HF are 3, 7, 11, ...
378  cPhi = (cPhi + 69) % 72 + 1; // cPhi -= 2 mod 72
379  int cEta = iEta;
380  if (negativeEta)
381  cEta = -iEta;
382  // This code is fragile! Note that towerDatum is packed as is done in HcalTriggerPrimitiveSample
383  // Bottom 8-bits are ET
384  // Then feature bit
385  // Then minBias ADC count bit
386  // The remaining bits are undefined presently
387  // We use next three bits for link details, which we did not have room in EcalTriggerPrimitiveSample case
388  // We use next three bits to set the tower masking, link masking and link status information as done for Ecal
389  // To decode these custom six bits use ((EcalTriggerPrimitiveSample::raw() >> 9) & 0x77)
390  uint32_t towerDatum = ctp7Data_HCALFB.getET(cType, negativeEta, iEta, iPhi);
391  towerDatum |= ctp7Data_HCALFB.getFB(cType, negativeEta, iEta, iPhi) << 8;
392  if (ctp7Data_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi))
393  towerDatum |= 0x0400;
394  if (ctp7Data_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi))
395  towerDatum |= 0x0800;
396  if (ctp7Data_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi))
397  towerDatum |= 0x1000;
398  if (ctp7Data_HCALFB.isTowerMasked(cType, negativeEta, iEta, iPhi))
399  towerDatum |= 0x2000;
400  if (ctp7Data_HCALFB.isLinkMasked(cType, negativeEta, iEta, iPhi))
401  towerDatum |= 0x4000;
402  if (ctp7Data_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi) ||
403  ctp7Data_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi) ||
404  ctp7Data_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi))
405  towerDatum |= 0x8000;
407  HcalTrigTowerDetId id(cEta, cPhi);
408  id.setVersion(1); // To not process these 1x1 HF TPGs with RCT
409  HcalTriggerPrimitiveDigi tpg(id);
410  tpg.setSize(1);
411  tpg.setSample(0, sample);
412  hcalTPGs->push_back(tpg);
413  }
414  }
415  }
416  }
417 
418  void CaloLayer1Unpacker::makeRegions_HCALFB(uint32_t lPhi,
419  UCTCTP7RawData_HCALFB& ctp7Data_HCALFB,
421  for (uint32_t side = 0; side <= 1; side++) {
422  bool negativeEta = false;
423  if (side == 0)
424  negativeEta = true;
425  for (uint32_t region = 0; region <= 6; region++) {
426  uint32_t regionData = ctp7Data_HCALFB.getRegionSummary(negativeEta, region);
427  uint32_t lEta = 10 - region; // GCT eta goes 0-21, 0-3 -HF, 4-10 -B/E, 11-17 +B/E, 18-21 +HF
428  if (!negativeEta)
429  lEta = region + 11;
430  regions->push_back(L1CaloRegion((uint16_t)regionData, (unsigned)lEta, (unsigned)lPhi, (int16_t)0));
431  }
432  }
433  }
434 
435  // The following four functions are duplicated from above, to be used for 5BX events
436  // They have a new parameter BX_n = 0, 1, 2, 3, 4, where 2 is nominal
437  // And use functions defined in UCTCTP7RawData5BX.h
438  // The idea is not to intervene the normal events unpacking
439 
440  void CaloLayer1Unpacker::makeECalTPGs5BX(uint32_t lPhi,
441  UCTCTP7RawData5BX& ctp7Data5BX,
442  EcalTrigPrimDigiCollection* ecalTPGs,
443  uint32_t BX_n) {
445  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) { // Loop over all four phi divisions on card
446  int cPhi = -1 + lPhi * 4 + iPhi; // Calorimeter phi index
447  if (cPhi == 0)
448  cPhi = 72;
449  else if (cPhi == -1)
450  cPhi = 71;
451  else if (cPhi < -1) {
452  LogError("CaloLayer1Unpacker") << "Major error in makeECalTPGs5BX" << std::endl;
453  return;
454  }
455  for (int cEta = -28; cEta <= 28; cEta++) { // Calorimeter Eta indices (HB/HE for now)
456  if (cEta != 0) { // Calorimeter eta = 0 is invalid
457  bool negativeEta = false;
458  if (cEta < 0)
459  negativeEta = true;
460  uint32_t iEta = abs(cEta);
461  // This code is fragile! Note that towerDatum is packed as is done in EcalTriggerPrimitiveSample
462  // Bottom 8-bits are ET
463  // Then finegrain feature bit
464  // Then three bits have ttBits, which I have no clue about (not available on ECAL links so not set)
465  // Then there is a spare FG Veto bit, which is used for L1 spike detection (not available on ECAL links so not set)
466  // Top three bits seem to be unused. So, we steal those to set the tower masking, link masking and link status information
467  // To decode these custom three bits use ((EcalTriggerPrimitiveSample::raw() >> 13) & 0x7)
468  uint32_t towerDatum = ctp7Data5BX.getET(cType, negativeEta, iEta, iPhi, BX_n);
469  if (ctp7Data5BX.getFB(cType, negativeEta, iEta, iPhi, BX_n) != 0)
470  towerDatum |= 0x0100;
471  if (ctp7Data5BX.isTowerMasked(cType, negativeEta, iEta, iPhi, BX_n))
472  towerDatum |= 0x2000;
473  if (ctp7Data5BX.isLinkMasked(cType, negativeEta, iEta, iPhi, BX_n))
474  towerDatum |= 0x4000;
475  if (ctp7Data5BX.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n) ||
476  ctp7Data5BX.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n) ||
477  ctp7Data5BX.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
478  towerDatum |= 0x8000;
480  int zSide = cEta / ((int)iEta);
481  // As far as I can tell, the ECal unpacker only uses barrel and endcap IDs, never EcalTriggerTower
482  const EcalSubdetector ecalTriggerTower =
484  EcalTrigTowerDetId id(zSide, ecalTriggerTower, iEta, cPhi);
485  EcalTriggerPrimitiveDigi tpg(id);
486  tpg.setSize(1);
487  tpg.setSample(0, sample);
488  ecalTPGs->push_back(tpg);
489  }
490  }
491  }
492  }
493 
494  void CaloLayer1Unpacker::makeHCalTPGs5BX(uint32_t lPhi,
495  UCTCTP7RawData5BX& ctp7Data5BX,
496  HcalTrigPrimDigiCollection* hcalTPGs,
497  uint32_t BX_n) {
499  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) { // Loop over all four phi divisions on card
500  int cPhi = -1 + lPhi * 4 + iPhi; // Calorimeter phi index
501  if (cPhi == 0)
502  cPhi = 72;
503  else if (cPhi == -1)
504  cPhi = 71;
505  else if (cPhi < -1) {
506  LogError("CaloLayer1Unpacker") << "Major error in makeHCalTPGs5BX" << std::endl;
507  return;
508  }
509  for (int cEta = -28; cEta <= 28; cEta++) { // Calorimeter Eta indices (HB/HE for now)
510  if (cEta != 0) { // Calorimeter eta = 0 is invalid
511  bool negativeEta = false;
512  if (cEta < 0)
513  negativeEta = true;
514  uint32_t iEta = abs(cEta);
515  // This code is fragile! Note that towerDatum is packed as is done in HcalTriggerPrimitiveSample
516  // Bottom 8-bits are ET
517  // Then feature bit
518  // The remaining bits are undefined presently
519  // We use next three bits for link details, which we did not have room in EcalTriggerPrimitiveSample case
520  // We use next three bits to set the tower masking, link masking and link status information as done for Ecal
521  // To decode these custom six bits use ((EcalTriggerPrimitiveSample::raw() >> 9) & 0x77)
522  uint32_t towerDatum = ctp7Data5BX.getET(cType, negativeEta, iEta, iPhi, BX_n);
523  if (ctp7Data5BX.getFB(cType, negativeEta, iEta, iPhi, BX_n) != 0)
524  towerDatum |= 0x0100;
525  if (ctp7Data5BX.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n))
526  towerDatum |= 0x0200;
527  if (ctp7Data5BX.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n))
528  towerDatum |= 0x0400;
529  if (ctp7Data5BX.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
530  towerDatum |= 0x0800;
531  if (ctp7Data5BX.isTowerMasked(cType, negativeEta, iEta, iPhi, BX_n))
532  towerDatum |= 0x2000;
533  if (ctp7Data5BX.isLinkMasked(cType, negativeEta, iEta, iPhi, BX_n))
534  towerDatum |= 0x4000;
535  if (ctp7Data5BX.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n) ||
536  ctp7Data5BX.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n) ||
537  ctp7Data5BX.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
538  towerDatum |= 0x8000;
540  HcalTrigTowerDetId id(cEta, cPhi);
541  HcalTriggerPrimitiveDigi tpg(id);
542  tpg.setSize(1);
543  tpg.setSample(0, sample);
544  hcalTPGs->push_back(tpg);
545  }
546  }
547  }
548  }
549 
550  void CaloLayer1Unpacker::makeHFTPGs5BX(uint32_t lPhi,
551  UCTCTP7RawData5BX& ctp7Data5BX,
552  HcalTrigPrimDigiCollection* hcalTPGs,
553  uint32_t BX_n) {
555  for (uint32_t side = 0; side <= 1; side++) {
556  bool negativeEta = false;
557  if (side == 0)
558  negativeEta = true;
559  for (uint32_t iEta = 30; iEta <= 40; iEta++) {
560  for (uint32_t iPhi = 0; iPhi < 2; iPhi++) {
561  if (iPhi == 1 && iEta == 40)
562  iEta = 41;
563  int cPhi = 1 + lPhi * 4 + iPhi * 2; // Calorimeter phi index: 1, 3, 5, ... 71
564  if (iEta == 41)
565  cPhi -= 2; // Last two HF are 3, 7, 11, ...
566  cPhi = (cPhi + 69) % 72 + 1; // cPhi -= 2 mod 72
567  int cEta = iEta;
568  if (negativeEta)
569  cEta = -iEta;
570  // This code is fragile! Note that towerDatum is packed as is done in HcalTriggerPrimitiveSample
571  // Bottom 8-bits are ET
572  // Then feature bit
573  // Then minBias ADC count bit
574  // The remaining bits are undefined presently
575  // We use next three bits for link details, which we did not have room in EcalTriggerPrimitiveSample case
576  // We use next three bits to set the tower masking, link masking and link status information as done for Ecal
577  // To decode these custom six bits use ((EcalTriggerPrimitiveSample::raw() >> 9) & 0x77)
578  uint32_t towerDatum = ctp7Data5BX.getET(cType, negativeEta, iEta, iPhi, BX_n);
579  towerDatum |= ctp7Data5BX.getFB(cType, negativeEta, iEta, iPhi, BX_n) << 8;
580  if (ctp7Data5BX.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n))
581  towerDatum |= 0x0400;
582  if (ctp7Data5BX.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n))
583  towerDatum |= 0x0800;
584  if (ctp7Data5BX.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
585  towerDatum |= 0x1000;
586  if (ctp7Data5BX.isTowerMasked(cType, negativeEta, iEta, iPhi, BX_n))
587  towerDatum |= 0x2000;
588  if (ctp7Data5BX.isLinkMasked(cType, negativeEta, iEta, iPhi, BX_n))
589  towerDatum |= 0x4000;
590  if (ctp7Data5BX.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n) ||
591  ctp7Data5BX.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n) ||
592  ctp7Data5BX.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
593  towerDatum |= 0x8000;
595  HcalTrigTowerDetId id(cEta, cPhi);
596  id.setVersion(1); // To not process these 1x1 HF TPGs with RCT
597  HcalTriggerPrimitiveDigi tpg(id);
598  tpg.setSize(1);
599  tpg.setSample(0, sample);
600  hcalTPGs->push_back(tpg);
601  }
602  }
603  }
604  }
605 
606  void CaloLayer1Unpacker::makeRegions5BX(uint32_t lPhi,
607  UCTCTP7RawData5BX& ctp7Data5BX,
609  uint32_t BX_n) {
610  for (uint32_t side = 0; side <= 1; side++) {
611  bool negativeEta = false;
612  if (side == 0)
613  negativeEta = true;
614  for (uint32_t region = 0; region <= 6; region++) {
615  uint32_t regionData = ctp7Data5BX.getRegionSummary(negativeEta, region, BX_n);
616  uint32_t lEta = 10 - region; // GCT eta goes 0-21, 0-3 -HF, 4-10 -B/E, 11-17 +B/E, 18-21 +HF
617  if (!negativeEta)
618  lEta = region + 11;
619  regions->push_back(L1CaloRegion((uint16_t)regionData, (unsigned)lEta, (unsigned)lPhi, (int16_t)0));
620  }
621  }
622  }
623 
624  // For addtional HCAL FB implementation
625  void CaloLayer1Unpacker::makeECalTPGs5BX_HCALFB(uint32_t lPhi,
626  UCTCTP7RawData5BX_HCALFB& ctp7Data5BX_HCALFB,
627  EcalTrigPrimDigiCollection* ecalTPGs,
628  uint32_t BX_n) {
630  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) { // Loop over all four phi divisions on card
631  int cPhi = -1 + lPhi * 4 + iPhi; // Calorimeter phi index
632  if (cPhi == 0)
633  cPhi = 72;
634  else if (cPhi == -1)
635  cPhi = 71;
636  else if (cPhi < -1) {
637  LogError("CaloLayer1Unpacker") << "Major error in makeECalTPGs5BX_HCALFB" << std::endl;
638  return;
639  }
640  for (int cEta = -28; cEta <= 28; cEta++) { // Calorimeter Eta indices (HB/HE for now)
641  if (cEta != 0) { // Calorimeter eta = 0 is invalid
642  bool negativeEta = false;
643  if (cEta < 0)
644  negativeEta = true;
645  uint32_t iEta = abs(cEta);
646  // This code is fragile! Note that towerDatum is packed as is done in EcalTriggerPrimitiveSample
647  // Bottom 8-bits are ET
648  // Then finegrain feature bit
649  // Then three bits have ttBits, which I have no clue about (not available on ECAL links so not set)
650  // Then there is a spare FG Veto bit, which is used for L1 spike detection (not available on ECAL links so not set)
651  // Top three bits seem to be unused. So, we steal those to set the tower masking, link masking and link status information
652  // To decode these custom three bits use ((EcalTriggerPrimitiveSample::raw() >> 13) & 0x7)
653  uint32_t towerDatum = ctp7Data5BX_HCALFB.getET(cType, negativeEta, iEta, iPhi, BX_n);
654  if (ctp7Data5BX_HCALFB.getFB(cType, negativeEta, iEta, iPhi, BX_n) != 0)
655  towerDatum |= 0x0100;
656  if (ctp7Data5BX_HCALFB.isTowerMasked(cType, negativeEta, iEta, iPhi, BX_n))
657  towerDatum |= 0x2000;
658  if (ctp7Data5BX_HCALFB.isLinkMasked(cType, negativeEta, iEta, iPhi, BX_n))
659  towerDatum |= 0x4000;
660  if (ctp7Data5BX_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n) ||
661  ctp7Data5BX_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n) ||
662  ctp7Data5BX_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
663  towerDatum |= 0x8000;
665  int zSide = cEta / ((int)iEta);
666  // As far as I can tell, the ECal unpacker only uses barrel and endcap IDs, never EcalTriggerTower
667  const EcalSubdetector ecalTriggerTower =
669  EcalTrigTowerDetId id(zSide, ecalTriggerTower, iEta, cPhi);
670  EcalTriggerPrimitiveDigi tpg(id);
671  tpg.setSize(1);
672  tpg.setSample(0, sample);
673  ecalTPGs->push_back(tpg);
674  }
675  }
676  }
677  }
678 
679  void CaloLayer1Unpacker::makeHCalTPGs5BX_HCALFB(uint32_t lPhi,
680  UCTCTP7RawData5BX_HCALFB& ctp7Data5BX_HCALFB,
681  HcalTrigPrimDigiCollection* hcalTPGs,
682  uint32_t BX_n) {
684  for (uint32_t iPhi = 0; iPhi < 4; iPhi++) { // Loop over all four phi divisions on card
685  int cPhi = -1 + lPhi * 4 + iPhi; // Calorimeter phi index
686  if (cPhi == 0)
687  cPhi = 72;
688  else if (cPhi == -1)
689  cPhi = 71;
690  else if (cPhi < -1) {
691  LogError("CaloLayer1Unpacker") << "Major error in makeHCalTPGs5BX_HCALFB" << std::endl;
692  return;
693  }
694  for (int cEta = -28; cEta <= 28; cEta++) { // Calorimeter Eta indices (HB/HE for now)
695  if (cEta != 0) { // Calorimeter eta = 0 is invalid
696  bool negativeEta = false;
697  if (cEta < 0)
698  negativeEta = true;
699  uint32_t iEta = abs(cEta);
700  // This code is fragile! Note that towerDatum is packed as is done in HcalTriggerPrimitiveSample
701  // Bottom 8-bits are ET
702  // Then feature bit
703  // The remaining bits are undefined presently
704  // We use next three bits for link details, which we did not have room in EcalTriggerPrimitiveSample case
705  // We use next three bits to set the tower masking, link masking and link status information as done for Ecal
706  // To decode these custom six bits use ((EcalTriggerPrimitiveSample::raw() >> 9) & 0x77)
707  uint32_t towerDatum = ctp7Data5BX_HCALFB.getET(cType, negativeEta, iEta, iPhi, BX_n);
708  uint32_t fb = ctp7Data5BX_HCALFB.getFB(cType, negativeEta, iEta, iPhi, BX_n);
709  towerDatum |= ((fb & 0x1) << 8);
710  uint32_t towerDatum2 = ((fb & 0x3E) >> 1);
711  if (ctp7Data5BX_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n))
712  towerDatum |= 0x0200;
713  if (ctp7Data5BX_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n))
714  towerDatum |= 0x0400;
715  if (ctp7Data5BX_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
716  towerDatum |= 0x0800;
717  if (ctp7Data5BX_HCALFB.isTowerMasked(cType, negativeEta, iEta, iPhi, BX_n))
718  towerDatum |= 0x2000;
719  if (ctp7Data5BX_HCALFB.isLinkMasked(cType, negativeEta, iEta, iPhi, BX_n))
720  towerDatum |= 0x4000;
721  if (ctp7Data5BX_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n) ||
722  ctp7Data5BX_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n) ||
723  ctp7Data5BX_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
724  towerDatum |= 0x8000;
726  HcalTriggerPrimitiveSample sample2(towerDatum2);
727  HcalTrigTowerDetId id(cEta, cPhi);
728  HcalTriggerPrimitiveDigi tpg(id);
729  tpg.setSize(2);
730  tpg.setSample(0, sample);
731  tpg.setSample(1, sample2);
732  hcalTPGs->push_back(tpg);
733  }
734  }
735  }
736  }
737 
738  void CaloLayer1Unpacker::makeHFTPGs5BX_HCALFB(uint32_t lPhi,
739  UCTCTP7RawData5BX_HCALFB& ctp7Data5BX_HCALFB,
740  HcalTrigPrimDigiCollection* hcalTPGs,
741  uint32_t BX_n) {
743  for (uint32_t side = 0; side <= 1; side++) {
744  bool negativeEta = false;
745  if (side == 0)
746  negativeEta = true;
747  for (uint32_t iEta = 30; iEta <= 40; iEta++) {
748  for (uint32_t iPhi = 0; iPhi < 2; iPhi++) {
749  if (iPhi == 1 && iEta == 40)
750  iEta = 41;
751  int cPhi = 1 + lPhi * 4 + iPhi * 2; // Calorimeter phi index: 1, 3, 5, ... 71
752  if (iEta == 41)
753  cPhi -= 2; // Last two HF are 3, 7, 11, ...
754  cPhi = (cPhi + 69) % 72 + 1; // cPhi -= 2 mod 72
755  int cEta = iEta;
756  if (negativeEta)
757  cEta = -iEta;
758  // This code is fragile! Note that towerDatum is packed as is done in HcalTriggerPrimitiveSample
759  // Bottom 8-bits are ET
760  // Then feature bit
761  // Then minBias ADC count bit
762  // The remaining bits are undefined presently
763  // We use next three bits for link details, which we did not have room in EcalTriggerPrimitiveSample case
764  // We use next three bits to set the tower masking, link masking and link status information as done for Ecal
765  // To decode these custom six bits use ((EcalTriggerPrimitiveSample::raw() >> 9) & 0x77)
766  uint32_t towerDatum = ctp7Data5BX_HCALFB.getET(cType, negativeEta, iEta, iPhi, BX_n);
767  towerDatum |= ctp7Data5BX_HCALFB.getFB(cType, negativeEta, iEta, iPhi, BX_n) << 8;
768  if (ctp7Data5BX_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n))
769  towerDatum |= 0x0400;
770  if (ctp7Data5BX_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n))
771  towerDatum |= 0x0800;
772  if (ctp7Data5BX_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
773  towerDatum |= 0x1000;
774  if (ctp7Data5BX_HCALFB.isTowerMasked(cType, negativeEta, iEta, iPhi, BX_n))
775  towerDatum |= 0x2000;
776  if (ctp7Data5BX_HCALFB.isLinkMasked(cType, negativeEta, iEta, iPhi, BX_n))
777  towerDatum |= 0x4000;
778  if (ctp7Data5BX_HCALFB.isLinkMisaligned(cType, negativeEta, iEta, iPhi, BX_n) ||
779  ctp7Data5BX_HCALFB.isLinkInError(cType, negativeEta, iEta, iPhi, BX_n) ||
780  ctp7Data5BX_HCALFB.isLinkDown(cType, negativeEta, iEta, iPhi, BX_n))
781  towerDatum |= 0x8000;
783  HcalTrigTowerDetId id(cEta, cPhi);
784  id.setVersion(1); // To not process these 1x1 HF TPGs with RCT
785  HcalTriggerPrimitiveDigi tpg(id);
786  tpg.setSize(1);
787  tpg.setSample(0, sample);
788  hcalTPGs->push_back(tpg);
789  }
790  }
791  }
792  }
793 
794  void CaloLayer1Unpacker::makeRegions5BX_HCALFB(uint32_t lPhi,
795  UCTCTP7RawData5BX_HCALFB& ctp7Data5BX_HCALFB,
797  uint32_t BX_n) {
798  for (uint32_t side = 0; side <= 1; side++) {
799  bool negativeEta = false;
800  if (side == 0)
801  negativeEta = true;
802  for (uint32_t region = 0; region <= 6; region++) {
803  uint32_t regionData = ctp7Data5BX_HCALFB.getRegionSummary(negativeEta, region, BX_n);
804  uint32_t lEta = 10 - region; // GCT eta goes 0-21, 0-3 -HF, 4-10 -B/E, 11-17 +B/E, 18-21 +HF
805  if (!negativeEta)
806  lEta = region + 11;
807  regions->push_back(L1CaloRegion((uint16_t)regionData, (unsigned)lEta, (unsigned)lPhi, (int16_t)0));
808  }
809  }
810  }
811 
812  } // namespace stage2
813 } // namespace l1t
814 
uint32_t getFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
void setSample(int i, const HcalTriggerPrimitiveSample &sam)
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 BX_n)
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
bool isLinkMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isTowerMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
void push_back(T const &t)
uint32_t getRegionSummary(bool negativeEta, uint32_t region, uint32_t BX_n)
delete x;
Definition: CaloConfig.h:22
Log< level::Error, false > LogError
bool isLinkDown(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
Definition: Electron.h:6
bool isTowerMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isLinkInError(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)
bool isLinkInError(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
bool isLinkMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
bool isLinkInError(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isTowerMasked(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 BX_n)
bool isLinkDown(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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)
bool isLinkMisaligned(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)
bool isLinkDown(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
const unsigned int N_BX
Definition: ConstantDef.h:5
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)
bool isLinkDown(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)
HLT enums.
#define DEFINE_L1T_UNPACKER(type)
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:21
bool isLinkInError(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
bool isLinkMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
std::vector< L1CaloRegion > L1CaloRegionCollection
bool isTowerMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
EcalSubdetector
bool isLinkMisaligned(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t BX_n)
bool isLinkMisaligned(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
#define LogDebug(id)