CMS 3D CMS Logo

TrackerMuon.h
Go to the documentation of this file.
1 #ifndef DataFormatsL1TMuonPhase2_TrackerMuon_h
2 #define DataFormatsL1TMuonPhase2_TrackerMuon_h
3 
13 
14 namespace l1t {
15 
16  class TrackerMuon;
17 
18  typedef std::vector<TrackerMuon> TrackerMuonCollection;
20  typedef std::vector<edm::Ref<TrackerMuonCollection> > TrackerMuonRefVector;
21 
22  class TrackerMuon : public L1Candidate {
23  public:
25  typedef std::vector<L1TTTrackType> L1TTTrackCollection;
26 
27  TrackerMuon();
28 
30  const edm::Ptr<L1TTTrackType>& trk, bool charge, uint pt, int eta, int phi, int z0, int d0, uint quality);
31 
32  ~TrackerMuon() override;
33 
34  const edm::Ptr<L1TTTrackType>& trkPtr() const { return trkPtr_; }
35  const std::vector<l1t::RegionalMuonCandRef>& muonRef() const { return muRef_; }
36 
37  const bool hwCharge() const { return hwCharge_; }
38  const int hwZ0() const { return hwZ0_; }
39  const int hwD0() const { return hwD0_; }
40  const int hwIsoSum() const { return hwIsoSum_; }
41  const int hwIsoSumAp() const { return hwIsoSumAp_; }
42  const uint hwBeta() const { return hwBeta_; }
43  void setBeta(uint beta) { hwBeta_ = beta; }
44  void setMuonRef(const std::vector<l1t::RegionalMuonCandRef>& p) { muRef_ = p; }
47 
48  // For GT, returning ap_ type
49  const Phase2L1GMT::valid_gt_t apValid() const { return Phase2L1GMT::valid_gt_t(hwPt() > 0); };
50  const Phase2L1GMT::pt_gt_t apPt() const { return Phase2L1GMT::pt_gt_t(hwPt()); };
53  const Phase2L1GMT::z0_gt_t apZ0() const { return Phase2L1GMT::z0_gt_t(hwZ0()); };
54  const Phase2L1GMT::d0_gt_t apD0() const { return Phase2L1GMT::d0_gt_t(hwD0()); };
59 
60  // For HLT
61  const double phZ0() const { return Phase2L1GMT::LSBGTz0 * hwZ0(); }
62  const double phD0() const { return Phase2L1GMT::LSBGTd0 * hwD0(); }
63  const double phPt() const { return Phase2L1GMT::LSBpt * hwPt(); }
64  const double phEta() const { return Phase2L1GMT::LSBeta * hwEta(); }
65  const double phPhi() const { return Phase2L1GMT::LSBphi * hwPhi(); }
66  const int phCharge() const { return pow(-1, hwCharge()); }
67 
68  const std::array<uint64_t, 2> word() const { return word_; }
69  void setWord(std::array<uint64_t, 2> word) { word_ = word; }
70  void print() const;
71  const MuonStubRefVector stubs() const { return stubs_; }
72  void addStub(const MuonStubRef& stub) { stubs_.push_back(stub); }
73 
74  bool operator<(const TrackerMuon& other) const { return (hwPt() < other.hwPt()); }
75  bool operator>(const TrackerMuon& other) const { return (hwPt() > other.hwPt()); }
76 
77  private:
78  // used for the Naive producer
80  bool hwCharge_;
81  int hwZ0_;
82  int hwD0_;
84  // The tracker muon is encoded in 96 bits as a 2-element array of uint64_t
85  std::array<uint64_t, 2> word_ = {{0, 0}};
86  //Store the eneryg sum for isolation
87  int hwIsoSum_;
88  //Store the eneryg sum for isolation with ap_type
90 
91  std::vector<l1t::RegionalMuonCandRef> muRef_;
93  };
94 } // namespace l1t
95 
96 #endif
ap_uint< 1 > valid_gt_t
Definition: Constants.h:100
bool operator>(const TrackerMuon &other) const
Definition: TrackerMuon.h:75
const std::array< uint64_t, 2 > word() const
Definition: TrackerMuon.h:68
const float LSBphi
Definition: Constants.h:92
const int hwZ0() const
Definition: TrackerMuon.h:38
const Phase2L1GMT::valid_gt_t apValid() const
Definition: TrackerMuon.h:49
const Phase2L1GMT::iso_gt_t apIso() const
Definition: TrackerMuon.h:57
const double phPt() const
Definition: TrackerMuon.h:63
double pt() const final
transverse momentum
const Phase2L1GMT::qual_gt_t apQual() const
Definition: TrackerMuon.h:56
const int hwIsoSum() const
Definition: TrackerMuon.h:40
const double phPhi() const
Definition: TrackerMuon.h:65
const uint hwBeta() const
Definition: TrackerMuon.h:42
const Phase2L1GMT::q_gt_t apCharge() const
Definition: TrackerMuon.h:55
int hwPhi() const
Definition: L1Candidate.h:37
ap_uint< 1 > q_gt_t
Definition: Constants.h:101
const float LSBGTz0
Definition: Constants.h:94
delete x;
Definition: CaloConfig.h:22
ap_uint< BITSGTISO > iso_gt_t
Definition: Constants.h:107
const Phase2L1GMT::d0_gt_t apD0() const
Definition: TrackerMuon.h:54
std::vector< l1t::RegionalMuonCandRef > muRef_
Definition: TrackerMuon.h:91
int hwQual() const
Definition: L1Candidate.h:38
const double phEta() const
Definition: TrackerMuon.h:64
std::array< uint64_t, 2 > word_
Definition: TrackerMuon.h:85
std::vector< edm::Ref< MuonStubCollection > > MuonStubRefVector
Definition: MuonStub.h:44
ap_int< BITSGTD0 > d0_gt_t
Definition: Constants.h:106
const MuonStubRefVector stubs() const
Definition: TrackerMuon.h:71
const Phase2L1GMT::phi_gt_t apPhi() const
Definition: TrackerMuon.h:51
string quality
uint64_t word
const float LSBpt
Definition: Constants.h:91
double p() const final
magnitude of momentum vector
void setHwIsoSumAp(int isoSum)
Definition: TrackerMuon.h:46
const float LSBGTd0
Definition: Constants.h:95
const std::vector< l1t::RegionalMuonCandRef > & muonRef() const
Definition: TrackerMuon.h:35
const int hwD0() const
Definition: TrackerMuon.h:39
ap_uint< BITSGTPT > pt_gt_t
Definition: Constants.h:102
bool operator<(const TrackerMuon &other) const
Definition: TrackerMuon.h:74
int hwEta() const
Definition: L1Candidate.h:36
ap_uint< BITSGTBETA > beta_gt_t
Definition: Constants.h:108
edm::Ptr< L1TTTrackType > trkPtr_
Definition: TrackerMuon.h:79
void print() const
Definition: TrackerMuon.cc:23
ap_uint< BITSGTQUAL > qual_gt_t
Definition: Constants.h:109
const int phCharge() const
Definition: TrackerMuon.h:66
~TrackerMuon() override
Definition: TrackerMuon.cc:21
const float LSBeta
Definition: Constants.h:93
void setWord(std::array< uint64_t, 2 > word)
Definition: TrackerMuon.h:69
static constexpr float d0
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
Definition: TrackerMuon.h:24
std::vector< TrackerMuon > TrackerMuonCollection
Definition: TrackerMuon.h:16
int hwPt() const
Definition: L1Candidate.h:35
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
void setBeta(uint beta)
Definition: TrackerMuon.h:43
int hwIso() const
Definition: L1Candidate.h:39
const Phase2L1GMT::beta_gt_t apBeta() const
Definition: TrackerMuon.h:58
ap_int< BITSGTPHI > phi_gt_t
Definition: Constants.h:103
ap_int< BITSGTETA > eta_gt_t
Definition: Constants.h:104
void addStub(const MuonStubRef &stub)
Definition: TrackerMuon.h:72
const Phase2L1GMT::pt_gt_t apPt() const
Definition: TrackerMuon.h:50
const bool hwCharge() const
Definition: TrackerMuon.h:37
isoSum
===> compute the isolation and find the most isolated track
std::vector< L1TTTrackType > L1TTTrackCollection
Definition: TrackerMuon.h:25
edm::Ref< TrackerMuonCollection > TrackerMuonRef
Definition: TrackerMuon.h:19
const Phase2L1GMT::eta_gt_t apEta() const
Definition: TrackerMuon.h:52
const int hwIsoSumAp() const
Definition: TrackerMuon.h:41
double phi() const final
momentum azimuthal angle
const double phZ0() const
Definition: TrackerMuon.h:61
ap_int< BITSGTZ0 > z0_gt_t
Definition: Constants.h:105
const Phase2L1GMT::z0_gt_t apZ0() const
Definition: TrackerMuon.h:53
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
std::vector< edm::Ref< TrackerMuonCollection > > TrackerMuonRefVector
Definition: TrackerMuon.h:20
const edm::Ptr< L1TTTrackType > & trkPtr() const
Definition: TrackerMuon.h:34
MuonStubRefVector stubs_
Definition: TrackerMuon.h:92
int charge() const final
electric charge
void setHwIsoSum(int isoSum)
Definition: TrackerMuon.h:45
void setMuonRef(const std::vector< l1t::RegionalMuonCandRef > &p)
Definition: TrackerMuon.h:44
const double phD0() const
Definition: TrackerMuon.h:62
double eta() const final
momentum pseudorapidity