CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

csc::L1TrackId Class Reference

#include <L1TrackId.h>

List of all members.

Public Types

enum  { kRankBitWidth = 6 }

Public Member Functions

unsigned encodeLUTMode (const unsigned &rank) const
unsigned endcap () const
bool erase () const
bool hasMB1 (const unsigned &rank) const
bool hasME1 (const unsigned &rank) const
 Functions to determine which stations are in this track.
bool hasME2 (const unsigned &rank) const
bool hasME3 (const unsigned &rank) const
bool hasME4 (const unsigned &rank) const
bool inOverlap () const
 L1TrackId (const unsigned &side, const unsigned &sector)
 L1TrackId ()
 L1TrackId (const csc::L1TrackId &)
unsigned mode () const
unsigned numSegments () const
const L1TrackIdoperator= (const csc::L1TrackId &)
void overlapMode (const unsigned &rank, int &mode, int &stnA, int &stnB)
unsigned rank () const
unsigned sector () const
void setMode (const unsigned &mode)
void setOverlap (const unsigned &rank)
void setRank (const unsigned &rank)
bool sharesHit (const csc::L1TrackId &) const
unsigned station () const

Private Attributes

CSCDetId id_
bool m_erase
unsigned m_mode
bool m_overlap
unsigned m_rank

Detailed Description

Definition at line 19 of file L1TrackId.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
kRankBitWidth 

Definition at line 22 of file L1TrackId.h.

{ kRankBitWidth = 6 };

Constructor & Destructor Documentation

L1TrackId::L1TrackId ( )

Definition at line 5 of file L1TrackId.cc.

  {}
L1TrackId::L1TrackId ( const unsigned &  side,
const unsigned &  sector 
)

Use a fake cscid and station... We just need to know endcap and sector

Definition at line 8 of file L1TrackId.cc.

References CSCTriggerNumbering::chamberFromTriggerLabels(), CSCDetId, and id_.

L1TrackId::L1TrackId ( const csc::L1TrackId id)

Definition at line 17 of file L1TrackId.cc.

References DetId::id_, id_, m_erase, m_mode, m_overlap, and m_rank.

  {
    m_rank = id.m_rank;
    m_mode = id.m_mode;
    m_erase = id.m_erase;
    m_overlap = id.m_overlap;
    id_ = id.id_;
    //stubs = id.stubs;  // add stubs back later
  }

Member Function Documentation

unsigned L1TrackId::encodeLUTMode ( const unsigned &  rank) const

Definition at line 145 of file L1TrackId.cc.

References mode().

  {
    int mode;
    switch (rank) 
      {
      case 0:
        mode = 0;
        break;
      case 1:
        mode = 10;
        break;
      case 2:
        mode = 9;
        break;
      case 3:
        mode = 8;
        break;
      case 4:
        mode = 5;
        break;
      case 5:
        mode = 7;
        break;
      case 6:
        mode = 6;
        break;
      case 7:
        mode = 15;
        break;
      case 8:
        mode = 13;
        break;
      case 9:
        mode = 14;
        break;
      case 10:
        mode = 7;
        break;
      case 11:
        mode = 6;
        break;
      case 12:
        mode = 14;
        break;
      case 13:
        mode = 7;
        break;
      case 14:
        mode = 6;
        break;
      case 15:
        mode = 14;
        break;
      case 16:
        mode = 4;
        break;
      case 17:
        mode = 3;
        break;
      case 18:
        mode = 2;
        break;
      case 19:
        mode = 12;
        break;
      case 20:
        mode = 11;
        break;
      case 21:
        mode = 4;
        break;
      case 22:
        mode = 3;
        break;
      case 23:
        mode = 2;
        break;
      case 24:
        mode = 12;
        break;
      case 25:
        mode = 11;
        break;
      case 26:
        mode = 4;
        break;
      case 27:
        mode = 3;
        break;
      case 28:
        mode = 2;
        break;
      case 29:
        mode = 12;
        break;
      case 30:
        mode = 11;
        break;
      case 31:
        mode = 2;
        break;
      case 32:
        mode = 11;
        break;
      case 33:
        mode = 2;
        break;
      case 34:
        mode = 11;
        break;
      case 35:
        mode = 2;
        break;
      case 36:
        mode = 11;
        break;
      default:
        mode = 0;
      }
    return mode;
  }
