CMS 3D CMS Logo

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 ()
 default 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...
 
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() [1/2]

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.

18  : valid_(valid),
21  striptype_(striptype),
22  bend_(bend),
23  strip_(strip),
24  cfeb_(cfeb),
25  bx_(bx),
26  trknmb_(trknmb),
27  fullbx_(fullbx) {}

◆ CSCCLCTPreTriggerDigi() [2/2]

CSCCLCTPreTriggerDigi::CSCCLCTPreTriggerDigi ( )

default

Default.

Definition at line 30 of file CSCCLCTPreTriggerDigi.cc.

31  : valid_(0),
32  quality_(0),
33  pattern_(0),
34  striptype_(0),
35  bend_(0),
36  strip_(0),
37  cfeb_(0),
38  bx_(0),
39  trknmb_(0),
40  fullbx_(0) {}

Member Function Documentation

◆ clear()

void CSCCLCTPreTriggerDigi::clear ( void  )

clear this CLCT

Clears this CLCT.

Definition at line 43 of file CSCCLCTPreTriggerDigi.cc.

43  {
44  valid_ = 0;
45  quality_ = 0;
46  pattern_ = 0;
47  striptype_ = 0;
48  bend_ = 0;
49  strip_ = 0;
50  cfeb_ = 0;
51  bx_ = 0;
52  trknmb_ = 0;
53  fullbx_ = 0;
54 }

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

Referenced by BeautifulSoup.Tag::setString().

◆ getBend()

int CSCCLCTPreTriggerDigi::getBend ( ) const
inline

return bend

Definition at line 47 of file CSCCLCTPreTriggerDigi.h.

47 { return bend_; }

References bend_.

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

◆ getBX()

int CSCCLCTPreTriggerDigi::getBX ( ) const
inline

return BX

Definition at line 56 of file CSCCLCTPreTriggerDigi.h.

56 { return bx_; }

References bx_.

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

◆ getCFEB()

int CSCCLCTPreTriggerDigi::getCFEB ( ) const
inline

return Key CFEB ID

Definition at line 53 of file CSCCLCTPreTriggerDigi.h.

53 { return cfeb_; }

References cfeb_.

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

◆ getFullBX()

int CSCCLCTPreTriggerDigi::getFullBX ( ) const
inline

return 12-bit full BX.

Definition at line 79 of file CSCCLCTPreTriggerDigi.h.

79 { return fullbx_; }

References fullbx_.

Referenced by print().

◆ getKeyStrip()

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 70 of file CSCCLCTPreTriggerDigi.h.

70  {
71  int keyStrip = cfeb_ * 32 + strip_;
72  return keyStrip;
73  }

References cfeb_, and strip_.

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

◆ getPattern()

int CSCCLCTPreTriggerDigi::getPattern ( ) const
inline

return pattern

Definition at line 41 of file CSCCLCTPreTriggerDigi.h.

41 { return pattern_; }

References pattern_.

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

◆ getQuality()

int CSCCLCTPreTriggerDigi::getQuality ( ) const
inline

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

Definition at line 38 of file CSCCLCTPreTriggerDigi.h.

38 { return quality_; }

References quality_.

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

◆ getStrip()

int CSCCLCTPreTriggerDigi::getStrip ( ) const
inline

return halfstrip that goes from 0 to 31

Definition at line 50 of file CSCCLCTPreTriggerDigi.h.

50 { return strip_; }

References strip_.

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

◆ getStripType()

int CSCCLCTPreTriggerDigi::getStripType ( ) const
inline

return striptype

Definition at line 44 of file CSCCLCTPreTriggerDigi.h.

44 { return striptype_; }

References striptype_.

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

◆ getTrknmb()

int CSCCLCTPreTriggerDigi::getTrknmb ( ) const
inline

return track number (1,2)

Definition at line 59 of file CSCCLCTPreTriggerDigi.h.

59 { return trknmb_; }

