BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
CFCir.cxx
Go to the documentation of this file.
1#include "MdcHoughFinder/CFCir.h"
2#include <math.h>
3#include <iostream>
4
6 }
7
8CFCir::CFCir(double x,double y,double phi,int n,double centerX,double centerY,double centerR):_x(x),_y(y),_phi(phi),_n(n),_centerX(centerX),_centerY(centerY),_centerR(centerR)
9{
10 double normal = (y-_centerY)/(x-centerX);
11 double k = -1./normal;
12 double b = y - k*x;
13 double x_cross = -b/(k+1/k);
14 double y_cross = b/(1+k*k);
15// std::cout<<"x y centerX centerY "<<x<<" "<<y<<" "<<centerX<<" "<<centerY<<std::endl;
16// std::cout<<"k b "<<k<<" "<<b<<std::endl;
17// std::cout<<"xcross ycross "<<x_cross<<" "<<y_cross<<std::endl;
18
19 double rho_temp=sqrt(x_cross*x_cross+y_cross*y_cross);
20 double theta_temp=atan2(y_cross,x_cross);
21 if(theta_temp<0) {
22 theta_temp=theta_temp+M_PI;
23 rho_temp=-rho_temp;
24 }
25 if( normal ==0 && x>0) {
26 rho_temp = fabs(x);
27 theta_temp = 0;
28 }
29 if( normal ==0 && x<0) {
30 rho_temp = -fabs(x);
31 theta_temp = M_PI;
32 }
33 _theta = theta_temp;
34 _rho = rho_temp;
35 double slant = _y*cos(_theta)-_x*sin(_theta);
36 _slant = slant;
37// std::cout<<"THETA RHO "<<theta_temp<<" "<<rho_temp<<std::endl;
38// std::cout<<std::endl;
39}
40//void CFtrans(){
41//
42// double Rcf = _x*_x + _y*_y - _d*_d;
43//
44// _cfx = _x/Rcf;
45// _cfy = _y/Rcf;
46// _cfd = _d/Rcf;
47//
48//}
50 _x =cir._x;
51 _y =cir._y;
52 _phi=cir._phi;
53 _n =cir._n;
54
55 _theta =cir._theta;
56 _rho =cir._rho;
57 _centerX =cir._centerX;
58 _centerY =cir._centerY;
59 _centerR =cir._centerR;
60 _slant =cir._slant;
61}
62
63CFCir::CFCir( const CFCir& cir) :
64 _x(cir._x),
65 _y(cir._y),
66 _phi(cir._phi),
67 _n(cir._n),
68
69 _theta(cir._theta),
70 _rho(cir._rho),
71 _centerX(cir._centerX),
72 _centerY(cir._centerY),
73 _centerR(cir._centerR),
74 _slant (cir._slant)
75{}
const Int_t n
Double_t x[10]
double sin(const BesAngle a)
double cos(const BesAngle a)
#define M_PI
Definition: TConstant.h:4
CFCir()
Definition: CFCir.cxx:5
CFCir & operator=(const CFCir &)
Definition: CFCir.cxx:49