unsigned csc::L1TrackId::endcap ( ) const [inline]

Definition at line 30 of file L1TrackId.h.

References CSCDetId::endcap(), and id_.

{ return id_.endcap(); }
bool csc::L1TrackId::erase ( ) const [inline]

Definition at line 57 of file L1TrackId.h.

References m_erase.

{ return m_erase; }
bool L1TrackId::hasMB1 ( const unsigned &  rank) const

Definition at line 394 of file L1TrackId.cc.

  {
    bool mb = false;
    switch (rank) 
      {
      case 9:
      case 12:
      case 15:
      case 19:
      case 20:
      case 24:
      case 25:
      case 29:
      case 30:
      case 32:
      case 34:
      case 36:
        mb = true;
        break;
      default:
        mb = false;
      }
    return mb;
  }
bool L1TrackId::hasME1 ( const unsigned &  rank) const

Functions to determine which stations are in this track.

Definition at line 267 of file L1TrackId.cc.

  {
    bool me = false;
    switch (rank) 
      {
      case 5: 
      case 6:
      case 10:
      case 11:          
      case 12:
      case 13:
      case 14:
      case 16:
      case 17:
      case 18:
      case 21:          
      case 22:
      case 23:
      case 26:
      case 27:
      case 28:
      case 31:
      case 33:
      case 35:
        me = true;
        break;
      default:
        me = false;
      }
    return me;
  }
bool L1TrackId::hasME2 ( const unsigned &  rank) const

Definition at line 299 of file L1TrackId.cc.

  {
    bool me = false;
    switch (rank) 
      {
      case 2: 
      case 3:
      case 4:
      case 6:          
      case 7:
      case 8:
      case 9:
      case 11:
      case 12:
      case 14:
      case 15:          
      case 17:
      case 18:
      case 19:
      case 20:
      case 22:
      case 23:
      case 24:
      case 25:
      case 27:
      case 28:
      case 29:
      case 30:
      case 31:
      case 32:
      case 33:
      case 34:
      case 35:
      case 36:
        me = true;
        break;
      default:
        me = false;
      }
    return me;
  }
bool L1TrackId::hasME3 ( const unsigned &  rank) const

Definition at line 341 of file L1TrackId.cc.

  {
    bool me = false;
    switch (rank) 
      {
      case 1:
      case 3:
      case 4:
      case 5:
      case 10:
      case 13:
      case 16:
      case 18:
      case 21:
      case 23:
      case 26:
      case 28:
      case 31:
      case 33:
      case 35:
        me = true;
        break;
      default:
        me = false;
      }
    return me;
  }
bool L1TrackId::hasME4 ( const unsigned &  rank) const

Definition at line 369 of file L1TrackId.cc.

  {
    bool me = false;
    switch (rank) 
      {
      case 1: 
      case 2:
      case 4:
      case 16:
      case 17:
      case 21: 
      case 22:
      case 26:
      case 27:
      case 31:
      case 33:
      case 35:
        me = true;
        break;
      default:
        me = false;
      }
    return me;
  }
bool csc::L1TrackId::inOverlap ( ) const [inline]

Definition at line 43 of file L1TrackId.h.

References m_overlap.

{ return m_overlap; }
unsigned csc::L1TrackId::mode ( void  ) const [inline]

Definition at line 35 of file L1TrackId.h.

References m_mode.

Referenced by encodeLUTMode(), and setMode().

{ return m_mode; }
unsigned csc::L1TrackId::numSegments ( ) const [inline]

Definition at line 36 of file L1TrackId.h.

{ return 0; } // finish later
const csc::L1TrackId & L1TrackId::operator= ( const csc::L1TrackId rhs)

Definition at line 27 of file L1TrackId.cc.

References id_, m_erase, m_mode, m_overlap, and m_rank.

  {
    if(&rhs != this)
      {
        m_rank = rhs.m_rank;
        m_mode = rhs.m_mode;
        m_erase = rhs.m_erase;
        m_overlap = rhs.m_overlap;
        id_ = rhs.id_;
        //stubs = rhs.stubs;
      }
    return *this;
  }
