File indexing completed on 2024-04-06 12:10:52
0001 #ifndef L1T_PACKER_STAGE2_MUONPACKER_H
0002 #define L1T_PACKER_STAGE2_MUONPACKER_H
0003
0004 #include <map>
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "EventFilter/L1TRawToDigi/interface/Packer.h"
0007
0008 #include "L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h"
0009
0010 namespace l1t {
0011 namespace stage2 {
0012 class MuonPacker : public Packer {
0013 public:
0014 MuonPacker(unsigned b1) : b1_(b1) {}
0015 Blocks pack(const edm::Event&, const PackerTokens*) override;
0016 unsigned b1_;
0017 inline void setFwVersion(unsigned fwId) { fwId_ = fwId; };
0018 inline void setFed(unsigned fedId) { fedId_ = fedId; };
0019
0020 private:
0021 struct GMTObjects {
0022 std::vector<Muon> mus;
0023 MuonShower shower;
0024 };
0025 typedef std::map<size_t, GMTObjects> GMTOutputObjectMap;
0026 typedef std::map<unsigned int, std::vector<uint32_t>> PayloadMap;
0027
0028 std::pair<int, int> getMuonShowers(GMTOutputObjectMap& objMap,
0029 const edm::Event& event,
0030 const edm::EDGetTokenT<MuonShowerBxCollection>& showerToken);
0031 std::pair<int, int> getMuons(GMTOutputObjectMap& objMap,
0032 const edm::Event& event,
0033 const edm::EDGetTokenT<MuonBxCollection>& muonToken);
0034 void packBx(const GMTOutputObjectMap& objMap,
0035 int firstMuonBx,
0036 int lastMuonBx,
0037 int firstMuonShowerBx,
0038 int lastMuonShowerBx,
0039 PayloadMap& payloadMap);
0040
0041 unsigned fwId_{0};
0042 unsigned fedId_{0};
0043 };
0044
0045 class GTMuonPacker : public MuonPacker {
0046 public:
0047 GTMuonPacker() : MuonPacker(0) {}
0048 };
0049 class GMTMuonPacker : public MuonPacker {
0050 public:
0051 GMTMuonPacker() : MuonPacker(1) {}
0052 };
0053 }
0054 }
0055
0056 #endif