Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:52

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 setUseOmtfDisplacementInfo() { useOmtfDisplacementInfo_ = true; };
0019       void setUseEmtfDisplacementInfo() { useEmtfDisplacementInfo_ = true; };
0020       void setUseEmtfNominalTightShowers() { useEmtfNominalTightShowers_ = true; };
0021       void setUseEmtfLooseShowers() { useEmtfLooseShowers_ = true; };
0022 
0023     private:
0024       struct GMTObjects {
0025         std::vector<RegionalMuonCand> mus;
0026         RegionalMuonShower shower;
0027       };
0028       typedef std::map<size_t, std::map<size_t, GMTObjects>> GMTObjectMap;  // Map of BX --> linkID --> objects
0029       typedef std::map<unsigned int, std::vector<uint32_t>> PayloadMap;
0030       void packTF(const GMTObjectMap& objMap,
0031                   int firstMuonBx,
0032                   int lastMuonBx,
0033                   int firstMuonShowerBx,
0034                   int lastMuonShowerBx,
0035                   Blocks&);
0036       std::pair<int, int> getMuons(GMTObjectMap& objMap,
0037                                    const edm::Event& event,
0038                                    const edm::EDGetTokenT<RegionalMuonCandBxCollection>& tfToken);
0039       std::pair<int, int> getMuonShowers(GMTObjectMap& objMap,
0040                                          const edm::Event& event,
0041                                          const edm::EDGetTokenT<RegionalMuonShowerBxCollection>& tfShowerToken);
0042 
0043       static constexpr size_t wordsPerBx_ = 6;  // number of 32 bit words per BX
0044 
0045       bool isKbmtf_{false};
0046       bool useOmtfDisplacementInfo_{false};
0047       bool useEmtfDisplacementInfo_{false};
0048       bool useEmtfNominalTightShowers_{false};
0049       bool useEmtfLooseShowers_{false};
0050     };
0051   }  // namespace stage2
0052 }  // namespace l1t
0053 
0054 #endif