18 LogDebug(
"L1T") <<
"Board ID = " << block.
amc().getBoardID();
22 auto ctp7_phi = block.
amc().getBoardID();
23 uint32_t * ptr = &*block.
payload().begin();
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());
37 for(uint32_t iPhi = 0; iPhi < 4; iPhi++) {
38 int cPhi = - 1 + lPhi * 4 + iPhi;
39 if(cPhi == 0) cPhi = 72;
40 else if(cPhi == -1) cPhi = 71;
42 LogError(
"CaloLayer1Unpacker") <<
"Major error in makeECalTPGs" << std::endl;
45 for(
int cEta = -28; cEta <= 28; cEta++) {
47 bool negativeEta =
false;
48 if(cEta < 0) negativeEta =
true;
49 uint32_t iEta =
abs(cEta);
57 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
58 if(ctp7Data.
getFB(cType, negativeEta, iEta, iPhi)!=0) towerDatum |= 0x0100;
59 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
60 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
63 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
65 int zSide = cEta / ((
int) iEta);
82 for(uint32_t iPhi = 0; iPhi < 4; iPhi++) {
83 int cPhi = - 1 + lPhi * 4 + iPhi;
84 if(cPhi == 0) cPhi = 72;
85 else if(cPhi == -1) cPhi = 71;
87 LogError(
"CaloLayer1Unpacker") <<
"Major error in makeHCalTPGs" << std::endl;
90 for(
int cEta = -28; cEta <= 28; cEta++) {
92 bool negativeEta =
false;
93 if(cEta < 0) negativeEta =
true;
94 uint32_t iEta =
abs(cEta);
102 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
103 if(ctp7Data.
getFB(cType, negativeEta, iEta, iPhi)!=0) towerDatum |= 0x0100;
104 if(ctp7Data.
isLinkMisaligned(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0200;
105 if(ctp7Data.
isLinkInError(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0400;
106 if(ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0800;
107 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
108 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
111 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
126 for(uint32_t side = 0; side <= 1; side++) {
127 bool negativeEta =
false;
128 if(side == 0) negativeEta =
true;
129 for(uint32_t iEta = 30; iEta <= 40; iEta++) {
130 for(uint32_t iPhi = 0; iPhi < 2; iPhi++) {
131 if(iPhi == 1 && iEta == 40) iEta = 41;
132 int cPhi = 1 + lPhi * 4 + iPhi * 2;
133 if(iEta == 41) cPhi -= 2;
134 cPhi = (cPhi+69)%72 + 1;
136 if(negativeEta) cEta = -iEta;
145 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
146 towerDatum |= ctp7Data.
getFB(cType, negativeEta, iEta, iPhi) << 8;
147 if(ctp7Data.
isLinkMisaligned(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0400;
148 if(ctp7Data.
isLinkInError(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0800;
149 if(ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x1000;
150 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
151 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
154 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
169 for(uint32_t side = 0; side <= 1; side++) {
170 bool negativeEta =
false;
171 if(side == 0) negativeEta =
true;
172 for(uint32_t region = 0; region <= 6; region++) {
174 uint32_t lEta = 10 - region;
175 if(!negativeEta) lEta = region + 11;
176 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)
bool isLinkMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
BlockHeader header() const
void push_back(T const &t)
std::vector< uint32_t > payload() const
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)
void reserve(size_type n)
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)