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