CMS 3D CMS Logo

CSCCLCTPreTriggerDigi.cc
Go to the documentation of this file.
3 
4 #include <iomanip>
5 #include <iostream>
6 
9  const int quality,
10  const int pattern,
11  const int striptype,
12  const int bend,
13  const int strip,
14  const int cfeb,
15  const int bx,
16  const int trknmb,
17  const int fullbx)
18  : valid_(valid),
19  quality_(quality),
20  pattern_(pattern),
21  striptype_(striptype),
22  bend_(bend),
23  strip_(strip),
24  cfeb_(cfeb),
25  bx_(bx),
26  trknmb_(trknmb),
27  fullbx_(fullbx) {}
28 
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) {}
41 
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 }
55 
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 }
82 
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 }
93 
95  // True if == is false.
96  bool returnValue = true;
97  if ((*this) == rhs)
98  returnValue = false;
99  return returnValue;
100 }
101 
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 }
119 
120 std::ostream& operator<<(std::ostream& o, const CSCCLCTPreTriggerDigi& digi) {
121  return o << "CSC CLCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality()
122  << " Pattern = " << digi.getPattern() << " StripType = " << digi.getStripType()
123  << " Bend = " << digi.getBend() << " Strip = " << digi.getStrip() << " KeyStrip = " << digi.getKeyStrip()
124  << " CFEB = " << digi.getCFEB() << " BX = " << digi.getBX();
125 }
CSCCLCTPreTriggerDigi::bx_
uint16_t bx_
Definition: CSCCLCTPreTriggerDigi.h:106
CSCCLCTPreTriggerDigi::getStripType
int getStripType() const
return striptype
Definition: CSCCLCTPreTriggerDigi.h:44
CSCCLCTPreTriggerDigi::operator!=
bool operator!=(const CSCCLCTPreTriggerDigi &) const
True if the preceding one is false.
Definition: CSCCLCTPreTriggerDigi.cc:94
MessageLogger.h
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
CSCCLCTPreTriggerDigi::print
void print() const
Print content of digi.
Definition: CSCCLCTPreTriggerDigi.cc:103
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::clear
void clear()
clear this CLCT
Definition: CSCCLCTPreTriggerDigi.cc:43
CSCCLCTPreTriggerDigi::getPattern
int getPattern() const
return pattern
Definition: CSCCLCTPreTriggerDigi.h:41
CSCCLCTPreTriggerDigi::CSCCLCTPreTriggerDigi
CSCCLCTPreTriggerDigi()
default
Definition: CSCCLCTPreTriggerDigi.cc:30
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
sistrip::valid_
static const uint16_t valid_
Definition: Constants.h:17
CSCCLCTPreTriggerDigi::cfeb_
uint16_t cfeb_
Definition: CSCCLCTPreTriggerDigi.h:105
CSCCLCTPreTriggerDigi::trknmb_
uint16_t trknmb_
Definition: CSCCLCTPreTriggerDigi.h:107
CSCCLCTPreTriggerDigi::fullbx_
uint16_t fullbx_
Definition: CSCCLCTPreTriggerDigi.h:108
CSCCLCTPreTriggerDigi
Definition: CSCCLCTPreTriggerDigi.h:15
CSCCLCTPreTriggerDigi::pattern_
uint16_t pattern_
Definition: CSCCLCTPreTriggerDigi.h:101
CSCCLCTPreTriggerDigi::getBend
int getBend() const
return bend
Definition: CSCCLCTPreTriggerDigi.h:47
edm::LogVerbatim
Definition: MessageLogger.h:297
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCCLCTPreTriggerDigi::getKeyStrip
int getKeyStrip() const
Definition: CSCCLCTPreTriggerDigi.h:70
CSCCLCTPreTriggerDigi.h
CSCCLCTPreTriggerDigi::quality_
uint16_t quality_
Definition: CSCCLCTPreTriggerDigi.h:100
CSCCLCTPreTriggerDigi::operator>
bool operator>(const CSCCLCTPreTriggerDigi &) const
Definition: CSCCLCTPreTriggerDigi.cc:56
CSCCLCTPreTriggerDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTPreTriggerDigi.h:35
operator<<
std::ostream & operator<<(std::ostream &o, const CSCCLCTPreTriggerDigi &digi)
Definition: CSCCLCTPreTriggerDigi.cc:120
CSCCLCTPreTriggerDigi::operator==
bool operator==(const CSCCLCTPreTriggerDigi &) const
True if the two LCTs have exactly the same members (except the number).
Definition: CSCCLCTPreTriggerDigi.cc:83
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
CSCCLCTPreTriggerDigi::getStrip
int getStrip() const
return halfstrip that goes from 0 to 31
Definition: CSCCLCTPreTriggerDigi.h:50
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
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
CSCCLCTPreTriggerDigi::strip_
uint16_t strip_
Definition: CSCCLCTPreTriggerDigi.h:104