CMS 3D CMS Logo

TPSAlgorithm.h
Go to the documentation of this file.
1 #ifndef L1Trigger_Phase2GMT_TPSAlgorithm_h
2 #define L1Trigger_Phase2GMT_TPSAlgorithm_h
3 
15 #include <fstream>
16 #include <iostream>
17 
18 namespace Phase2L1GMT {
19 
20  const unsigned int PHIDIVIDER = 1 << (BITSPHI - BITSSTUBCOORD);
21  const unsigned int ETADIVIDER = 1 << (BITSETA - BITSSTUBETA);
22 
23  typedef struct {
24  ap_int<BITSSTUBCOORD> coord1;
25  ap_uint<BITSSIGMACOORD> sigma_coord1;
26  ap_int<BITSSTUBCOORD> coord2;
27  ap_uint<BITSSIGMACOORD> sigma_coord2;
28  ap_int<BITSSTUBETA> eta;
29  ap_uint<BITSSIGMAETA> sigma_eta1;
30  ap_uint<BITSSIGMAETA> sigma_eta2;
31  ap_uint<1> valid;
32  ap_uint<1> is_barrel;
33  } propagation_t;
34 
35  typedef struct {
36  ap_uint<BITSMATCHQUALITY - 2> quality;
37  ap_uint<BITSSTUBID> id;
38  ap_uint<2> valid;
39  bool isGlobal;
42 
43  } match_t;
44 
45  class TPSAlgorithm {
46  public:
47  TPSAlgorithm(const edm::ParameterSet& iConfig);
48  ~TPSAlgorithm();
49 
50  std::vector<PreTrackMatchedMuon> processNonant(const std::vector<ConvertedTTTrack>& convertedTracks,
52 
53  std::vector<PreTrackMatchedMuon> cleanNeighbor(const std::vector<PreTrackMatchedMuon>& muons,
54  const std::vector<PreTrackMatchedMuon>& muonsPrevious,
55  const std::vector<PreTrackMatchedMuon>& muonsNext,
56  bool equality);
57  std::vector<l1t::TrackerMuon> convert(std::vector<PreTrackMatchedMuon>& muons, uint maximum);
58  bool outputGT(std::vector<l1t::TrackerMuon>& muons);
59  void SetQualityBits(std::vector<l1t::TrackerMuon>& muons);
60  std::vector<l1t::TrackerMuon> sort(std::vector<l1t::TrackerMuon>& muons, uint maximum);
61 
62  private:
63  int verbose_;
65  ap_uint<BITSSIGMAETA + 1> deltaEta(const ap_int<BITSSTUBETA>& eta1, const ap_int<BITSSTUBETA>& eta2);
66  ap_uint<BITSSIGMACOORD + 1> deltaCoord(const ap_int<BITSSTUBCOORD>& phi1, const ap_int<BITSSTUBCOORD>& phi2);
67  match_t match(const propagation_t prop, const l1t::MuonStubRef& stub, uint trackID);
69  match_t getBest(const std::vector<match_t> matches);
71  ap_uint<5> cleanMuon(const PreTrackMatchedMuon& mu, const PreTrackMatchedMuon& other, bool eq);
72  void matchingInfos(std::vector<match_t> matchInfo, PreTrackMatchedMuon& muon, ap_uint<BITSMATCHQUALITY>& quality);
73  std::vector<PreTrackMatchedMuon> clean(std::vector<PreTrackMatchedMuon>& muons);
74  };
75 } // namespace Phase2L1GMT
76 
77 #endif
ap_uint< BITSSIGMACOORD > sigma_coord1
Definition: TPSAlgorithm.h:25
const int BITSSTUBCOORD
Definition: Constants.h:31
const int BITSMATCHQUALITY
Definition: Constants.h:41
ap_int< BITSSTUBCOORD > coord1
Definition: TPSAlgorithm.h:24
match_t propagateAndMatch(const ConvertedTTTrack &track, const l1t::MuonStubRef &stub, uint trackID)
propagation_t propagate(const ConvertedTTTrack &track, uint layer)
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
const int BITSSTUBETA
Definition: Constants.h:32
ap_uint< BITSSIGMAETA > sigma_eta2
Definition: TPSAlgorithm.h:30
l1t::MuonStubRef stubRef
Definition: TPSAlgorithm.h:41
ap_uint< BITSSIGMACOORD > sigma_coord2
Definition: TPSAlgorithm.h:27
std::vector< edm::Ref< MuonStubCollection > > MuonStubRefVector
Definition: MuonStub.h:44
l1t::SAMuonRef muRef
Definition: TPSAlgorithm.h:40
string quality
bool outputGT(std::vector< l1t::TrackerMuon > &muons)
Definition: TPSAlgorithm.cc:99
ap_uint< BITSSIGMAETA+1 > deltaEta(const ap_int< BITSSTUBETA > &eta1, const ap_int< BITSSTUBETA > &eta2)
void matchingInfos(std::vector< match_t > matchInfo, PreTrackMatchedMuon &muon, ap_uint< BITSMATCHQUALITY > &quality)
const int BITSETA
Definition: Constants.h:26
void SetQualityBits(std::vector< l1t::TrackerMuon > &muons)
Definition: TPSAlgorithm.cc:86
const int BITSPHI
Definition: Constants.h:25
match_t getBest(const std::vector< match_t > matches)
ap_uint< 5 > cleanMuon(const PreTrackMatchedMuon &mu, const PreTrackMatchedMuon &other, bool eq)
std::vector< PreTrackMatchedMuon > processNonant(const std::vector< ConvertedTTTrack > &convertedTracks, const l1t::MuonStubRefVector &stubs)
Definition: TPSAlgorithm.cc:9
ap_uint< BITSMATCHQUALITY - 2 > quality
Definition: TPSAlgorithm.h:36
ap_uint< BITSSIGMAETA > sigma_eta1
Definition: TPSAlgorithm.h:29
ap_uint< 2 > valid
Definition: TPSAlgorithm.h:38
ap_uint< BITSSIGMACOORD+1 > deltaCoord(const ap_int< BITSSTUBCOORD > &phi1, const ap_int< BITSSTUBCOORD > &phi2)
ap_uint< BITSSTUBID > id
Definition: TPSAlgorithm.h:37
std::vector< l1t::TrackerMuon > convert(std::vector< PreTrackMatchedMuon > &muons, uint maximum)
Definition: TPSAlgorithm.cc:58
std::vector< PreTrackMatchedMuon > cleanNeighbor(const std::vector< PreTrackMatchedMuon > &muons, const std::vector< PreTrackMatchedMuon > &muonsPrevious, const std::vector< PreTrackMatchedMuon > &muonsNext, bool equality)
Definition: TPSAlgorithm.cc:21
ap_int< BITSSTUBETA > eta
Definition: TPSAlgorithm.h:28
const unsigned int PHIDIVIDER
Definition: TPSAlgorithm.h:20
std::vector< PreTrackMatchedMuon > clean(std::vector< PreTrackMatchedMuon > &muons)
PreTrackMatchedMuon processTrack(const ConvertedTTTrack &, const l1t::MuonStubRefVector &)
std::vector< l1t::TrackerMuon > sort(std::vector< l1t::TrackerMuon > &muons, uint maximum)
TPSAlgorithm(const edm::ParameterSet &iConfig)
Definition: TPSAlgorithm.cc:5
match_t match(const propagation_t prop, const l1t::MuonStubRef &stub, uint trackID)
ap_int< BITSSTUBCOORD > coord2
Definition: TPSAlgorithm.h:26
const unsigned int ETADIVIDER
Definition: TPSAlgorithm.h:21