References trknmb_.

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

◆ isValid()

bool CSCCLCTPreTriggerDigi::isValid ( void  ) const
inline

check CLCT validity (1 - valid CLCT)

Definition at line 35 of file CSCCLCTPreTriggerDigi.h.

35 { return valid_; }

References valid_.

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

◆ operator!=()

bool CSCCLCTPreTriggerDigi::operator!= ( const CSCCLCTPreTriggerDigi rhs) const

True if the preceding one is false.

Definition at line 94 of file CSCCLCTPreTriggerDigi.cc.

94  {
95  // True if == is false.
96  bool returnValue = true;
97  if ((*this) == rhs)
98  returnValue = false;
99  return returnValue;
100 }

◆ operator==()

bool CSCCLCTPreTriggerDigi::operator== ( const CSCCLCTPreTriggerDigi rhs) const

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

Definition at line 83 of file CSCCLCTPreTriggerDigi.cc.

83  {
84  // Exact equality.
85  bool returnValue = false;
86  if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && getPattern() == rhs.getPattern() &&
87  getKeyStrip() == rhs.getKeyStrip() && getStripType() == rhs.getStripType() && getBend() == getBend() &&
88  getBX() == rhs.getBX()) {
89  returnValue = true;
90  }
91  return returnValue;
92 }

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

◆ operator>()

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 56 of file CSCCLCTPreTriggerDigi.cc.

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

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

◆ print()

void CSCCLCTPreTriggerDigi::print ( void  ) const

Print content of digi.

Debug.

Definition at line 103 of file CSCCLCTPreTriggerDigi.cc.

103  {
104  if (isValid()) {
105  char stripType = (getStripType() == 0) ? 'D' : 'H';
106  char bend = (getBend() == 0) ? 'L' : 'R';
107 
108  edm::LogVerbatim("CSCDigi") << " CSC CLCT #" << std::setw(1) << getTrknmb() << ": Valid = " << std::setw(1)
109  << isValid() << " Key Strip = " << std::setw(3) << getKeyStrip()
110  << " Strip = " << std::setw(2) << getStrip() << " Quality = " << std::setw(1)
111  << getQuality() << " Pattern = " << std::setw(1) << getPattern()
112  << " Bend = " << std::setw(1) << bend << " Strip type = " << std::setw(1) << stripType
113  << " CFEB ID = " << std::setw(1) << getCFEB() << " BX = " << std::setw(1) << getBX()
114  << " Full BX= " << std::setw(1) << getFullBX();
115  } else {
116  edm::LogVerbatim("CSCDigi") << "Not a valid Cathode LCT.";
117  }
118 }

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

◆ setFullBX()

void CSCCLCTPreTriggerDigi::setFullBX ( const uint16_t  fullbx)
inline

Set 12-bit full BX.

Definition at line 82 of file CSCCLCTPreTriggerDigi.h.

82 { fullbx_ = fullbx; }

References fullbx_.

◆ setTrknmb()

void CSCCLCTPreTriggerDigi::setTrknmb ( const uint16_t  number)
inline

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

Definition at line 76 of file CSCCLCTPreTriggerDigi.h.

76 { trknmb_ = number; }

References contentValuesFiles::number, and trknmb_.

Member Data Documentation

◆ bend_

uint16_t CSCCLCTPreTriggerDigi::bend_
private

Definition at line 103 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getBend().

◆ bx_

uint16_t CSCCLCTPreTriggerDigi::bx_
private

Definition at line 106 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getBX().

◆ cfeb_

uint16_t CSCCLCTPreTriggerDigi::cfeb_
private

Definition at line 105 of file CSCCLCTPreTriggerDigi.h.

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

◆ fullbx_

uint16_t CSCCLCTPreTriggerDigi::fullbx_
private

Definition at line 108 of file CSCCLCTPreTriggerDigi.h.

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

◆ pattern_

