CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/L1Trigger/DTTrackFinder/src/L1MuDTTrackAssembler.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00022 //
00023 //--------------------------------------------------
00024 #ifndef L1MUDT_TRACK_ASSEMBLER_H
00025 #define L1MUDT_TRACK_ASSEMBLER_H
00026 
00027 //---------------
00028 // C++ Headers --
00029 //---------------
00030 
00031 #include <bitset>
00032 
00033 //----------------------
00034 // Base Class Headers --
00035 //----------------------
00036 
00037 #include "L1Trigger/DTTrackFinder/interface/L1AbstractProcessor.h"
00038 
00039 //------------------------------------
00040 // Collaborating Class Declarations --
00041 //------------------------------------
00042 
00043 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackAssParam.h"
00044 #include "L1Trigger/DTTrackFinder/src/L1MuDTAddressArray.h"
00045 class L1MuDTSectorProcessor;
00046 
00047 //              ---------------------
00048 //              -- Class Interface --
00049 //              ---------------------
00050 
00051 class L1MuDTTrackAssembler : public L1AbstractProcessor {
00052 
00053   public:
00054 
00056     L1MuDTTrackAssembler(const L1MuDTSectorProcessor& );
00057 
00059     virtual ~L1MuDTTrackAssembler();
00060 
00062     virtual void run();
00063 
00065     virtual void reset();
00066     
00068     void print() const;
00069 
00071     inline TrackClass trackClass(int id) const { return m_theTCs[id]; }
00072     
00074     inline const std::bitset<4>& trackBitMap(int id) const { return m_theBitMaps[id]; }
00075    
00077     inline bool isEmpty(int id) const { return (m_theTCs[id] == UNDEF); }
00078    
00080     inline int address(int id, int stat) const { return m_theAddresses[id].station(stat); }
00081 
00083     inline L1MuDTAddressArray address(int id) const { return m_theAddresses[id]; }
00084 
00085   private:
00086 
00088     void runEncoderSubUnit1(unsigned& global, unsigned& group, unsigned& priority);
00089 
00091     void runEncoderSubUnit2(unsigned& global, unsigned& group, unsigned& priority);
00092     
00094     void runAddressAssignment1(int global, int group);
00095 
00097     void runAddressAssignment2(int global, int group);    
00098     
00100     static unsigned int priorityEncoder12(const std::bitset<12>& input);
00101 
00103     static unsigned int priorityEncoder4(const std::bitset<4>& input); 
00104     
00106     static unsigned int priorityEncoder22(const std::bitset<22>& input);    
00107 
00109     static unsigned int priorityEncoder21(const std::bitset<21>& input);
00110 
00112     static unsigned int addressEncoder12(const std::bitset<12>& input);
00113     
00115     static unsigned int addressEncoder12s(const std::bitset<12>& input);    
00116 
00118     static unsigned long subBitset68(const std::bitset<68>& input, int pos, int length);
00119  
00121     static unsigned long subBitset56(const std::bitset<56>& input, int pos, int length);            
00122 
00124     static std::bitset<56> getCancelationTable(unsigned int);
00125       
00126   private:
00127 
00128     const L1MuDTSectorProcessor& m_sp;
00129 
00130     std::bitset<68>              m_thePriorityTable1;
00131     std::bitset<56>              m_thePriorityTable2;
00132     unsigned int                 m_theLastAddress[68];
00133     unsigned int                 m_theLastAddressI[12];
00134     
00135     TrackClass                   m_theTCs[2];        // Track Classes of the 2 candidates
00136     std::bitset<4>               m_theBitMaps[2];    // bitmaps of Track Class
00137     L1MuDTAddressArray           m_theAddresses[2];  // relative addresses of the 2 candidates
00138                                         
00139 };
00140 
00141 #endif