#include <DataFormats/CSCDigi/interface/CSCCLCTDigi.h>
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) | |
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 |
Convert strip_ and cfeb_ to keyStrip. | |
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 |
False only when both LCTs have exactly the same members. | |
bool | operator== (const CSCCLCTDigi &) const |
True if the two LCTs have exactly the same members OR they are high- and low-pT LCTs from the exact same location in the chamber. | |
bool | operator> (const CSCCLCTDigi &) const |
True if the left-hand side has a larger "quality". | |
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_ |
Definition at line 16 of file CSCCLCTDigi.h.
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 | |||
) |
Constructors.
Definition at line 18 of file CSCCLCTDigi.cc.
References bend_, bx_, cfeb_, pattern_, quality_, strip_, striptype_, trknmb_, and valid_.
00020 { 00021 valid_ = valid; 00022 quality_ = quality; 00023 pattern_ = pattern; 00024 striptype_ = striptype; 00025 bend_ = bend; 00026 strip_ = strip; 00027 cfeb_ = cfeb; 00028 bx_ = bx; 00029 trknmb_ = trknmb; 00030 }
CSCCLCTDigi::CSCCLCTDigi | ( | ) |
default
Default.
Definition at line 33 of file CSCCLCTDigi.cc.
References clear().
00033 { 00034 clear(); // set contents to zero 00035 }
clear this CLCT
Clears this CLCT.
Definition at line 38 of file CSCCLCTDigi.cc.
References bend_, bx_, cfeb_, fullbx_, pattern_, quality_, strip_, striptype_, trknmb_, and valid_.
Referenced by CSCCathodeLCTProcessor::clear(), CSCCLCTDigi(), and CSCCathodeLCTProcessor::run().
00038 { 00039 valid_ = 0; 00040 quality_ = 0; 00041 pattern_ = 0; 00042 striptype_ = 0; 00043 bend_ = 0; 00044 strip_ = 0; 00045 cfeb_ = 0; 00046 bx_ = 0; 00047 trknmb_ = 0; 00048 fullbx_ = 0; 00049 }
int CSCCLCTDigi::getBend | ( | ) | const [inline] |
return bend
Definition at line 43 of file CSCCLCTDigi.h.
References bend_.
Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), CSCMotherboard::constructLCTs(), operator!=(), operator<<(), operator==(), print(), CSCMotherboard::testLCT(), and CSCCathodeLCTProcessor::testLCTs().
00043 {return bend_ ;}
int CSCCLCTDigi::getBX | ( | ) | const [inline] |
return BX
Definition at line 52 of file CSCCLCTDigi.h.
References bx_.
Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007_rev0x50c3::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), CSCMotherboard::constructLCTs(), operator!=(), operator<<(), operator==(), print(), and CSCCathodeLCTProcessor::testLCTs().
00052 {return bx_ ;}
int CSCCLCTDigi::getCFEB | ( | ) | const [inline] |
return Key CFEB ID
Definition at line 49 of file CSCCLCTDigi.h.
References cfeb_.
Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), operator<<(), print(), and CSCCathodeLCTProcessor::testLCTs().
00049 {return cfeb_ ;}
int CSCCLCTDigi::getFullBX | ( | ) | const [inline] |
return 12-bit full BX.
Definition at line 75 of file CSCCLCTDigi.h.
References fullbx_.
Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007_rev0x50c3::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), and CSCTMBHeader2007_rev0x50c3::addCLCT1().
00075 {return fullbx_ ;}
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 66 of file CSCCLCTDigi.h.
Referenced by CSCTMBHeader2007_rev0x50c3::addCLCT0(), CSCTMBHeader2007_rev0x50c3::addCLCT1(), CSCMotherboard::constructLCTs(), operator!=(), operator<<(), operator==(), operator>(), print(), CSCMotherboard::testLCT(), and CSCCathodeLCTProcessor::testLCTs().
int CSCCLCTDigi::getPattern | ( | ) | const [inline] |
return pattern
Definition at line 37 of file CSCCLCTDigi.h.
References pattern_.
Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007_rev0x50c3::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), CSCTMBHeader2007_rev0x50c3::addCLCT1(), CSCMotherboard::constructLCTs(), CSCMotherboard::findQuality(), operator!=(), operator<<(), operator==(), operator>(), print(), CSCMotherboard::testLCT(), and CSCCathodeLCTProcessor::testLCTs().
00037 {return pattern_ ;}
int CSCCLCTDigi::getQuality | ( | ) | const [inline] |
return quality of a pattern (number of layers hit!)
Definition at line 34 of file CSCCLCTDigi.h.
References quality_.
Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007_rev0x50c3::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), CSCTMBHeader2007_rev0x50c3::addCLCT1(), CSCMotherboard::findQuality(), operator!=(), operator<<(), operator==(), operator>(), print(), and CSCCathodeLCTProcessor::testLCTs().
00034 {return quality_ ;}
int CSCCLCTDigi::getStrip | ( | ) | const [inline] |
return halfstrip that goes from 0 to 31
Definition at line 46 of file CSCCLCTDigi.h.
References strip_.
Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), operator<<(), and print().
00046 {return strip_ ;}
int CSCCLCTDigi::getStripType | ( | ) | const [inline] |
return striptype
Definition at line 40 of file CSCCLCTDigi.h.
References striptype_.
Referenced by CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2006::addCLCT1(), CSCMotherboard::constructLCTs(), CSCMotherboard::findQuality(), operator!=(), operator<<(), operator==(), operator>(), print(), CSCMotherboard::testLCT(), and CSCCathodeLCTProcessor::testLCTs().
00040 {return striptype_ ;}
int CSCCLCTDigi::getTrknmb | ( | ) | const [inline] |
return track number (1,2)
Definition at line 55 of file CSCCLCTDigi.h.
References trknmb_.
Referenced by operator<<(), and print().
00055 {return trknmb_ ;}
check CLCT validity (1 - valid CLCT)
Definition at line 31 of file CSCCLCTDigi.h.
References valid_.
Referenced by CSCTMBHeader2007::addCLCT0(), CSCTMBHeader2006::addCLCT0(), CSCTMBHeader2007_rev0x50c3::addCLCT0(), CSCTMBHeader2007::addCLCT1(), CSCTMBHeader2006::addCLCT1(), CSCTMBHeader2007_rev0x50c3::addCLCT1(), CSCMotherboard::correlateLCTs(), CSCMotherboard::findQuality(), CSCCathodeLCTProcessor::getCLCTs(), operator!=(), operator<<(), operator==(), print(), CSCMotherboard::run(), and CSCCathodeLCTProcessor::run().
00031 {return valid_ ;}
bool CSCCLCTDigi::operator!= | ( | const CSCCLCTDigi & | rhs | ) | const |
False only when both LCTs have exactly the same members.
@ Shouldn't be false only when the preceding one is true? To be checked.
Definition at line 163 of file CSCCLCTDigi.cc.
References getBend(), getBX(), getKeyStrip(), getPattern(), getQuality(), getStripType(), and isValid().
00163 { 00164 bool returnValue = false; 00165 // Check exact equality. 00166 if (isValid() != rhs.isValid() || getQuality() != rhs.getQuality() || 00167 getPattern() != rhs.getPattern() || getKeyStrip()!= rhs.getKeyStrip()|| 00168 getStripType() != rhs.getStripType() || getBend() != getBend() || 00169 getBX() != rhs.getBX()) { 00170 returnValue = true; 00171 } 00172 return returnValue; 00173 }
bool CSCCLCTDigi::operator== | ( | const CSCCLCTDigi & | rhs | ) | const |
True if the two LCTs have exactly the same members OR they are high- and low-pT LCTs from the exact same location in the chamber.
Definition at line 134 of file CSCCLCTDigi.cc.
References funct::abs(), getBend(), getBX(), getKeyStrip(), getPattern(), getQuality(), getStripType(), and isValid().
00134 { 00135 bool returnValue = false; 00136 00137 // Exact equality. 00138 if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && 00139 getPattern() == rhs.getPattern() && getKeyStrip()== rhs.getKeyStrip()&& 00140 getStripType() == rhs.getStripType() && getBend() == getBend() && 00141 getBX() == rhs.getBX()) { 00142 returnValue = true; 00143 } 00144 else { 00145 int stripType = getStripType(); 00146 int rhsStripType = rhs.getStripType(); 00147 00148 // Note: if both muons are either high and low pT, then there's the chance 00149 // that one of them is at exactly the strip of the other. Don't 00150 // want to chuck out muons that way! 00151 // The numbering is not obvious because of the 'staggering' on each of the 00152 // layers. When the staggering is completely understood, this algorithm 00153 // should be re-checked for consistency. -JM 00154 if (stripType != rhsStripType) { 00155 if (abs(getKeyStrip() - rhs.getKeyStrip()) < 5) { 00156 returnValue = true; 00157 } 00158 } 00159 } 00160 return returnValue; 00161 }
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 51 of file CSCCLCTDigi.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), getKeyStrip(), getPattern(), getQuality(), and getStripType().
00051 { 00052 bool returnValue = false; 00053 /* The quality value for the cathodeLCT is different than for the 00054 anodeLCT. Remember that for the anodeLCT, the more layers that were 00055 hit the higher the quality. For the cathodeLCT there is a pattern 00056 assignment given. This is based on the range of strips hit and 00057 the number of layers. The hits on the strips are divided into 00058 high Pt (transverse momentum) and low Pt. A half strip pattern check 00059 is used for high Pt; and a di-strip pattern is used for low Pt. 00060 The order of quality from highest to lowest is 6/6 halfstrip, 00061 5/6 halfstrip, 6/6 distrip, 4/6 halfstrip, 5/6 distrip, 4/6 distrip. 00062 (see CSCCathodeLCTProcessor for further details.) -JM 00063 */ 00064 int quality = getQuality(); 00065 int rhsQuality = rhs.getQuality(); 00066 int stripType = getStripType(); 00067 int rhsStripType = rhs.getStripType(); 00068 00069 #ifdef TB 00070 // Test beams' implementation. 00071 #ifdef TBs 00072 // This algo below was used in 2003 and 2004 test beams, but not in MTCC. 00073 if (stripType == rhsStripType) { // both di-strip or half-strip 00074 if (quality > rhsQuality) {returnValue = true;} 00075 #ifdef LATER 00076 else if (quality == rhsQuality) { 00077 // The rest SEEMS NOT TO BE USED at the moment. Brian's comment: 00078 // "There is a bug in the TMB firmware in terms of swapping the lcts." 00079 // In the case of identical quality, select higher pattern. 00080 int pattern = getPattern(); 00081 int rhsPattern = rhs.getPattern(); 00082 if (pattern > rhsPattern) {returnValue = true;} 00083 else if (pattern == rhsPattern) { 00084 // In the case of identical pattern, select lower key strip number. 00085 if (getKeyStrip() < rhs.getKeyStrip()) {returnValue = true;} 00086 } 00087 } 00088 #endif 00089 } 00090 else if (stripType > rhsStripType) { 00091 // Always select half-strip pattern over di-strip pattern. 00092 returnValue = true; 00093 } 00094 #else 00095 // MTCC variant. 00096 if (quality > rhsQuality) {returnValue = true;} 00097 #endif 00098 00099 #else 00100 // Hack to preserve old behaviour; needs to be clarified. 00101 quality -= 3; 00102 rhsQuality -= 3; 00103 if (quality < 0 || rhsQuality < 0) { 00104 std::cout << " +++ CSCCLCTDigi, overloaded > : undefined qualities " 00105 << quality << " " << rhsQuality << " ... Do nothing +++" 00106 << std::endl; 00107 return returnValue; 00108 } 00109 // Default ORCA option. 00110 if (stripType == rhsStripType) { // both di-strip or half-strip 00111 if (quality > rhsQuality) {returnValue = true;} 00112 else if (quality == rhsQuality) { 00113 // In the case of cathode LCTs with identical quality, the lower 00114 // strip number is selected. 00115 if (getKeyStrip() < rhs.getKeyStrip()) {returnValue = true;} 00116 } 00117 } 00118 else if (stripType > rhsStripType) { // halfstrip, distrip 00119 // 5/6, 6/6 halfstrip better than all but 6/6 distrip: 00120 // If halfstrip quality is 2 or 3, it beats all distrip qualities. 00121 // If halfstrip quality is 1, it beats everything except 00122 // distrip quality or 3. 00123 if (quality >= rhsQuality - 1) {returnValue = true;} 00124 } 00125 else if (stripType < rhsStripType) { // distrip, halfstrip 00126 // If distrip quality is 3, it beats a halfstrip quality of 1. 00127 if (quality - 1 > rhsQuality) {returnValue = true;} 00128 } 00129 #endif 00130 00131 return returnValue; 00132 }
Print content of digi.
Debug.
Definition at line 176 of file CSCCLCTDigi.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), getBend(), getBX(), getCFEB(), getKeyStrip(), getPattern(), getQuality(), getStrip(), getStripType(), getTrknmb(), and isValid().
00176 { 00177 if (isValid()) { 00178 char stripType = (getStripType() == 0) ? 'D' : 'H'; 00179 char bend = (getBend() == 0) ? 'L' : 'R'; 00180 00181 std::cout << " CSC CLCT #" << setw(1) << getTrknmb() 00182 << ": Valid = " << setw(1) << isValid() 00183 << " Key Strip = " << setw(3) << getKeyStrip() 00184 << " Strip = " << setw(2) << getStrip() 00185 << " Quality = " << setw(1) << getQuality() 00186 << " Pattern = " << setw(1) << getPattern() 00187 << " Bend = " << setw(1) << bend 00188 << " Strip type = " << setw(1) << stripType 00189 << " CFEB ID = " << setw(1) << getCFEB() 00190 << " BX = " << setw(1) << getBX() << std::endl; 00191 } 00192 else { 00193 std::cout << "Not a valid Cathode LCT." << std::endl; 00194 } 00195 }
void CSCCLCTDigi::setFullBX | ( | const uint16_t | fullbx | ) | [inline] |
Set 12-bit full BX.
Definition at line 78 of file CSCCLCTDigi.h.
References fullbx_.
Referenced by CSCTMBHeader2007_rev0x50c3::CLCTDigis(), CSCTMBHeader2007::CLCTDigis(), and CSCTMBHeader2006::CLCTDigis().
00078 {fullbx_ = fullbx;}
void CSCCLCTDigi::setTrknmb | ( | const uint16_t | number | ) | [inline] |
Set track number (1,2) after sorting CLCTs.
Definition at line 72 of file CSCCLCTDigi.h.
References trknmb_.
Referenced by CSCCathodeLCTProcessor::run().
00072 {trknmb_ = number;}
uint16_t CSCCLCTDigi::bend_ [private] |
uint16_t CSCCLCTDigi::bx_ [private] |
uint16_t CSCCLCTDigi::cfeb_ [private] |
Definition at line 106 of file CSCCLCTDigi.h.
Referenced by clear(), CSCCLCTDigi(), getCFEB(), and getKeyStrip().
uint16_t CSCCLCTDigi::fullbx_ [private] |
uint16_t CSCCLCTDigi::pattern_ [private] |
Definition at line 102 of file CSCCLCTDigi.h.
Referenced by clear(), CSCCLCTDigi(), and getPattern().
uint16_t CSCCLCTDigi::quality_ [private] |
Definition at line 101 of file CSCCLCTDigi.h.
Referenced by clear(), CSCCLCTDigi(), and getQuality().
uint16_t CSCCLCTDigi::strip_ [private] |
Definition at line 105 of file CSCCLCTDigi.h.
Referenced by clear(), CSCCLCTDigi(), getKeyStrip(), and getStrip().
uint16_t CSCCLCTDigi::striptype_ [private] |
Definition at line 103 of file CSCCLCTDigi.h.
Referenced by clear(), CSCCLCTDigi(), and getStripType().
uint16_t CSCCLCTDigi::trknmb_ [private] |
Definition at line 108 of file CSCCLCTDigi.h.
Referenced by clear(), CSCCLCTDigi(), getTrknmb(), and setTrknmb().
uint16_t CSCCLCTDigi::valid_ [private] |