Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1Trigger_TrackFindingTMTT_Make3Dtracks_h
0002 #define L1Trigger_TrackFindingTMTT_Make3Dtracks_h
0003 
0004 #include "L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h"
0005 #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h"
0006 
0007 #include <vector>
0008 #include <list>
0009 #include <utility>
0010 #include <memory>
0011 
0012 //=== This reconstructs 3D tracks from the 2D tracks found by the Hough transform.
0013 //=== It can do this by simply estimating the r-z helix parameters from the centre of the eta sector
0014 //=== and/or by running an r-z filter (e.g. Seed Filter), which also cleans up the tracks by
0015 //=== checking their stubs consistency with a straight line in the r-z plane.
0016 //===
0017 //=== To create 3D tracks, call run() and then get tracks via trackCands3D().
0018 
0019 namespace tmtt {
0020 
0021   class Settings;
0022   class Stub;
0023   class TP;
0024 
0025   class Make3Dtracks {
0026   public:
0027     // Initialize
0028     Make3Dtracks(const Settings* settings,
0029                  unsigned int iPhiSec,
0030                  unsigned int iEtaReg,
0031                  float etaMinSector,
0032                  float etaMaxSector,
0033                  float phiCentreSector);
0034 
0035     //=== Main routines to make 3D tracks.
0036 
0037     // Make 3D track collections.
0038     void run(const std::list<L1track2D>& vecTracksRphi) {
0039       this->makeUnfilteredTrks(vecTracksRphi);
0040       if (runRZfilter_)
0041         this->makeRZfilteredTrks(vecTracksRphi);
0042     }
0043 
0044     //=== Get 3D tracks.
0045 
0046     // Get 3D tracks (either r-z filtered or unfiltered, depending on the boolean).
0047     // (Each L1track3D object gives access to stubs on each track and helix parameters
0048     // & also to the associated truth tracking particle).
0049     const std::list<L1track3D>& trackCands3D(bool rzFiltered) const {
0050       if (rzFiltered) {
0051         return vecTracks3D_rzFiltered_;
0052       } else {
0053         return vecTracks3D_unfiltered_;
0054       }
0055     }
0056 
0057     // Get all 3D track candidates (either r-z filtered on unfiltered, depending on the boolean),
0058     // that are associated to the given tracking particle.
0059     // (If the std::vector is empty, then the tracking particle was not reconstructed in this sector).
0060     std::vector<const L1track3D*> assocTrackCands3D(const TP& tp, bool rzFiltered) const;
0061 
0062     //=== Access to track r-z filter in case internal info from it required.
0063 
0064     bool ranRZfilter() const { return runRZfilter_; }  // Was r-z filter required/run?
0065 
0066     const TrkRZfilter* rzFilter() const { return rzFilter_.get(); }
0067 
0068   private:
0069     // Convert 2D HT tracks within the current sector to 3D tracks,
0070     // by adding a rough estimate of their r-z helix parameters, without running any r-z track filter.
0071     void makeUnfilteredTrks(const std::list<L1track2D>& vecTracksRphi);
0072 
0073     // Make 3D tracks from the 2D HT tracks within the current sector, by running the r-z track filter.
0074     // The r-z filter also adds an estimate of the r-z helix parameters to each track.
0075     // (Not filled if no track fitter needs the r-z filter).
0076     void makeRZfilteredTrks(const std::list<L1track2D>& vecTracksRphi);
0077 
0078   private:
0079     // Configuration parameters
0080     const Settings* settings_;
0081     unsigned int iPhiSec_;  // Sector number.
0082     unsigned int iEtaReg_;
0083     float etaMinSector_;     // Range of eta sector
0084     float etaMaxSector_;     // Range of eta sector
0085     float phiCentreSector_;  // Phi angle of centre of this (eta,phi) sector.
0086 
0087     bool runRZfilter_;  // Does r-z track filter need to be run.
0088 
0089     // Track filter(s), such as r-z filters, run after the r-phi Hough transform.
0090     std::unique_ptr<TrkRZfilter> rzFilter_;
0091 
0092     // List of all found 3D track candidates and their associated properties.
0093     std::list<L1track3D> vecTracks3D_rzFiltered_;  // After r-z filter run
0094     std::list<L1track3D> vecTracks3D_unfiltered_;  // Before r-z filter run.
0095   };
0096 
0097 }  // namespace tmtt
0098 #endif