Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:55

0001 #ifndef L1Trigger_TrackFindingTracklet_interface_PurgeDuplicate_h
0002 #define L1Trigger_TrackFindingTracklet_interface_PurgeDuplicate_h
0003 
0004 #include "L1Trigger/TrackFindingTracklet/interface/TrackFitMemory.h"
0005 #include "L1Trigger/TrackFindingTracklet/interface/CleanTrackMemory.h"
0006 #include "L1Trigger/TrackFindingTracklet/interface/ProcessBase.h"
0007 
0008 #include <vector>
0009 
0010 // Run algorithm to remove duplicate tracks.
0011 // Returns Track object that represent output at end of L1 track chain,
0012 // (and are later converted to TTTrack). Duplicate Track objects are flagged,
0013 // but only deleted if using the Hybrid algo.
0014 // Also writes to memory the same tracks in more detailed Tracklet format,
0015 // where duplicates are all deleted.
0016 
0017 namespace trklet {
0018 
0019   class Settings;
0020   class Globals;
0021   class MemoryBase;
0022   class Stub;
0023   class L1TStub;
0024   class Track;
0025   class Tracklet;
0026 
0027   class PurgeDuplicate : public ProcessBase {
0028   public:
0029     PurgeDuplicate(std::string name, Settings const& settings, Globals* global);
0030 
0031     ~PurgeDuplicate() override = default;
0032 
0033     void addOutput(MemoryBase* memory, std::string output) override;
0034     void addInput(MemoryBase* memory, std::string input) override;
0035 
0036     void execute(std::vector<Track>& outputtracks, unsigned int iSector);
0037 
0038   private:
0039     double getPhiRes(Tracklet* curTracklet, const Stub* curStub) const;
0040     bool isSeedingStub(int, int, int) const;
0041     std::string l1tinfo(const L1TStub*, std::string) const;
0042     std::pair<int, int> findLayerDisk(const Stub*) const;
0043     // calculate stub coordinates based on tracklet trajectory for prompt tracking
0044     std::vector<double> getInventedCoords(unsigned int, const Stub*, const Tracklet*) const;
0045     // calculate stub coordinates based on tracklet trajectory for extended tracking
0046     std::vector<double> getInventedCoordsExtended(unsigned int, const Stub*, const Tracklet*) const;
0047     // return stub with invented x,y,z coords, if it's a seeding one for this tracklet
0048     std::vector<const Stub*> getInventedSeedingStub(unsigned int,
0049                                                     const Tracklet*,
0050                                                     const std::vector<const Stub*>&) const;
0051     // return the regular rinv bins which contain the input tracklet
0052     unsigned int findRinvBin(const Tracklet* trk) const;
0053     // return the regular phi bins which contain the input tracklet
0054     unsigned int findPhiBin(const Tracklet* trk) const;
0055     // return the overlap rinv bins which contain the input tracklet
0056     std::vector<unsigned int> findOverlapRinvBins(const Tracklet* trk) const;
0057     // return the overlap phi bins which contain the input tracklet
0058     std::vector<unsigned int> findOverlapPhiBins(const Tracklet* trk) const;
0059     // sort the tracklets into the correct bin by comparing the overlap rinv bin(s) the tracklets are in to the current bin
0060     bool isTrackInBin(const std::vector<unsigned int>& vec, unsigned int num) const;
0061 
0062     std::vector<Track*> inputtracks_;
0063     std::vector<std::vector<const Stub*>> inputstublists_;
0064     std::vector<std::vector<std::pair<int, int>>> inputstubidslists_;
0065     std::vector<std::vector<std::pair<int, int>>> mergedstubidslists_;
0066     std::vector<TrackFitMemory*> inputtrackfits_;
0067     std::vector<Tracklet*> inputtracklets_;
0068     std::vector<CleanTrackMemory*> outputtracklets_;
0069   };
0070 
0071 };  // namespace trklet
0072 #endif