File indexing completed on 2024-04-06 12:21:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef L1Trigger_TrackFindingTracklet_interface_MatchEngineUnit_h
0011 #define L1Trigger_TrackFindingTracklet_interface_MatchEngineUnit_h
0012
0013 #include "L1Trigger/TrackFindingTracklet/interface/VMStubsMEMemory.h"
0014 #include "L1Trigger/TrackFindingTracklet/interface/CircularBuffer.h"
0015 #include "L1Trigger/TrackFindingTracklet/interface/Tracklet.h"
0016 #include "L1Trigger/TrackFindingTracklet/interface/MemoryBase.h"
0017
0018 #include <cassert>
0019 #include <vector>
0020
0021 namespace trklet {
0022
0023 class Settings;
0024 class Stub;
0025 class L1TStub;
0026 class TrackletLUT;
0027
0028 class MatchEngineUnit {
0029 public:
0030 MatchEngineUnit(const Settings& settings, bool barrel, unsigned int layerdisk, const TrackletLUT& luttable);
0031
0032 ~MatchEngineUnit() = default;
0033
0034 void init(VMStubsMEMemory* vmstubsmemory,
0035 unsigned int nrzbin,
0036 unsigned int rzbin,
0037 unsigned int iphi,
0038 int shift,
0039 int projrinv,
0040 int projfinerz,
0041 int projfinephi,
0042 bool usefirstMinus,
0043 bool usefirstPlus,
0044 bool usesecondMinus,
0045 bool usesecondPlus,
0046 bool isPSseed,
0047 Tracklet* proj);
0048
0049 bool empty() const { return candmatches_.empty(); }
0050
0051 int TCID() const;
0052
0053 std::pair<Tracklet*, const Stub*> read() { return candmatches_.read(); }
0054
0055 std::pair<Tracklet*, const Stub*> peek() const { return candmatches_.peek(); }
0056
0057 bool idle() const { return idle_; }
0058
0059 bool active() const { return !idle_ || good__ || good____ || !empty(); }
0060
0061 void setAlmostFull();
0062
0063 void setimeu(int imeu) { imeu_ = imeu; }
0064
0065 void setprint(bool print) { print_ = print; }
0066
0067 void reset();
0068
0069 unsigned int rptr() const { return candmatches_.rptr(); }
0070 unsigned int wptr() const { return candmatches_.wptr(); }
0071
0072 void step();
0073
0074 void processPipeline();
0075
0076 private:
0077
0078 const Settings& settings_;
0079
0080 VMStubsMEMemory* vmstubsmemory_;
0081
0082 unsigned int nrzbins_;
0083 unsigned int rzbin_, rzbin__, rzbin____, rzbin___;
0084 unsigned int phibin_;
0085 int shift_;
0086
0087 unsigned int istub_;
0088 unsigned int iuse_;
0089
0090 bool barrel_;
0091 int projrinv_;
0092 int projfinerz_;
0093 int projfinephi_;
0094 std::vector<std::pair<unsigned int, unsigned int>> use_;
0095 bool isPSseed_;
0096 Tracklet* proj_;
0097
0098 bool idle_;
0099
0100 unsigned int layerdisk_;
0101
0102
0103 unsigned int ir2smin_;
0104
0105
0106 bool almostfullsave_;
0107
0108
0109 const TrackletLUT& luttable_;
0110
0111
0112
0113
0114 VMStubME vmstub__, vmstub___, vmstub____;
0115 bool isPSseed__, isPSseed___, isPSseed____;
0116 bool good__, good___, good____;
0117 int projfinerz__, projfinerz___, projfinerz____;
0118 int projfinephi__, projfinephi___, projfinephi____;
0119 int projrinv__, projrinv___, projrinv____;
0120 Tracklet *proj__, *proj___, *proj____;
0121
0122
0123 CircularBuffer<std::pair<Tracklet*, const Stub*>> candmatches_;
0124
0125
0126 int imeu_;
0127 bool print_;
0128 };
0129
0130 };
0131 #endif