CMS 3D CMS Logo

MatchEngineUnit.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_MatchEngineUnit_h
2 #define L1Trigger_TrackFindingTracklet_interface_MatchEngineUnit_h
3 
8 
9 #include <cassert>
10 #include <vector>
11 
12 namespace trklet {
13 
14  class Settings;
15  class Stub;
16  class L1TStub;
17  class TrackletLUT;
18 
20  public:
21  MatchEngineUnit(bool barrel, unsigned int layerdisk, const TrackletLUT& luttable);
22 
23  ~MatchEngineUnit() = default;
24 
25  void init(VMStubsMEMemory* vmstubsmemory,
26  unsigned int nrzbin,
27  unsigned int rzbin,
28  unsigned int iphi,
29  int shift,
30  int projrinv,
31  int projfinerz,
32  int projfinephi,
33  bool usefirstMinus,
34  bool usefirstPlus,
35  bool usesecondMinus,
36  bool usesecondPlus,
37  bool isPSseed,
38  Tracklet* proj,
39  bool print);
40 
41  bool empty() const { return candmatches_.empty(); }
42 
43  int TCID() const;
44 
45  std::pair<Tracklet*, const Stub*> read() { return candmatches_.read(); }
46 
47  std::pair<Tracklet*, const Stub*> peek() const { return candmatches_.peek(); }
48 
49  Tracklet* currentProj() const { return proj_; }
50 
51  bool idle() const { return idle_; }
52 
53  bool active() const { return !idle_ || goodpair_ || goodpair__ || !empty(); }
54 
55  //needed for consistency with HLS FW version ("_" vs "__" indicating different pipelining stages)
56  bool have_() const { return havepair_; }
57  bool have__() const { return havepair__; }
58 
59  void reset();
60 
61  unsigned int rptr() const { return candmatches_.rptr(); }
62  unsigned int wptr() const { return candmatches_.wptr(); }
63 
64  void step(bool print);
65 
66  private:
68 
69  unsigned int nrzbins_;
70  unsigned int rzbin_;
71  unsigned int phibin_;
72  int shift_;
73 
74  unsigned int istub_;
75  unsigned int iuse_;
76 
77  bool barrel_;
78  int projrinv_;
81  std::vector<std::pair<unsigned int, unsigned int>> use_;
82  bool isPSseed_;
84 
85  bool idle_;
86 
87  unsigned int layerdisk_;
88 
89  //LUT for bend consistency with rinv
91 
92  //Pipeline variables
93  std::pair<Tracklet*, const Stub*> tmppair_, tmppair__;
96 
97  //save the candidate matches
99  };
100 
101 }; // namespace trklet
102 #endif
unsigned int rptr() const
Tracklet * currentProj() const
void init(VMStubsMEMemory *vmstubsmemory, unsigned int nrzbin, unsigned int rzbin, unsigned int iphi, int shift, int projrinv, int projfinerz, int projfinephi, bool usefirstMinus, bool usefirstPlus, bool usesecondMinus, bool usesecondPlus, bool isPSseed, Tracklet *proj, bool print)
std::pair< Tracklet *, const Stub * > peek() const
CircularBuffer< std::pair< Tracklet *, const Stub * > > candmatches_
std::pair< Tracklet *, const Stub * > read()
const TrackletLUT & luttable_
std::pair< Tracklet *, const Stub * > tmppair_
VMStubsMEMemory * vmstubsmemory_
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
MatchEngineUnit(bool barrel, unsigned int layerdisk, const TrackletLUT &luttable)
std::pair< Tracklet *, const Stub * > tmppair__
std::vector< std::pair< unsigned int, unsigned int > > use_
unsigned int wptr() const
static unsigned int const shift