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
trklet::TrackletEngineUnit::settings_
const Settings * settings_
Definition: TrackletEngineUnit.h:68
trklet::TEData::rzbinfirst_
int rzbinfirst_
Definition: TrackletEngineUnit.h:21
trklet::TEData::start_
int start_
Definition: TrackletEngineUnit.h:20
trklet::TrackletEngineUnit::goodpair__
bool goodpair__
Definition: TrackletEngineUnit.h:90
trklet::TEData::rzdiffmax_
int rzdiffmax_
Definition: TrackletEngineUnit.h:22
trklet::TrackletEngineUnit::pttableinnernew_
const TrackletLUT * pttableinnernew_
Definition: TrackletEngineUnit.h:86
TrackletLUT.h
trklet::TrackletEngineUnit::setNearFull
void setNearFull()
Definition: TrackletEngineUnit.h:53
trklet::TrackletEngineUnit::peek
const std::pair< const Stub *, const Stub * > & peek() const
Definition: TrackletEngineUnit.h:49
trklet::Settings
Definition: Settings.h:52
trklet::TrackletEngineUnit::outervmstubs_
VMStubsTEMemory * outervmstubs_
Definition: TrackletEngineUnit.h:66
trklet::TrackletLUT
Definition: TrackletLUT.h:12
trklet::VMStubsTEMemory
Definition: VMStubsTEMemory.h:18
trklet::TrackletEngineUnit::idle_
bool idle_
Definition: TrackletEngineUnit.h:84
trklet::TrackletEngineUnit::layerdisk1_
unsigned int layerdisk1_
Definition: TrackletEngineUnit.h:70
trklet::TrackletEngineUnit::tedata_
TEData tedata_
Definition: TrackletEngineUnit.h:67
trklet::TEData::innerbend_
FPGAWord innerbend_
Definition: TrackletEngineUnit.h:24
trklet::TrackletEngineUnit::nearfull_
bool nearfull_
Definition: TrackletEngineUnit.h:74
CircularBuffer.h
trklet::TrackletEngineUnit::~TrackletEngineUnit
~TrackletEngineUnit()=default
trklet::TEData::innerfinephi_
int innerfinephi_
Definition: TrackletEngineUnit.h:23
trklet::TrackletEngineUnit::nreg_
unsigned int nreg_
Definition: TrackletEngineUnit.h:78
trklet::Stub
Definition: Stub.h:18
trklet::TrackletEngineUnit::next_
unsigned int next_
Definition: TrackletEngineUnit.h:81
trklet::TrackletEngineUnit::nstub_
unsigned int nstub_
Definition: TrackletEngineUnit.h:82
trklet::TrackletEngineUnit
Definition: TrackletEngineUnit.h:28
trklet::TrackletEngineUnit::read
const std::pair< const Stub *, const Stub * > & read()
Definition: TrackletEngineUnit.h:47
trklet::FPGAWord
Definition: FPGAWord.h:9
trklet::TrackletEngineUnit::candpair_
std::pair< const Stub *, const Stub * > candpair_
Definition: TrackletEngineUnit.h:89
trklet::TrackletEngineUnit::iAllStub_
unsigned int iAllStub_
Definition: TrackletEngineUnit.h:75
trklet::TrackletEngineUnit::rptr
int rptr() const
Definition: TrackletEngineUnit.h:59
trklet::CircularBuffer
Definition: CircularBuffer.h:10
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
trklet::TrackletEngineUnit::init
void init(const TEData &tedata)
Definition: TrackletEngineUnit.cc:29
trklet::TrackletEngineUnit::innerStub
const Stub * innerStub() const
Definition: TrackletEngineUnit.h:63
trklet::TrackletEngineUnit::ireg_
unsigned int ireg_
Definition: TrackletEngineUnit.h:80
trklet::TrackletEngineUnit::wptr
int wptr() const
Definition: TrackletEngineUnit.h:61
trklet
Definition: AllInnerStubsMemory.h:10
trklet::TrackletEngineUnit::nbitsfinephi_
unsigned int nbitsfinephi_
Definition: TrackletEngineUnit.h:69
VMStubsTEMemory.h
trklet::TrackletEngineUnit::empty
bool empty() const
Definition: TrackletEngineUnit.h:45
trklet::TrackletEngineUnit::candpairs_
CircularBuffer< std::pair< const Stub *, const Stub * > > candpairs_
Definition: TrackletEngineUnit.h:93
trklet::TrackletEngineUnit::step
void step(bool print, int istep, int iTE)
Definition: TrackletEngineUnit.cc:45
trklet::TEData::stub_
const Stub * stub_
Definition: TrackletEngineUnit.h:19
trklet::TrackletEngineUnit::iSeed_
unsigned int iSeed_
Definition: TrackletEngineUnit.h:72
trklet::TrackletEngineUnit::pttableouternew_
const TrackletLUT * pttableouternew_
Definition: TrackletEngineUnit.h:87
trklet::TrackletEngineUnit::nbitsfinephidiff_
unsigned int nbitsfinephidiff_
Definition: TrackletEngineUnit.h:73
trklet::TrackletEngineUnit::idle
bool idle() const
Definition: TrackletEngineUnit.h:51
trklet::TrackletEngineUnit::TrackletEngineUnit
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)
Definition: TrackletEngineUnit.cc:8
trklet::TEData::regions_
std::vector< std::tuple< int, int, int > > regions_
Definition: TrackletEngineUnit.h:25
trklet::TrackletEngineUnit::goodpair_
bool goodpair_
Definition: TrackletEngineUnit.h:90
trklet::TrackletEngineUnit::candpair__
std::pair< const Stub *, const Stub * > candpair__
Definition: TrackletEngineUnit.h:89
trklet::TrackletEngineUnit::reset
void reset()
Definition: TrackletEngineUnit.cc:38
trklet::TrackletEngineUnit::layerdisk2_
unsigned int layerdisk2_
Definition: TrackletEngineUnit.h:71
trklet::TrackletEngineUnit::istub_
unsigned int istub_
Definition: TrackletEngineUnit.h:79
trklet::TEData
Definition: TrackletEngineUnit.h:18