CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
Log< level::Info, true > LogVerbatim
bool operator!=(const CSCALCTPreTriggerDigi &) const
True if the preceding one is false.
bool operator==(const CSCALCTPreTriggerDigi &) const
True if all members (except the number) of both ALCTs are equal.
bool operator>(const CSCALCTPreTriggerDigi &) const
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
std::ostream & operator<<(std::ostream &out, const std::tuple< Types...> &value)
Definition: Utilities.h:32
uint32_t const *__restrict__ Quality * quality
activeDets clear()
void print() const
Print content of digi.
bool isValid() const
check ALCT validity (1 - valid ALCT)
static const uint16_t valid_
Definition: Constants.h:17
int getTrknmb() const
return track number (1,2)
void clear()
clear this ALCT
int getQuality() const
return quality of a pattern
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
int getKeyWG() const
return key wire group