18 LogDebug(
"L1T") <<
"Board ID = " << block.
amc().getBoardID();
22 auto ctp7_phi = block.
amc().getBoardID();
23 const uint32_t * ptr = block.
payload().data();
26 makeECalTPGs(ctp7_phi, ctp7Data,
res->getEcalDigis());
27 makeHCalTPGs(ctp7_phi, ctp7Data,
res->getHcalDigis());
28 makeHFTPGs(ctp7_phi, ctp7Data,
res->getHcalDigis());
29 makeRegions(ctp7_phi, ctp7Data,
res->getRegions());
36 for(uint32_t iPhi = 0; iPhi < 4; iPhi++) {
37 int cPhi = - 1 + lPhi * 4 + iPhi;
38 if(cPhi == 0) cPhi = 72;
39 else if(cPhi == -1) cPhi = 71;
41 LogError(
"CaloLayer1Unpacker") <<
"Major error in makeECalTPGs" << std::endl;
44 for(
int cEta = -28; cEta <= 28; cEta++) {
46 bool negativeEta =
false;
47 if(cEta < 0) negativeEta =
true;
48 uint32_t iEta =
abs(cEta);
56 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
57 if(ctp7Data.
getFB(cType, negativeEta, iEta, iPhi)!=0) towerDatum |= 0x0100;
58 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
59 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
62 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
64 int zSide = cEta / ((
int) iEta);
80 for(uint32_t iPhi = 0; iPhi < 4; iPhi++) {
81 int cPhi = - 1 + lPhi * 4 + iPhi;
82 if(cPhi == 0) cPhi = 72;
83 else if(cPhi == -1) cPhi = 71;
85 LogError(
"CaloLayer1Unpacker") <<
"Major error in makeHCalTPGs" << std::endl;
88 for(
int cEta = -28; cEta <= 28; cEta++) {
90 bool negativeEta =
false;
91 if(cEta < 0) negativeEta =
true;
92 uint32_t iEta =
abs(cEta);
100 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
101 if(ctp7Data.
getFB(cType, negativeEta, iEta, iPhi)!=0) towerDatum |= 0x0100;
102 if(ctp7Data.
isLinkMisaligned(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0200;
103 if(ctp7Data.
isLinkInError(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0400;
104 if(ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0800;
105 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
106 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
109 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
124 for(uint32_t side = 0; side <= 1; side++) {
125 bool negativeEta =
false;
126 if(side == 0) negativeEta =
true;
127 for(uint32_t iEta = 30; iEta <= 40; iEta++) {
128 for(uint32_t iPhi = 0; iPhi < 2; iPhi++) {
129 if(iPhi == 1 && iEta == 40) iEta = 41;
130 int cPhi = 1 + lPhi * 4 + iPhi * 2;
131 if(iEta == 41) cPhi -= 2;
132 cPhi = (cPhi+69)%72 + 1;
134 if(negativeEta) cEta = -iEta;
143 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
144 towerDatum |= ctp7Data.
getFB(cType, negativeEta, iEta, iPhi) << 8;
145 if(ctp7Data.
isLinkMisaligned(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0400;
146 if(ctp7Data.
isLinkInError(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0800;
147 if(ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x1000;
148 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
149 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
152 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
167 for(uint32_t side = 0; side <= 1; side++) {
168 bool negativeEta =
false;
169 if(side == 0) negativeEta =
true;
170 for(uint32_t region = 0; region <= 6; region++) {
172 uint32_t lEta = 10 - region;
173 if(!negativeEta) lEta = region + 11;
174 regions->push_back(
L1CaloRegion((uint16_t) regionData, (
unsigned) lEta, (
unsigned) lPhi, (int16_t) 0));
void setSample(int i, const HcalTriggerPrimitiveSample &sam)
uint32_t getFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
const std::vector< uint32_t > & payload() const
bool isLinkMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
BlockHeader header() const
void push_back(T const &t)
bool isLinkDown(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
bool isLinkInError(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isTowerMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
Abs< T >::type abs(const T &t)
uint32_t getET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
#define DEFINE_L1T_UNPACKER(type)
A calorimeter trigger region (sum of 4x4 trigger towers)
std::vector< L1CaloRegion > L1CaloRegionCollection
void amc(const amc::Header &h)
uint32_t getRegionSummary(bool negativeEta, uint32_t region)
bool isLinkMisaligned(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)