CMS 3D CMS Logo

PurgeDuplicate.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_PurgeDuplicate_h
2 #define L1Trigger_TrackFindingTracklet_interface_PurgeDuplicate_h
3 
7 
8 #include <vector>
9 
10 // Run algorithm to remove duplicate tracks.
11 // Returns Track object that represent output at end of L1 track chain,
12 // (and are later converted to TTTrack). Duplicate Track objects are flagged,
13 // but only deleted if using the Hybrid algo.
14 // Also writes to memory the same tracks in more detailed Tracklet format,
15 // where duplicates are all deleted.
16 
17 namespace trklet {
18 
19  class Settings;
20  class Globals;
21  class MemoryBase;
22  class Stub;
23  class L1TStub;
24  class Track;
25  class Tracklet;
26 
27  class PurgeDuplicate : public ProcessBase {
28  public:
29  PurgeDuplicate(std::string name, Settings const& settings, Globals* global);
30 
31  ~PurgeDuplicate() override = default;
32 
33  void addOutput(MemoryBase* memory, std::string output) override;
34  void addInput(MemoryBase* memory, std::string input) override;
35 
36  void execute(std::vector<Track>& outputtracks, unsigned int iSector);
37 
38  private:
39  double getPhiRes(Tracklet* curTracklet, const Stub* curStub) const;
40  bool isSeedingStub(int, int, int) const;
41  std::string l1tinfo(const L1TStub*, std::string) const;
42  std::pair<int, int> findLayerDisk(const Stub*) const;
43  // calculate stub coordinates based on tracklet trajectory for prompt tracking
44  std::vector<double> getInventedCoords(unsigned int, const Stub*, const Tracklet*) const;
45  // calculate stub coordinates based on tracklet trajectory for extended tracking
46  std::vector<double> getInventedCoordsExtended(unsigned int, const Stub*, const Tracklet*) const;
47  // return stub with invented x,y,z coords, if it's a seeding one for this tracklet
48  std::vector<const Stub*> getInventedSeedingStub(unsigned int,
49  const Tracklet*,
50  const std::vector<const Stub*>&) const;
51  // return the regular rinv bins which contain the input tracklet
52  unsigned int findRinvBin(const Tracklet* trk) const;
53  // return the regular phi bins which contain the input tracklet
54  unsigned int findPhiBin(const Tracklet* trk) const;
55  // return the overlap rinv bins which contain the input tracklet
56  std::vector<unsigned int> findOverlapRinvBins(const Tracklet* trk) const;
57  // return the overlap phi bins which contain the input tracklet
58  std::vector<unsigned int> findOverlapPhiBins(const Tracklet* trk) const;
59  // sort the tracklets into the correct bin by comparing the overlap rinv bin(s) the tracklets are in to the current bin
60  bool isTrackInBin(const std::vector<unsigned int>& vec, unsigned int num) const;
61 
62  std::vector<Track*> inputtracks_;
63  std::vector<std::vector<const Stub*>> inputstublists_;
64  std::vector<std::vector<std::pair<int, int>>> inputstubidslists_;
65  std::vector<std::vector<std::pair<int, int>>> mergedstubidslists_;
66  std::vector<TrackFitMemory*> inputtrackfits_;
67  std::vector<Tracklet*> inputtracklets_;
68  std::vector<CleanTrackMemory*> outputtracklets_;
69  };
70 
71 }; // namespace trklet
72 #endif
std::vector< std::vector< std::pair< int, int > > > inputstubidslists_
Trktree trk
Definition: Trktree.cc:2
double getPhiRes(Tracklet *curTracklet, const Stub *curStub) const
std::vector< CleanTrackMemory * > outputtracklets_
~PurgeDuplicate() override=default
std::vector< Track * > inputtracks_
static std::string const input
Definition: EdmProvDump.cc:50
std::vector< double > getInventedCoords(unsigned int, const Stub *, const Tracklet *) const
std::vector< double > getInventedCoordsExtended(unsigned int, const Stub *, const Tracklet *) const
std::vector< unsigned int > findOverlapPhiBins(const Tracklet *trk) const
unsigned int findPhiBin(const Tracklet *trk) const
void execute(std::vector< Track > &outputtracks, unsigned int iSector)
std::vector< TrackFitMemory * > inputtrackfits_
bool isTrackInBin(const std::vector< unsigned int > &vec, unsigned int num) const
std::pair< int, int > findLayerDisk(const Stub *) const
std::vector< unsigned int > findOverlapRinvBins(const Tracklet *trk) const
void addInput(MemoryBase *memory, std::string input) override
unsigned int findRinvBin(const Tracklet *trk) const
std::vector< Tracklet * > inputtracklets_
std::vector< std::vector< std::pair< int, int > > > mergedstubidslists_
void addOutput(MemoryBase *memory, std::string output) override
std::vector< const Stub * > getInventedSeedingStub(unsigned int, const Tracklet *, const std::vector< const Stub *> &) const
Definition: output.py:1
std::vector< std::vector< const Stub * > > inputstublists_
std::string l1tinfo(const L1TStub *, std::string) const
bool isSeedingStub(int, int, int) const
PurgeDuplicate(std::string name, Settings const &settings, Globals *global)