Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-10 02:50:53

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