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
46 }
47 
50  valid_ = 0;
51  quality_ = 0;
52  accel_ = 0;
53  patternb_ = 0;
54  keywire_ = 0;
55  bx_ = 0;
56  trknmb_ = 0;
57  fullbx_ = 0;
58  hmt_ = 0;
59  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  returnValue = true;
102  }
103  return returnValue;
104 }
105 
106 bool CSCALCTDigi::operator!=(const CSCALCTDigi& rhs) const {
107  // True if == is false.
108  bool returnValue = true;
109  if ((*this) == rhs)
110  returnValue = false;
111  return returnValue;
112 }
113 
115 void CSCALCTDigi::print() const {
116  if (isValid()) {
117  edm::LogVerbatim("CSCDigi") << "CSC ALCT #" << setw(1) << getTrknmb() << ": Valid = " << setw(1) << isValid()
118  << " Quality = " << setw(2) << getQuality() << " Accel. = " << setw(1)
119  << getAccelerator() << " PatternB = " << setw(1) << getCollisionB()
120  << " Key wire group = " << setw(3) << getKeyWG() << " BX = " << setw(2) << getBX()
121  << " Full BX = " << std::setw(1) << getFullBX();
122  } else {
123  edm::LogVerbatim("CSCDigi") << "Not a valid Anode LCT.";
124  }
125 }
126 
127 std::ostream& operator<<(std::ostream& o, const CSCALCTDigi& digi) {
128  return o << "CSC ALCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality()
129  << " Accel. = " << digi.getAccelerator() << " PatternB = " << digi.getCollisionB()
130  << " Key wire group = " << digi.getKeyWG() << " BX = " << digi.getBX();
131 }
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
CSCALCTDigi::clear
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:49
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCALCTDigi::Version::Run3
CSCALCTDigi::print
void print() const
Print content of digi.
Definition: CSCALCTDigi.cc:115
CSCALCTDigi::bx_
uint16_t bx_
Definition: CSCALCTDigi.h:128
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
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:122
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:127
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:106
CSCALCTDigi::operator>
bool operator>(const CSCALCTDigi &) const
Definition: CSCALCTDigi.cc:72
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
ALCT_PATTERN_WIDTH
Definition: CSCALCTDigi.cc:14
CSCALCTDigi::fullbx_
uint16_t fullbx_
Definition: CSCALCTDigi.h:130
L1TdeCSCTPG_cfi.isRun3
isRun3
Definition: L1TdeCSCTPG_cfi.py:32
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:139
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:135
CSCALCTDigi::version_
Version version_
Definition: CSCALCTDigi.h:137