void L1TrackId::overlapMode ( const unsigned &  rank,
int &  mode,
int &  stnA,
int &  stnB 
)

Definition at line 78 of file L1TrackId.cc.

  {
    switch (rank) 
      {
      case 7:
        stnA = 2; stnB = 1;
        mode = 4;
        break;
      case 8:
        stnA = 3; stnB = 2;
        mode = 4;
        break;
      case 9:
        stnA = 2; stnB = 1;
        mode = 2;
        break;
      case 12:
        stnA = 2; stnB = 1;
        mode = 2;
        break;
      case 15:
        stnA = 2; stnB = 1;
        mode = 2;
        break;
      case 19:
        stnA = 3; stnB = 2;
        mode = 2;
        break;
      case 20:
        stnA = 2; stnB = 1;
        mode = 2;
        break;
      case 24:
        stnA = 3; stnB = 2;
        mode = 2;
        break;
      case 25:
        stnA = 2; stnB = 1;
        mode = 2;
        break;
      case 29:
        stnA = 3; stnB = 2;
        mode = 2;
        break;
      case 30:
        stnA = 2; stnB = 1;
        mode = 2;
        break;
      case 32:
        stnA = 3; stnB = 2;
        mode = 2;
        break;
      case 34:
        stnA = 3; stnB = 2;
        mode = 2;
        break;
      case 36:
        stnA = 3; stnB = 2;
        mode = 2;
        break;
      default:
        // standard case for CSC tracks
        stnA = 1; stnB = 2;
        mode = 0;
      }
  }
unsigned csc::L1TrackId::rank ( ) const [inline]

Definition at line 34 of file L1TrackId.h.

References m_rank.

Referenced by setRank().

{ return m_rank; }
unsigned csc::L1TrackId::sector ( ) const [inline]
void csc::L1TrackId::setMode ( const unsigned &  mode) [inline]

Definition at line 39 of file L1TrackId.h.

References m_mode, and mode().

Referenced by CSCTFSPCoreLogic::run().

{ m_mode = mode; } 
void L1TrackId::setOverlap ( const unsigned &  rank)

Definition at line 46 of file L1TrackId.cc.

References m_overlap.

Referenced by setRank().

  {
    if (  (rank == 7)  || (rank == 8)  || 
          (rank == 9)  || (rank == 12) || (rank == 15)  ||
          (rank == 19) || (rank == 20) || 
          (rank == 24) || (rank == 25) || 
          (rank == 29) || (rank == 30) || 
          (rank == 32) || (rank == 34) || (rank == 36) ) {
      m_overlap = true;
    }
    else m_overlap = false;
  }
void L1TrackId::setRank ( const unsigned &  rank)

Definition at line 59 of file L1TrackId.cc.

References kRankBitWidth, m_rank, rank(), and setOverlap().

  {
    if (rank<(1<<kRankBitWidth)) // rank >= 0, since rank is unsigned
      {
        m_rank = rank;
        setOverlap(rank);
      }
    else 
      {
        m_rank = 0;
      }
  }
bool L1TrackId::sharesHit ( const csc::L1TrackId a_id) const

Definition at line 41 of file L1TrackId.cc.

  {
    return false; // finish later
  }
unsigned csc::L1TrackId::station ( ) const [inline]

Definition at line 32 of file L1TrackId.h.

References id_, and CSCDetId::station().

{ return id_.station(); }

Member Data Documentation

Definition at line 63 of file L1TrackId.h.

Referenced by endcap(), L1TrackId(), operator=(), sector(), and station().

bool csc::L1TrackId::m_erase [private]

Definition at line 61 of file L1TrackId.h.

Referenced by erase(), L1TrackId(), and operator=().

unsigned csc::L1TrackId::m_mode [private]

Definition at line 60 of file L1TrackId.h.

Referenced by L1TrackId(), mode(), operator=(), and setMode().

bool csc::L1TrackId::m_overlap [private]

Definition at line 61 of file L1TrackId.h.

Referenced by inOverlap(), L1TrackId(), operator=(), and setOverlap().

unsigned csc::L1TrackId::m_rank [private]

Definition at line 60 of file L1TrackId.h.

Referenced by L1TrackId(), operator=(), rank(), and setRank().