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);
45 Block block(hdr, &*load.begin(), &*load.end());
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;
71 uint32_t iEta =
abs(cEta);
73 int zSide = cEta / ((int)iEta);
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;
106 uint32_t iEta =
abs(cEta);
109 const auto tp = hcalTPGs->
find(
id);
110 if (
tp != hcalTPGs->
end()) {
111 ctp7Data.
setET(cType, negativeEta, iEta, iPhi,
tp->SOI_compressedEt());
112 ctp7Data.
setFB(cType, negativeEta, iEta, iPhi,
tp->SOI_fineGrain());
123 for (uint32_t side = 0; side <= 1; side++) {
124 bool negativeEta =
false;
127 for (uint32_t iEta = 30; iEta <= 40; iEta++) {
128 for (uint32_t iPhi = 0; iPhi < 2; iPhi++) {
129 if (iPhi == 1 && iEta == 40)
131 int cPhi = 1 + lPhi * 4 + iPhi * 2;
134 cPhi = (cPhi + 69) % 72 + 1;
141 const auto tp = hcalTPGs->
find(
id);
142 if (
tp != hcalTPGs->
end()) {
143 ctp7Data.
setET(cType, negativeEta, iEta, iPhi,
tp->SOI_compressedEt());
144 ctp7Data.
setFB(cType, negativeEta, iEta, iPhi, ((
tp->SOI_fineGrain(1) << 1) |
tp->SOI_fineGrain(0)));
152 for (uint32_t side = 0; side <= 1; side++) {
153 bool negativeEta =
false;
157 uint32_t lEta = 10 -
region;
164 for (
const auto& rtp : *regions) {
165 if (rtp.id() ==
id) {
uint16_t *__restrict__ id
void setET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi, uint32_t et)
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)
T const * product() const
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