CMS 3D CMS Logo

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