Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackFitUtils Class Reference

#include <coresoftware/blob/master/offline/packages/trackbase/TrackFitUtils.h>

Public Types

using position_t = std::pair< double, double >
 
using position_vector_t = std::vector< position_t >
 
using circle_fit_output_t = std::tuple< double, double, double >
 circle fit output [R, x0, y0]
 
using line_fit_output_t = std::tuple< double, double >
 line fit output [slope, intercept]
 
using circle_circle_intersection_output_t = std::tuple< double, double, double, double >
 circle-circle intersection output. (xplus, yplus, xminus, yminus)
 

Static Public Member Functions

static circle_fit_output_t circle_fit_by_taubin (const position_vector_t &)
 
static circle_fit_output_t circle_fit_by_taubin (const std::vector< Acts::Vector3 > &)
 convenient overload
 
static line_fit_output_t line_fit (const position_vector_t &)
 line_fit
 
static line_fit_output_t line_fit (const std::vector< Acts::Vector3 > &)
 convenient overload
 
static
circle_circle_intersection_output_t 
circle_circle_intersection (double r1, double r2, double x2, double y2)
 
static unsigned int addClusters (std::vector< float > &fitpars, double dca_cut, ActsGeometry *_tGeometry, TrkrClusterContainer *_cluster_map, std::vector< Acts::Vector3 > &global_vec, std::vector< TrkrDefs::cluskey > &cluskey_vec, unsigned int startLayer, unsigned int endLayer)
 
static unsigned int addClustersOnLine (TrackFitUtils::line_fit_output_t &fitpars, const bool &isXY, const double &dca_cut, ActsGeometry *tGeometry, TrkrClusterContainer *clusterContainer, std::vector< Acts::Vector3 > &global_vec, std::vector< TrkrDefs::cluskey > &cluskey_vec, const unsigned int &startLayer, const unsigned int &endLayer)
 
static std::pair
< Acts::Vector3, Acts::Vector3
get_helix_tangent (const std::vector< float > &fitpars, Acts::Vector3 &global)
 
static Acts::Vector3 get_helix_pca (std::vector< float > &fitpars, Acts::Vector3 global)
 
static Acts::Vector2 get_circle_point_pca (float radius, float x0, float y0, Acts::Vector3 global)
 
static std::vector< float > fitClusters (std::vector< Acts::Vector3 > &global_vec, std::vector< TrkrDefs::cluskey > cluskey_vec)
 
static void getTrackletClusters (ActsGeometry *_tGeometry, TrkrClusterContainer *_cluster_map, std::vector< Acts::Vector3 > &global_vec, std::vector< TrkrDefs::cluskey > &cluskey_vec)
 
static Acts::Vector3 getPCALinePoint (Acts::Vector3 global, Acts::Vector3 tangent, Acts::Vector3 posref)
 
static std::vector< doublegetLineClusterResiduals (position_vector_t &rz_pts, float slope, float intercept)
 
static std::vector< doublegetCircleClusterResiduals (position_vector_t &xy_pts, float R, float X0, float Y0)
 

Detailed Description

Definition at line 15 of file TrackFitUtils.h.

View newest version in sPHENIX GitHub at line 15 of file TrackFitUtils.h

Member Typedef Documentation

circle-circle intersection output. (xplus, yplus, xminus, yminus)

Definition at line 55 of file TrackFitUtils.h.

View newest version in sPHENIX GitHub at line 55 of file TrackFitUtils.h

circle fit output [R, x0, y0]

Definition at line 22 of file TrackFitUtils.h.

View newest version in sPHENIX GitHub at line 22 of file TrackFitUtils.h

line fit output [slope, intercept]

Definition at line 42 of file TrackFitUtils.h.

View newest version in sPHENIX GitHub at line 42 of file TrackFitUtils.h

Definition at line 18 of file TrackFitUtils.h.

View newest version in sPHENIX GitHub at line 18 of file TrackFitUtils.h

Definition at line 19 of file TrackFitUtils.h.

View newest version in sPHENIX GitHub at line 19 of file TrackFitUtils.h

Member Function Documentation

unsigned int TrackFitUtils::addClusters ( std::vector< float > &  fitpars,
double  dca_cut,
ActsGeometry _tGeometry,
TrkrClusterContainer _cluster_map,
std::vector< Acts::Vector3 > &  global_vec,
std::vector< TrkrDefs::cluskey > &  cluskey_vec,
unsigned int  startLayer,
unsigned int  endLayer 
)
static

no cluster was found in that layer

Definition at line 363 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 363 of file TrackFitUtils.cc

References INTTVtxZ::dca, detectors, TrkrClusterContainer::findCluster(), get_helix_pca(), TrkrClusterContainer::getClusters(), ActsGeometry::getGlobalPosition(), TrkrClusterContainer::getHitSetKeys(), TrkrDefs::getLayer(), TrkrDefs::inttId, layer, TrkrDefs::micromegasId, TrkrDefs::mvtxId, norm, and TrkrDefs::tpcId.

