Go to the documentation of this file.00001
00011 #include <DataFormats/CSCDigi/interface/CSCCLCTDigi.h>
00012
00013 #include <iomanip>
00014 #include <iostream>
00015
00017 CSCCLCTDigi::CSCCLCTDigi(const int valid, const int quality, const int pattern,
00018 const int striptype, const int bend, const int strip,
00019 const int cfeb, const int bx, const int trknmb, const int fullbx):
00020 valid_(valid),
00021 quality_(quality),
00022 pattern_(pattern),
00023 striptype_(striptype),
00024 bend_(bend),
00025 strip_(strip),
00026 cfeb_(cfeb),
00027 bx_(bx),
00028 trknmb_(trknmb),
00029
00030 fullbx_(fullbx)
00031 {
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 }
00042
00044 CSCCLCTDigi::CSCCLCTDigi () :
00045 valid_(0),
00046 quality_(0),
00047 pattern_(0),
00048 striptype_(0),
00049 bend_(0),
00050 strip_(0),
00051 cfeb_(0),
00052 bx_(0),
00053 trknmb_(0),
00054 fullbx_(0)
00055 {
00056
00057 }
00058
00060 void CSCCLCTDigi::clear() {
00061 valid_ = 0;
00062 quality_ = 0;
00063 pattern_ = 0;
00064 striptype_ = 0;
00065 bend_ = 0;
00066 strip_ = 0;
00067 cfeb_ = 0;
00068 bx_ = 0;
00069 trknmb_ = 0;
00070 fullbx_ = 0;
00071 }
00072
00073 bool CSCCLCTDigi::operator > (const CSCCLCTDigi& rhs) const {
00074
00075
00076
00077 bool returnValue = false;
00078
00079 int quality1 = getQuality();
00080 int quality2 = rhs.getQuality();
00081
00082
00083 int pattern1 = getPattern() & 14;
00084 int pattern2 = rhs.getPattern() & 14;
00085
00086
00087
00088
00089
00090
00091
00092 if ((quality1 > quality2) ||
00093 (quality1 == quality2 && pattern1 > pattern2) ||
00094 (quality1 == quality2 && pattern1 == pattern2 &&
00095 getKeyStrip() < rhs.getKeyStrip())) {returnValue = true;}
00096
00097 return returnValue;
00098 }
00099
00100 bool CSCCLCTDigi::operator == (const CSCCLCTDigi& rhs) const {
00101
00102 bool returnValue = false;
00103 if (isValid() == rhs.isValid() && getQuality() == rhs.getQuality() &&
00104 getPattern() == rhs.getPattern() && getKeyStrip()== rhs.getKeyStrip()&&
00105 getStripType() == rhs.getStripType() && getBend() == getBend() &&
00106 getBX() == rhs.getBX()) {
00107 returnValue = true;
00108 }
00109 return returnValue;
00110 }
00111
00112 bool CSCCLCTDigi::operator != (const CSCCLCTDigi& rhs) const {
00113
00114 bool returnValue = true;
00115 if ((*this) == rhs) returnValue = false;
00116 return returnValue;
00117 }
00118
00120 void CSCCLCTDigi::print() const {
00121 if (isValid()) {
00122 char stripType = (getStripType() == 0) ? 'D' : 'H';
00123 char bend = (getBend() == 0) ? 'L' : 'R';
00124
00125 std::cout << " CSC CLCT #" << std::setw(1) << getTrknmb()
00126 << ": Valid = " << std::setw(1) << isValid()
00127 << " Key Strip = " << std::setw(3) << getKeyStrip()
00128 << " Strip = " << std::setw(2) << getStrip()
00129 << " Quality = " << std::setw(1) << getQuality()
00130 << " Pattern = " << std::setw(1) << getPattern()
00131 << " Bend = " << std::setw(1) << bend
00132 << " Strip type = " << std::setw(1) << stripType
00133 << " CFEB ID = " << std::setw(1) << getCFEB()
00134 << " BX = " << std::setw(1) << getBX()
00135 << " Full BX= " << std::setw(1) << getFullBX() << std::endl;
00136 }
00137 else {
00138 std::cout << "Not a valid Cathode LCT." << std::endl;
00139 }
00140 }
00141
00142 std::ostream & operator<<(std::ostream & o, const CSCCLCTDigi& digi) {
00143 return o << "CSC CLCT #" << digi.getTrknmb()
00144 << ": Valid = " << digi.isValid()
00145 << " Quality = " << digi.getQuality()
00146 << " Pattern = " << digi.getPattern()
00147 << " StripType = " << digi.getStripType()
00148 << " Bend = " << digi.getBend()
00149 << " Strip = " << digi.getStrip()
00150 << " KeyStrip = " << digi.getKeyStrip()
00151 << " CFEB = " << digi.getCFEB()
00152 << " BX = " << digi.getBX();
00153 }