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
trklet::MatchEngineUnit::~MatchEngineUnit
~MatchEngineUnit()=default
trklet::MatchEngineUnit::active
bool active() const
Definition: MatchEngineUnit.h:53
trklet::VMStubsMEMemory
Definition: VMStubsMEMemory.h:16
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
trklet::MatchEngineUnit::havepair_
bool havepair_
Definition: MatchEngineUnit.h:95
trklet::MatchEngineUnit::init
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)
Definition: MatchEngineUnit.cc:18
trklet::TrackletLUT
Definition: TrackletLUT.h:12
trklet::MatchEngineUnit::projrinv_
int projrinv_
Definition: MatchEngineUnit.h:78
trklet::MatchEngineUnit::peek
std::pair< Tracklet *, const Stub * > peek() const
Definition: MatchEngineUnit.h:47
trklet::Tracklet
Definition: Tracklet.h:27
trklet::MatchEngineUnit::layerdisk_
unsigned int layerdisk_
Definition: MatchEngineUnit.h:87
trklet::MatchEngineUnit::istub_
unsigned int istub_
Definition: MatchEngineUnit.h:74
trklet::MatchEngineUnit::wptr
unsigned int wptr() const
Definition: MatchEngineUnit.h:62
trklet::MatchEngineUnit::read
std::pair< Tracklet *, const Stub * > read()
Definition: MatchEngineUnit.h:45
trklet::MatchEngineUnit::rzbin_
unsigned int rzbin_
Definition: MatchEngineUnit.h:70
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
trklet::MatchEngineUnit::luttable_
const TrackletLUT & luttable_
Definition: MatchEngineUnit.h:90
CircularBuffer.h
trklet::MatchEngineUnit::goodpair__
bool goodpair__
Definition: MatchEngineUnit.h:94
trklet::MatchEngineUnit::candmatches_
CircularBuffer< std::pair< Tracklet *, const Stub * > > candmatches_
Definition: MatchEngineUnit.h:98
trklet::MatchEngineUnit::currentProj
Tracklet * currentProj() const
Definition: MatchEngineUnit.h:49
trklet::MatchEngineUnit::barrel_
bool barrel_
Definition: MatchEngineUnit.h:77
trklet::MatchEngineUnit::MatchEngineUnit
MatchEngineUnit(bool barrel, unsigned int layerdisk, const TrackletLUT &luttable)
Definition: MatchEngineUnit.cc:7
trklet::MatchEngineUnit::empty
bool empty() const
Definition: MatchEngineUnit.h:41
trklet::MatchEngineUnit::nrzbins_
unsigned int nrzbins_
Definition: MatchEngineUnit.h:69
VMStubsMEMemory.h
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
trklet::CircularBuffer
Definition: CircularBuffer.h:10
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
trklet::MatchEngineUnit::TCID
int TCID() const
Definition: MatchEngineUnit.cc:183
trklet::MatchEngineUnit::have_
bool have_() const
Definition: MatchEngineUnit.h:56
trklet::MatchEngineUnit::proj_
Tracklet * proj_
Definition: MatchEngineUnit.h:83
trklet::MatchEngineUnit::idle_
bool idle_
Definition: MatchEngineUnit.h:85
trklet::MatchEngineUnit::vmstubsmemory_
VMStubsMEMemory * vmstubsmemory_
Definition: MatchEngineUnit.h:67
trklet::MatchEngineUnit::step
void step(bool print)
Definition: MatchEngineUnit.cc:76
trklet::MatchEngineUnit::use_
std::vector< std::pair< unsigned int, unsigned int > > use_
Definition: MatchEngineUnit.h:81
trklet
Definition: AllInnerStubsMemory.h:10
trklet::MatchEngineUnit::have__
bool have__() const
Definition: MatchEngineUnit.h:57
trklet::MatchEngineUnit::reset
void reset()
Definition: MatchEngineUnit.cc:173
trklet::MatchEngineUnit::isPSseed_
bool isPSseed_
Definition: MatchEngineUnit.h:82
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
trklet::MatchEngineUnit::havepair__
bool havepair__
Definition: MatchEngineUnit.h:95
trklet::MatchEngineUnit::shift_
int shift_
Definition: MatchEngineUnit.h:72
trklet::MatchEngineUnit::tmppair_
std::pair< Tracklet *, const Stub * > tmppair_
Definition: MatchEngineUnit.h:93
MemoryBase.h
trklet::MatchEngineUnit::projfinephi_
int projfinephi_
Definition: MatchEngineUnit.h:80
trklet::MatchEngineUnit
Definition: MatchEngineUnit.h:19
trklet::MatchEngineUnit::projfinerz_
int projfinerz_
Definition: MatchEngineUnit.h:79
trklet::MatchEngineUnit::iuse_
unsigned int iuse_
Definition: MatchEngineUnit.h:75
trklet::MatchEngineUnit::phibin_
unsigned int phibin_
Definition: MatchEngineUnit.h:71
trklet::MatchEngineUnit::idle
bool idle() const
Definition: MatchEngineUnit.h:51
trklet::MatchEngineUnit::rptr
unsigned int rptr() const
Definition: MatchEngineUnit.h:61
trklet::MatchEngineUnit::tmppair__
std::pair< Tracklet *, const Stub * > tmppair__
Definition: MatchEngineUnit.h:93
Tracklet.h
trklet::MatchEngineUnit::goodpair_
bool goodpair_
Definition: MatchEngineUnit.h:94