CMS 3D CMS Logo

SAMuon.h
Go to the documentation of this file.
1 #ifndef DataFormatsL1TMuonPhase2_SAMuon_h
2 #define DataFormatsL1TMuonPhase2_SAMuon_h
3 
11 
12 namespace l1t {
13 
14  class SAMuon;
15 
16  typedef std::vector<SAMuon> SAMuonCollection;
18  typedef std::vector<edm::Ref<SAMuonCollection> > SAMuonRefVector;
19 
20  class SAMuon : public L1Candidate {
21  public:
22  SAMuon();
23 
24  SAMuon(const l1t::Muon& mu, bool charge, uint pt, int eta, int phi, int z0, int d0, uint quality);
25 
26  ~SAMuon() override;
27 
28  const bool hwCharge() const { return hwCharge_; }
29  const int hwZ0() const { return hwZ0_; }
30  const int hwD0() const { return hwD0_; }
31  const uint hwBeta() const { return hwBeta_; }
32  void setBeta(uint beta) { hwBeta_ = beta; }
33 
34  // For HLT
35  const double phZ0() const { return Phase2L1GMT::LSBSAz0 * hwZ0(); }
36  const double phD0() const { return Phase2L1GMT::LSBSAd0 * hwD0(); }
37  const double phPt() const { return Phase2L1GMT::LSBpt * hwPt(); }
38  const double phEta() const { return Phase2L1GMT::LSBeta * hwEta(); }
39  const double phPhi() const { return Phase2L1GMT::LSBphi * hwPhi(); }
40  const int phCharge() const { return pow(-1, hwCharge()); }
41 
42  const uint64_t word() const { return word_; }
44  void print() const;
45 
46  bool operator<(const SAMuon& other) const {
47  if (hwPt() == other.hwPt())
48  return (hwEta() < other.hwEta());
49  else
50  return (hwPt() < other.hwPt());
51  }
52  bool operator>(const SAMuon& other) const {
53  if (hwPt() == other.hwPt())
54  return (hwEta() > other.hwEta());
55  else
56  return (hwPt() > other.hwPt());
57  }
58 
59  private:
60  bool hwCharge_;
61  int hwZ0_;
62  int hwD0_;
65  };
66 } // namespace l1t
67 
68 #endif
const float LSBphi
Definition: Constants.h:82
bool operator<(const SAMuon &other) const
Definition: SAMuon.h:46
uint hwBeta_
Definition: SAMuon.h:63
const bool hwCharge() const
Definition: SAMuon.h:28
double pt() const final
transverse momentum
bool operator>(const SAMuon &other) const
Definition: SAMuon.h:52
const float LSBSAz0
Definition: Constants.h:86
const uint hwBeta() const
Definition: SAMuon.h:31
void setWord(uint64_t word)
Definition: SAMuon.h:43
int hwPhi() const
Definition: L1Candidate.h:37
delete x;
Definition: CaloConfig.h:22
void print() const
Definition: SAMuon.cc:13
const int hwD0() const
Definition: SAMuon.h:30
std::vector< edm::Ref< SAMuonCollection > > SAMuonRefVector
Definition: SAMuon.h:18
int hwZ0_
Definition: SAMuon.h:61
const float LSBSAd0
Definition: Constants.h:87
void setBeta(uint beta)
Definition: SAMuon.h:32
uint64_t word
const float LSBpt
Definition: Constants.h:81
bool hwCharge_
Definition: SAMuon.h:60
const double phEta() const
Definition: SAMuon.h:38
uint64_t word_
Definition: SAMuon.h:64
SAMuon()
Definition: SAMuon.cc:6
int hwEta() const
Definition: L1Candidate.h:36
edm::Ref< SAMuonCollection > SAMuonRef
Definition: SAMuon.h:17
int hwD0_
Definition: SAMuon.h:62
const uint64_t word() const
Definition: SAMuon.h:42
Definition: Muon.h:21
const double phPt() const
Definition: SAMuon.h:37
const float LSBeta
Definition: Constants.h:83
const double phD0() const
Definition: SAMuon.h:36
static constexpr float d0
std::vector< SAMuon > SAMuonCollection
Definition: SAMuon.h:14
int hwPt() const
Definition: L1Candidate.h:35
unsigned long long uint64_t
Definition: Time.h:13
const int phCharge() const
Definition: SAMuon.h:40
const int hwZ0() const
Definition: SAMuon.h:29
~SAMuon() override
Definition: SAMuon.cc:11
const double phZ0() const
Definition: SAMuon.h:35
string quality
double phi() const final
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
int charge() const final
electric charge
const double phPhi() const
Definition: SAMuon.h:39
double eta() const final
momentum pseudorapidity