00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _MDCXHEL_
00022 #define _MDCXHEL_
00023
00024
00025 #include <iostream>
00026 #include <fstream>
00027 #include "CLHEP/Alist/AList.h"
00028 #include "CLHEP/Vector/ThreeVector.h"
00029 #include "MdcxReco/MdcxHit.h"
00030 #include "MdcxReco/MdcxParameters.h"
00031 #include <math.h>
00032 #include <vector>
00033
00034 using CLHEP::Hep3Vector;
00035
00036
00037 class MdcxHel {
00038
00039 public:
00040
00041
00042
00043 MdcxHel( );
00044
00045 MdcxHel(double D0, double Phi0, double Omega, double Z0=0.0, double Tanl=0.0,
00046 double T0=0.0, int Code=11111, int Mode=0, double X=0.0, double Y=0.0);
00047
00048
00049
00050 virtual ~MdcxHel( );
00051
00052
00053 inline double D0()const{return d0;}
00054 inline double Phi0()const{return phi0;}
00055 inline double Omega()const{return omega;}
00056 inline double Z0()const{return z0;}
00057 inline double Tanl()const{return tanl;}
00058 inline double X()const{return xref;}
00059 inline double Xref()const{return xref;}
00060 inline double Y()const{return yref;}
00061 inline double Yref()const{return yref;}
00062 inline double T0()const{return t0;}
00063 inline double CosPhi0()const{return cphi0;}
00064 inline double SinPhi0()const{return sphi0;}
00065 inline double Doca_Len()const{return len;}
00066 inline double Doca_FLen()const{return len*sqrt(1.0+tanl*tanl);}
00067 inline double Doca_Tof()const{return len*sqrt(1.0+tanl*tanl)/MdcxParameters::c;}
00068 inline double Doca_Zh()const{return zh;}
00069 inline int Doca_Samb()const{return samb;}
00070 inline int Doca_Wamb()const{return wamb;}
00071 inline double Doca_Eang()const{return eang;}
00072 inline double Omin()const{return omin;}
00073 inline int Mode()const{return mode;}
00074 inline int Code()const{return code;}
00075 inline int Nfree()const{return nfree;}
00076 inline int Ominfl()const{return ominfl;}
00077 inline int Qd0()const{return qd0;}
00078 inline int Qphi0()const{return qphi0;}
00079 inline int Qomega()const{return qomega;}
00080 inline int Qz0()const{return qz0;}
00081 inline int Qtanl()const{return qtanl;}
00082 inline int Qt0()const{return qt0;}
00083 double Xc()const;
00084 double Yc()const;
00085 double X0()const;
00086 double Y0()const;
00087 double Xh(double l)const;
00088 double Yh(double l)const;
00089 double Zh(double l)const;
00090 double Px(double l=0.0)const;
00091 double Py(double l=0.0)const;
00092 double Pz(double l=0.0)const;
00093 double Ptot(double l=0.0)const;
00094 double Lmax()const;
00095
00096
00097 double Doca(double WX,double WY,double WZ,double X,double Y,double Z=0.0);
00098 double Doca(const MdcxHit& h);
00099
00100 void print()const;
00101 void flip();
00102
00103
00104 std::vector<float> derivatives(const MdcxHit& h);
00105 void SetRef(double x, double y);
00106
00107
00108 void SetMode(int n);
00109 void SetD0(int n);
00110 void SetPhi0(int n);
00111 void SetOmega(int n);
00112 void SetZ0(int n);
00113 void SetTanl(int n);
00114 void SetT0(int n);
00115 inline void SetTurnFlag(const int &i) {turnflag=i;}
00116 inline int GetTurnFlag()const {return turnflag;}
00117
00118
00119 MdcxHel& operator=(const MdcxHel&);
00120
00121 protected:
00122
00123 double d0;
00124 double phi0;
00125 double omega;
00126 double z0;
00127 double tanl;
00128 double t0;
00129 double xref;
00130 double yref;
00131 double cphi0;
00132 double sphi0;
00133 double x0;
00134 double y0;
00135 double xc;
00136 double yc;
00137 int code;
00138
00139
00140
00141
00142
00143
00144
00145 int mode;
00146
00147 int qd0;
00148 int qphi0;
00149 int qomega;
00150 int qz0;
00151 int qtanl;
00152 int qt0;
00153 int nfree;
00154 int ominfl;
00155 int turnflag;
00156
00157
00158 double omin;
00159
00160
00161
00162 double len,phi,xh,yh,zh,vx,vy,vz,cosl,sinl,f0,tx,ty,tz;
00163 Hep3Vector wvec,tvec,vhat,dvec;
00164 int samb,wamb; double eang;
00165
00166
00167 double CalcPhi(double xf,double yf,double xl,double yl) const{
00168 double phit=atan2(yl-yf,xl-xf); return phit<0?phit+2*M_PI:phit;
00169 }
00170 int deltaq(int i,int j) const { return i==j?0:i==0?1:-1; }
00171 void decode(const int i, int& i1, int& i2,
00172 int& i3, int& i4, int& i5, int& i6,int& n);
00173 void copy(const MdcxHel& hel);
00174
00175 };
00176
00177
00178 #endif