CMS 3D CMS Logo

CSCALCTDigi.cc
Go to the documentation of this file.
1 
11 #include <iomanip>
12 #include <iostream>
13 
14 using namespace std;
15 
18  const uint16_t quality,
19  const uint16_t accel,
20  const uint16_t patternb,
21  const uint16_t keywire,
22  const uint16_t bx,
23  const uint16_t trknmb,
24  const uint16_t hmt,
25  const Version version)
26  : valid_(valid),
27  quality_(quality),
28  accel_(accel),
29  patternb_(patternb),
30  keywire_(keywire),
31  bx_(bx),
32  trknmb_(trknmb),
33  hmt_(hmt),
34  version_(version) {}
35 
38  clear(); // set contents to zero
40 }
41 
44  valid_ = 0;
45  quality_ = 0;
46  accel_ = 0;
47  patternb_ = 0;
48  keywire_ = 0;
49  bx_ = 0;
50  trknmb_ = 0;
51  fullbx_ = 0;
52  hmt_ = 0;
53 }
54 
55 uint16_t CSCALCTDigi::getHMT() const { return (isRun3() ? hmt_ : std::numeric_limits<uint16_t>::max()); }
56 
58 
60 
61 bool CSCALCTDigi::operator>(const CSCALCTDigi& rhs) const {
62  bool returnValue = false;
63 
64  // Early ALCTs are always preferred to the ones found at later bx's.
65  if (getBX() < rhs.getBX()) {
66  returnValue = true;
67  }
68  if (getBX() != rhs.getBX()) {
69  return returnValue;
70  }
71 
72  // The > operator then checks the quality of ALCTs.
73  // If two qualities are equal, the ALCT furthest from the beam axis
74  // (lowest eta, highest wire group number) is selected.
75  uint16_t quality1 = getQuality();
76  uint16_t quality2 = rhs.getQuality();
77  if (quality1 > quality2) {
78  returnValue = true;
79  } else if (quality1 == quality2 && getKeyWG() > rhs.getKeyWG()) {
80  returnValue = true;
81  }
82  return returnValue;
83 }
84 
85 bool CSCALCTDigi::operator==(const CSCALCTDigi& rhs) const {
86  // Exact equality.
87  bool returnValue = false;
88  if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && getAccelerator() == rhs.getAccelerator() &&
89  getCollisionB() == rhs.getCollisionB() && getKeyWG() == rhs.getKeyWG() && getBX() == rhs.getBX() &&
90  getHMT() == rhs.getHMT()) {
91  returnValue = true;
92  }
93  return returnValue;
94 }
95 
96 bool CSCALCTDigi::operator!=(const CSCALCTDigi& rhs) const {
97  // True if == is false.
98  bool returnValue = true;
99  if ((*this) == rhs)
100  returnValue = false;
101  return returnValue;
102 }
103 
105 void CSCALCTDigi::print() const {
106  if (isValid()) {
107  edm::LogVerbatim("CSCDigi") << "CSC ALCT #" << setw(1) << getTrknmb() << ": Valid = " << setw(1) << isValid()
108  << " Quality = " << setw(2) << getQuality() << " Accel. = " << setw(1)
109  << getAccelerator() << " PatternB = " << setw(1) << getCollisionB()
110  << " Key wire group = " << setw(3) << getKeyWG() << " BX = " << setw(2) << getBX()
111  << " Full BX = " << std::setw(1) << getFullBX() << " HMT = " << std::setw(1)
112  << getHMT();
113  } else {
114  edm::LogVerbatim("CSCDigi") << "Not a valid Anode LCT.";
115  }
116 }
117 
118 std::ostream& operator<<(std::ostream& o, const CSCALCTDigi& digi) {
119  return o << "CSC ALCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality()
120  << " Accel. = " << digi.getAccelerator() << " PatternB = " << digi.getCollisionB()
121  << " Key wire group = " << digi.getKeyWG() << " BX = " << digi.getBX() << " HMT = " << digi.getHMT();
122 }
CSCALCTDigi::getHMT
uint16_t getHMT() const
return the high multiplicity bits
Definition: CSCALCTDigi.cc:55
CSCALCTDigi::getBX
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:70
CSCALCTDigi::patternb_
uint16_t patternb_
Definition: CSCALCTDigi.h:118
MessageLogger.h
CSCALCTDigi::Version::Legacy
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
CSCALCTDigi::clear
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:43
CSCALCTDigi::Version::Run3
CSCALCTDigi::print
void print() const
Print content of digi.
Definition: CSCALCTDigi.cc:105
CSCALCTDigi::bx_
uint16_t bx_
Definition: CSCALCTDigi.h:120
CSCALCTDigi::trknmb_
uint16_t trknmb_
Definition: CSCALCTDigi.h:121
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
simKBmtfDigis_cfi.bx
bx
Definition: simKBmtfDigis_cfi.py:55
CSCALCTDigi::getKeyWG
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:64
CSCALCTDigi::valid_
uint16_t valid_
Definition: CSCALCTDigi.h:115
operator<<
std::ostream & operator<<(std::ostream &o, const CSCALCTDigi &digi)
Definition: CSCALCTDigi.cc:118
CSCALCTDigi.h
h
CSCALCTDigi::keywire_
uint16_t keywire_
Definition: CSCALCTDigi.h:119
CSCALCTDigi::CSCALCTDigi
CSCALCTDigi()
default
Definition: CSCALCTDigi.cc:37
CSCALCTDigi::setHMT
void setHMT(const uint16_t hmt)
set the high multiplicity bits
Definition: CSCALCTDigi.cc:57
CSCALCTDigi::getCollisionB
uint16_t getCollisionB() const
Definition: CSCALCTDigi.h:58
CSCALCTDigi::setRun3
void setRun3(const bool isRun3)
Definition: CSCALCTDigi.cc:59
CSCALCTDigi::getQuality
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:43
CSCALCTDigi::operator!=
bool operator!=(const CSCALCTDigi &) const
True if the preceding one is false.
Definition: CSCALCTDigi.cc:96
CSCALCTDigi::operator>
bool operator>(const CSCALCTDigi &) const
Definition: CSCALCTDigi.cc:61
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CSCALCTDigi::fullbx_
uint16_t fullbx_
Definition: CSCALCTDigi.h:122
edm::LogVerbatim
Definition: MessageLogger.h:297
CSCALCTDigi::getFullBX
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCALCTDigi.h:82
CSCALCTDigi::quality_
uint16_t quality_
Definition: CSCALCTDigi.h:116
std
Definition: JetResolutionObject.h:76
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
CSCALCTDigi::getAccelerator
uint16_t getAccelerator() const
Definition: CSCALCTDigi.h:50
CSCALCTDigi
Definition: CSCALCTDigi.h:16
CSCALCTDigi::accel_
uint16_t accel_
Definition: CSCALCTDigi.h:117
CSCALCTDigi::isValid
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:37
CSCALCTDigi::getTrknmb
uint16_t getTrknmb() const
return track number (1,2)
Definition: CSCALCTDigi.h:76
CSCALCTDigi::isRun3
bool isRun3() const
Distinguish Run-1/2 from Run-3.
Definition: CSCALCTDigi.h:110
CSCALCTDigi::operator==
bool operator==(const CSCALCTDigi &) const
True if all members (except the number) of both ALCTs are equal.
Definition: CSCALCTDigi.cc:85
Version
Definition: InitMessage.h:39
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
CSCALCTDigi::hmt_
uint16_t hmt_
Definition: CSCALCTDigi.h:126
CSCALCTDigi::version_
Version version_
Definition: CSCALCTDigi.h:128