CMS 3D CMS Logo

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