Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:57

0001 //-------------------------------------------------
0002 //
0003 /** \class L1MuGMTMerger
0004  *
0005  *  L1 Global Muon Trigger Merger.
0006  * 
0007  *  There are two GMT Mergers. One for the barrel (id=0) and 
0008  *  one for the forward (id=1) part.
0009  *
0010  *  The merger receives four DT(CSC) muons and four RPC muons.
0011  *  Each DT(CSC) muon is either merged with an RPC one or
0012  *  passed through.
0013  *
0014  *  To simplify the C++ model, the merger conatians also the conversion
0015  *  units and sort rank units as well as the MergeMethodSelection unit 
0016  *  which are separate units in the hardware.
0017  *  
0018  *
0019  *
0020 */
0021 //
0022 //
0023 //   Author :
0024 //   H. Sakulin           HEPHY Vienna
0025 //
0026 //   Migrated to CMSSW:
0027 //   I. Mikulec
0028 //
0029 //--------------------------------------------------
0030 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTMerger_h
0031 #define L1TriggerGlobalMuonTrigger_L1MuGMTMerger_h
0032 
0033 //---------------
0034 // C++ Headers --
0035 //---------------
0036 
0037 #include <vector>
0038 
0039 //----------------------
0040 // Base Class Headers --
0041 //----------------------
0042 
0043 //------------------------------------
0044 // Collaborating Class Declarations --
0045 //------------------------------------
0046 
0047 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
0048 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMatrix.h"
0049 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
0050 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTExtendedCand.h"
0051 
0052 class L1MuGlobalMuonTrigger;
0053 
0054 //              ---------------------
0055 //              -- Class Interface --
0056 //              ---------------------
0057 
0058 class L1MuGMTMerger {
0059 public:
0060   /// constructor
0061   L1MuGMTMerger(const L1MuGlobalMuonTrigger& gmt, int id);
0062 
0063   /// destructor
0064   virtual ~L1MuGMTMerger();
0065 
0066   /// run GMT Merger
0067   void run();
0068 
0069   /// clear Merger
0070   void reset();
0071 
0072   /// print results after selection
0073   void print() const;
0074 
0075   /// return identifier
0076   inline int id() const { return m_id; }
0077 
0078   /// return std::vector with all muon candidates
0079   inline const std::vector<L1MuGMTExtendedCand*>& Cands() const { return m_MuonCands; }
0080 
0081 private:
0082   void load();
0083   void merge();
0084 
0085   void createMergedCand(int idx_dtcsc, int idx_rpc);
0086   void createDTCSCCand(int idx_dtcsc);
0087   void createRPCCand(int idx_rpc);
0088 
0089   int doSpecialMerge(unsigned MMconfig) const;
0090   int doANDMerge(unsigned MMconfig) const;
0091   int selectDTCSC(unsigned MMconfig, int by_rank, int by_pt, int by_combi) const;
0092 
0093   unsigned convertedEta(const L1MuRegionalCand* mu) const;
0094   unsigned projectedPhi(const L1MuRegionalCand* mu) const;
0095   unsigned sysign(const L1MuRegionalCand* mu) const;
0096 
0097   /// Merge Rank Table
0098   int merge_rank(const L1MuRegionalCand*) const;
0099 
0100 private:
0101   const L1MuGlobalMuonTrigger& m_gmt;
0102   int m_id;
0103 
0104   std::vector<const L1MuRegionalCand*> dtcsc_mu;
0105   std::vector<const L1MuRegionalCand*> rpc_mu;
0106 
0107   std::vector<L1MuGMTExtendedCand*> m_MuonCands;  // up to eight
0108 
0109   std::vector<int> singleRank;  //@ 8 bits
0110 };
0111 
0112 #endif