Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:34

0001 #ifndef _TwoTrackMinimumDistance_H_
0002 #define _TwoTrackMinimumDistance_H_
0003 
0004 #include "TrackingTools/PatternTools/interface/ClosestApproachOnHelices.h"
0005 #include "TrackingTools/PatternTools/interface/ClosestApproachInRPhi.h"
0006 #include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceHelixHelix.h"
0007 #include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceLineLine.h"
0008 #include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceHelixLine.h"
0009 #include "FWCore/Utilities/interface/Visibility.h"
0010 
0011 /**
0012    * General interface to calculate the PCA of two tracks. 
0013    * According to the charge of the tracks, the correct algorithm is used:<ul>
0014    * <li> charged-charged: TwoTrackMinimumDistanceHelixHelix
0015    * <li> charged-neutral: TwoTrackMinimumDistanceHelixLine
0016    * <li> neutral-neutral: TwoTrackMinimumDistanceLineLine
0017    * </ul>
0018    */
0019 
0020 class TwoTrackMinimumDistance final : public ClosestApproachOnHelices {
0021 public:
0022   enum Mode { FastMode = 0, SlowMode = 1 };
0023 
0024   TwoTrackMinimumDistance(const Mode m = FastMode) {
0025     theModus = m;
0026     status_ = false;
0027   };
0028   ~TwoTrackMinimumDistance() override {}
0029 
0030   bool calculate(const TrajectoryStateOnSurface& sta, const TrajectoryStateOnSurface& stb) override;
0031 
0032   bool calculate(const FreeTrajectoryState& sta, const FreeTrajectoryState& stb) override;
0033 
0034   virtual bool calculate(const GlobalTrajectoryParameters& sta, const GlobalTrajectoryParameters& stb);
0035 
0036   bool status() const override { return status_; }
0037 
0038   /**
0039    * Returns the two PCA on the trajectories.
0040    */
0041 
0042   std::pair<GlobalPoint, GlobalPoint> points() const override;
0043 
0044   /** arithmetic mean of the two points of closest approach */
0045   GlobalPoint crossingPoint() const override;
0046 
0047   /** distance between the two points of closest approach in 3D */
0048   float distance() const override;
0049 
0050   /**
0051    *  Clone method
0052    */
0053   TwoTrackMinimumDistance* clone() const override { return new TwoTrackMinimumDistance(*this); }
0054 
0055   double firstAngle() const;
0056   double secondAngle() const;
0057   std::pair<double, double> pathLength() const;
0058 
0059 private:
0060   enum Charge { hh, hl, ll };
0061   Mode theModus;
0062   Charge theCharge;
0063   ClosestApproachInRPhi theIniAlgo;
0064   TwoTrackMinimumDistanceHelixHelix theTTMDhh;
0065   TwoTrackMinimumDistanceLineLine theTTMDll;
0066   TwoTrackMinimumDistanceHelixLine theTTMDhl;
0067   bool status_;
0068   std::pair<GlobalPoint, GlobalPoint> points_;
0069 
0070   bool pointsLineLine(const GlobalTrajectoryParameters& sta, const GlobalTrajectoryParameters& stb) dso_internal;
0071   bool pointsHelixLine(const GlobalTrajectoryParameters& sta, const GlobalTrajectoryParameters& stb) dso_internal;
0072   bool pointsHelixHelix(const GlobalTrajectoryParameters& sta, const GlobalTrajectoryParameters& stb) dso_internal;
0073 };
0074 
0075 #endif