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 GT, returning ap_ type
35  const Phase2L1GMT::valid_sa_t apValid() const { return Phase2L1GMT::valid_sa_t(hwPt() > 0); };
36  const Phase2L1GMT::pt_sa_t apPt() const { return Phase2L1GMT::pt_sa_t(hwPt()); };
39  const Phase2L1GMT::z0_sa_t apZ0() const { return Phase2L1GMT::z0_sa_t(hwZ0()); };
40  const Phase2L1GMT::d0_sa_t apD0() const { return Phase2L1GMT::d0_sa_t(hwD0()); };
43 
44  // For HLT
45  const double phZ0() const { return Phase2L1GMT::LSBSAz0 * hwZ0(); }
46  const double phD0() const { return Phase2L1GMT::LSBSAd0 * hwD0(); }
47  const double phPt() const { return Phase2L1GMT::LSBpt * hwPt(); }
48  const double phEta() const { return Phase2L1GMT::LSBeta * hwEta(); }
49  const double phPhi() const { return Phase2L1GMT::LSBphi * hwPhi(); }
50  const int phCharge() const { return pow(-1, hwCharge()); }
51 
52  const uint64_t word() const { return word_; }
54  void print() const;
55 
56  bool operator<(const SAMuon& other) const {
57  if (hwPt() == other.hwPt())
58  return (hwEta() < other.hwEta());
59  else
60  return (hwPt() < other.hwPt());
61  }
62  bool operator>(const SAMuon& other) const {
63  if (hwPt() == other.hwPt())
64  return (hwEta() > other.hwEta());
65  else
66  return (hwPt() > other.hwPt());
67  }
68 
69  private:
70  bool hwCharge_;
71  int hwZ0_;
72  int hwD0_;
75  };
76 } // namespace l1t
77 
78 #endif
const Phase2L1GMT::valid_sa_t apValid() const
Definition: SAMuon.h:35
const float LSBphi
Definition: Constants.h:92
bool operator<(const SAMuon &other) const
Definition: SAMuon.h:56
uint hwBeta_
Definition: SAMuon.h:73
const bool hwCharge() const
Definition: SAMuon.h:28
double pt() const final
transverse momentum
ap_uint< BITSGTPT > pt_sa_t
Definition: Constants.h:113
bool operator>(const SAMuon &other) const
Definition: SAMuon.h:62
ap_uint< BITSSAQUAL > qual_sa_t
Definition: Constants.h:119
const float LSBSAz0
Definition: Constants.h:96
const uint hwBeta() const
Definition: SAMuon.h:31
ap_uint< 1 > q_sa_t
Definition: Constants.h:118
void setWord(uint64_t word)
Definition: SAMuon.h:53
int hwPhi() const
Definition: L1Candidate.h:37
delete x;
Definition: CaloConfig.h:22
void print() const
Definition: SAMuon.cc:13
ap_int< BITSSAD0 > d0_sa_t
Definition: Constants.h:117
const int hwD0() const
Definition: SAMuon.h:30
const Phase2L1GMT::phi_sa_t apPhi() const
Definition: SAMuon.h:37
std::vector< edm::Ref< SAMuonCollection > > SAMuonRefVector
Definition: SAMuon.h:18
const Phase2L1GMT::d0_sa_t apD0() const
Definition: SAMuon.h:40
int hwZ0_
Definition: SAMuon.h:71
const float LSBSAd0
Definition: Constants.h:97
int hwQual() const
Definition: L1Candidate.h:38
const Phase2L1GMT::q_sa_t apCharge() const
Definition: SAMuon.h:41
void setBeta(uint beta)
Definition: SAMuon.h:32
string quality
const Phase2L1GMT::eta_sa_t apEta() const
Definition: SAMuon.h:38
uint64_t word
const float LSBpt
Definition: Constants.h:91
const Phase2L1GMT::z0_sa_t apZ0() const
Definition: SAMuon.h:39
const Phase2L1GMT::qual_sa_t apQual() const
Definition: SAMuon.h:42
bool hwCharge_
Definition: SAMuon.h:70
const double phEta() const
Definition: SAMuon.h:48
ap_int< BITSGTETA > eta_sa_t
Definition: Constants.h:115
uint64_t word_
Definition: SAMuon.h:74
const Phase2L1GMT::pt_sa_t apPt() const
Definition: SAMuon.h:36
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:72
const uint64_t word() const
Definition: SAMuon.h:52
Definition: Muon.h:21
const double phPt() const
Definition: SAMuon.h:47
const float LSBeta
Definition: Constants.h:93
const double phD0() const
Definition: SAMuon.h:46
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:50
const int hwZ0() const
Definition: SAMuon.h:29
ap_int< BITSSAZ0 > z0_sa_t
Definition: Constants.h:116
~SAMuon() override
Definition: SAMuon.cc:11
ap_uint< 1 > valid_sa_t
Definition: Constants.h:112
const double phZ0() const
Definition: SAMuon.h:45
double phi() const final
momentum azimuthal angle
ap_int< BITSGTPHI > phi_sa_t
Definition: Constants.h:114
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:49
double eta() const final
momentum pseudorapidity