CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCCLCTDigi Class Reference

#include <CSCCLCTDigi.h>

List of all members.

Public Member Functions

void clear ()
 clear this CLCT
 CSCCLCTDigi ()
 default
 CSCCLCTDigi (const int valid, const int quality, const int pattern, const int striptype, const int bend, const int strip, const int cfeb, const int bx, const int trknmb=0, const int fullbx=0)
 Constructors.
int getBend () const
 return bend
int getBX () const
 return BX
int getCFEB () const
 return Key CFEB ID
int getFullBX () const
 return 12-bit full BX.
int getKeyStrip () const
int getPattern () const
 return pattern
int getQuality () const
 return quality of a pattern (number of layers hit!)
int getStrip () const
 return halfstrip that goes from 0 to 31
int getStripType () const
 return striptype
int getTrknmb () const
 return track number (1,2)
bool isValid () const
 check CLCT validity (1 - valid CLCT)
bool operator!= (const CSCCLCTDigi &) const
 True if the preceding one is false.
bool operator== (const CSCCLCTDigi &) const
 True if the two LCTs have exactly the same members (except the number).
bool operator> (const CSCCLCTDigi &) const
void print () const
 Print content of digi.
void setFullBX (const uint16_t fullbx)
 Set 12-bit full BX.
void setTrknmb (const uint16_t number)
 Set track number (1,2) after sorting CLCTs.

Private Attributes

uint16_t bend_
uint16_t bx_
uint16_t cfeb_
uint16_t fullbx_
uint16_t pattern_
uint16_t quality_
uint16_t strip_
uint16_t striptype_
uint16_t trknmb_
uint16_t valid_

Detailed Description

Digi for CLCT trigger primitives.

Date:
2010/06/15 13:40:07
Revision:
1.14
Author:
N. Terentiev, CMU

Digi for CLCT trigger primitives.

Date:
2010/06/15 13:40:07
Revision:
1.17
Author:
N. Terentiev, CMU

Definition at line 17 of file CSCCLCTDigi.h.


Constructor & Destructor Documentation

CSCCLCTDigi::CSCCLCTDigi ( const int  valid,
const int  quality,
const int  pattern,
const int  striptype,
const int  bend,
const int  strip,
const int  cfeb,
const int  bx,
const int  trknmb = 0,
const int  fullbx = 0 
)

Constructors.

Definition at line 17 of file CSCCLCTDigi.cc.

                                                                                          :
  valid_(valid),
  quality_(quality),
  pattern_(pattern),
  striptype_(striptype),
  bend_(bend),
  strip_(strip),
  cfeb_(cfeb),
  bx_(bx),
  trknmb_(trknmb),
  //fullbx_(0)
  fullbx_(fullbx)
 {
  //valid_     = valid;
  //quality_   = quality;
  //pattern_   = pattern;
  //striptype_ = striptype;
  //bend_      = bend;
  //strip_     = strip;
  //cfeb_      = cfeb;
  //bx_        = bx;
  //trknmb_    = trknmb;
}
CSCCLCTDigi::CSCCLCTDigi ( )

default

Default.

Definition at line 44 of file CSCCLCTDigi.cc.

                          :
  valid_(0),
  quality_(0),
  pattern_(0),
  striptype_(0),
  bend_(0),
  strip_(0),
  cfeb_(0),
  bx_(0),
  trknmb_(0),
  fullbx_(0)
{
//  clear(); // set contents to zero
}

Member Function Documentation

void CSCCLCTDigi::clear ( void  )

clear this CLCT

Clears this CLCT.

Definition at line 60 of file CSCCLCTDigi.cc.

References bend_, bx_, cfeb_, fullbx_, pattern_, quality_, strip_, striptype_, trknmb_, and valid_.

Referenced by CSCCathodeLCTProcessor::clear(), and CSCMotherboardME11::correlateLCTs().

                        {
  valid_     = 0;
  quality_   = 0;
  pattern_   = 0;
  striptype_ = 0;
  bend_      = 0;
  strip_     = 0;
  cfeb_      = 0;
  bx_        = 0;
  trknmb_    = 0;
  fullbx_    = 0;
}
int CSCCLCTDigi::getBend ( ) const [inline]
int CSCCLCTDigi::getBX ( ) const [inline]
int CSCCLCTDigi::getCFEB ( ) const [inline]
int CSCCLCTDigi::getFullBX ( ) const [inline]
int CSCCLCTDigi::getKeyStrip ( ) const [inline]

