Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 /**  \class L1MuDTEUX
0004  *
0005  *   Extrapolator:
0006  *
0007  *   The Extrapolator receives a start and 
0008  *   a target track segment and performs the 
0009  *   actual extrapolation
0010  *
0011  *
0012  *
0013  *   N. Neumeister            CERN EP
0014  */
0015 //
0016 //--------------------------------------------------
0017 #ifndef L1MUDT_EUX_H
0018 #define L1MUDT_EUX_H
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 
0024 #include <utility>
0025 #include <map>
0026 
0027 //----------------------
0028 // Base Class Headers --
0029 //----------------------
0030 
0031 //------------------------------------
0032 // Collaborating Class Declarations --
0033 //------------------------------------
0034 
0035 #include "FWCore/Framework/interface/Frameworkfwd.h"
0036 #include "FWCore/Framework/interface/ESHandle.h"
0037 class L1MuDTTrackSegPhi;
0038 class L1MuDTSectorProcessor;
0039 class L1MuDTSEU;
0040 class L1MuDTExtLut;
0041 class L1MuDTTFParameters;
0042 class L1MuDTExtLut;
0043 
0044 //              ---------------------
0045 //              -- Class Interface --
0046 //              ---------------------
0047 
0048 class L1MuDTEUX {
0049 public:
0050   /// constructor
0051   L1MuDTEUX(const L1MuDTSectorProcessor& sp, const L1MuDTSEU& seu, int id);
0052 
0053   /// destructor
0054   ~L1MuDTEUX();
0055 
0056   /// equal operator
0057   bool operator==(const L1MuDTEUX&) const;
0058 
0059   /// run Extrapolator
0060   void run(const L1MuDTExtLut& extLUTs, const L1MuDTTFParameters& pars);
0061 
0062   /// reset Extrapolator
0063   void reset();
0064 
0065   /// load data into EUX
0066   void load(const L1MuDTTrackSegPhi* start_ts, const L1MuDTTrackSegPhi* target_ts);
0067 
0068   /// return pointer to start and target track segment
0069   std::pair<const L1MuDTTrackSegPhi*, const L1MuDTTrackSegPhi*> ts() const;
0070 
0071   /// helper class for finding the best and second best extrapolation
0072   class EUX_Comp {
0073   public:
0074     EUX_Comp(const L1MuDTEUX* k = nullptr) : _not(k) {}
0075     bool operator()(const L1MuDTEUX* first, const L1MuDTEUX* second) const {
0076       if (!second->result())
0077         return false;
0078       if (_not != nullptr && *first == *_not)
0079         return true;
0080       if (_not != nullptr && *second == *_not)
0081         return false;
0082       return (first->quality() < second->quality());
0083     }
0084 
0085   private:
0086     const L1MuDTEUX* _not;
0087   };
0088 
0089   /// return Extrapolation identifier
0090   inline int id() const { return m_id; }
0091 
0092   /// return extrapolation result
0093   inline bool result() const { return m_result; }
0094 
0095   /// return extrapolation quality
0096   inline unsigned int quality() const { return m_quality; }
0097 
0098   /// return extrapolation address (0-11) (address = 15 indicates negative ext. result)
0099   inline unsigned short int address() const { return m_address; }
0100 
0101 private:
0102   /// output sector numbers in the range -6 to +5
0103   int sec_mod(int) const;
0104 
0105 private:
0106   const L1MuDTSectorProcessor& m_sp;
0107   const L1MuDTSEU& m_seu;  // reference to Single Extrapolation Unit
0108   int m_id;                // index of start TS
0109 
0110   bool m_result;                 //@@ 1 bit
0111   unsigned short int m_quality;  //@@ 1 bit
0112   unsigned short int m_address;  //@@ 4 bits
0113 
0114   const L1MuDTTrackSegPhi* m_start;   // start track segment
0115   const L1MuDTTrackSegPhi* m_target;  // target track segment
0116 
0117   int const theExtFilter = 1;           // extrapolation quality filter
0118   unsigned short const nbit_phi = 12;   // number of bits used for phi
0119   unsigned short const nbit_phib = 10;  // number of bits used for phib
0120 };
0121 #endif