Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 /**  \class L1MuDTTrackAssembler
0004  *
0005  *   Track Assembler:
0006  *
0007  *   The Track Assembler gets the 
0008  *   18 Bitmap tables from the
0009  *   Quality Sorter Unit and links the
0010  *   corresponding track segments 
0011  *   to full tracks
0012  *                 
0013  *   (this version corresponds to the VHDL
0014  *   model b_sts_7 version 7 )
0015  *
0016  *
0017  *
0018  *   N. Neumeister            CERN EP
0019  */
0020 //
0021 //--------------------------------------------------
0022 #ifndef L1MUDT_TRACK_ASSEMBLER_H
0023 #define L1MUDT_TRACK_ASSEMBLER_H
0024 
0025 //---------------
0026 // C++ Headers --
0027 //---------------
0028 
0029 #include <bitset>
0030 
0031 //----------------------
0032 // Base Class Headers --
0033 //----------------------
0034 
0035 //------------------------------------
0036 // Collaborating Class Declarations --
0037 //------------------------------------
0038 
0039 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackAssParam.h"
0040 #include "L1Trigger/DTTrackFinder/interface/L1MuDTAddressArray.h"
0041 class L1MuDTSectorProcessor;
0042 
0043 //              ---------------------
0044 //              -- Class Interface --
0045 //              ---------------------
0046 
0047 class L1MuDTTrackAssembler {
0048 public:
0049   /// constructor
0050   L1MuDTTrackAssembler(const L1MuDTSectorProcessor&);
0051 
0052   /// destructor
0053   ~L1MuDTTrackAssembler();
0054 
0055   /// run Track Assembler
0056   void run();
0057 
0058   /// reset Track Assembler
0059   void reset();
0060 
0061   /// print result of Track Assembler
0062   void print() const;
0063 
0064   /// return Track Class of found track
0065   inline TrackClass trackClass(int id) const { return m_theTCs[id]; }
0066 
0067   /// return bitmap of found track
0068   inline const std::bitset<4>& trackBitMap(int id) const { return m_theBitMaps[id]; }
0069 
0070   /// is it a valid Track Class?
0071   inline bool isEmpty(int id) const { return (m_theTCs[id] == UNDEF); }
0072 
0073   /// get address of a single station of selected track candidate
0074   inline int address(int id, int stat) const { return m_theAddresses[id].station(stat); }
0075 
0076   /// get address-array of selected track candidate
0077   inline L1MuDTAddressArray address(int id) const { return m_theAddresses[id]; }
0078 
0079 private:
0080   /// run the first Priority Encoder Sub-Unit
0081   void runEncoderSubUnit1(unsigned& global, unsigned& group, unsigned& priority);
0082 
0083   /// run the second Priority Encoder Sub-Unit
0084   void runEncoderSubUnit2(unsigned& global, unsigned& group, unsigned& priority);
0085 
0086   /// run the first Address Assignment Sub-Unit
0087   void runAddressAssignment1(int global, int group);
0088 
0089   /// run the second Address Assignment Sub-Unit
0090   void runAddressAssignment2(int global, int group);
0091 
0092   /// 12 bit priority encoder
0093   static unsigned int priorityEncoder12(const std::bitset<12>& input);
0094 
0095   /// 4 bit priority encoder
0096   static unsigned int priorityEncoder4(const std::bitset<4>& input);
0097 
0098   /// 22 bit priority encoder
0099   static unsigned int priorityEncoder22(const std::bitset<22>& input);
0100 
0101   /// 21 bit priority encoder
0102   static unsigned int priorityEncoder21(const std::bitset<21>& input);
0103 
0104   /// 12 bit address encoder
0105   static unsigned int addressEncoder12(const std::bitset<12>& input);
0106 
0107   /// special 12 bit address encoder
0108   static unsigned int addressEncoder12s(const std::bitset<12>& input);
0109 
0110   /// get sub-bitmap of a 68-bit word
0111   static unsigned long subBitset68(const std::bitset<68>& input, int pos, int length);
0112 
0113   /// get sub-bitmap of a 56-bit word
0114   static unsigned long subBitset56(const std::bitset<56>& input, int pos, int length);
0115 
0116   /// cancel Out Table
0117   static std::bitset<56> getCancelationTable(unsigned int);
0118 
0119 private:
0120   const L1MuDTSectorProcessor& m_sp;
0121 
0122   std::bitset<68> m_thePriorityTable1;
0123   std::bitset<56> m_thePriorityTable2;
0124   unsigned int m_theLastAddress[68];
0125   unsigned int m_theLastAddressI[12];
0126 
0127   TrackClass m_theTCs[2];                // Track Classes of the 2 candidates
0128   std::bitset<4> m_theBitMaps[2];        // bitmaps of Track Class
0129   L1MuDTAddressArray m_theAddresses[2];  // relative addresses of the 2 candidates
0130 };
0131 
0132 #endif