Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 /**  \class L1MuBMAssignmentUnit
0004  *
0005  *   Assignment Unit:
0006  *
0007  *   assigns pt, charge, phi
0008  *   and quality to a muon candidate
0009  *   found by the Track Assembler
0010  *
0011  *
0012  *
0013  *   N. Neumeister            CERN EP
0014  *   J. Troconiz              UAM Madrid
0015  */
0016 //
0017 //--------------------------------------------------
0018 #ifndef L1MUBM_ASSIGNMENT_UNIT_H
0019 #define L1MUBM_ASSIGNMENT_UNIT_H
0020 
0021 //---------------
0022 // C++ Headers --
0023 //---------------
0024 
0025 #include <vector>
0026 #include <iosfwd>
0027 
0028 //----------------------
0029 // Base Class Headers --
0030 //----------------------
0031 
0032 //------------------------------------
0033 // Collaborating Class Declarations --
0034 //------------------------------------
0035 #include "L1Trigger/L1TMuonBarrel/interface/L1TMuonBarrelParamsAllPublic.h"
0036 #include "L1Trigger/L1TMuonBarrel/interface/L1MuBMLUTHandler.h"
0037 #include "CondFormats/L1TObjects/interface/L1TMuonBarrelParams.h"
0038 #include "CondFormats/DataRecord/interface/L1TMuonBarrelParamsRcd.h"
0039 
0040 #include "FWCore/Framework/interface/ESHandle.h"
0041 #include "FWCore/Framework/interface/EventSetup.h"
0042 #include "DataFormats/L1TMuon/interface/BMTF/L1MuBMAddressArray.h"
0043 
0044 class L1MuBMTrackSegPhi;
0045 class L1MuBMSectorProcessor;
0046 class L1MuBMLUTHandler;
0047 //              ---------------------
0048 //              -- Class Interface --
0049 //              ---------------------
0050 
0051 class L1MuBMAssignmentUnit {
0052 public:
0053   /// constructor
0054   L1MuBMAssignmentUnit(L1MuBMSectorProcessor& sp, int id);
0055 
0056   /// destructor
0057   ~L1MuBMAssignmentUnit();
0058 
0059   /// run Assignment Unit
0060   void run(const L1TMuonBarrelParams& mbtfParams);
0061 
0062   /// reset Assignment Unit
0063   void reset();
0064 
0065   /// assign phi
0066   void PhiAU(const L1TMuonBarrelParams&);
0067 
0068   /// assign pt and charge
0069   void PtAU(const L1TMuonBarrelParams&);
0070 
0071   /// assign quality
0072   void QuaAU();
0073   unsigned int Quality();
0074 
0075   /// set precision of phi and phib
0076   static void setPrecision();
0077 
0078 private:
0079   /// Track Segment Router
0080   void TSR();
0081 
0082   /// get track segment from a given station
0083   const L1MuBMTrackSegPhi* getTSphi(int station) const;
0084 
0085   /// convert sector Id to 8 bit code (= sector center)
0086   static int convertSector(int);
0087 
0088   /// determine charge
0089   static int getCharge(L1MuBMLUTHandler::PtAssMethod);
0090 
0091   /// determine pt assignment method
0092   L1MuBMLUTHandler::PtAssMethod getPtMethod() const;
0093   L1MuBMLUTHandler::PtAssMethod getPt1Method(L1MuBMLUTHandler::PtAssMethod) const;
0094   L1MuBMLUTHandler::PtAssMethod getPt2Method(L1MuBMLUTHandler::PtAssMethod) const;
0095 
0096   /// calculate bend angle
0097   int getPtAddress(L1MuBMLUTHandler::PtAssMethod, int bendcharge = 0) const;
0098   int getPt1Address(L1MuBMLUTHandler::PtAssMethod) const;
0099   int getPt2Address(L1MuBMLUTHandler::PtAssMethod) const;
0100 
0101   /// build difference of two phi values
0102   int phiDiff(int stat1, int stat2) const;
0103 
0104 private:
0105   L1MuBMSectorProcessor& m_sp;
0106   int m_id;
0107 
0108   L1MuBMAddressArray m_addArray;
0109   std::vector<const L1MuBMTrackSegPhi*> m_TSphi;
0110   L1MuBMLUTHandler::PtAssMethod m_ptAssMethod;
0111 
0112   L1MuBMLUTHandler* thePtaLUTs;     ///< pt-assignment look-up tables
0113   L1MuBMLUTHandler* thePhiLUTs;     ///< phi-assignment look-up tables
0114   static unsigned short nbit_phi;   ///< # of bits used for pt-assignment
0115   static unsigned short nbit_phib;  ///< # of bits used for pt-assignment
0116 };
0117 
0118 #endif