Referenced by HelicalFitter::addSiliconClusters(), PHSiliconHelicalPropagator::process_event(), PHCosmicSiliconPropagator::process_event(), and HelicalFitter::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int TrackFitUtils::addClustersOnLine ( TrackFitUtils::line_fit_output_t fitpars,
const bool &  isXY,
const double dca_cut,
ActsGeometry tGeometry,
TrkrClusterContainer clusterContainer,
std::vector< Acts::Vector3 > &  global_vec,
std::vector< TrkrDefs::cluskey > &  cluskey_vec,
const unsigned int &  startLayer,
const unsigned int &  endLayer 
)
static

use r-z

Need to find the point on the line closest to the cluster position The line connecting the cluster and the line is necessarily perpendicular, so it has the opposite and reciprocal slope The cluster is on the line so we use it to find the intercept

Now we have two lines, so solve the system of eqns to get the intersection

Take the difference to find the distance

Definition at line 250 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 250 of file TrackFitUtils.cc

References INTTVtxZ::dca, detectors, TrkrClusterContainer::findCluster(), TrkrClusterContainer::getClusters(), ActsGeometry::getGlobalPosition(), TrkrClusterContainer::getHitSetKeys(), TrkrDefs::getLayer(), intercept(), TrkrDefs::inttId, TrkrDefs::micromegasId, TrkrDefs::mvtxId, square(), TrkrDefs::tpcId, ambiguity_solver_full_chain::x, and y.

Referenced by PHCosmicSiliconPropagator::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TrackFitUtils::circle_circle_intersection_output_t TrackFitUtils::circle_circle_intersection ( double  r1,
double  r2,
double  x2,
double  y2 
)
static

r1 is radius of sPHENIX layer r2, x2 and y2 are parameters of circle fitted to TPC clusters the solutions are xplus, xminus, yplus, yminus

The intersection of two circles occurs when (x-x1)^2 + (y-y1)^2 = r1^2, / (x-x2)^2 + (y-y2)^2 = r2^2 Here we assume that circle 1 is an sPHENIX layer centered on x1=y1=0, and circle 2 is arbitrary x^2 +y^2 = r1^2, (x-x2)^2 + (y-y2)^2 = r2^2 expand the equations and subtract to eliminate the x^2 and y^2 terms, gives the radical line connecting the intersection points iy = - (2*x2*x - D) / 2*y2, then substitute for y in equation of circle 1

Definition at line 231 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 231 of file TrackFitUtils.cc

References KFPMath::a, KFPMath::b, Acts::PhysicalConstants::c, physmon_vertexing::delta, std::tr1::make_tuple(), and square().

Referenced by PHActsKDTreeSeeding::findInttMatches(), PHActsSiliconSeeding::findInttMatches(), TpcClusterMover::get_circle_circle_intersection(), PHTpcClusterMover::get_circle_circle_intersection(), PHCosmicsTrkFitter::loopTracks(), TrackSeedTrackMapConverter::process_event(), and PHMicromegasTpcTrackMatching::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TrackFitUtils::circle_fit_output_t TrackFitUtils::circle_fit_by_taubin ( const position_vector_t positions)
static

Circle fit to a given set of data points (in 2D) This is an algebraic fit, due to Taubin, based on the journal article G. Taubin, "Estimation Of Planar Curves, Surfaces And Nonplanar Space Curves Defined By Implicit Equations, With Applications To Edge And Range Image Segmentation", IEEE Trans. PAMI, Vol. 13, pages 1115-1138, (1991) It works well whether data points are sampled along an entire circle or along a small arc. It still has a small bias and its statistical accuracy is slightly lower than that of the geometric fit (minimizing geometric distances), It provides a very good initial guess for a subsequent geometric fit. Nikolai Chernov (September 2012)

Definition at line 67 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 67 of file TrackFitUtils.cc

References std::tr1::make_tuple(), Acts::IntegrationTest::R, square(), ambiguity_solver_full_chain::x, X0, y, and Y0.

Referenced by ALICEKF::ALICEKalmanFilter(), circle_fit_by_taubin(), TrackSeed_v1::circleFitByTaubin(), QAG4SimulationMicromegas::evaluate_clusters(), QAG4SimulationTpc::evaluate_clusters(), fitClusters(), PHTpcClusterMover::process_event(), PHMicromegasTpcTrackMatching::process_event(), TpcClusterMover::processTrack(), PHSimpleKFProp::RemoveBadClusters(), and PHCASeeding::RemoveBadClusters().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TrackFitUtils::circle_fit_output_t TrackFitUtils::circle_fit_by_taubin ( const std::vector< Acts::Vector3 > &  positions)
static

convenient overload

Definition at line 158 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 158 of file TrackFitUtils.cc

References circle_fit_by_taubin(), and position.

+ Here is the call graph for this function:

std::vector< float > TrackFitUtils::fitClusters ( std::vector< Acts::Vector3 > &  global_vec,
std::vector< TrkrDefs::cluskey cluskey_vec 
)
static

Definition at line 521 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 521 of file TrackFitUtils.cc

References circle_fit_by_taubin(), TrkrDefs::getTrkrId(), TrkrDefs::inttId, and line_fit().

