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
CSCCLCTDigi Class Reference

#include <CSCCLCTDigi.h>

Public Member Functions

void clear ()
 clear this CLCT More...
 
 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. More...
 
 CSCCLCTDigi ()
 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 CSCCLCTDigi &) const
 True if the preceding one is false. More...
 
bool operator== (const CSCCLCTDigi &) const
 True if the two LCTs have exactly the same members (except the number). More...
 
bool operator> (const CSCCLCTDigi &) 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 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.

19  :
20  valid_(valid),
21  quality_(quality),
23  striptype_(striptype),
24  bend_(bend),
25  strip_(strip),
26  cfeb_(cfeb),
27  bx_(bx),
28  trknmb_(trknmb),
29  //fullbx_(0)
30  fullbx_(fullbx)
31  {
32  //valid_ = valid;
33  //quality_ = quality;
34  //pattern_ = pattern;
35  //striptype_ = striptype;
36  //bend_ = bend;
37  //strip_ = strip;
38  //cfeb_ = cfeb;
39  //bx_ = bx;
40  //trknmb_ = trknmb;
41 }
uint16_t trknmb_
Definition: CSCCLCTDigi.h:106
uint16_t strip_
Definition: CSCCLCTDigi.h:103
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
uint16_t pattern_
Definition: CSCCLCTDigi.h:100
uint16_t valid_
Definition: CSCCLCTDigi.h:98
uint16_t bx_
Definition: CSCCLCTDigi.h:105
uint16_t bend_
Definition: CSCCLCTDigi.h:102
uint16_t fullbx_
Definition: CSCCLCTDigi.h:107
uint16_t cfeb_
Definition: CSCCLCTDigi.h:104
uint16_t striptype_
Definition: CSCCLCTDigi.h:101
uint16_t quality_
Definition: CSCCLCTDigi.h:99
CSCCLCTDigi::CSCCLCTDigi ( )

default

Default.

Definition at line 44 of file CSCCLCTDigi.cc.

44  :
45  valid_(0),
46  quality_(0),
47  pattern_(0),
48  striptype_(0),
49  bend_(0),
50  strip_(0),
51  cfeb_(0),
52  bx_(0),
53  trknmb_(0),
54  fullbx_(0)
55 {
56 // clear(); // set contents to zero
57 }
uint16_t trknmb_
Definition: CSCCLCTDigi.h:106
uint16_t strip_
Definition: CSCCLCTDigi.h:103
uint16_t pattern_
Definition: CSCCLCTDigi.h:100
uint16_t valid_
Definition: CSCCLCTDigi.h:98
uint16_t bx_
Definition: CSCCLCTDigi.h:105
uint16_t bend_
Definition: CSCCLCTDigi.h:102
uint16_t fullbx_
Definition: CSCCLCTDigi.h:107
uint16_t cfeb_
Definition: CSCCLCTDigi.h:104
uint16_t striptype_
Definition: CSCCLCTDigi.h:101
uint16_t quality_
Definition: CSCCLCTDigi.h:99

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(), Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), L1Comparator::produce(), 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().

60  {
61  valid_ = 0;
62  quality_ = 0;
63  pattern_ = 0;
64  striptype_ = 0;
65  bend_ = 0;
66  strip_ = 0;
67  cfeb_ = 0;
68  bx_ = 0;
69  trknmb_ = 0;
70  fullbx_ = 0;
71 }
uint16_t trknmb_
Definition: CSCCLCTDigi.h:106
uint16_t strip_
Definition: CSCCLCTDigi.h:103
uint16_t pattern_
Definition: CSCCLCTDigi.h:100
uint16_t valid_
Definition: CSCCLCTDigi.h:98
uint16_t bx_
Definition: CSCCLCTDigi.h:105
uint16_t bend_
Definition: CSCCLCTDigi.h:102
uint16_t fullbx_
Definition: CSCCLCTDigi.h:107
uint16_t cfeb_
Definition: CSCCLCTDigi.h:104
uint16_t striptype_
Definition: CSCCLCTDigi.h:101
uint16_t quality_
Definition: CSCCLCTDigi.h:99
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(), operator<<(), operator==(), operator>(), print(), CSCMotherboard::testLCT(), and CSCCathodeLCTProcessor::testLCTs().

67  {
68  int keyStrip = cfeb_ * 32 + strip_;
69  return keyStrip;
70  }
uint16_t strip_
Definition: CSCCLCTDigi.h:103
uint16_t cfeb_
Definition: CSCCLCTDigi.h:104
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 CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT1(), CSCTMBHeader2007::addCLCT1(), operator<<(), and print().

