Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-15 23:40:40

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/L1MuBMLUTHandler.h"
0036 #include "CondFormats/L1TObjects/interface/L1TMuonBarrelParams.h"
0037 #include "CondFormats/DataRecord/interface/L1TMuonBarrelParamsRcd.h"
0038 
0039 #include "FWCore/Framework/interface/ESHandle.h"
0040 #include "FWCore/Framework/interface/EventSetup.h"
0041 #include "DataFormats/L1TMuon/interface/BMTF/L1MuBMAddressArray.h"
0042 
0043 class L1MuBMTrackSegPhi;
0044 class L1MuBMSectorProcessor;
0045 class L1MuBMLUTHandler;
0046 //              ---------------------
0047 //              -- Class Interface --
0048 //              ---------------------
0049 
0050 class L1MuBMAssignmentUnit {
0051 public:
0052   /// constructor
0053   L1MuBMAssignmentUnit(L1MuBMSectorProcessor& sp, int id);
0054 
0055   /// destructor
0056   ~L1MuBMAssignmentUnit();
0057 
0058   /// run Assignment Unit
0059   void run(const L1TMuonBarrelParams& mbtfParams);
0060 
0061   /// reset Assignment Unit
0062   void reset();
0063 
0064   /// assign phi
0065   void PhiAU(const L1TMuonBarrelParams&);
0066 
0067   /// assign pt and charge
0068   void PtAU(const L1TMuonBarrelParams&);
0069 
0070   /// assign quality
0071   void QuaAU();
0072   unsigned int Quality();
0073 
0074   /// set precision of phi and phib
0075   void setPrecision();
0076 
0077 private:
0078   /// Track Segment Router
0079   void TSR();
0080 
0081   /// get track segment from a given station
0082   const L1MuBMTrackSegPhi* getTSphi(int station) const;
0083 
0084   /// convert sector Id to 8 bit code (= sector center)
0085   static int convertSector(int);
0086 
0087   /// determine charge
0088   static int getCharge(L1MuBMLUTHandler::PtAssMethod);
0089 
0090   /// determine pt assignment method
0091   L1MuBMLUTHandler::PtAssMethod getPtMethod() const;
0092   L1MuBMLUTHandler::PtAssMethod getPt1Method(L1MuBMLUTHandler::PtAssMethod) const;
0093   L1MuBMLUTHandler::PtAssMethod getPt2Method(L1MuBMLUTHandler::PtAssMethod) const;
0094 
0095   /// calculate bend angle
0096   int getPtAddress(L1MuBMLUTHandler::PtAssMethod, int bendcharge = 0) const;
0097   int getPt1Address(L1MuBMLUTHandler::PtAssMethod) const;
0098   int getPt2Address(L1MuBMLUTHandler::PtAssMethod) const;
0099 
0100   /// build difference of two phi values
0101   int phiDiff(int stat1, int stat2) const;
0102 
0103 private:
0104   L1MuBMSectorProcessor& m_sp;
0105   int m_id;
0106 
0107   L1MuBMAddressArray m_addArray;
0108   std::vector<const L1MuBMTrackSegPhi*> m_TSphi;
0109   L1MuBMLUTHandler::PtAssMethod m_ptAssMethod;
0110 
0111   L1MuBMLUTHandler* thePtaLUTs;   ///< pt-assignment look-up tables
0112   L1MuBMLUTHandler* thePhiLUTs;   ///< phi-assignment look-up tables
0113   unsigned short nbit_phi = 12;   ///< # of bits used for pt-assignment
0114   unsigned short nbit_phib = 10;  ///< # of bits used for pt-assignment
0115 };
0116 
0117 #endif