Referenced by TrkrNtuplizer::fillOutputNtuples(), HelicalFitter::fitClusters(), PHSiliconHelicalPropagator::process_event(), PHCosmicSiliconPropagator::process_event(), and HelicalFitter::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Acts::Vector2 TrackFitUtils::get_circle_point_pca ( float  radius,
float  x0,
float  y0,
Acts::Vector3  global 
)
static

Definition at line 506 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 506 of file TrackFitUtils.cc

References Acts::Test::origin().

Referenced by get_helix_pca(), get_helix_tangent(), HelicalFitter::get_helix_vtx(), and HelicalFitter::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Acts::Vector3 TrackFitUtils::get_helix_pca ( std::vector< float > &  fitpars,
Acts::Vector3  global 
)
static

Definition at line 469 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 469 of file TrackFitUtils.cc

References get_circle_point_pca(), getPCALinePoint(), and x0.

Referenced by addClusters(), TrkrNtuplizer::fillOutputNtuples(), HelicalFitter::get_helix_pca(), and PHCosmicSiliconPropagator::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::pair< Acts::Vector3, Acts::Vector3 > TrackFitUtils::get_helix_tangent ( const std::vector< float > &  fitpars,
Acts::Vector3 global 
)
static

Definition at line 23 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 23 of file TrackFitUtils.cc

References get_circle_point_pca(), line, and x0.

Referenced by HelicalFitter::get_helix_tangent(), PHCosmicsTrkFitter::loopTracks(), and TrackSeedTrackMapConverter::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< double > TrackFitUtils::getCircleClusterResiduals ( TrackFitUtils::position_vector_t xy_pts,
float  R,
float  X0,
float  Y0 
)
static

Definition at line 633 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 633 of file TrackFitUtils.cc

References Acts::IntegrationTest::R, square(), Acts::Test::transform, ambiguity_solver_full_chain::x, X0, y, and Y0.

Referenced by PHSimpleKFProp::RemoveBadClusters(), and PHCASeeding::RemoveBadClusters().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< double > TrackFitUtils::getLineClusterResiduals ( TrackFitUtils::position_vector_t rz_pts,
float  slope,
float  intercept 
)
static

Definition at line 614 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 614 of file TrackFitUtils.cc

References KFPMath::a, KFPMath::b, Acts::PhysicalConstants::c, intercept(), physmon_track_finding_ttbar::r, square(), Acts::Test::transform, and physmon_track_finding_ttbar::z.

Referenced by PHSimpleKFProp::RemoveBadClusters().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Acts::Vector3 TrackFitUtils::getPCALinePoint ( Acts::Vector3  global,
Acts::Vector3  tangent,
Acts::Vector3  posref 
)
static

Definition at line 595 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 595 of file TrackFitUtils.cc

Referenced by get_helix_pca().

+ Here is the caller graph for this function:

void TrackFitUtils::getTrackletClusters ( ActsGeometry _tGeometry,
TrkrClusterContainer _cluster_map,
std::vector< Acts::Vector3 > &  global_vec,
std::vector< TrkrDefs::cluskey > &  cluskey_vec 
)
static

Definition at line 561 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 561 of file TrackFitUtils.cc

References TrkrClusterContainer::findCluster(), and ActsGeometry::getGlobalPosition().

Referenced by TrkrNtuplizer::fillOutputNtuples(), HelicalFitter::getTrackletClusters(), TrackResiduals::lineFitClusters(), PHSiliconHelicalPropagator::process_event(), PHCosmicSiliconPropagator::process_event(), and HelicalFitter::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TrackFitUtils::line_fit_output_t TrackFitUtils::line_fit ( const position_vector_t positions)
static

line_fit

copied from: https://www.bragitoff.com typically used to fit we want to fit z vs radius

The fit fails for the case where the line is close to vertical, because there is little dependence on x and thus the denominator is very small we can swap the x-y points to find a y-x horizontal line in this case then check which line minimizes the sums of squares of residuals that is the best fit, and should be returned

now determine which one minimizes the sum of residuals to return

the best fit is swapped in y-x, so find the perpendicular line

Definition at line 170 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 170 of file TrackFitUtils.cc

References KFPMath::a, KFPMath::b, std::tr1::make_tuple(), physmon_track_finding_ttbar::r, square(), and physmon_track_finding_ttbar::z.

Referenced by fitClusters(), line_fit(), TrackSeed_v1::lineFit(), TrackResiduals::lineFitClusters(), PHCosmicSiliconPropagator::process_event(), PHCosmicTrackMerger::process_event(), PHTpcClusterMover::process_event(), PHMicromegasTpcTrackMatching::process_event(), TpcClusterMover::processTrack(), PHSimpleKFProp::RemoveBadClusters(), and PHCosmicTrackMerger::removeOutliers().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TrackFitUtils::line_fit_output_t TrackFitUtils::line_fit ( const std::vector< Acts::Vector3 > &  positions)
static

convenient overload

Definition at line 219 of file TrackFitUtils.cc.

View newest version in sPHENIX GitHub at line 219 of file TrackFitUtils.cc

References line_fit(), position, and square().

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: