Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:25

0001 /**
0002  * \class L1Track (for CSC TrackFinder)
0003  * \author L. Gray (partial port from ORCA)
0004  *
0005  * A L1 Track class for the CSC Track Finder.
0006  *
0007  **/
0008 
0009 #ifndef L1CSCTrackFinder_L1Track_h
0010 #define L1CSCTrackFinder_L1Track_h
0011 
0012 #include <DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h>
0013 #include <DataFormats/L1CSCTrackFinder/interface/L1TrackId.h>
0014 
0015 class CSCTFSectorProcessor;
0016 class CSCTFUnpacker;
0017 class CSCTFSPCoreLogic;
0018 
0019 namespace csc {
0020 
0021   class L1Track : public L1MuRegionalCand {
0022   public:
0023     L1Track() : L1MuRegionalCand(), m_name("csc::L1Track") {
0024       setType(2);
0025       setPtPacked(0);
0026     }
0027     L1Track(const csc::L1TrackId&);
0028     L1Track(const csc::L1Track&);
0029 
0030     const csc::L1Track& operator=(const csc::L1Track&);
0031 
0032     ~L1Track() override;
0033 
0034     unsigned rank() const;
0035     void setRank(const unsigned& rank) { m_rank = rank; }
0036 
0037     unsigned localPhi() const { return m_lphi; }
0038     void setLocalPhi(const unsigned& lphi) { m_lphi = lphi; }
0039 
0040     unsigned me1ID() const { return me1_id; }
0041     unsigned me2ID() const { return me2_id; }
0042     unsigned me3ID() const { return me3_id; }
0043     unsigned me4ID() const { return me4_id; }
0044     unsigned mb1ID() const { return mb1_id; }
0045 
0046     unsigned endcap() const { return m_endcap; }
0047     unsigned sector() const { return m_sector; }
0048     unsigned station() const { return 0; }
0049     // these next two are needed by the trigger container class
0050     unsigned subsector() const { return 0; }
0051     unsigned cscid() const { return 0; }
0052 
0053     int BX() const { return bx(); }
0054 
0055     static unsigned encodeRank(const unsigned& pt, const unsigned& quality);
0056     static void decodeRank(const unsigned& rank, unsigned& pt, unsigned& quality);
0057 
0058     unsigned ptLUTAddress() const { return m_ptAddress; }
0059     unsigned front_rear() const { return m_fr; }
0060     void setPtLUTAddress(const unsigned& adr) { m_ptAddress = adr; }
0061     void set_front_rear(unsigned fr) { m_fr = fr; }
0062 
0063     unsigned outputLink() const { return m_output_link; }
0064     void setOutputLink(unsigned oPL) { m_output_link = oPL; }
0065     bool winner() const { return m_winner; }
0066 
0067     bool operator>(const csc::L1Track&) const;
0068     bool operator<(const csc::L1Track&) const;
0069     bool operator>=(const csc::L1Track&) const;
0070     bool operator<=(const csc::L1Track&) const;
0071     bool operator==(const csc::L1Track&) const;
0072     bool operator!=(const csc::L1Track&) const;
0073 
0074     //friend std::ostream& operator<<(std::ostream&, const csc::L1Track&);
0075     //friend std::ostream& operator<<(std::ostream&, csc::L1Track&);
0076 
0077     /// Only the Unpacker and SectorProcessor should have access to addTrackStub()
0078     /// This prevents people from adding too many track stubs.
0079 
0080     friend class CSCTFSectorProcessor;  // for track stubs
0081     friend class ::CSCTFUnpacker;       // for track id bits and track stubs
0082     friend class ::CSCTFSPCoreLogic;    // for track id bits
0083 
0084     void Print() const;
0085 
0086     // Accessors for some technical information:
0087     unsigned deltaPhi12(void) const { return m_ptAddress & 0xFF; }
0088     unsigned deltaPhi23(void) const { return (m_ptAddress >> 8) & 0xF; }
0089     unsigned addressEta(void) const { return (m_ptAddress >> 12) & 0xF; }
0090     unsigned mode(void) const { return (m_ptAddress >> 16) & 0xF; }
0091     bool sign(void) const { return (m_ptAddress >> 20) & 0x1; }
0092     bool synch_err(void) const { return m_se; }
0093     bool bx0(void) const { return m_bx0; }
0094     bool bc0(void) const { return m_bc0; }
0095     unsigned me1Tbin(void) const { return m_me1Tbin; }
0096     unsigned me2Tbin(void) const { return m_me2Tbin; }
0097     unsigned me3Tbin(void) const { return m_me3Tbin; }
0098     unsigned me4Tbin(void) const { return m_me4Tbin; }
0099     unsigned mb1Tbin(void) const { return m_mbTbin; }
0100     void setBits(bool se, bool bx0, bool bc0) {
0101       m_se = se;
0102       m_bx0 = bx0;
0103       m_bc0 = bc0;
0104     }
0105     void setTbins(unsigned me1, unsigned me2, unsigned me3, unsigned me4, unsigned mb) {
0106       m_me1Tbin = me1;
0107       m_me2Tbin = me2;
0108       m_me3Tbin = me3;
0109       m_me4Tbin = me4;
0110       m_mbTbin = mb;
0111     }
0112     void setStationIds(
0113         const unsigned& me1, const unsigned& me2, const unsigned& me3, const unsigned& me4, const unsigned& mb1);
0114 
0115     unsigned modeExtended(void) const;
0116 
0117   private:
0118     std::string m_name;
0119     //L1TrackId m_id; remove this nested class for now... POOL doesn't like it.
0120     unsigned m_endcap = 0, m_sector = 0;
0121     //CSCCorrelatedLCTDigiCollection track_stubs;  same as above
0122     unsigned m_lphi = 0;
0123     unsigned m_ptAddress = 0;
0124     unsigned m_fr = 0;
0125     unsigned me1_id = 0, me2_id = 0, me3_id = 0, me4_id = 0, mb1_id = 0;
0126     unsigned m_rank = 0;
0127     unsigned m_output_link = 0;
0128     bool m_empty = true;
0129     bool m_winner = false;
0130 
0131     // Technical information:
0132     bool m_se = true, m_bx0 = true, m_bc0 = true;
0133     unsigned m_me1Tbin = 0, m_me2Tbin = 0, m_me3Tbin = 0, m_me4Tbin = 0, m_mbTbin = 0;
0134   };
0135 }  // namespace csc
0136 
0137 #endif