16 LogDebug(
"L1T") <<
"Block size = " <<
block.header().getSize();
19 auto res = static_cast<CaloLayer1Collections*>(coll);
21 auto ctp7_phi =
block.amc().getBoardID();
22 const uint32_t* ptr =
block.payload().data();
25 makeECalTPGs(ctp7_phi, ctp7Data,
res->getEcalDigis());
26 makeHCalTPGs(ctp7_phi, ctp7Data,
res->getHcalDigis());
27 makeHFTPGs(ctp7_phi, ctp7Data,
res->getHcalDigis());
28 makeRegions(ctp7_phi, ctp7Data,
res->getRegions());
33 void CaloLayer1Unpacker::makeECalTPGs(uint32_t lPhi,
37 for (uint32_t iPhi = 0; iPhi < 4; iPhi++) {
38 int cPhi = -1 + lPhi * 4 + iPhi;
44 LogError(
"CaloLayer1Unpacker") <<
"Major error in makeECalTPGs" << std::endl;
47 for (
int cEta = -28; cEta <= 28; cEta++) {
49 bool negativeEta =
false;
60 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta,
iEta, iPhi);
61 if (ctp7Data.
getFB(cType, negativeEta,
iEta, iPhi) != 0)
86 void CaloLayer1Unpacker::makeHCalTPGs(uint32_t lPhi,
90 for (uint32_t iPhi = 0; iPhi < 4; iPhi++) {
91 int cPhi = -1 + lPhi * 4 + iPhi;
97 LogError(
"CaloLayer1Unpacker") <<
"Major error in makeHCalTPGs" << std::endl;
100 for (
int cEta = -28; cEta <= 28; cEta++) {
102 bool negativeEta =
false;
113 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta,
iEta, iPhi);
114 if (ctp7Data.
getFB(cType, negativeEta,
iEta, iPhi) != 0)
115 towerDatum |= 0x0100;
117 towerDatum |= 0x0200;
119 towerDatum |= 0x0400;
121 towerDatum |= 0x0800;
123 towerDatum |= 0x2000;
125 towerDatum |= 0x4000;
129 towerDatum |= 0x8000;
143 for (uint32_t side = 0; side <= 1; side++) {
144 bool negativeEta =
false;
148 for (uint32_t iPhi = 0; iPhi < 2; iPhi++) {
149 if (iPhi == 1 &&
iEta == 40)
151 int cPhi = 1 + lPhi * 4 + iPhi * 2;
154 cPhi = (cPhi + 69) % 72 + 1;
166 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta,
iEta, iPhi);
167 towerDatum |= ctp7Data.
getFB(cType, negativeEta,
iEta, iPhi) << 8;
169 towerDatum |= 0x0400;
171 towerDatum |= 0x0800;
173 towerDatum |= 0x1000;
175 towerDatum |= 0x2000;
177 towerDatum |= 0x4000;
181 towerDatum |= 0x8000;
195 for (uint32_t side = 0; side <= 1; side++) {
196 bool negativeEta =
false;
201 uint32_t lEta = 10 -
region;
204 regions->push_back(
L1CaloRegion((uint16_t)regionData, (
unsigned)lEta, (
unsigned)lPhi, (int16_t)0));