CMS 3D CMS Logo

AlgoMuon.cc
Go to the documentation of this file.
2 
3 #include <bitset>
4 #include <iostream>
5 
6 bool AlgoMuon::isValid() const { return m_q >= 0; }
7 
8 bool AlgoMuon::operator<(const AlgoMuon &o) const {
9  if (this->getQ() > o.getQ())
10  return false;
11  else if (this->getQ() == o.getQ() && this->getDisc() > o.getDisc())
12  return false;
13  else if (getQ() == o.getQ() && getDisc() == o.getDisc() && getPatternNumber() > o.getPatternNumber())
14  return false;
15  else if (getQ() == o.getQ() && getDisc() == o.getDisc() && getPatternNumber() == o.getPatternNumber() &&
16  getRefHitNumber() < o.getRefHitNumber())
17  return false;
18  else
19  return true;
20 }
21 
22 std::ostream &operator<<(std::ostream &out, const AlgoMuon &o) {
23  out << "AlgoMuon: ";
24  out << " pt: " << o.getPt() << ", phi: " << o.getPhi() << ", eta: " << o.getEta() * 2.61 / 240
25  << ", hits: " << std::bitset<18>(o.getHits()).to_string() << ", q: " << o.getQ() << ", bx: " << o.getBx()
26  << ", charge: " << o.getCharge() << ", disc: " << o.getDisc() << " refLayer: " << o.getRefLayer();
27 
28  return out;
29 }
int getQ() const
Definition: AlgoMuon.h:39
bool isValid() const
Definition: AlgoMuon.cc:6
std::string to_string(const V &value)
Definition: OMSAccess.h:77
unsigned int getPatternNumber() const
Definition: AlgoMuon.h:44
int m_q
Definition: AlgoMuon.h:72
unsigned int getRefHitNumber() const
Definition: AlgoMuon.h:45
bool operator<(const AlgoMuon &o) const
Definition: AlgoMuon.cc:8
int getDisc() const
Definition: AlgoMuon.h:34
std::ostream & operator<<(std::ostream &out, const AlgoMuon &o)
Definition: AlgoMuon.cc:22