Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:21:59

0001 #ifndef __MvtxStandaloneTracking_h__
0002 #define __MvtxStandaloneTracking_h__
0003 
0004 #include <vector>
0005 #include <set>
0006 
0007 #include <TMatrixD.h>
0008 #include <TVectorD.h>
0009 
0010 class TrkrCluster;
0011 class TrkrClusterContainer;
0012 class PHCompositeNode;
0013 
0014 class MvtxStandaloneTracking
0015 {
0016 public:
0017 
0018   struct MvtxTrack
0019   {
0020     std::vector<TrkrCluster*> ClusterList;
0021     std::vector<double> dx;
0022     std::vector<double> dz;
0023     double m_xy;
0024     double b_xy;
0025     double chi2_xy;
0026     double m_zy;
0027     double b_zy;
0028     double chi2_zy;
0029   };
0030   typedef std::vector<MvtxTrack> MvtxTrackList;
0031 
0032   //! ctor
0033   MvtxStandaloneTracking();
0034 
0035   //! dtor
0036   ~MvtxStandaloneTracking();
0037 
0038   //! run tracking
0039   void RunTracking(PHCompositeNode* topNode, MvtxTrackList &trklst, std::vector<int> &lyrs);
0040 
0041   //! reject ghosts
0042   void RunGhostRejection( MvtxTrackList &trklst);
0043 
0044   //! set association window
0045   void SetWindowX(float w) { window_x_ = w; }
0046   void SetWindowZ(float w) { window_z_ = w; }
0047 
0048   //! set ghost rejection
0049   void SetGhostRejection( bool yn ) {}
0050 
0051   //! set verbosity
0052   void Verbosity(int v ) { verbosity_ = v; }
0053 
0054 private:
0055 
0056   //! Associate clusters into track candidates
0057   void AssociateClusters(MvtxTrackList &trklst, std::vector<int> &lyrs);
0058 
0059   //! Fit track in x vs y
0060   void TrackFitXY(MvtxTrack &trk);
0061 
0062   //! Fit track in z vs y
0063   void TrackFitZY(MvtxTrack &trk);
0064 
0065   //! Generalized least squares fitter
0066   TVectorD SolveGLS(TMatrixD &X, TVectorD &y, TMatrixD &L);
0067 
0068 
0069   double CalcSlope(double x0, double y0, double x1, double y1);
0070   double CalcIntecept(double x0, double y0, double m);
0071   double CalcProjection(double x, double m, double b);
0072 
0073   //! Print out track candidate information
0074   void PrintTrackCandidates(MvtxTrackList &trklst);
0075 
0076   //! Cluster node
0077   TrkrClusterContainer* clusters_;
0078 
0079   //! window size in x & z
0080   float window_x_;
0081   float window_z_;
0082 
0083   //! ghost rejection
0084   bool ghostrejection_;
0085   
0086   // verbosity
0087   int verbosity_;
0088 
0089   static const int NLYR = 4;
0090 
0091 };
0092 
0093 #endif //__MvtxStandaloneTracking_h__#