47 {return strip_ ;}
uint16_t strip_
Definition: CSCCLCTDigi.h:103
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().

56 {return trknmb_ ;}
uint16_t trknmb_
Definition: CSCCLCTDigi.h:106
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.

112  {
113  // True if == is false.
114  bool returnValue = true;
115  if ((*this) == rhs) returnValue = false;
116  return returnValue;
117 }
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().

100  {
101  // Exact equality.
102  bool returnValue = false;
103  if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() &&
104  getPattern() == rhs.getPattern() && getKeyStrip()== rhs.getKeyStrip()&&
105  getStripType() == rhs.getStripType() && getBend() == getBend() &&
106  getBX() == rhs.getBX()) {
107  returnValue = true;
108  }
109  return returnValue;
110 }
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:35
int getStripType() const
return striptype
Definition: CSCCLCTDigi.h:41
int getBend() const
return bend
Definition: CSCCLCTDigi.h:44
int getBX() const
return BX
Definition: CSCCLCTDigi.h:53
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:32
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:38
int getKeyStrip() const
Definition: CSCCLCTDigi.h:67
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().

73  {
74  // Several versions of CLCT sorting criteria were used before 2008.
75  // They are available in CMSSW versions prior to 3_1_0; here we only keep
76  // the latest one, used in TMB-07 firmware (w/o distrips).
77  bool returnValue = false;
78 
79  int quality1 = getQuality();
80  int quality2 = rhs.getQuality();
81  // The bend-direction bit pid[0] is ignored (left and right bends have
82  // equal quality).
83  int pattern1 = getPattern() & 14;
84  int pattern2 = rhs.getPattern() & 14;
85 
86  // Better-quality CLCTs are preferred.
87  // If two qualities are equal, larger pattern id (i.e., straighter pattern)
88  // is preferred; left- and right-bend patterns are considered to be of
89  // the same quality.
90  // If both qualities and pattern id's are the same, lower keystrip
91  // is preferred.
92  if ((quality1 > quality2) ||
93  (quality1 == quality2 && pattern1 > pattern2) ||
94  (quality1 == quality2 && pattern1 == pattern2 &&
95  getKeyStrip() < rhs.getKeyStrip())) {returnValue = true;}
96 
97  return returnValue;
98 }
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:35
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:38
int getKeyStrip() const
Definition: CSCCLCTDigi.h:67
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().

120  {
121  if (isValid()) {
122  char stripType = (getStripType() == 0) ? 'D' : 'H';
123  char bend = (getBend() == 0) ? 'L' : 'R';
124 
125  std::cout << " CSC CLCT #" << std::setw(1) << getTrknmb()
126  << ": Valid = " << std::setw(1) << isValid()
127  << " Key Strip = " << std::setw(3) << getKeyStrip()
128  << " Strip = " << std::setw(2) << getStrip()
129  << " Quality = " << std::setw(1) << getQuality()
130  << " Pattern = " << std::setw(1) << getPattern()
131  << " Bend = " << std::setw(1) << bend
132  << " Strip type = " << std::setw(1) << stripType
133  << " CFEB ID = " << std::setw(1) << getCFEB()
134  << " BX = " << std::setw(1) << getBX()
135  << " Full BX= " << std::setw(1) << getFullBX() << std::endl;
136  }
137  else {
138  std::cout << "Not a valid Cathode LCT." << std::endl;
139  }
140 }
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:35
int getStrip() const
return halfstrip that goes from 0 to 31
Definition: CSCCLCTDigi.h:47
int getStripType() const
return striptype
Definition: CSCCLCTDigi.h:41
int getBend() const
return bend
Definition: CSCCLCTDigi.h:44
int getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:50
int getBX() const
return BX
Definition: CSCCLCTDigi.h:53
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:32
int getTrknmb() const
return track number (1,2)
Definition: CSCCLCTDigi.h:56
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:38
tuple cout
Definition: gather_cfg.py:121
int getKeyStrip() const
Definition: CSCCLCTDigi.h:67
int getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:76
void CSCCLCTDigi::setFullBX ( const uint16_t  fullbx)
inline

Set 12-bit full BX.

Definition at line 79 of file CSCCLCTDigi.h.

References fullbx_.

79 {fullbx_ = fullbx;}
uint16_t fullbx_
Definition: CSCCLCTDigi.h:107
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().

73 {trknmb_ = number;}
uint16_t trknmb_
Definition: CSCCLCTDigi.h:106

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().