File indexing completed on 2023-10-25 09:45:38
0001 #ifndef L1T_PACKER_STAGE2_REGIONALMUONGMTPACKER_H
0002 #define L1T_PACKER_STAGE2_REGIONALMUONGMTPACKER_H
0003
0004 #include <vector>
0005 #include <map>
0006 #include "EventFilter/L1TRawToDigi/interface/PackerTokens.h"
0007 #include "EventFilter/L1TRawToDigi/interface/Block.h"
0008 #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
0009 #include "DataFormats/L1TMuon/interface/RegionalMuonShower.h"
0010 #include "FWCore/Framework/interface/Event.h"
0011
0012 namespace l1t {
0013 namespace stage2 {
0014 class RegionalMuonGMTPacker : public Packer {
0015 public:
0016 Blocks pack(const edm::Event&, const PackerTokens*) override;
0017 void setIsKbmtf() { isKbmtf_ = true; };
0018 void setUseEmtfDisplacementInfo() { useEmtfDisplacementInfo_ = true; };
0019 void setUseEmtfNominalTightShowers() { useEmtfNominalTightShowers_ = true; };
0020 void setUseEmtfLooseShowers() { useEmtfLooseShowers_ = true; };
0021
0022 private:
0023 struct GMTObjects {
0024 std::vector<RegionalMuonCand> mus;
0025 RegionalMuonShower shower;
0026 };
0027 typedef std::map<size_t, std::map<size_t, GMTObjects>> GMTObjectMap;
0028 typedef std::map<unsigned int, std::vector<uint32_t>> PayloadMap;
0029 void packTF(const GMTObjectMap& objMap,
0030 int firstMuonBx,
0031 int lastMuonBx,
0032 int firstMuonShowerBx,
0033 int lastMuonShowerBx,
0034 Blocks&);
0035 std::pair<int, int> getMuons(GMTObjectMap& objMap,
0036 const edm::Event& event,
0037 const edm::EDGetTokenT<RegionalMuonCandBxCollection>& tfToken);
0038 std::pair<int, int> getMuonShowers(GMTObjectMap& objMap,
0039 const edm::Event& event,
0040 const edm::EDGetTokenT<RegionalMuonShowerBxCollection>& tfShowerToken);
0041
0042 static constexpr size_t wordsPerBx_ = 6;
0043
0044 bool isKbmtf_{false};
0045 bool useEmtfDisplacementInfo_{false};
0046 bool useEmtfNominalTightShowers_{false};
0047 bool useEmtfLooseShowers_{false};
0048 };
0049 }
0050 }
0051
0052 #endif