Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:01

0001 /*
0002  *
0003 * This is a part of CTPPS offline software.
0004 * Author:
0005 *   Fabrizio Ferro (ferro@ge.infn.it)
0006 *   Enrico Robutti (robutti@ge.infn.it)
0007 *   Fabio Ravera   (fabio.ravera@cern.ch)
0008 *
0009 */
0010 
0011 #include "DataFormats/CTPPSReco/interface/CTPPSPixelLocalTrack.h"
0012 
0013 //----------------------------------------------------------------------------------------------------
0014 
0015 AlgebraicSymMatrix22 CTPPSPixelLocalTrack::trackPointInterpolationCovariance(float z) const {
0016   math::Matrix<2, dimension>::type h;
0017   h(0, 0) = 1;
0018   h(1, 1) = 1;
0019   h(0, 2) = z - z0_;
0020   h(1, 3) = z - z0_;
0021 
0022   return ROOT::Math::Similarity(h, par_covariance_matrix_);
0023 }
0024 
0025 //----------------------------------------------------------------------------------------------------
0026 
0027 CTPPSPixelLocalTrack::CTPPSPixelLocalTrack(float z0,
0028                                            const ParameterVector &track_params_vector,
0029                                            const CovarianceMatrix &par_covariance_matrix,
0030                                            float chiSquared)
0031     : track_params_vector_(track_params_vector),
0032       z0_(z0),
0033       par_covariance_matrix_(par_covariance_matrix),
0034       chiSquared_(chiSquared),
0035       valid_(true),
0036       numberOfPointsUsedForFit_(0),
0037       recoInfo_(CTPPSpixelLocalTrackReconstructionInfo::invalid) {}
0038 
0039 bool CTPPSPixelLocalTrack::operator<(const CTPPSPixelLocalTrack &r) {
0040   if (z0_ < r.z0_)
0041     return true;
0042   if (z0_ > r.z0_)
0043     return false;
0044 
0045   for (int i = 0; i < CTPPSPixelLocalTrack::dimension; ++i) {
0046     if (track_params_vector_[i] < r.track_params_vector_[i])
0047       return true;
0048     if (track_params_vector_[i] > r.track_params_vector_[i])
0049       return false;
0050   }
0051 
0052   return false;
0053 }