Convert strip_ and cfeb_ to keyStrip. Each CFEB has up to 16 strips (32 halfstrips). There are 5 cfebs. The "strip_" variable is one of 32 halfstrips on the keylayer of a single CFEB, so that Distrip = (cfeb*32 + strip)/4. Halfstrip = (cfeb*32 + strip). Always return halfstrip number since this is what is stored in the correlated LCT digi. For distrip patterns, the convention is the same as for persistent strip numbers: low halfstrip of a distrip. SV, June 15th, 2006.

Definition at line 67 of file CSCCLCTDigi.h.

References cfeb_, and strip_.

Referenced by CSCTMBHeader2007_rev0x50c3::addCLCT0(), CSCTMBHeader2007_rev0x50c3::addCLCT1(), CSCMotherboard::constructLCTs(), CSCMotherboardME11::doesALCTCrossCLCT(), operator<<(), operator==(), operator>(), print(), CSCMotherboard::testLCT(), and CSCCathodeLCTProcessor::testLCTs().

                           {
    int keyStrip = cfeb_ * 32 + strip_;
    return keyStrip;
  }
int CSCCLCTDigi::getPattern ( ) const [inline]
int CSCCLCTDigi::getQuality ( ) const [inline]
int CSCCLCTDigi::getStrip ( ) const [inline]

return halfstrip that goes from 0 to 31

Definition at line 47 of file CSCCLCTDigi.h.

References strip_.

Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), operator<<(), and print().

{return strip_ ;}
int CSCCLCTDigi::getStripType ( ) const [inline]
int CSCCLCTDigi::getTrknmb ( ) const [inline]

return track number (1,2)

Definition at line 56 of file CSCCLCTDigi.h.

References trknmb_.

Referenced by operator<<(), and print().

{return trknmb_ ;}
bool CSCCLCTDigi::isValid ( void  ) const [inline]
bool CSCCLCTDigi::operator!= ( const CSCCLCTDigi rhs) const

True if the preceding one is false.

Definition at line 112 of file CSCCLCTDigi.cc.

                                                           {
  // True if == is false.
  bool returnValue = true;
  if ((*this) == rhs) returnValue = false;
  return returnValue;
}
bool CSCCLCTDigi::operator== ( const CSCCLCTDigi rhs) const

True if the two LCTs have exactly the same members (except the number).

Definition at line 100 of file CSCCLCTDigi.cc.

References getBend(), getBX(), getKeyStrip(), getPattern(), getQuality(), getStripType(), and isValid().

                                                           {
  // Exact equality.
  bool returnValue = false;
  if (isValid()      == rhs.isValid()    && getQuality() == rhs.getQuality() &&
      getPattern()   == rhs.getPattern() && getKeyStrip()== rhs.getKeyStrip()&&
      getStripType() == rhs.getStripType() && getBend()  == getBend()        &&
      getBX()        == rhs.getBX()) {
    returnValue = true;
  }
  return returnValue;
}
bool CSCCLCTDigi::operator> ( const CSCCLCTDigi rhs) const

True if the left-hand side has a larger "quality". Full definition of "quality" depends on quality word itself, pattern type, and strip number.

Definition at line 73 of file CSCCLCTDigi.cc.

References getKeyStrip(), getPattern(), and getQuality().

                                                          {
  // Several versions of CLCT sorting criteria were used before 2008.
  // They are available in CMSSW versions prior to 3_1_0; here we only keep
  // the latest one, used in TMB-07 firmware (w/o distrips).
  bool returnValue = false;

  int quality1 = getQuality();
  int quality2 = rhs.getQuality();
  // The bend-direction bit pid[0] is ignored (left and right bends have
  // equal quality).
  int pattern1 = getPattern()     & 14;
  int pattern2 = rhs.getPattern() & 14;

  // Better-quality CLCTs are preferred.
  // If two qualities are equal, larger pattern id (i.e., straighter pattern)
  // is preferred; left- and right-bend patterns are considered to be of
  // the same quality.
  // If both qualities and pattern id's are the same, lower keystrip
  // is preferred.
  if ((quality1  > quality2) ||
      (quality1 == quality2 && pattern1 > pattern2) ||
      (quality1 == quality2 && pattern1 == pattern2 &&
       getKeyStrip() < rhs.getKeyStrip())) {returnValue = true;}

  return returnValue;
}
void CSCCLCTDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 120 of file CSCCLCTDigi.cc.

