File indexing completed on 2023-03-17 10:50:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include "DataFormats/L1TMuon/interface/L1MuBMTrackSegEta.h"
0019
0020
0021
0022
0023
0024 #include <iostream>
0025 #include <iomanip>
0026 #include <algorithm>
0027 #include <bitset>
0028
0029
0030
0031
0032
0033 #include "DataFormats/L1TMuon/interface/BMTF/L1MuBMTrackSegLoc.h"
0034
0035 using namespace std;
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 L1MuBMTrackSegEta::L1MuBMTrackSegEta() : m_location(), m_position(0), m_quality(0), m_bx(0) {}
0046
0047 L1MuBMTrackSegEta::L1MuBMTrackSegEta(int wheel_id, int sector_id, int station_id, int pos, int quality, int bx)
0048 : m_location(wheel_id, sector_id, station_id), m_position(pos), m_quality(quality), m_bx(bx) {}
0049
0050 L1MuBMTrackSegEta::L1MuBMTrackSegEta(const L1MuBMTrackSegLoc& id, int pos, int quality, int bx)
0051 : m_location(id), m_position(pos), m_quality(quality), m_bx(bx) {}
0052
0053 L1MuBMTrackSegEta::L1MuBMTrackSegEta(const L1MuBMTrackSegEta& id)
0054 : m_location(id.m_location), m_position(id.m_position), m_quality(id.m_quality), m_bx(id.m_bx) {}
0055
0056
0057
0058
0059 L1MuBMTrackSegEta::~L1MuBMTrackSegEta() {}
0060
0061
0062
0063
0064
0065
0066
0067
0068 void L1MuBMTrackSegEta::reset() {
0069 m_position = 0;
0070 m_quality = 0;
0071 m_bx = 0;
0072 }
0073
0074
0075
0076
0077 L1MuBMTrackSegEta& L1MuBMTrackSegEta::operator=(const L1MuBMTrackSegEta& id) {
0078 if (this != &id) {
0079 m_location = id.m_location;
0080 m_position = id.m_position;
0081 m_quality = id.m_quality;
0082 m_bx = id.m_bx;
0083 }
0084 return *this;
0085 }
0086
0087
0088
0089
0090 bool L1MuBMTrackSegEta::operator==(const L1MuBMTrackSegEta& id) const {
0091 if (m_location != id.m_location)
0092 return false;
0093 if (m_position != id.m_position)
0094 return false;
0095 if (m_quality != id.m_quality)
0096 return false;
0097 if (m_bx != id.m_bx)
0098 return false;
0099 return true;
0100 }
0101
0102
0103
0104
0105 bool L1MuBMTrackSegEta::operator!=(const L1MuBMTrackSegEta& id) const {
0106 if (m_location != id.m_location)
0107 return true;
0108 if (m_position != id.m_position)
0109 return true;
0110 if (m_quality != id.m_quality)
0111 return true;
0112 if (m_bx != id.m_bx)
0113 return true;
0114 return false;
0115 }
0116
0117
0118
0119
0120 ostream& operator<<(ostream& s, const L1MuBMTrackSegEta& id) {
0121 s.setf(ios::right, ios::adjustfield);
0122 s << (id.m_location) << "\t"
0123 << "position : " << bitset<7>(id.position()) << " "
0124 << "quality : " << bitset<7>(id.quality());
0125
0126 return s;
0127 }