File indexing completed on 2024-04-06 12:21:53
0001 #ifndef L1Trigger_TrackFindingTracklet_DR_h
0002 #define L1Trigger_TrackFindingTracklet_DR_h
0003
0004 #include "L1Trigger/TrackTrigger/interface/Setup.h"
0005 #include "L1Trigger/TrackerTFP/interface/DataFormats.h"
0006 #include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.h"
0007
0008 #include <vector>
0009
0010 namespace trklet {
0011
0012
0013
0014
0015
0016
0017
0018
0019 class DR {
0020 public:
0021 DR(const edm::ParameterSet& iConfig,
0022 const tt::Setup* setup_,
0023 const trackerTFP::DataFormats* dataFormats,
0024 const ChannelAssignment* channelAssignment,
0025 int region);
0026 ~DR() {}
0027
0028 void consume(const tt::StreamsTrack& streamsTrack, const tt::StreamsStub& streamsStub);
0029
0030 void produce(tt::StreamsStub& accpetedStubs,
0031 tt::StreamsTrack& acceptedTracks,
0032 tt::StreamsStub& lostStubs,
0033 tt::StreamsTrack& lostTracks);
0034
0035 private:
0036 struct Stub {
0037 Stub(const tt::FrameStub& frame, int stubId, int channel) : frame_(frame), stubId_(stubId), channel_(channel) {}
0038 bool operator==(const Stub& s) const { return s.stubId_ == stubId_; }
0039 tt::FrameStub frame_;
0040
0041 int stubId_;
0042
0043 int channel_;
0044 };
0045 struct Track {
0046
0047 static constexpr int max_ = 7;
0048 Track() { stubs_.reserve(max_); }
0049 Track(const tt::FrameTrack& frame, const std::vector<Stub*>& stubs) : frame_(frame), stubs_(stubs) {}
0050 tt::FrameTrack frame_;
0051 std::vector<Stub*> stubs_;
0052 };
0053
0054 bool equalEnough(Track* t0, Track* t1) const;
0055
0056 bool enableTruncation_;
0057
0058 const tt::Setup* setup_;
0059
0060 const trackerTFP::DataFormats* dataFormats_;
0061
0062 const ChannelAssignment* channelAssignment_;
0063
0064 const int region_;
0065
0066 std::vector<Track> tracks_;
0067
0068 std::vector<Stub> stubs_;
0069
0070 std::vector<std::vector<Track*>> input_;
0071 };
0072
0073 }
0074
0075 #endif