10 std::pair<int, int> muonBx =
getMuons(gmtObjMap,
event, static_cast<const CommonTokens*>(toks)->getMuonToken());
11 std::pair<int, int> muonShowerBx{0, 0};
13 muonShowerBx =
getMuonShowers(gmtObjMap,
event, static_cast<const CommonTokens*>(toks)->getMuonShowerToken());
18 packBx(gmtObjMap, muonBx.first, muonBx.second, muonShowerBx.first, muonShowerBx.second, payloadMap);
22 for (
auto& kv : payloadMap) {
32 event.getByToken(showerToken, muonShowers);
33 for (
int bx = muonShowers->getFirstBX();
bx <= muonShowers->getLastBX(); ++
bx) {
34 if (muonShowers->size(
bx) > 0) {
35 objMap[
bx].shower = muonShowers->at(
bx, 0);
38 return std::make_pair(muonShowers->getFirstBX(), muonShowers->getLastBX());
49 objMap[
bx].mus.push_back(*
mu);
52 return std::make_pair(
muons->getFirstBX(),
muons->getLastBX());
56 const int firstMuonBx,
58 const int firstMuonShowerBx,
59 const int lastMuonShowerBx,
61 const auto firstBx{
std::min(firstMuonShowerBx, firstMuonBx)};
62 const auto lastBx{
std::max(lastMuonShowerBx, lastMuonBx)};
64 for (
int bx{firstBx};
bx < lastBx + 1; ++
bx) {
66 for (
unsigned int blkId =
b1_; blkId <
b1_ + 7; blkId += 2) {
67 payloadMap[blkId].push_back(0);
70 unsigned int blkId =
b1_;
71 uint32_t mu1_shared_word{0};
72 uint32_t mu2_shared_word{0};
77 auto mu{objMap.at(
bx).mus.begin()};
78 std::array<std::array<uint32_t, 4>, 2>
const showerWords{
89 for (
int muCtr = 1; muCtr <= 8; ++muCtr) {
90 if (
mu != objMap.at(
bx).mus.end()) {
92 *
mu, mu2_shared_word, mu2_lsw, mu2_msw,
fedId_,
fwId_, 2 - (muCtr % 2));
99 mu1_shared_word = mu2_shared_word;
102 mu1_msw |= showerWords.at(0).at(muCtr / 2);
104 mu2_msw |= showerWords.at(1).at(muCtr / 2 - 1);
105 payloadMap[blkId].push_back(mu1_shared_word | mu2_shared_word);
106 payloadMap[blkId].push_back(mu1_lsw);
107 payloadMap[blkId].push_back(mu1_msw);
108 payloadMap[blkId].push_back(mu2_lsw);
109 payloadMap[blkId].push_back(mu2_msw);
std::pair< int, int > getMuons(GMTOutputObjectMap &objMap, const edm::Event &event, const edm::EDGetTokenT< MuonBxCollection > &muonToken)
std::map< size_t, GMTObjects > GMTOutputObjectMap
static std::array< std::array< uint32_t, 4 >, 2 > getPackedShowerDataWords(const MuonShower &shower, int fedId, int fwId)
std::map< unsigned int, std::vector< uint32_t > > PayloadMap
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
void packBx(const GMTOutputObjectMap &objMap, int firstMuonBx, int lastMuonBx, int firstMuonShowerBx, int lastMuonShowerBx, PayloadMap &payloadMap)
Blocks pack(const edm::Event &, const PackerTokens *) override
static bool isFwVersionWithShowers(int fedId, int fwId)
std::vector< Block > Blocks
static void generatePackedMuonDataWords(const Muon &mu, uint32_t &raw_data_spare, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, int fedId, int fwId, int muInBx)
#define DEFINE_L1T_PACKER(type)
std::pair< int, int > getMuonShowers(GMTOutputObjectMap &objMap, const edm::Event &event, const edm::EDGetTokenT< MuonShowerBxCollection > &showerToken)