References gather_cfg::cout, getBend(), getBX(), getCFEB(), getFullBX(), getKeyStrip(), getPattern(), getQuality(), getStrip(), getStripType(), getTrknmb(), and isValid().

                              {
  if (isValid()) {
    char stripType = (getStripType() == 0) ? 'D' : 'H';
    char bend      = (getBend()      == 0) ? 'L' : 'R';

    std::cout << " CSC CLCT #"    << std::setw(1) << getTrknmb()
              << ": Valid = "     << std::setw(1) << isValid()
              << " Key Strip = "  << std::setw(3) << getKeyStrip()
              << " Strip = "      << std::setw(2) << getStrip()
              << " Quality = "    << std::setw(1) << getQuality()
              << " Pattern = "    << std::setw(1) << getPattern()
              << " Bend = "       << std::setw(1) << bend
              << " Strip type = " << std::setw(1) << stripType
              << " CFEB ID = "    << std::setw(1) << getCFEB()
              << " BX = "         << std::setw(1) << getBX() 
              << " Full BX= "     << std::setw(1) << getFullBX() << std::endl;
  }
  else {
    std::cout << "Not a valid Cathode LCT." << std::endl;
  }
}
void CSCCLCTDigi::setFullBX ( const uint16_t  fullbx) [inline]

Set 12-bit full BX.

Definition at line 79 of file CSCCLCTDigi.h.

References fullbx_.

Referenced by CSCCathodeLCTProcessor::findLCTsSLHC().

{fullbx_ = fullbx;}
void CSCCLCTDigi::setTrknmb ( const uint16_t  number) [inline]

Set track number (1,2) after sorting CLCTs.

Definition at line 73 of file CSCCLCTDigi.h.

References trknmb_.

Referenced by CSCCathodeLCTProcessor::run().

{trknmb_ = number;}

Member Data Documentation

uint16_t CSCCLCTDigi::bend_ [private]

Definition at line 102 of file CSCCLCTDigi.h.

Referenced by clear(), and getBend().

uint16_t CSCCLCTDigi::bx_ [private]

Definition at line 105 of file CSCCLCTDigi.h.

Referenced by clear(), and getBX().

uint16_t CSCCLCTDigi::cfeb_ [private]

Definition at line 104 of file CSCCLCTDigi.h.

Referenced by clear(), getCFEB(), and getKeyStrip().

uint16_t CSCCLCTDigi::fullbx_ [private]

Definition at line 107 of file CSCCLCTDigi.h.

Referenced by clear(), getFullBX(), and setFullBX().

uint16_t CSCCLCTDigi::pattern_ [private]

Definition at line 100 of file CSCCLCTDigi.h.

Referenced by clear(), and getPattern().

uint16_t CSCCLCTDigi::quality_ [private]

Definition at line 99 of file CSCCLCTDigi.h.

Referenced by clear(), and getQuality().

uint16_t CSCCLCTDigi::strip_ [private]

Definition at line 103 of file CSCCLCTDigi.h.

Referenced by clear(), getKeyStrip(), and getStrip().

uint16_t CSCCLCTDigi::striptype_ [private]

Definition at line 101 of file CSCCLCTDigi.h.

Referenced by clear(), and getStripType().

uint16_t CSCCLCTDigi::trknmb_ [private]

Definition at line 106 of file CSCCLCTDigi.h.

Referenced by clear(), getTrknmb(), and setTrknmb().

uint16_t CSCCLCTDigi::valid_ [private]

Definition at line 98 of file CSCCLCTDigi.h.

Referenced by clear(), and isValid().