CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DR.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_DR_h
2 #define L1Trigger_TrackFindingTracklet_DR_h
3 
7 
8 #include <vector>
9 
10 namespace trklet {
11 
19  class DR {
20  public:
21  DR(const edm::ParameterSet& iConfig,
22  const tt::Setup* setup_,
23  const trackerTFP::DataFormats* dataFormats,
24  const ChannelAssignment* channelAssignment,
25  int region);
26  ~DR() {}
27  // read in and organize input tracks and stubs
28  void consume(const tt::StreamsTrack& streamsTrack, const tt::StreamsStub& streamsStub);
29  // fill output products
30  void produce(tt::StreamsStub& accpetedStubs,
31  tt::StreamsTrack& acceptedTracks,
32  tt::StreamsStub& lostStubs,
34 
35  private:
36  struct Stub {
37  Stub(const tt::FrameStub& frame, int stubId, int channel) : frame_(frame), stubId_(stubId), channel_(channel) {}
38  bool operator==(const Stub& s) const { return s.stubId_ == stubId_; }
40  // all stubs id
41  int stubId_;
42  // kf layer id
43  int channel_;
44  };
45  struct Track {
46  // max number of stubs a track may formed of (we allow only one stub per layer)
47  static constexpr int max_ = 7;
48  Track() { stubs_.reserve(max_); }
49  Track(const tt::FrameTrack& frame, const std::vector<Stub*>& stubs) : frame_(frame), stubs_(stubs) {}
51  std::vector<Stub*> stubs_;
52  };
53  // compares two tracks, returns true if those are considered duplicates
54  bool equalEnough(Track* t0, Track* t1) const;
55  // true if truncation is enbaled
57  // provides run-time constants
58  const tt::Setup* setup_;
59  // provides dataformats
61  // helper class to assign tracks to channel
63  // processing region (0 - 8) aka processing phi nonant
64  const int region_;
65  // storage of input tracks
66  std::vector<Track> tracks_;
67  // storage of input stubs
68  std::vector<Stub> stubs_;
69  // h/w liked organized pointer to input tracks
70  std::vector<std::vector<Track*>> input_;
71  };
72 
73 } // namespace trklet
74 
75 #endif
std::vector< std::vector< Track * > > input_
Definition: DR.h:70
bool enableTruncation_
Definition: DR.h:56
std::vector< StreamTrack > StreamsTrack
Definition: TTTypes.h:67
std::pair< TTStubRef, Frame > FrameStub
Definition: TTTypes.h:60
Class to process and provide run-time constants used by Track Trigger emulators.
Definition: Setup.h:44
std::vector< StreamStub > StreamsStub
Definition: TTTypes.h:66
void consume(const tt::StreamsTrack &streamsTrack, const tt::StreamsStub &streamsStub)
Definition: DR.cc:27
Class to assign tracklet tracks and stubs to output channel based on their Pt or seed type as well as...
int stubId_
Definition: DR.h:41
std::pair< TTTrackRef, Frame > FrameTrack
Definition: TTTypes.h:62
int channel_
Definition: DR.h:43
Track(const tt::FrameTrack &frame, const std::vector< Stub *> &stubs)
Definition: DR.h:49
const int region_
Definition: DR.h:64
void produce(tt::StreamsStub &accpetedStubs, tt::StreamsTrack &acceptedTracks, tt::StreamsStub &lostStubs, tt::StreamsTrack &lostTracks)
Definition: DR.cc:92
bool equalEnough(Track *t0, Track *t1) const
Definition: DR.cc:148
DR(const edm::ParameterSet &iConfig, const tt::Setup *setup_, const trackerTFP::DataFormats *dataFormats, const ChannelAssignment *channelAssignment, int region)
Definition: DR.cc:14
const tt::Setup * setup_
Definition: DR.h:58
static constexpr int max_
Definition: DR.h:47
tt::FrameTrack frame_
Definition: DR.h:50
~DR()
Definition: DR.h:26
const ChannelAssignment * channelAssignment_
Definition: DR.h:62
bool operator==(const Stub &s) const
Definition: DR.h:38
std::vector< Track > tracks_
Definition: DR.h:66
tt::FrameStub frame_
Definition: DR.h:39
std::vector< Stub * > stubs_
Definition: DR.h:51
Class to calculate and provide dataformats used by Track Trigger emulator.
Definition: DataFormats.h:216
std::vector< Stub > stubs_
Definition: DR.h:68
Class to bit- and clock-accurate emulate duplicate removal DR identifies duplicates based on pairs of...
Definition: DR.h:19
const trackerTFP::DataFormats * dataFormats_
Definition: DR.h:60
Stub(const tt::FrameStub &frame, int stubId, int channel)
Definition: DR.h:37