17 event.getByToken(static_cast<const CaloLayer1Tokens*>(toks)->getEcalDigiToken(),
ecalDigis);
19 event.getByToken(static_cast<const CaloLayer1Tokens*>(toks)->getHcalDigiToken(),
hcalDigis);
21 event.getByToken(static_cast<const CaloLayer1Tokens*>(toks)->getCaloRegionToken(),
caloRegions);
23 std::vector<uint32_t>
load;
26 auto ctp7_phi =
board();
27 uint32_t* ptr =
load.data();
34 unsigned bx_per_l1a = 1;
37 unsigned calo_bxid = (
event.bunchCrossing() + 1) % 3564;
41 unsigned blockSize = 192;
43 unsigned blockFlags = ((bx_per_l1a & 0xf) << 16) | (calo_bxid & 0xfff);
56 for (uint32_t iPhi = 0; iPhi < 4; iPhi++) {
57 int cPhi = -1 + lPhi * 4 + iPhi;
63 edm::LogError(
"CaloLayer1Packer") <<
"Major error in makeECalTPGs" << std::endl;
66 for (
int cEta = -28; cEta <= 28; cEta++) {
68 bool negativeEta =
false;
77 const auto&
tp = ecalTPGs->
find(
id);
78 if (
tp != ecalTPGs->
end()) {
79 ctp7Data.
setET(cType, negativeEta,
iEta, iPhi,
tp->compressedEt());
80 ctp7Data.
setFB(cType, negativeEta,
iEta, iPhi,
tp->fineGrain());
91 for (uint32_t iPhi = 0; iPhi < 4; iPhi++) {
92 int cPhi = -1 + lPhi * 4 + iPhi;
98 edm::LogError(
"CaloLayer1Packer") <<
"Major error in makeHCalTPGs" << std::endl;
101 for (
int cEta = -28; cEta <= 28; cEta++) {
103 bool negativeEta =
false;
109 const auto tp = hcalTPGs->
find(
id);
111 if (
tp != hcalTPGs->
end()) {
112 uint32_t fg_bits = 0;
116 ctp7Data.
setET(cType, negativeEta,
iEta, iPhi,
tp->SOI_compressedEt());
117 ctp7Data.
setFB(cType, negativeEta,
iEta, iPhi, fg_bits);
129 bool negativeEta =
false;
133 for (uint32_t iPhi = 0; iPhi < 2; iPhi++) {
134 if (iPhi == 1 &&
iEta == 40)
136 int cPhi = 1 + lPhi * 4 + iPhi * 2;
139 cPhi = (cPhi + 69) % 72 + 1;
146 const auto tp = hcalTPGs->
find(
id);
147 if (
tp != hcalTPGs->
end()) {
148 ctp7Data.
setET(cType, negativeEta,
iEta, iPhi,
tp->SOI_compressedEt());
149 ctp7Data.
setFB(cType, negativeEta,
iEta, iPhi, ((
tp->SOI_fineGrain(1) << 1) |
tp->SOI_fineGrain(0)));
158 bool negativeEta =
false;
162 uint32_t lEta = 10 -
region;
169 for (
const auto& rtp : *
regions) {
170 if (rtp.id() ==
id) {
void setET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t et)
ALPAKA_FN_ACC int side(int ieta, int iphi)
void makeHCalTPGs(uint32_t lPhi, UCTCTP7RawData &ctp7Data, const HcalTrigPrimDigiCollection *hcalTPGs)
Log< level::Error, false > LogError
void setRegionSummary(bool negativeEta, uint32_t region, uint32_t regionData)
void makeECalTPGs(uint32_t lPhi, UCTCTP7RawData &ctp7Data, const EcalTrigPrimDigiCollection *ecalTPGs)
std::vector< Block > Blocks
Abs< T >::type abs(const T &t)
void setFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t fb)
Blocks pack(const edm::Event &, const PackerTokens *) override
const_iterator end() const
#define DEFINE_L1T_PACKER(type)
void makeHFTPGs(uint32_t lPhi, UCTCTP7RawData &ctp7Data, const HcalTrigPrimDigiCollection *hcalTPGs)
void makeRegions(uint32_t lPhi, UCTCTP7RawData &ctp7Data, const L1CaloRegionCollection *regions)
iterator find(key_type k)
std::vector< L1CaloRegion > L1CaloRegionCollection