CMS 3D CMS Logo

CSCALCTPreTriggerDigi.cc
Go to the documentation of this file.
3 #include <iomanip>
4 #include <iostream>
5 
6 using namespace std;
7 
10  const int quality,
11  const int accel,
12  const int patternb,
13  const int keywire,
14  const int bx,
15  const int trknmb) {
16  valid_ = valid;
17  quality_ = quality;
18  accel_ = accel;
19  patternb_ = patternb;
20  keywire_ = keywire;
21  bx_ = bx;
22  trknmb_ = trknmb;
23 }
24 
27  clear(); // set contents to zero
28 }
29 
32  valid_ = 0;
33  quality_ = 0;
34  accel_ = 0;
35  patternb_ = 0;
36  keywire_ = 0;
37  bx_ = 0;
38  trknmb_ = 0;
39  fullbx_ = 0;
40 }
41 
43  bool returnValue = false;
44 
45  // Early ALCTs are always preferred to the ones found at later bx's.
46  if (getBX() < rhs.getBX()) {
47  returnValue = true;
48  }
49  if (getBX() != rhs.getBX()) {
50  return returnValue;
51  }
52 
53  // The > operator then checks the quality of ALCTs.
54  // If two qualities are equal, the ALCT furthest from the beam axis
55  // (lowest eta, highest wire group number) is selected.
56  int quality1 = getQuality();
57  int quality2 = rhs.getQuality();
58  if (quality1 > quality2) {
59  returnValue = true;
60  } else if (quality1 == quality2 && getKeyWG() > rhs.getKeyWG()) {
61  returnValue = true;
62  }
63  return returnValue;
64 }
65 
67  // Exact equality.
68  bool returnValue = false;
69  if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() && getAccelerator() == rhs.getAccelerator() &&
70  getCollisionB() == rhs.getCollisionB() && getKeyWG() == rhs.getKeyWG() && getBX() == rhs.getBX()) {
71  returnValue = true;
72  }
73  return returnValue;
74 }
75 
77  // True if == is false.
78  bool returnValue = true;
79  if ((*this) == rhs)
80  returnValue = false;
81  return returnValue;
82 }
83 
86  if (isValid()) {
87  edm::LogVerbatim("CSCDigi") << "CSC ALCT #" << setw(1) << getTrknmb() << ": Valid = " << setw(1) << isValid()
88  << " Quality = " << setw(2) << getQuality() << " Accel. = " << setw(1)
89  << getAccelerator() << " PatternB = " << setw(1) << getCollisionB()
90  << " Key wire group = " << setw(3) << getKeyWG() << " BX = " << setw(2) << getBX()
91  << " Full BX= " << std::setw(1) << getFullBX();
92  } else {
93  edm::LogVerbatim("CSCDigi") << "Not a valid Anode LCT.";
94  }
95 }
96 
97 std::ostream& operator<<(std::ostream& o, const CSCALCTPreTriggerDigi& digi) {
98  return o << "CSC ALCT #" << digi.getTrknmb() << ": Valid = " << digi.isValid() << " Quality = " << digi.getQuality()
99  << " Accel. = " << digi.getAccelerator() << " PatternB = " << digi.getCollisionB()
100  << " Key wire group = " << digi.getKeyWG() << " BX = " << digi.getBX();
101 }
MessageLogger.h
CSCALCTPreTriggerDigi::CSCALCTPreTriggerDigi
CSCALCTPreTriggerDigi()
default
Definition: CSCALCTPreTriggerDigi.cc:26
CSCALCTPreTriggerDigi::getKeyWG
int getKeyWG() const
return key wire group
Definition: CSCALCTPreTriggerDigi.h:57
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCALCTPreTriggerDigi::operator==
bool operator==(const CSCALCTPreTriggerDigi &) const
True if all members (except the number) of both ALCTs are equal.
Definition: CSCALCTPreTriggerDigi.cc:66
CSCALCTPreTriggerDigi::getBX
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTPreTriggerDigi.h:63
std::operator<<
std::ostream & operator<<(std::ostream &out, const std::tuple< Types... > &value)
Definition: Utilities.h:32
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
CSCALCTPreTriggerDigi::getAccelerator
int getAccelerator() const
Definition: CSCALCTPreTriggerDigi.h:43
sistrip::SpyUtilities::isValid
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Definition: SiStripSpyUtilities.cc:124
clear
void clear(HadCaloObj &c)
Definition: data.h:124
CSCALCTPreTriggerDigi::getQuality
int getQuality() const
return quality of a pattern
Definition: CSCALCTPreTriggerDigi.h:36
CSCALCTPreTriggerDigi.h
CSCALCTPreTriggerDigi::isValid
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTPreTriggerDigi.h:30
CSCALCTPreTriggerDigi
Definition: CSCALCTPreTriggerDigi.h:13
std
Definition: JetResolutionObject.h:76
CSCALCTPreTriggerDigi::getCollisionB
int getCollisionB() const
Definition: CSCALCTPreTriggerDigi.h:51
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
CSCALCTPreTriggerDigi::clear
void clear()
clear this ALCT
Definition: CSCALCTPreTriggerDigi.cc:31
CSCALCTPreTriggerDigi::operator>
bool operator>(const CSCALCTPreTriggerDigi &) const
Definition: CSCALCTPreTriggerDigi.cc:42
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
CSCALCTPreTriggerDigi::getTrknmb
int getTrknmb() const
return track number (1,2)
Definition: CSCALCTPreTriggerDigi.h:69
CSCALCTPreTriggerDigi::operator!=
bool operator!=(const CSCALCTPreTriggerDigi &) const
True if the preceding one is false.
Definition: CSCALCTPreTriggerDigi.cc:76
CSCALCTPreTriggerDigi::print
void print() const
Print content of digi.
Definition: CSCALCTPreTriggerDigi.cc:85