CMS 3D CMS Logo

TrackletEngineUnit.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_TrackletEngineUnit_h
2 #define L1Trigger_TrackFindingTracklet_interface_TrackletEngineUnit_h
3 
7 
8 #include <cassert>
9 #include <vector>
10 
11 namespace trklet {
12 
13  class Settings;
14  class Stub;
15  class L1TStub;
16  class FPGAWord;
17 
18  struct TEData {
19  const Stub* stub_;
20  int start_;
25  std::vector<std::tuple<int, int, int> > regions_; // next z/r bin; phi-region; nstub
26  };
27 
29  public:
30  TrackletEngineUnit(const Settings* const settings,
31  unsigned int nbitsfinephi,
32  unsigned int layerdisk1,
33  unsigned int layerdisk2,
34  unsigned int iSeed,
35  unsigned int nbitsfinephiediff,
36  unsigned int iAllStub,
37  const TrackletLUT* pttableinnernew,
38  const TrackletLUT* pttableouternew,
39  VMStubsTEMemory* outervmstubs);
40 
41  ~TrackletEngineUnit() = default;
42 
43  void init(const TEData& tedata);
44 
45  bool empty() const { return candpairs_.empty(); }
46 
47  const std::pair<const Stub*, const Stub*>& read() { return candpairs_.read(); }
48 
49  const std::pair<const Stub*, const Stub*>& peek() const { return candpairs_.peek(); }
50 
51  bool idle() const { return idle_; }
52 
53  void setNearFull() { nearfull_ = candpairs_.nearfull(); }
54 
55  void reset();
56 
57  void step(bool print, int istep, int iTE);
58 
59  int rptr() const { return candpairs_.rptr(); }
60 
61  int wptr() const { return candpairs_.wptr(); }
62 
63  const Stub* innerStub() const { return tedata_.stub_; }
64 
65  private:
69  unsigned int nbitsfinephi_;
70  unsigned int layerdisk1_;
71  unsigned int layerdisk2_;
72  unsigned int iSeed_;
73  unsigned int nbitsfinephidiff_;
74  bool nearfull_; //initialized at start of each processing step
75  unsigned int iAllStub_;
76 
77  //unsigned int memory slot
78  unsigned int nreg_;
79  unsigned int istub_;
80  unsigned int ireg_;
81  unsigned int next_;
82  unsigned int nstub_;
83 
84  bool idle_;
85 
88 
89  std::pair<const Stub*, const Stub*> candpair_, candpair__;
91 
92  //save the candidate matches
94  }; // TrackletEngineUnit
95 
96 }; // namespace trklet
97 #endif
const std::pair< const Stub *, const Stub * > & read()
std::pair< const Stub *, const Stub * > candpair__
TrackletEngineUnit(const Settings *const settings, unsigned int nbitsfinephi, unsigned int layerdisk1, unsigned int layerdisk2, unsigned int iSeed, unsigned int nbitsfinephiediff, unsigned int iAllStub, const TrackletLUT *pttableinnernew, const TrackletLUT *pttableouternew, VMStubsTEMemory *outervmstubs)
std::pair< const Stub *, const Stub * > candpair_
const TrackletLUT * pttableinnernew_
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
const TrackletLUT * pttableouternew_
const Stub * stub_
VMStubsTEMemory * outervmstubs_
const Stub * innerStub() const
const std::pair< const Stub *, const Stub * > & peek() const
void init(const TEData &tedata)
CircularBuffer< std::pair< const Stub *, const Stub * > > candpairs_
void step(bool print, int istep, int iTE)
std::vector< std::tuple< int, int, int > > regions_