CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCCLCTPreTriggerDigi.cc
Go to the documentation of this file.
3 
4 #include <iomanip>
5 #include <iostream>
6 
8 CSCCLCTPreTriggerDigi::CSCCLCTPreTriggerDigi(const int valid, const int quality, const int pattern,
9  const int striptype, const int bend, const int strip,
10  const int cfeb, const int bx, const int trknmb, const int fullbx):
11  valid_(valid),
12  quality_(quality),
13  pattern_(pattern),
14  striptype_(striptype),
15  bend_(bend),
16  strip_(strip),
17  cfeb_(cfeb),
18  bx_(bx),
19  trknmb_(trknmb),
20  fullbx_(fullbx)
21 {
22 }
23 
26  valid_(0),
27  quality_(0),
28  pattern_(0),
29  striptype_(0),
30  bend_(0),
31  strip_(0),
32  cfeb_(0),
33  bx_(0),
34  trknmb_(0),
35  fullbx_(0)
36 {
37 }
38 
41  valid_ = 0;
42  quality_ = 0;
43  pattern_ = 0;
44  striptype_ = 0;
45  bend_ = 0;
46  strip_ = 0;
47  cfeb_ = 0;
48  bx_ = 0;
49  trknmb_ = 0;
50  fullbx_ = 0;
51 }
52 
54  // Several versions of CLCT sorting criteria were used before 2008.
55  // They are available in CMSSW versions prior to 3_1_0; here we only keep
56  // the latest one, used in TMB-07 firmware (w/o distrips).
57  bool returnValue = false;
58 
59  int quality1 = getQuality();
60  int quality2 = rhs.getQuality();
61  // The bend-direction bit pid[0] is ignored (left and right bends have
62  // equal quality).
63  int pattern1 = getPattern() & 14;
64  int pattern2 = rhs.getPattern() & 14;
65 
66  // Better-quality CLCTs are preferred.
67  // If two qualities are equal, larger pattern id (i.e., straighter pattern)
68  // is preferred; left- and right-bend patterns are considered to be of
69  // the same quality.
70  // If both qualities and pattern id's are the same, lower keystrip
71  // is preferred.
72  if ((quality1 > quality2) ||
73  (quality1 == quality2 && pattern1 > pattern2) ||
74  (quality1 == quality2 && pattern1 == pattern2 &&
75  getKeyStrip() < rhs.getKeyStrip())) {returnValue = true;}
76 
77  return returnValue;
78 }
79 
81  // Exact equality.
82  bool returnValue = false;
83  if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() &&
84  getPattern() == rhs.getPattern() && getKeyStrip()== rhs.getKeyStrip()&&
85  getStripType() == rhs.getStripType() && getBend() == getBend() &&
86  getBX() == rhs.getBX()) {
87  returnValue = true;
88  }
89  return returnValue;
90 }
91 
93  // True if == is false.
94  bool returnValue = true;
95  if ((*this) == rhs) returnValue = false;
96  return returnValue;
97 }
98 
101  if (isValid()) {
102  char stripType = (getStripType() == 0) ? 'D' : 'H';
103  char bend = (getBend() == 0) ? 'L' : 'R';
104 
105  edm::LogVerbatim("CSCDigi")
106  << " CSC CLCT #" << std::setw(1) << getTrknmb()
107  << ": Valid = " << std::setw(1) << isValid()
108  << " Key Strip = " << std::setw(3) << getKeyStrip()
109  << " Strip = " << std::setw(2) << getStrip()
110  << " Quality = " << std::setw(1) << getQuality()
111  << " Pattern = " << std::setw(1) << getPattern()
112  << " Bend = " << std::setw(1) << bend
113  << " Strip type = " << std::setw(1) << stripType
114  << " CFEB ID = " << std::setw(1) << getCFEB()
115  << " BX = " << std::setw(1) << getBX()
116  << " Full BX= " << std::setw(1) << getFullBX();
117  }
118  else {
119  edm::LogVerbatim("CSCDigi") << "Not a valid Cathode LCT.";
120  }
121 }
122 
123 std::ostream & operator<<(std::ostream & o, const CSCCLCTPreTriggerDigi& digi) {
124  return o << "CSC CLCT #" << digi.getTrknmb()
125  << ": Valid = " << digi.isValid()
126  << " Quality = " << digi.getQuality()
127  << " Pattern = " << digi.getPattern()
128  << " StripType = " << digi.getStripType()
129  << " Bend = " << digi.getBend()
130  << " Strip = " << digi.getStrip()
131  << " KeyStrip = " << digi.getKeyStrip()
132  << " CFEB = " << digi.getCFEB()
133  << " BX = " << digi.getBX();
134 }
PhiMemoryImage pattern1(0x8000, 0, 0, 0x8000, 0, 0, 0x8000, 0, 0, 0x8000, 0, 0)
void print() const
Print content of digi.
int getCFEB() const
return Key CFEB ID
int getStripType() const
return striptype
int getPattern() const
return pattern
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
static const uint16_t valid_
Definition: Constants.h:17
bool operator!=(const CSCCLCTPreTriggerDigi &) const
True if the preceding one is false.
bool operator==(const CSCCLCTPreTriggerDigi &) const
True if the two LCTs have exactly the same members (except the number).
void clear()
clear this CLCT
bool operator>(const CSCCLCTPreTriggerDigi &) const
int getTrknmb() const
return track number (1,2)
int getBend() const
return bend
int getQuality() const
return quality of a pattern (number of layers hit!)
int getBX() const
return BX
PhiMemoryImage pattern2(0x10000, 0, 0, 0x8000, 0, 0, 0xc000, 0, 0, 0xc000, 0, 0)
int getFullBX() const
return 12-bit full BX.
int getStrip() const
return halfstrip that goes from 0 to 31
bool isValid() const
check CLCT validity (1 - valid CLCT)