From ec2207e8393bc7601adcd9b1cd0e6a8c51b4fdb9 Mon Sep 17 00:00:00 2001 From: Adam Edward Barton <adam.edward.barton@cern.ch> Date: Fri, 16 Mar 2018 12:25:03 +0000 Subject: [PATCH] Merge branch 'licence' into 'master' Licence cleanup - see ATLASRECTS-4399 See merge request atlas/athena!9570 Former-commit-id: 7c21e8c6c9d5378dedf6134a7b2e59857476b25a --- .../iPat/iPatTrackFitter/src/TrackFitter.cxx | 1 - .../TrkiPatFitter/src/iPatFitter.cxx | 4 - .../TrkiPatFitterUtils/CMakeLists.txt | 3 +- .../TrkiPatFitterUtils/FitMatrices.h | 8 +- .../TrkiPatFitterUtils/FitParameters.h | 21 +- .../TrkiPatFitterUtils/FitProcedure.h | 1 - .../TrkiPatFitterUtils/src/FitMatrices.cxx | 120 ++------- .../TrkiPatFitterUtils/src/FitParameters.cxx | 242 ++---------------- .../TrkiPatFitterUtils/src/FitProcedure.cxx | 4 +- 9 files changed, 53 insertions(+), 351 deletions(-) diff --git a/Reconstruction/iPat/iPatTrackFitter/src/TrackFitter.cxx b/Reconstruction/iPat/iPatTrackFitter/src/TrackFitter.cxx index 983a65b8599c..abcdfaa4cdf3 100755 --- a/Reconstruction/iPat/iPatTrackFitter/src/TrackFitter.cxx +++ b/Reconstruction/iPat/iPatTrackFitter/src/TrackFitter.cxx @@ -639,7 +639,6 @@ TrackFitter::initialize() // can now create FitProcedure class m_fitProcedure = new Trk::FitProcedure(false, - false, false, false, m_rungeKuttaIntersector, diff --git a/Tracking/TrkFitter/TrkiPatFitter/src/iPatFitter.cxx b/Tracking/TrkFitter/TrkiPatFitter/src/iPatFitter.cxx index 85fbeb33a1ba..bb67f23aa738 100755 --- a/Tracking/TrkFitter/TrkiPatFitter/src/iPatFitter.cxx +++ b/Tracking/TrkFitter/TrkiPatFitter/src/iPatFitter.cxx @@ -61,7 +61,6 @@ iPatFitter::iPatFitter (const std::string& type, m_parameters (0), m_aggregateMaterial (true), m_asymmetricCaloEnergy (true), - m_eigenMatrixTreatment (true), m_fullCombinedFit (true), m_lineFit (false), m_lineMomentum (100.*Gaudi::Units::GeV), @@ -93,7 +92,6 @@ iPatFitter::iPatFitter (const std::string& type, declareInterface<ITrackFitter>(this); declareProperty("AggregateMaterial", m_aggregateMaterial); declareProperty("AsymmetricCaloEnergy", m_asymmetricCaloEnergy); - declareProperty("EigenMatrixTreatment", m_eigenMatrixTreatment); declareProperty("FullCombinedFit", m_fullCombinedFit); declareProperty("LineFit", m_lineFit); declareProperty("LineMomentum", m_lineMomentum); @@ -133,7 +131,6 @@ iPatFitter::initialize() msg(MSG::INFO) << " with options: "; if (m_aggregateMaterial) msg() << " AggregateMaterial"; if (m_asymmetricCaloEnergy) msg() << " AsymmetricCaloEnergy"; - if (m_eigenMatrixTreatment) msg() << " EigenMatrixTreatment"; if (m_fullCombinedFit) msg() << " FullCombinedFit"; if (m_globalFit) msg() << " GlobalFitter"; if (m_lineFit) msg() << " LineFit with p = " @@ -245,7 +242,6 @@ iPatFitter::initialize() // can now create FitProcedure class m_fitProcedure = new FitProcedure(m_constrainedAlignmentEffects, m_extendedDebug, - m_eigenMatrixTreatment, m_lineFit, m_rungeKuttaIntersector, m_solenoidalIntersector, diff --git a/Tracking/TrkFitter/TrkiPatFitterUtils/CMakeLists.txt b/Tracking/TrkFitter/TrkiPatFitterUtils/CMakeLists.txt index 7c4cb5be50bb..aeabfde24f5d 100644 --- a/Tracking/TrkFitter/TrkiPatFitterUtils/CMakeLists.txt +++ b/Tracking/TrkFitter/TrkiPatFitterUtils/CMakeLists.txt @@ -15,7 +15,6 @@ atlas_depends_on_subdirs( PUBLIC Tracking/TrkDetDescr/TrkGeometry Tracking/TrkEvent/TrkEventPrimitives Tracking/TrkEvent/TrkParameters - Tracking/TrkAlignment/TrkAlgebraUtils PRIVATE Tracking/TrkDetDescr/TrkSurfaces Tracking/TrkEvent/TrkMaterialOnTrack @@ -44,5 +43,5 @@ atlas_add_library( TrkiPatFitterUtils INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps DataModel GeoPrimitives EventPrimitives GaudiKernel TrkEventPrimitives TrkParameters TrkAlgebraUtils + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps DataModel GeoPrimitives EventPrimitives GaudiKernel TrkEventPrimitives TrkParameters PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} TrkGeometry TrkSurfaces TrkMaterialOnTrack TrkMeasurementBase TrkTrack TrkExInterfaces TrkExUtils ) diff --git a/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitMatrices.h b/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitMatrices.h index 97373e18be8f..2205bc52de7d 100755 --- a/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitMatrices.h +++ b/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitMatrices.h @@ -43,7 +43,7 @@ namespace Trk class FitMatrices { public: - FitMatrices (bool constrainedAlignmentEffects, bool eigenMatrixTreatment); + FitMatrices (bool constrainedAlignmentEffects); ~FitMatrices (void); @@ -110,15 +110,11 @@ namespace Trk void addPerigeeMeasurement (void); // fix for momentum singularity void avoidMomentumSingularity (void); // using Eigen - // implementation of matrix equation solution - bool solveEquationsEigen (void); // using Eigen - bool solveEquations***REMOVED*** (void); // using alignment matrix pkg ***REMOVED*** - + int m_columnsDM; bool m_constrainedAlignmentEffects; Amg::MatrixX* m_covariance; Amg::MatrixX* m_derivativeMatrix; - bool m_eigen; Amg::MatrixX* m_finalCovariance; std::vector<int> m_firstRowForParameter; double m_largePhiWeight; diff --git a/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitParameters.h b/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitParameters.h index 9155aaf64900..2ab47c78b88b 100755 --- a/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitParameters.h +++ b/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitParameters.h @@ -16,8 +16,6 @@ #include <vector> #include "EventPrimitives/EventPrimitives.h" #include "GeoPrimitives/GeoPrimitives.h" -#include "TrkAlgebraUtils/AlSymMat.h" -#include "TrkAlgebraUtils/AlVec.h" #include "TrkParameters/TrackParameters.h" //<<<<<< CLASS DECLARATIONS >>>>>> @@ -64,7 +62,6 @@ public: void d0 (double value); double difference (int param) const; const Amg::VectorX& differences (void) const; - const AlVec& differences***REMOVED*** (void) const; Amg::Vector3D direction (void) const; bool extremeMomentum (void) const; void extremeMomentum (bool value); @@ -112,7 +109,6 @@ public: const TrackParameters* trackParameters (MsgStream& log, const FitMeasurement& measurement, bool withCovariance=false) const; - void update (const AlVec& differences); void update (const Amg::VectorX& differences); void update (Amg::Vector3D position, Amg::Vector3D direction, @@ -136,7 +132,6 @@ private: double m_cotTheta; double m_d0; Amg::VectorX* m_differences; - AlVec* m_differences***REMOVED***; bool m_eigen; bool m_extremeMomentum; Amg::MatrixX* m_finalCovariance; @@ -205,26 +200,14 @@ FitParameters::d0 (void) const inline double FitParameters::difference (int param) const { - if (m_eigen) - { - // if (! m_differences) return 0.; // surely unnecessary? - return (*m_differences)(param); - } - else - { - // if (! m_differences***REMOVED***) return 0.; - return (*m_differences***REMOVED***)[param]; - } + // if (! m_differences) return 0.; // surely unnecessary? + return (*m_differences)(param); } inline const Amg::VectorX& FitParameters::differences (void) const { return *m_differences; } -inline const AlVec& -FitParameters::differences***REMOVED*** (void) const -{ return *m_differences***REMOVED***; } - inline Amg::Vector3D FitParameters::direction (void) const { return Amg::Vector3D(m_cosPhi*m_sinTheta,m_sinPhi*m_sinTheta,m_cosTheta); } diff --git a/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitProcedure.h b/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitProcedure.h index dbbed2697aa2..60c80d4bf5a9 100755 --- a/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitProcedure.h +++ b/Tracking/TrkFitter/TrkiPatFitterUtils/TrkiPatFitterUtils/FitProcedure.h @@ -49,7 +49,6 @@ class FitProcedure public: FitProcedure (bool constrainedAlignmentEffects, bool extendedDebug, - bool eigenMatrixTreatment, bool lineFit, ToolHandle<IIntersector>& rungeKuttaIntersector, ToolHandle<IIntersector>& solenoidalIntersector, diff --git a/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitMatrices.cxx b/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitMatrices.cxx index 6f647684c4ad..9fd5685f0cec 100755 --- a/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitMatrices.cxx +++ b/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitMatrices.cxx @@ -29,7 +29,6 @@ #include <iostream> #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/SystemOfUnits.h" -#include "TrkAlgebraUtils/AlSpaMat.h" #include "TrkExUtils/TrackSurfaceIntersection.h" #include "TrkiPatFitterUtils/FitMatrices.h" #include "TrkiPatFitterUtils/FitMatrix.h" @@ -40,12 +39,11 @@ namespace Trk{ -FitMatrices::FitMatrices(bool constrainedAlignmentEffects, bool eigenMatrixTreatment) +FitMatrices::FitMatrices(bool constrainedAlignmentEffects) : m_columnsDM (0), m_constrainedAlignmentEffects (constrainedAlignmentEffects), m_covariance (0), m_derivativeMatrix (0), - m_eigen (eigenMatrixTreatment), m_finalCovariance (0), m_largePhiWeight (10000.), // arbitrary - equiv to 10um m_matrixFromCLHEP (false), @@ -154,36 +152,19 @@ FitMatrices::fullCovariance (void) // avoid singularity through ill-defined momentum ???? again avoidMomentumSingularity(); - if (m_eigen) + // neater - but gives small rounding-like diffs wrt matrix copy version + // keep matrix copy for release 21 to avoid rounding changes at Tier0 + // covariance = (*m_weight).inverse(); + + // matrix copy version (legacy of ***REMOVED*** which needed copy between matrix packages) + Amg::MatrixX weight(m_columnsDM,m_columnsDM); + weight.selfadjointView<0x2>(); + weight = (*m_weight).inverse(); + for (int row = 0; row != m_columnsDM; ++row) { - // neater - but gives small rounding-like diffs wrt matrix copy version - // keep matrix copy for release 21 to avoid rounding changes at Tier0 - // covariance = (*m_weight).inverse(); - - // matrix copy version (legacy of ***REMOVED*** which needed copy between matrix packages) - Amg::MatrixX weight(m_columnsDM,m_columnsDM); - weight.selfadjointView<0x2>(); - weight = (*m_weight).inverse(); - for (int row = 0; row != m_columnsDM; ++row) - { - for (int col = 0; col != m_columnsDM; ++col) covariance(row,col) = weight(col,row); - } + for (int col = 0; col != m_columnsDM; ++col) covariance(row,col) = weight(col,row); } - else - { - // copy to AlSymMat for inversion - AlSymMat weight(m_columnsDM); - for (int i = 0; i != m_columnsDM; ++i) - { - for (int j = 0; j <= i; ++j) weight[i][j] = (*m_weight)(i,j); - } - failure = weight.invert(); - for (int i = 0; i != m_columnsDM; ++i) - { - for (int j = 0; j != m_columnsDM; ++j) covariance(j,i) = weight[i][j]; - } - } - + // trap singular matrix if (failure) { @@ -723,15 +704,20 @@ FitMatrices::solveEquations(void) // avoid some possible singularities in matrix inversion avoidMomentumSingularity(); - // use eigen or ***REMOVED*** methods - if (m_eigen) - { - return solveEquationsEigen(); - } - else - { - return solveEquations***REMOVED***(); - } + // solve is faster than inverse: wait for explicit request for covariance before inversion + *m_weightedDifference = weight.colPivHouseholderQr().solve(weightedDifference); + + // bool failure = (weight*(*m_weightedDifference) - weightedDifference).isZero(1e-4); + // if (failure) + // { + // std::cout << " Eigen failed " << std::endl; + // return false; + // } + // else + // { + m_parameters->update(*m_weightedDifference); + return true; + // } } void @@ -790,58 +776,4 @@ FitMatrices::avoidMomentumSingularity(void) } } -bool -FitMatrices::solveEquationsEigen(void) -{ - // solve is faster than inverse: wait for explicit request for covariance before inversion - Amg::MatrixX& weight = *m_weight; - Amg::VectorX& weightedDifference = *m_weightedDifference; - *m_weightedDifference = weight.colPivHouseholderQr().solve(weightedDifference); - - // bool failure = (weight*(*m_weightedDifference) - weightedDifference).isZero(1e-4); - // if (failure) - // { - // std::cout << " Eigen failed " << std::endl; - // return false; - // } - // else - // { - m_parameters->update(*m_weightedDifference); - return true; - // } -} - -bool -FitMatrices::solveEquations***REMOVED***(void) -{ - // using alignment matrix package - // with copy from eigen weightMatrix - Amg::MatrixX& weight = *m_weight; - Amg::VectorX& weightedDifference = *m_weightedDifference; - AlSpaMat weight***REMOVED***(m_columnsDM); - AlVec weightedDifference***REMOVED***(m_columnsDM); - for (int row = 0; row < m_columnsDM; ++row) - { - for (int col = 0; col < m_columnsDM; ++col) - { - weight***REMOVED***[row][col] = weight(row,col); - } - weightedDifference***REMOVED***[row] = weightedDifference(row); - } - - // solve is faster than inverse: wait for explicit request for covariance before inversion - int failure = weight***REMOVED***.***REMOVED***Solve(weightedDifference***REMOVED***); - - // trap singular matrix - if (failure) - { - return false; - } - else - { - m_parameters->update(weightedDifference***REMOVED***); - return true; - } -} - } // end of namespace diff --git a/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitParameters.cxx b/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitParameters.cxx index b42e80081e4e..a976bcc6b195 100755 --- a/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitParameters.cxx +++ b/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitParameters.cxx @@ -31,8 +31,6 @@ FitParameters::FitParameters (const Perigee& perigee) m_cosTheta1 (0.), m_d0 (perigee.parameters()[Trk::d0]), m_differences (0), - m_differences***REMOVED*** (0), - m_eigen (true), m_extremeMomentum (false), m_finalCovariance (0), m_firstAlignmentParameter (0), @@ -81,8 +79,6 @@ FitParameters::FitParameters (double d0, m_cotTheta (cotTheta), m_d0 (d0), m_differences (0), - m_differences***REMOVED*** (0), - m_eigen (true), m_extremeMomentum (false), m_finalCovariance (0), m_firstAlignmentParameter (0), @@ -127,8 +123,6 @@ FitParameters::FitParameters (const FitParameters& parameters) m_cotTheta (parameters.m_cotTheta), m_d0 (parameters.m_d0), m_differences (0), - m_differences***REMOVED*** (0), - m_eigen (parameters.m_eigen), m_extremeMomentum (parameters.m_extremeMomentum), m_finalCovariance (parameters.m_finalCovariance), m_firstAlignmentParameter (parameters.m_firstAlignmentParameter), @@ -157,20 +151,12 @@ FitParameters::FitParameters (const FitParameters& parameters) m_vertex (parameters.m_vertex), m_z0 (parameters.m_z0) { - if (m_eigen) - { - if (parameters.m_differences) m_differences = new Amg::VectorX(*(parameters.m_differences)); - } - else if (parameters.m_differences***REMOVED***) - { - m_differences***REMOVED*** = new AlVec(*parameters.m_differences***REMOVED***); - } + if (parameters.m_differences) m_differences = new Amg::VectorX(*(parameters.m_differences)); } FitParameters::~FitParameters (void) { delete m_differences; - delete m_differences***REMOVED***; } //<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>> @@ -297,45 +283,23 @@ FitParameters::performCutStep (double cutStep) // revert parameters to previous parameter change with cutStep*value // i.e. 0 < cutstep < 1 such that cutStep = 0 gives complete reversion - if (m_eigen) - { - Amg::VectorX cutDifferences(*m_differences); - cutDifferences *= (cutStep - 1.); - Amg::VectorX oldDifferences(*m_differences); - oldDifferences *= cutStep; - - // leave phi alone when unstable - if (m_phiInstability) - { - cutDifferences(2) = 0.; - oldDifferences(2) = (*m_differences)(2); - } + Amg::VectorX cutDifferences(*m_differences); + cutDifferences *= (cutStep - 1.); + Amg::VectorX oldDifferences(*m_differences); + oldDifferences *= cutStep; - // apply cut - update(cutDifferences); - delete m_differences; - m_differences = new Amg::VectorX(oldDifferences); - } - else + // leave phi alone when unstable + if (m_phiInstability) { - AlVec cutDifferences(*m_differences***REMOVED***); - cutDifferences *= (cutStep - 1.); - AlVec oldDifferences(*m_differences***REMOVED***); - oldDifferences *= cutStep; + cutDifferences(2) = 0.; + oldDifferences(2) = (*m_differences)(2); + } - // leave phi alone when unstable - if (m_phiInstability) - { - cutDifferences[2] = 0.; - oldDifferences[2] = (*m_differences***REMOVED***)[2]; - } + // apply cut + update(cutDifferences); + delete m_differences; + m_differences = new Amg::VectorX(oldDifferences); - // apply cut - update(cutDifferences); - delete m_differences***REMOVED***; - m_differences***REMOVED*** = new AlVec(oldDifferences); - } - m_numberOscillations = 0; m_oldDifference = 0.; //std::cout << " after cutstep " << std::endl; @@ -490,67 +454,6 @@ FitParameters::printVerbose (MsgStream& log) const } } - if (m_differences***REMOVED*** && m_differences***REMOVED***->size()) - { - const AlVec& differences = *m_differences***REMOVED***; - log << " dParams ====" - << std::setiosflags(std::ios::fixed) - << std::setw(10) << std::setprecision(4) << differences[0] - << " (0) " - << std::setw(10) << std::setprecision(4) << differences[1] - << " (1) " - << std::setw(10) << std::setprecision(5) << differences[2] - << " (2) " - << std::setw(10) << std::setprecision(5) << differences[3] - << " (3) " - << std::setw(13) << std::setprecision(9) - << differences[4]*Gaudi::Units::GeV/Gaudi::Units::TeV << " (4) "; - if (m_fitEnergyDeposit) - log << std::setiosflags(std::ios::fixed) - << std::setw(13) << std::setprecision(9) - << differences[5]*Gaudi::Units::GeV/Gaudi::Units::TeV << " (5) "; - log << std::endl; - - if (m_numberAlignments) - { - log << " dAlign ==== "; - unsigned param = m_firstAlignmentParameter; - for (int scat = 0; scat < m_numberAlignments; ++scat) - { - ++param; - if (scat%5 == 0 && scat > 0) log << std::endl << " "; - log << std::setiosflags(std::ios::fixed) - << std::setw(10) << std::setprecision(6) - << differences[param]; - ++param; - log << std::setiosflags(std::ios::fixed) - << std::setw(10) << std::setprecision(6) - << differences[param] - << " ("<< std::setw(2) << scat << "A) "; - } - log << std::endl; - } - - if (m_numberScatterers) - { - log << " dScat ==== "; - unsigned param = m_firstScatteringParameter; - for (int scat = 0; scat < m_numberScatterers; ++scat) - { - ++param; - if (scat%5 == 0 && scat > 0) log << std::endl << " "; - log << std::setiosflags(std::ios::fixed) - << std::setw(10) << std::setprecision(6) - << differences[param]; - ++param; - log << std::setiosflags(std::ios::fixed) - << std::setw(10) << std::setprecision(6) - << differences[param] - << " ("<< std::setw(2) << scat << "S) "; - } - log << std::endl; - } - } log << std::setiosflags(std::ios::fixed|std::ios::right) << " parameters: " << std::setw(12) << std::setprecision(4) << m_d0 @@ -666,31 +569,16 @@ FitParameters::reset (const FitParameters& parameters) m_scattererTheta[s] = parameters.m_scattererTheta[s]; } - // restore difference history - if (m_eigen) - { - delete m_differences; - if (parameters.m_differences) - { - m_differences = new Amg::VectorX(*parameters.m_differences); - } - else - { - m_differences = new Amg::VectorX(m_numberParameters); - m_differences->setZero(); - } + // restore difference history + delete m_differences; + if (parameters.m_differences) + { + m_differences = new Amg::VectorX(*parameters.m_differences); } else { - delete m_differences***REMOVED***; - if (parameters.m_differences***REMOVED***) - { - m_differences***REMOVED*** = new AlVec(*parameters.m_differences***REMOVED***); - } - else - { - m_differences***REMOVED*** = new AlVec(m_numberParameters); - } + m_differences = new Amg::VectorX(m_numberParameters); + m_differences->setZero(); } m_numberOscillations = 0; @@ -930,94 +818,6 @@ FitParameters::trackParameters (MsgStream& log, return 0; } -void -FitParameters::update (const AlVec& differences) -{ - // this is the ***REMOVED*** version - m_eigen = false; - - // keep update values in case of cutStep procedure - if (m_numberOscillations && m_oldDifference*differences[4] < 0.) - { - ++m_numberOscillations; - } - else - { - m_numberOscillations = 1; - } - delete m_differences***REMOVED***; - m_differences***REMOVED*** = new AlVec(differences); - m_oldDifference = differences[4]; - - // misalignment parameters - std::vector<double>::iterator a = m_alignmentAngle.begin(); - std::vector<double>::iterator o = m_alignmentOffset.begin(); - int align = m_firstAlignmentParameter; - for (int i = 0; i != m_numberAlignments; ++i) - { - (*a++) += differences[++align]; - (*o++) += differences[++align]; - } - - // scattering angles - std::vector<double>::iterator p = m_scattererPhi.begin(); - std::vector<double>::iterator t = m_scattererTheta.begin(); - int scat = m_firstScatteringParameter; - for (int i = 0; i != m_numberScatterers; ++i) - { - (*p++) += differences[++scat]; - (*t++) += differences[++scat]; - } - - // qOverP, cotTheta - if (m_fitMomentum) m_qOverP += differences[4]/Gaudi::Units::TeV; - m_cotTheta -= differences[3]/(m_sinTheta*m_sinTheta); - - // impose charge conservation and decreasing energy - if (m_fitEnergyDeposit) - { - m_qOverP1 += differences[5]/Gaudi::Units::TeV; - double deposit = 1./std::abs(m_qOverP) - 1./std::abs(m_qOverP1); - if (std::abs(deposit) < std::abs(m_minEnergyDeposit) - || deposit*m_minEnergyDeposit < 0. - || m_qOverP*m_qOverP1 < 0.) - { - m_qOverP = 1./(1./std::abs(m_qOverP1) + m_minEnergyDeposit); - if (m_qOverP1 < 0.) m_qOverP = -m_qOverP; - } - } - - // protect phi against some rounding instabilities - double sinDPhi = differences[2]; - double cosDPhi = 0.; - if (std::abs(sinDPhi) < 1.0) - { - cosDPhi = std::sqrt(1. - sinDPhi*sinDPhi); - } - else - { - if (sinDPhi > 0.) - { - sinDPhi = 1.0; - } - else - { - sinDPhi = -1.0; - } - } - - double cosPhi = m_cosPhi*cosDPhi - m_sinPhi*sinDPhi; - m_sinPhi = m_sinPhi*cosDPhi + m_cosPhi*sinDPhi; - m_cosPhi = cosPhi; - m_z0 += differences[1]; - m_d0 += differences[0]; - m_sinTheta = 1./std::sqrt(1. + m_cotTheta*m_cotTheta); - m_cosTheta = m_cotTheta*m_sinTheta; - m_position = Amg::Vector3D(m_vertex.x() - m_d0*m_sinPhi, - m_vertex.y() + m_d0*m_cosPhi, - m_z0); -} - void FitParameters::update (const Amg::VectorX& differences) { diff --git a/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitProcedure.cxx b/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitProcedure.cxx index de7017d1df33..e246eed9cfb4 100755 --- a/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitProcedure.cxx +++ b/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitProcedure.cxx @@ -49,7 +49,6 @@ namespace Trk{ // constructor FitProcedure::FitProcedure (bool constrainedAlignmentEffects, bool extendedDebug, - bool eigenMatrixTreatment, bool lineFit, ToolHandle<IIntersector>& rungeKuttaIntersector, ToolHandle<IIntersector>& solenoidalIntersector, @@ -73,8 +72,7 @@ FitProcedure::FitProcedure (bool constrainedAlignmentEffects, m_driftSumLast (0.), m_extendedDebug (extendedDebug), m_extremeOneOverP (1./(10.*Gaudi::Units::TeV)), - m_fitMatrices (new FitMatrices(constrainedAlignmentEffects, - eigenMatrixTreatment)), + m_fitMatrices (new FitMatrices(constrainedAlignmentEffects)), m_fitProbability (0.), m_fitQuality (0), m_indetVolume (indetVolume), -- GitLab