CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CSCCLCTPreTriggerDigi Class Reference

#include <CSCCLCTPreTriggerDigi.h>

Public Member Functions

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

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 pre-trigger primitives.

Author
Tao Huang (TAMU)

Definition at line 15 of file CSCCLCTPreTriggerDigi.h.

Constructor & Destructor Documentation

CSCCLCTPreTriggerDigi::CSCCLCTPreTriggerDigi ( 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 8 of file CSCCLCTPreTriggerDigi.cc.

CSCCLCTPreTriggerDigi::CSCCLCTPreTriggerDigi ( )

default

Default.

Definition at line 25 of file CSCCLCTPreTriggerDigi.cc.

Member Function Documentation

void CSCCLCTPreTriggerDigi::clear ( void  )

clear this CLCT

Clears this CLCT.

Definition at line 40 of file CSCCLCTPreTriggerDigi.cc.

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

Referenced by Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), BeautifulSoup.Tag::setString(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

int CSCCLCTPreTriggerDigi::getBend ( ) const
inline

return bend

Definition at line 42 of file CSCCLCTPreTriggerDigi.h.

References bend_.

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

42 {return bend_ ;}
int CSCCLCTPreTriggerDigi::getBX ( ) const
inline

return BX

Definition at line 51 of file CSCCLCTPreTriggerDigi.h.

References bx_.

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

51 {return bx_ ;}
int CSCCLCTPreTriggerDigi::getCFEB ( ) const
inline

return Key CFEB ID

Definition at line 48 of file CSCCLCTPreTriggerDigi.h.

References cfeb_.

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

48 {return cfeb_ ;}
int CSCCLCTPreTriggerDigi::getFullBX ( ) const
inline

return 12-bit full BX.

Definition at line 74 of file CSCCLCTPreTriggerDigi.h.

References fullbx_.

Referenced by print().

74 {return fullbx_ ;}
int CSCCLCTPreTriggerDigi::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 65 of file CSCCLCTPreTriggerDigi.h.

References cfeb_, and strip_.

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

65  {
66  int keyStrip = cfeb_ * 32 + strip_;
67  return keyStrip;
68  }
int CSCCLCTPreTriggerDigi::getPattern ( ) const
inline

return pattern

Definition at line 36 of file CSCCLCTPreTriggerDigi.h.

References pattern_.

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

36 {return pattern_ ;}
int CSCCLCTPreTriggerDigi::getQuality ( ) const
inline

return quality of a pattern (number of layers hit!)

Definition at line 33 of file CSCCLCTPreTriggerDigi.h.

References quality_.

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

33 {return quality_ ;}
int CSCCLCTPreTriggerDigi::getStrip ( ) const
inline

return halfstrip that goes from 0 to 31

Definition at line 45 of file CSCCLCTPreTriggerDigi.h.

References strip_.

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

45 {return strip_ ;}
int CSCCLCTPreTriggerDigi::getStripType ( ) const
inline

return striptype

Definition at line 39 of file CSCCLCTPreTriggerDigi.h.

References striptype_.

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

39 {return striptype_ ;}
int CSCCLCTPreTriggerDigi::getTrknmb ( ) const
inline

return track number (1,2)

Definition at line 54 of file CSCCLCTPreTriggerDigi.h.

References trknmb_.

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

54 {return trknmb_ ;}
bool CSCCLCTPreTriggerDigi::isValid ( void  ) const
inline

check CLCT validity (1 - valid CLCT)

Definition at line 30 of file CSCCLCTPreTriggerDigi.h.

References valid_.

Referenced by operator<<(), operator==(), print(), and core.AutoHandle.AutoHandle::ReallyLoad().

30 {return valid_ ;}
bool CSCCLCTPreTriggerDigi::operator!= ( const CSCCLCTPreTriggerDigi rhs) const

True if the preceding one is false.

Definition at line 92 of file CSCCLCTPreTriggerDigi.cc.

92  {
93  // True if == is false.
94  bool returnValue = true;
95  if ((*this) == rhs) returnValue = false;
96  return returnValue;
97 }
bool CSCCLCTPreTriggerDigi::operator== ( const CSCCLCTPreTriggerDigi rhs) const

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

Definition at line 80 of file CSCCLCTPreTriggerDigi.cc.

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

80  {
81  // Exact equality.
82  bool returnValue = false;
83  if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() &&
84  getPattern() == rhs.getPattern() && getKeyStrip()== rhs.getKeyStrip()&&
85  getStripType() == rhs.getStripType() && getBend() == getBend() &&
86  getBX() == rhs.getBX()) {
87  returnValue = true;
88  }
89  return returnValue;
90 }
int getStripType() const
return striptype
int getPattern() const
return pattern
int getBend() const
return bend
int getQuality() const
return quality of a pattern (number of layers hit!)
int getBX() const
return BX
bool isValid() const
check CLCT validity (1 - valid CLCT)
bool CSCCLCTPreTriggerDigi::operator> ( const CSCCLCTPreTriggerDigi 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 53 of file CSCCLCTPreTriggerDigi.cc.

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

53  {
54  // Several versions of CLCT sorting criteria were used before 2008.
55  // They are available in CMSSW versions prior to 3_1_0; here we only keep
56  // the latest one, used in TMB-07 firmware (w/o distrips).
57  bool returnValue = false;
58 
59  int quality1 = getQuality();
60  int quality2 = rhs.getQuality();
61  // The bend-direction bit pid[0] is ignored (left and right bends have
62  // equal quality).
63  int pattern1 = getPattern() & 14;
64  int pattern2 = rhs.getPattern() & 14;
65 
66  // Better-quality CLCTs are preferred.
67  // If two qualities are equal, larger pattern id (i.e., straighter pattern)
68  // is preferred; left- and right-bend patterns are considered to be of
69  // the same quality.
70  // If both qualities and pattern id's are the same, lower keystrip
71  // is preferred.
72  if ((quality1 > quality2) ||
73  (quality1 == quality2 && pattern1 > pattern2) ||
74  (quality1 == quality2 && pattern1 == pattern2 &&
75  getKeyStrip() < rhs.getKeyStrip())) {returnValue = true;}
76 
77  return returnValue;
78 }
PhiMemoryImage pattern1(0x8000, 0, 0, 0x8000, 0, 0, 0x8000, 0, 0, 0x8000, 0, 0)
int getPattern() const
return pattern
int getQuality() const
return quality of a pattern (number of layers hit!)
PhiMemoryImage pattern2(0x10000, 0, 0, 0x8000, 0, 0, 0xc000, 0, 0, 0xc000, 0, 0)
void CSCCLCTPreTriggerDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 100 of file CSCCLCTPreTriggerDigi.cc.

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

100  {
101  if (isValid()) {
102  char stripType = (getStripType() == 0) ? 'D' : 'H';
103  char bend = (getBend() == 0) ? 'L' : 'R';
104 
105  edm::LogVerbatim("CSCDigi")
106  << " CSC CLCT #" << std::setw(1) << getTrknmb()
107  << ": Valid = " << std::setw(1) << isValid()
108  << " Key Strip = " << std::setw(3) << getKeyStrip()
109  << " Strip = " << std::setw(2) << getStrip()
110  << " Quality = " << std::setw(1) << getQuality()
111  << " Pattern = " << std::setw(1) << getPattern()
112  << " Bend = " << std::setw(1) << bend
113  << " Strip type = " << std::setw(1) << stripType
114  << " CFEB ID = " << std::setw(1) << getCFEB()
115  << " BX = " << std::setw(1) << getBX()
116  << " Full BX= " << std::setw(1) << getFullBX();
117  }
118  else {
119  edm::LogVerbatim("CSCDigi") << "Not a valid Cathode LCT.";
120  }
121 }
int getCFEB() const
return Key CFEB ID
int getStripType() const
return striptype
int getPattern() const
return pattern
int getTrknmb() const
return track number (1,2)
int getBend() const
return bend
int getQuality() const
return quality of a pattern (number of layers hit!)
int getBX() const
return BX
int getFullBX() const
return 12-bit full BX.
int getStrip() const
return halfstrip that goes from 0 to 31
bool isValid() const
check CLCT validity (1 - valid CLCT)
void CSCCLCTPreTriggerDigi::setFullBX ( const uint16_t  fullbx)
inline

Set 12-bit full BX.

Definition at line 77 of file CSCCLCTPreTriggerDigi.h.

References fullbx_.

77 {fullbx_ = fullbx;}
void CSCCLCTPreTriggerDigi::setTrknmb ( const uint16_t  number)
inline

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

Definition at line 71 of file CSCCLCTPreTriggerDigi.h.

References contentValuesFiles::number, and trknmb_.

Member Data Documentation

uint16_t CSCCLCTPreTriggerDigi::bend_
private

Definition at line 100 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getBend().

uint16_t CSCCLCTPreTriggerDigi::bx_
private

Definition at line 103 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getBX().

uint16_t CSCCLCTPreTriggerDigi::cfeb_
private

Definition at line 102 of file CSCCLCTPreTriggerDigi.h.

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

uint16_t CSCCLCTPreTriggerDigi::fullbx_
private

Definition at line 105 of file CSCCLCTPreTriggerDigi.h.

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

uint16_t CSCCLCTPreTriggerDigi::pattern_
private

Definition at line 98 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getPattern().

uint16_t CSCCLCTPreTriggerDigi::quality_
private

Definition at line 97 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getQuality().

uint16_t CSCCLCTPreTriggerDigi::strip_
private

Definition at line 101 of file CSCCLCTPreTriggerDigi.h.

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

uint16_t CSCCLCTPreTriggerDigi::striptype_
private

Definition at line 99 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getStripType().

uint16_t CSCCLCTPreTriggerDigi::trknmb_
private

Definition at line 104 of file CSCCLCTPreTriggerDigi.h.

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

uint16_t CSCCLCTPreTriggerDigi::valid_
private

Definition at line 96 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and isValid().