Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:55

0001 //#define MK_DEBUG
0002 #include "RecoTracker/TkSeedGenerator/interface/FastCircleFit.h"
0003 
0004 #include <iostream>
0005 
0006 namespace {
0007   void test(const std::vector<GlobalPoint>& points, const std::vector<GlobalError>& errors) {
0008     FastCircleFit c(points, errors);
0009 
0010     std::cout << "origin " << c.x0() << " " << c.y0() << " radius " << c.rho() << " chi2 " << c.chi2() << std::endl;
0011   };
0012 }  // namespace
0013 
0014 int main() {
0015   {
0016     std::vector<GlobalPoint> points = {{GlobalPoint(0., -1., 0.), GlobalPoint(-1., 0., 0.), GlobalPoint(0., 1., 0.)}};
0017     std::vector<GlobalError> errors = {
0018         {GlobalError(1, 0, 1, 0, 0, 1), GlobalError(1, 0, 1, 0, 0, 1), GlobalError(1, 0, 1, 0, 0, 1)}};
0019 
0020     test(points, errors);
0021   }
0022 
0023   {
0024     std::vector<GlobalPoint> points = {{GlobalPoint(0.1, 0., 0.), GlobalPoint(-0.9, 1., 0.), GlobalPoint(0.1, 2., 0.)}};
0025     std::vector<GlobalError> errors = {
0026         {GlobalError(1, 0, 1, 0, 0, 1), GlobalError(1, 0, 1, 0, 0, 1), GlobalError(1, 0, 1, 0, 0, 1)}};
0027 
0028     test(points, errors);
0029   }
0030 
0031   {
0032     std::vector<GlobalPoint> points = {{GlobalPoint(-3.18318, 0.0479436, 0.),
0033                                         GlobalPoint(-6.74696, -0.303678, 0.),
0034                                         GlobalPoint(-10.7557, -1.24485, 0.),
0035                                         GlobalPoint(-14.6143, -2.79196, 0.)}};
0036     std::vector<GlobalError> errors = {{GlobalError(2.37751e-07, 8.873e-07, 3.31145e-06, 0, 0, 5.22405e-06),
0037                                         GlobalError(6.10596e-09, -5.41919e-08, 4.80966e-07, 0, 0, 7.44661e-06),
0038                                         GlobalError(6.41271e-09, -8.96614e-08, 1.25363e-06, 0, 0, 4.73874e-06),
0039                                         GlobalError(1.19665e-06, 2.78201e-07, 2.80112e-07, 0, 0, 2.78938e-08)}};
0040 
0041     test(points, errors);
0042   }
0043   {
0044     std::vector<GlobalPoint> points = {{GlobalPoint(-3.18318, 0.0479436, 0.),
0045                                         GlobalPoint(-6.74696, -0.303678, 0.),
0046                                         GlobalPoint(-10.7557, -1.24485, 0.),
0047                                         GlobalPoint(-14.699, -2.83295, 0.)}};
0048     std::vector<GlobalError> errors = {{GlobalError(2.37751e-07, 8.873e-07, 3.31145e-06, 0, 0, 5.22405e-06),
0049                                         GlobalError(6.10596e-09, -5.41919e-08, 4.80966e-07, 0, 0, 7.44661e-06),
0050                                         GlobalError(6.41271e-09, -8.96614e-08, 1.25363e-06, 0, 0, 4.73874e-06),
0051                                         GlobalError(3.14525e-06, 2.64413e-07, 4.33922e-07, 0, 0, 5.69573e-08)}};
0052 
0053     test(points, errors);
0054   }
0055 
0056   return 0;
0057 }