Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-02 03:45:46

0001 //-------------------------------------------------
0002 //
0003 /**  \class L1MuDTTrack
0004  *
0005  *   L1 Muon Track Candidate
0006  *
0007  *
0008  *
0009  *   N. Neumeister            CERN EP
0010  *   J. Troconiz              UAM Madrid
0011  */
0012 //
0013 //--------------------------------------------------
0014 #ifndef L1MUDT_TRACK_H
0015 #define L1MUDT_TRACK_H
0016 
0017 //---------------
0018 // C++ Headers --
0019 //---------------
0020 
0021 #include <iosfwd>
0022 #include <string>
0023 #include <vector>
0024 
0025 //----------------------
0026 // Base Class Headers --
0027 //----------------------
0028 
0029 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
0030 
0031 //------------------------------------
0032 // Collaborating Class Declarations --
0033 //------------------------------------
0034 
0035 #include <FWCore/Framework/interface/ESHandle.h>
0036 #include <FWCore/Framework/interface/EventSetup.h>
0037 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackAssParam.h"
0038 #include "L1Trigger/DTTrackFinder/interface/L1MuDTAddressArray.h"
0039 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackSegPhi.h"
0040 #include "L1Trigger/DTTrackFinder/interface/L1MuDTTrackSegEta.h"
0041 #include "L1Trigger/DTTrackFinder/interface/L1MuDTSecProcId.h"
0042 
0043 //              ---------------------
0044 //              -- Class Interface --
0045 //              ---------------------
0046 
0047 class L1MuDTTrack : public L1MuRegionalCand {
0048 public:
0049   /// default constructor
0050   L1MuDTTrack();
0051 
0052   /// constructor
0053   L1MuDTTrack(const L1MuDTSecProcId&);
0054 
0055   /// copy constructor
0056   L1MuDTTrack(const L1MuDTTrack&);
0057 
0058   /// destructor
0059   ~L1MuDTTrack() override;
0060 
0061   /// reset muon candidate
0062   void reset() override;
0063 
0064   /// get name of object
0065   inline std::string name() const { return m_name; }
0066 
0067   /// get pt-code (5 bits)
0068   inline unsigned int pt() const { return pt_packed(); }
0069 
0070   /// get phi-code (8 bits)
0071   inline unsigned int phi() const { return phi_packed(); }
0072 
0073   /// get eta-code (6 bits)
0074   inline unsigned int eta() const { return eta_packed(); }
0075 
0076   /// get fine eta bit
0077   inline bool fineEtaBit() const { return isFineHalo(); }
0078 
0079   /// get charge (1 bit)
0080   inline int charge() const { return chargeValue(); }
0081 
0082   /// get track-class
0083   inline TrackClass tc() const { return m_tc; }
0084 
0085   /// is it an empty  muon candidate?
0086   inline bool empty() const override { return m_empty; }
0087 
0088   /// return Sector Processor in which the muon candidate was found
0089   inline const L1MuDTSecProcId& spid() const { return m_spid; }
0090 
0091   /// get address-array for this muon candidate
0092   inline L1MuDTAddressArray address() const { return m_addArray; }
0093 
0094   /// get relative address of a given station
0095   inline int address(int stat) const { return m_addArray.station(stat); }
0096 
0097   /// return number of phi track segments used to form the muon candidate
0098   inline int numberOfTSphi() const { return m_tsphiList.size(); }
0099 
0100   /// return number of eta track segments used to form the muon candidate
0101   inline int numberOfTSeta() const { return m_tsetaList.size(); }
0102 
0103   /// return all phi track segments of the muon candidate
0104   const std::vector<L1MuDTTrackSegPhi>& getTSphi() const { return m_tsphiList; }
0105 
0106   /// return start phi track segment of muon candidate
0107   const L1MuDTTrackSegPhi& getStartTSphi() const;
0108 
0109   /// return end phi track segment of muon candidate
0110   const L1MuDTTrackSegPhi& getEndTSphi() const;
0111 
0112   /// return all eta track segments of the muon candidate
0113   const std::vector<L1MuDTTrackSegEta>& getTSeta() const { return m_tsetaList; }
0114 
0115   /// return start eta track segment of muon candidate
0116   const L1MuDTTrackSegEta& getStartTSeta() const;
0117 
0118   /// return end eta track segment of muon candidate
0119   const L1MuDTTrackSegEta& getEndTSeta() const;
0120 
0121   /// enable muon candidate
0122   inline void enable() {
0123     m_empty = false;
0124     setType(0);
0125   }
0126 
0127   /// disable muon candidate
0128   inline void disable() { m_empty = true; }
0129 
0130   /// set name of object
0131   inline void setName(std::string name) { m_name = name; }
0132 
0133   /// set track-class of muon candidate
0134   inline void setTC(TrackClass tc) { m_tc = tc; }
0135 
0136   /// set phi-code of muon candidate
0137   inline void setPhi(int phi) { setPhiPacked(phi); }
0138 
0139   /// set eta-code of muon candidate
0140   void setEta(int eta);
0141 
0142   /// set fine eta bit
0143   inline void setFineEtaBit() { setFineHalo(true); }
0144 
0145   /// set pt-code of muon candidate
0146   inline void setPt(int pt) { setPtPacked(pt); }
0147 
0148   /// set charge of muon candidate
0149   inline void setCharge(int charge) {
0150     setChargeValue(charge);
0151     setChargeValid(true);
0152   }
0153 
0154   /// set quality of muon candidate
0155   inline void setQuality(unsigned int quality) { setQualityPacked(quality); }
0156 
0157   /// set relative addresses of muon candidate
0158   inline void setAddresses(const L1MuDTAddressArray& addr) { m_addArray = addr; }
0159 
0160   /// set phi track segments used to form the muon candidate
0161   void setTSphi(const std::vector<const L1MuDTTrackSegPhi*>& tsList);
0162 
0163   /// set eta track segments used to form the muon candidate
0164   void setTSeta(const std::vector<const L1MuDTTrackSegEta*>& tsList);
0165 
0166   /// convert  pt value in GeV to pt code
0167   unsigned int triggerScale(float value, const edm::EventSetup& c) const;
0168 
0169   /// assignment operator
0170   L1MuDTTrack& operator=(const L1MuDTTrack&);
0171 
0172   /// equal operator
0173   bool operator==(const L1MuDTTrack&) const;
0174 
0175   /// unequal operator
0176   bool operator!=(const L1MuDTTrack&) const;
0177 
0178   /// print parameters of muon candidate
0179   void print() const override;
0180 
0181   /// output stream operator
0182   friend std::ostream& operator<<(std::ostream&, const L1MuDTTrack&);
0183 
0184   /// define a rank for muon candidates
0185   static bool rank(const L1MuDTTrack* first, const L1MuDTTrack* second) {
0186     unsigned short int rank_f = 0;  // rank of first
0187     unsigned short int rank_s = 0;  // rank of second
0188     if (first)
0189       rank_f = 10 * first->pt() + first->quality();
0190     if (second)
0191       rank_s = 10 * second->pt() + second->quality();
0192     return rank_f > rank_s;
0193   }
0194 
0195 private:
0196   L1MuDTSecProcId m_spid;  // which SP found the track
0197   std::string m_name;
0198   bool m_empty;
0199   TrackClass m_tc;
0200 
0201   L1MuDTAddressArray m_addArray;
0202   std::vector<L1MuDTTrackSegPhi> m_tsphiList;
0203   std::vector<L1MuDTTrackSegEta> m_tsetaList;
0204 };
0205 
0206 #endif