CMS 3D CMS Logo

L1Track.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 namespace csc {
5 
6  L1Track::L1Track(const csc::L1TrackId& id) : m_name("csc::L1Track") {
7  m_endcap = id.endcap();
8  m_sector = id.sector();
9  m_lphi = 0;
10  m_ptAddress = 0;
11  m_empty = true;
12  setType(2);
13  setPtPacked(0);
14  m_rank = 0;
15  me1_id = 0;
16  me2_id = 0;
17  me3_id = 0;
18  me4_id = 0;
19  mb1_id = 0;
20  m_me1Tbin = 0;
21  m_me2Tbin = 0;
22  m_me3Tbin = 0;
23  m_me4Tbin = 0;
24  m_mbTbin = 0;
25  m_output_link = 0;
26  m_winner = false;
27  m_fr = 0;
28  m_se = true;
29  m_bx0 = true;
30  m_bc0 = true;
31  }
32 
34  : L1MuRegionalCand(rhs.type_idx(),
35  rhs.phi_packed(),
36  rhs.eta_packed(),
37  rhs.pt_packed(),
38  rhs.charge_packed(),
39  rhs.charge_valid_packed(),
40  rhs.finehalo_packed(),
41  rhs.quality_packed(),
42  rhs.bx()),
43  m_name(rhs.m_name) {
44  this->setBx(rhs.bx());
45  this->setDataWord(rhs.getDataWord());
46  m_name = rhs.m_name;
47  this->setType(rhs.type_idx());
48  this->setPhiPacked(rhs.phi_packed());
49  this->setEtaPacked(rhs.eta_packed());
50  this->setPtPacked(rhs.pt_packed());
51  this->setChargePacked(rhs.charge_packed());
54  this->setQualityPacked(rhs.quality_packed());
55  m_empty = rhs.m_empty;
56  m_lphi = rhs.m_lphi;
57  m_endcap = rhs.m_endcap;
58  m_sector = rhs.m_sector;
60  m_rank = rhs.m_rank;
61  me1_id = rhs.me1_id;
62  me2_id = rhs.me2_id;
63  me3_id = rhs.me3_id;
64  me4_id = rhs.me4_id;
65  mb1_id = rhs.mb1_id;
66  m_me1Tbin = rhs.m_me1Tbin;
67  m_me2Tbin = rhs.m_me2Tbin;
68  m_me3Tbin = rhs.m_me3Tbin;
69  m_me4Tbin = rhs.m_me4Tbin;
70  m_mbTbin = rhs.m_mbTbin;
72  m_winner = rhs.m_winner;
73  m_fr = rhs.m_fr;
74  m_se = rhs.m_se;
75  m_bx0 = rhs.m_bx0;
76  m_bc0 = rhs.m_bc0;
77  }
78 
80 
82  if (this != &rhs) {
83  m_fr = rhs.m_fr;
84  m_se = rhs.m_se;
85  m_bx0 = rhs.m_bx0;
86  m_bc0 = rhs.m_bc0;
87  m_empty = rhs.m_empty;
88  this->setBx(rhs.bx());
89  this->setDataWord(rhs.getDataWord());
90  m_name = rhs.m_name;
91  m_lphi = rhs.m_lphi;
92  this->setType(rhs.type_idx());
93  this->setPhiPacked(rhs.phi_packed());
94  this->setEtaPacked(rhs.eta_packed());
95  this->setPtPacked(rhs.pt_packed());
96  this->setChargePacked(rhs.charge_packed());
99  this->setQualityPacked(rhs.quality_packed());
100  m_endcap = rhs.m_endcap;
101  m_sector = rhs.m_sector;
102  m_ptAddress = rhs.m_ptAddress;
103  m_rank = rhs.m_rank;
104  me1_id = rhs.me1_id;
105  me2_id = rhs.me2_id;
106  me3_id = rhs.me3_id;
107  me4_id = rhs.me4_id;
108  mb1_id = rhs.mb1_id;
109  m_me1Tbin = rhs.m_me1Tbin;
110  m_me2Tbin = rhs.m_me2Tbin;
111  m_me3Tbin = rhs.m_me3Tbin;
112  m_me4Tbin = rhs.m_me4Tbin;
113  m_mbTbin = rhs.m_mbTbin;
115  m_winner = rhs.m_winner;
116  }
117  return *this;
118  }
119 
120  unsigned L1Track::rank() const { return m_rank; }
121 
123  const unsigned& me1, const unsigned& me2, const unsigned& me3, const unsigned& me4, const unsigned& mb1) {
124  me1_id = me1;
125  me2_id = me2;
126  me3_id = me3;
127  me4_id = me4;
128  mb1_id = mb1;
129  }
130 
131  unsigned L1Track::encodeRank(const unsigned& pt, const unsigned& quality) {
132  if (pt == 0)
133  return 0;
134  return pt | (quality << L1MuRegionalCand::PT_LENGTH);
135  }
136 
137  void L1Track::decodeRank(const unsigned& rank, unsigned& pt, unsigned& quality) {
138  if (rank == 0) {
139  quality = 0;
140  pt = 0;
141  } else {
143  pt = rank & ((1 << L1MuRegionalCand::PT_LENGTH) - 1);
144  }
145  }
146 
147  bool L1Track::operator>(const csc::L1Track& rhs) const { return (rank() > rhs.rank()); }
148 
149  bool L1Track::operator<(const csc::L1Track& rhs) const { return (rank() < rhs.rank()); }
150 
151  bool L1Track::operator>=(const csc::L1Track& rhs) const { return (rank() >= rhs.rank()); }
152 
153  bool L1Track::operator<=(const csc::L1Track& rhs) const { return (rank() <= rhs.rank()); }
154 
155  bool L1Track::operator==(const csc::L1Track& rhs) const { return (rank() == rhs.rank()); }
156 
157  bool L1Track::operator!=(const csc::L1Track& rhs) const { return (rank() != rhs.rank()); }
158 
159  void L1Track::Print() const {
160  if (!empty()) {
161  std::cout << "\t Pt(int): "
162  << " " << pt_packed() << " Phi(int): "
163  << " " << phi_packed() << " Eta(int): "
164  << " " << eta_packed() << " Quality: "
165  << " " << quality_packed() << " charge: "
166  << " " << charge_packed() << " side: "
167  << " " << endcap() << " bx: "
168  << " " << BX() << " Winner: "
169  << " " << winner() << std::endl;
170  } else {
171  std::cout << "\t Empty track!\n";
172  std::cout << "\t Pt(int): "
173  << " "
174  << "unassigned or zero"
175  << " Phi(int): "
176  << " " << phi_packed() << " Eta(int): "
177  << " " << eta_packed() << " Quality: "
178  << " "
179  << "unassigned or zero"
180  << " charge: "
181  << " " << charge_packed() << " side: "
182  << " " << endcap() << " bx: "
183  << " " << BX() << " Winner: "
184  << " " << winner() << std::endl;
185  }
186  }
187 
188  unsigned L1Track::modeExtended(void) const {
189  unsigned modeExt = mode();
190  unsigned fr = (m_ptAddress >> 21) & 0x1;
191 
192  if (modeExt == 11 && fr == 1)
193  modeExt = 17;
194  else if (modeExt == 12 && fr == 1)
195  modeExt = 18;
196  else if (modeExt == 14 && fr == 1)
197  modeExt = 16;
198  return modeExt;
199  }
200 } // namespace csc
L1MuRegionalCand::bx
int bx() const
return bunch crossing identifier
Definition: L1MuRegionalCand.h:79
L1MuRegionalCand::setPhiPacked
void setPhiPacked(unsigned phi)
Set Phi: 0..143.
Definition: L1MuRegionalCand.h:120
csc::L1Track::m_empty
bool m_empty
Definition: L1Track.h:128
csc::L1Track::m_se
bool m_se
Definition: L1Track.h:132
L1MuRegionalCand::setEtaPacked
void setEtaPacked(unsigned eta)
Set Eta: 6-bit code.
Definition: L1MuRegionalCand.h:135
csc::L1Track::m_fr
unsigned m_fr
Definition: L1Track.h:124
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
L1MuRegionalCand::phi_packed
unsigned phi_packed() const
return phi packed as in hardware
Definition: L1MuRegionalCand.h:86
csc::L1Track::m_me2Tbin
unsigned m_me2Tbin
Definition: L1Track.h:133
gather_cfg.cout
cout
Definition: gather_cfg.py:144
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
csc::L1Track::m_winner
bool m_winner
Definition: L1Track.h:129
csc::L1Track::modeExtended
unsigned modeExtended(void) const
Definition: L1Track.cc:188
csc::L1Track::operator==
bool operator==(const csc::L1Track &) const
Definition: L1Track.cc:155
csc::L1Track::m_mbTbin
unsigned m_mbTbin
Definition: L1Track.h:133
csc::L1Track::~L1Track
~L1Track() override
Definition: L1Track.cc:79
csc::L1Track::me1_id
unsigned me1_id
Definition: L1Track.h:125
csc::L1Track::mode
unsigned mode(void) const
Definition: L1Track.h:90
csc::L1Track::operator>
bool operator>(const csc::L1Track &) const
Definition: L1Track.cc:147
csc::L1Track::L1Track
L1Track()
Definition: L1Track.h:23
csc::L1Track::encodeRank
static unsigned encodeRank(const unsigned &pt, const unsigned &quality)
Definition: L1Track.cc:131
csc::L1Track::endcap
unsigned endcap() const
Definition: L1Track.h:46
L1MuRegionalCand::setType
void setType(unsigned type)
Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC.
Definition: L1MuRegionalCand.h:114
csc::L1Track::BX
int BX() const
Definition: L1Track.h:53
L1MuRegionalCand::getDataWord
unsigned getDataWord() const
return data word
Definition: L1MuRegionalCand.h:107
L1MuRegionalCand::charge_valid_packed
unsigned charge_valid_packed() const
return charge valid packed as in hardware (1=valid, 0=not valid)
Definition: L1MuRegionalCand.h:104
L1MuRegionalCand::quality_packed
unsigned int quality_packed() const
return quality packed as in hardware
Definition: L1MuRegionalCand.h:92
L1MuRegionalCand::setBx
void setBx(int bx)
Set Bunch Crossing.
Definition: L1MuRegionalCand.h:117
csc
Definition: L1Track.h:19
L1Track.h
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
hlt_dqm_clientPB-live_cfg.me2
me2
Definition: hlt_dqm_clientPB-live_cfg.py:73
L1MuRegionalCand::empty
virtual bool empty() const
return empty flag
Definition: L1MuRegionalCand.h:50
csc::L1Track::m_me4Tbin
unsigned m_me4Tbin
Definition: L1Track.h:133
csc::L1Track::m_bc0
bool m_bc0
Definition: L1Track.h:132
csc::L1Track::operator!=
bool operator!=(const csc::L1Track &) const
Definition: L1Track.cc:157
L1MuRegionalCand
Definition: L1MuRegionalCand.h:26
L1MuRegionalCand::setChargeValidPacked
void setChargeValidPacked(unsigned valid)
Set Charge Valid.
Definition: L1MuRegionalCand.h:132
csc::L1Track::m_ptAddress
unsigned m_ptAddress
Definition: L1Track.h:123
csc::L1Track::m_me1Tbin
unsigned m_me1Tbin
Definition: L1Track.h:133
csc::L1Track::m_rank
unsigned m_rank
Definition: L1Track.h:126
csc::L1Track::me2_id
unsigned me2_id
Definition: L1Track.h:125
csc::L1TrackId
Definition: L1TrackId.h:18
L1MuRegionalCand::setDataWord
void setDataWord(unsigned dataword)
Set data word.
Definition: L1MuRegionalCand.h:166
csc::L1Track::decodeRank
static void decodeRank(const unsigned &rank, unsigned &pt, unsigned &quality)
Definition: L1Track.cc:137
L1MuRegionalCand::setPtPacked
void setPtPacked(unsigned pt)
Set Pt: 0..31.
Definition: L1MuRegionalCand.h:123
csc::L1Track::m_me3Tbin
unsigned m_me3Tbin
Definition: L1Track.h:133
csc::L1Track::Print
void Print() const
Definition: L1Track.cc:159
hlt_dqm_clientPB-live_cfg.me1
me1
Definition: hlt_dqm_clientPB-live_cfg.py:68
csc::L1Track::operator<
bool operator<(const csc::L1Track &) const
Definition: L1Track.cc:149
L1MuRegionalCand::PT_LENGTH
Definition: L1MuRegionalCand.h:189
csc::L1Track::operator=
const csc::L1Track & operator=(const csc::L1Track &)
Definition: L1Track.cc:81
csc::L1Track::me3_id
unsigned me3_id
Definition: L1Track.h:125
csc::L1Track::setStationIds
void setStationIds(const unsigned &me1, const unsigned &me2, const unsigned &me3, const unsigned &me4, const unsigned &mb1)
Definition: L1Track.cc:122
csc::L1Track::m_lphi
unsigned m_lphi
Definition: L1Track.h:122
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
MuonStationSelectors_cff.mb1
mb1
Definition: MuonStationSelectors_cff.py:3
csc::L1Track::mb1_id
unsigned mb1_id
Definition: L1Track.h:125
csc::L1Track::rank
unsigned rank() const
Definition: L1Track.cc:120
L1MuRegionalCand::eta_packed
unsigned eta_packed() const
return eta packed as in hardware
Definition: L1MuRegionalCand.h:95
csc::L1Track::m_sector
unsigned m_sector
Definition: L1Track.h:120
L1MuRegionalCand::setChargePacked
void setChargePacked(unsigned ch)
Set Charge (0=pos, 1=neg)
Definition: L1MuRegionalCand.h:129
csc::L1Track::m_endcap
unsigned m_endcap
Definition: L1Track.h:120
csc::L1Track::m_bx0
bool m_bx0
Definition: L1Track.h:132
L1MuRegionalCand::finehalo_packed
unsigned finehalo_packed() const
return eta-fine (for DT) / halo (for CSC) bit
Definition: L1MuRegionalCand.h:98
csc::L1Track
Definition: L1Track.h:21
L1MuRegionalCand::pt_packed
unsigned pt_packed() const
return pt packed as in hardware
Definition: L1MuRegionalCand.h:89
csc::L1Track::me4_id
unsigned me4_id
Definition: L1Track.h:125
csc::L1Track::operator<=
bool operator<=(const csc::L1Track &) const
Definition: L1Track.cc:153
csc::L1Track::m_output_link
unsigned m_output_link
Definition: L1Track.h:127
csc::L1Track::winner
bool winner() const
Definition: L1Track.h:65
csc::L1Track::operator>=
bool operator>=(const csc::L1Track &) const
Definition: L1Track.cc:151
L1MuRegionalCand::type_idx
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
Definition: L1MuRegionalCand.h:76
L1MuRegionalCand::setQualityPacked
void setQualityPacked(unsigned qual)
Set Quality: 0..7.
Definition: L1MuRegionalCand.h:126
L1MuRegionalCand::quality
unsigned int quality() const
return quality
Definition: L1MuRegionalCand.h:73
csc::L1Track::m_name
std::string m_name
Definition: L1Track.h:118
L1MuRegionalCand::charge_packed
unsigned charge_packed() const
return charge packed as in hardware (0=pos, 1=neg)
Definition: L1MuRegionalCand.h:101
L1MuRegionalCand::setFineHaloPacked
void setFineHaloPacked(unsigned fh)
Set Fine / Halo.
Definition: L1MuRegionalCand.h:138