CMS 3D CMS Logo

SAMuon.h
Go to the documentation of this file.
1 #ifndef DataFormatsL1TMuonPhase2_SAMuon_h
2 #define DataFormatsL1TMuonPhase2_SAMuon_h
3 
12 
13 namespace l1t {
14 
15  class SAMuon;
16 
17  typedef std::vector<SAMuon> SAMuonCollection;
19  typedef std::vector<edm::Ref<SAMuonCollection> > SAMuonRefVector;
20 
21  class SAMuon : public L1Candidate {
22  public:
23  SAMuon();
24 
25  SAMuon(const l1t::Muon& mu, bool charge, uint pt, int eta, int phi, int z0, int d0, uint quality);
26 
27  ~SAMuon() override;
28 
29  const bool hwCharge() const { return hwCharge_; }
30  const int hwZ0() const { return hwZ0_; }
31  const int hwD0() const { return hwD0_; }
32  const uint hwBeta() const { return hwBeta_; }
33  void setBeta(uint beta) { hwBeta_ = beta; }
34  void setTF(tftype tf) { tf_ = tf; }
35  unsigned int trackID() const { return trackID_; }
36 
37  void setTrackID(unsigned int ID) { trackID_ = ID; }
38 
39  const tftype tfType() const { return tf_; }
40  // For GT, returning ap_ type
41  const Phase2L1GMT::valid_sa_t apValid() const { return Phase2L1GMT::valid_sa_t(hwPt() > 0); };
42  const Phase2L1GMT::pt_sa_t apPt() const { return Phase2L1GMT::pt_sa_t(hwPt()); };
45  const Phase2L1GMT::z0_sa_t apZ0() const { return Phase2L1GMT::z0_sa_t(hwZ0()); };
46  const Phase2L1GMT::d0_sa_t apD0() const { return Phase2L1GMT::d0_sa_t(hwD0()); };
49 
50  // For HLT
51  const double phZ0() const { return Phase2L1GMT::LSBSAz0 * hwZ0(); }
52  const double phD0() const { return Phase2L1GMT::LSBSAd0 * hwD0(); }
53  const double phPt() const { return Phase2L1GMT::LSBpt * hwPt(); }
54  const double phEta() const { return Phase2L1GMT::LSBeta * hwEta(); }
55  const double phPhi() const { return Phase2L1GMT::LSBphi * hwPhi(); }
56  const int phCharge() const { return pow(-1, hwCharge()); }
57 
58  const uint64_t word() const { return word_; }
60  void print() const;
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  bool operator>(const SAMuon& other) const {
69  if (hwPt() == other.hwPt())
70  return (hwEta() > other.hwEta());
71  else
72  return (hwPt() > other.hwPt());
73  }
74 
75  void addStub(const MuonStubRef& stub) { stubs_.push_back(stub); }
77  const MuonStubRefVector stubs() const { return stubs_; }
78 
79  private:
80  bool hwCharge_;
81  int hwZ0_;
82  int hwD0_;
86  unsigned int trackID_;
88  };
89 } // namespace l1t
90 
91 #endif
const Phase2L1GMT::valid_sa_t apValid() const
Definition: SAMuon.h:41
const float LSBphi
Definition: Constants.h:93
unsigned int trackID() const
Definition: SAMuon.h:35
bool operator<(const SAMuon &other) const
Definition: SAMuon.h:62
uint hwBeta_
Definition: SAMuon.h:83
const bool hwCharge() const
Definition: SAMuon.h:29
double pt() const final
transverse momentum
ap_uint< BITSGTPT > pt_sa_t
Definition: Constants.h:116
bool operator>(const SAMuon &other) const
Definition: SAMuon.h:68
ap_uint< BITSSAQUAL > qual_sa_t
Definition: Constants.h:122
const float LSBSAz0
Definition: Constants.h:98
uint32_t ID
Definition: Definitions.h:24
const uint hwBeta() const
Definition: SAMuon.h:32
ap_uint< 1 > q_sa_t
Definition: Constants.h:121
void setWord(uint64_t word)
Definition: SAMuon.h:59
int hwPhi() const
Definition: L1Candidate.h:37
unsigned int trackID_
Definition: SAMuon.h:86
const MuonStubRefVector stubs() const
Definition: SAMuon.h:77
delete x;
Definition: CaloConfig.h:22
void print() const
Definition: SAMuon.cc:20
ap_int< BITSSAD0 > d0_sa_t
Definition: Constants.h:120
const int hwD0() const
Definition: SAMuon.h:31
const Phase2L1GMT::phi_sa_t apPhi() const
Definition: SAMuon.h:43
std::vector< edm::Ref< SAMuonCollection > > SAMuonRefVector
Definition: SAMuon.h:19
const Phase2L1GMT::d0_sa_t apD0() const
Definition: SAMuon.h:46
int hwZ0_
Definition: SAMuon.h:81
const float LSBSAd0
Definition: Constants.h:99
int hwQual() const
Definition: L1Candidate.h:38
std::vector< edm::Ref< MuonStubCollection > > MuonStubRefVector
Definition: MuonStub.h:44
const Phase2L1GMT::q_sa_t apCharge() const
Definition: SAMuon.h:47
void setBeta(uint beta)
Definition: SAMuon.h:33
string quality
const Phase2L1GMT::eta_sa_t apEta() const
Definition: SAMuon.h:44
tftype tf_
Definition: SAMuon.h:87
uint64_t word
const float LSBpt
Definition: Constants.h:92
const Phase2L1GMT::z0_sa_t apZ0() const
Definition: SAMuon.h:45
bool hwCharge_
Definition: SAMuon.h:80
const double phEta() const
Definition: SAMuon.h:54
ap_int< BITSGTETA > eta_sa_t
Definition: Constants.h:118
const Phase2L1GMT::qual_sa_t apQualFlags() const
Definition: SAMuon.h:48
uint64_t word_
Definition: SAMuon.h:84
const Phase2L1GMT::pt_sa_t apPt() const
Definition: SAMuon.h:42
SAMuon()
Definition: SAMuon.cc:6
void setTF(tftype tf)
Definition: SAMuon.h:34
int hwEta() const
Definition: L1Candidate.h:36
edm::Ref< SAMuonCollection > SAMuonRef
Definition: SAMuon.h:18
int hwD0_
Definition: SAMuon.h:82
const uint64_t word() const
Definition: SAMuon.h:58
Definition: Muon.h:21
const double phPt() const
Definition: SAMuon.h:53
const float LSBeta
Definition: Constants.h:94
const tftype tfType() const
Definition: SAMuon.h:39
const double phD0() const
Definition: SAMuon.h:52
static constexpr float d0
MuonStubRefVector stubs_
Definition: SAMuon.h:85
std::vector< SAMuon > SAMuonCollection
Definition: SAMuon.h:15
int hwPt() const
Definition: L1Candidate.h:35
unsigned long long uint64_t
Definition: Time.h:13
const int phCharge() const
Definition: SAMuon.h:56
const int hwZ0() const
Definition: SAMuon.h:30
ap_int< BITSSAZ0 > z0_sa_t
Definition: Constants.h:119
void setTrackID(unsigned int ID)
Definition: SAMuon.h:37
~SAMuon() override
Definition: SAMuon.cc:18
ap_uint< 1 > valid_sa_t
Definition: Constants.h:115
const double phZ0() const
Definition: SAMuon.h:51
double phi() const final
momentum azimuthal angle
ap_int< BITSGTPHI > phi_sa_t
Definition: Constants.h:117
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
void setStubs(const MuonStubRefVector &stubs)
Definition: SAMuon.h:76
int charge() const final
electric charge
const double phPhi() const
Definition: SAMuon.h:55
void addStub(const MuonStubRef &stub)
Definition: SAMuon.h:75
double eta() const final
momentum pseudorapidity