uint16_t CSCCLCTPreTriggerDigi::pattern_
private

Definition at line 101 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getPattern().

◆ quality_

uint16_t CSCCLCTPreTriggerDigi::quality_
private

Definition at line 100 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getQuality().

◆ strip_

uint16_t CSCCLCTPreTriggerDigi::strip_
private

Definition at line 104 of file CSCCLCTPreTriggerDigi.h.

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

◆ striptype_

uint16_t CSCCLCTPreTriggerDigi::striptype_
private

Definition at line 102 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and getStripType().

◆ trknmb_

uint16_t CSCCLCTPreTriggerDigi::trknmb_
private

Definition at line 107 of file CSCCLCTPreTriggerDigi.h.

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

◆ valid_

uint16_t CSCCLCTPreTriggerDigi::valid_
private

Definition at line 99 of file CSCCLCTPreTriggerDigi.h.

Referenced by clear(), and isValid().

CSCCLCTPreTriggerDigi::bx_
uint16_t bx_
Definition: CSCCLCTPreTriggerDigi.h:106
CSCCLCTPreTriggerDigi::getStripType
int getStripType() const
return striptype
Definition: CSCCLCTPreTriggerDigi.h:44
CSCCLCTPreTriggerDigi::getFullBX
int getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTPreTriggerDigi.h:79
CSCCLCTPreTriggerDigi::valid_
uint16_t valid_
Definition: CSCCLCTPreTriggerDigi.h:99
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCCLCTPreTriggerDigi::getQuality
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTPreTriggerDigi.h:38
CSCCLCTPreTriggerDigi::getTrknmb
int getTrknmb() const
return track number (1,2)
Definition: CSCCLCTPreTriggerDigi.h:59
CSCCLCTPreTriggerDigi::bend_
uint16_t bend_
Definition: CSCCLCTPreTriggerDigi.h:103
CSCCLCTPreTriggerDigi::getPattern
int getPattern() const
return pattern
Definition: CSCCLCTPreTriggerDigi.h:41
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:109
CSCCLCTPreTriggerDigi::cfeb_
uint16_t cfeb_
Definition: CSCCLCTPreTriggerDigi.h:105
CSCCLCTPreTriggerDigi::trknmb_
uint16_t trknmb_
Definition: CSCCLCTPreTriggerDigi.h:107
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
CSCCLCTPreTriggerDigi::fullbx_
uint16_t fullbx_
Definition: CSCCLCTPreTriggerDigi.h:108
CSCCLCTPreTriggerDigi::pattern_
uint16_t pattern_
Definition: CSCCLCTPreTriggerDigi.h:101
CSCCLCTPreTriggerDigi::getBend
int getBend() const
return bend
Definition: CSCCLCTPreTriggerDigi.h:47
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCCLCTPreTriggerDigi::getKeyStrip
int getKeyStrip() const
Definition: CSCCLCTPreTriggerDigi.h:70
CSCCLCTPreTriggerDigi::quality_
uint16_t quality_
Definition: CSCCLCTPreTriggerDigi.h:100
CSCCLCTPreTriggerDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTPreTriggerDigi.h:35
CSCCLCTPreTriggerDigi::getStrip
int getStrip() const
return halfstrip that goes from 0 to 31
Definition: CSCCLCTPreTriggerDigi.h:50
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:166
CSCCLCTPreTriggerDigi::striptype_
uint16_t striptype_
Definition: CSCCLCTPreTriggerDigi.h:102
CSCCLCTPreTriggerDigi::getCFEB
int getCFEB() const
return Key CFEB ID
Definition: CSCCLCTPreTriggerDigi.h:53
CSCCLCTPreTriggerDigi::getBX
int getBX() const
return BX
Definition: CSCCLCTPreTriggerDigi.h:56
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
CSCCLCTPreTriggerDigi::strip_
uint16_t strip_
Definition: CSCCLCTPreTriggerDigi.h:104