Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:50

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