/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcxReco/MdcxReco-00-01-59/MdcxReco/MdcxHel.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: MdcxHel.h,v 1.7 2011/12/08 06:52:29 zhangy Exp $
00004 //
00005 // Description:
00006 //      Class Header for |MdcxHel| and |MdcxFittedHel| - helix fitting classes
00007 //
00008 // Environment:
00009 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00010 //
00011 // Author List:
00012 //      S. Wagner
00013 //
00014 // Copyright Information:
00015 //      Copyright (C) 1996      BEPCII
00016 // 
00017 // History:
00018 //      Migration for BESIII MDC
00019 //
00020 //------------------------------------------------------------------------
00021 #ifndef _MDCXHEL_
00022 #define _MDCXHEL_
00023 
00024 //MdcxHel & MdcxFittedHel classes ...
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 //class MdcxHit;//yzhang del
00036 
00037 class MdcxHel {
00038 
00039 public:
00040 
00041   //constructors
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   //destructor
00049   
00050   virtual ~MdcxHel( );
00051   
00052   //access
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   //workers
00097   double Doca(double WX,double WY,double WZ,double X,double Y,double Z=0.0);
00098   double Doca(const MdcxHit& h);
00099   //double Doca(const MdcxHit& h) { return Doca( h.wx(), h.wy(), h.wz(), h.x(), h.y() ); }
00100   void print()const; //print this helix
00101   void flip(); //flip this helix if moving towards origin
00102   
00103   //set values
00104   std::vector<float> derivatives(const MdcxHit& h);
00105   void SetRef(double x, double y);
00106   
00107   //controls
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   //operators
00119   MdcxHel& operator=(const MdcxHel&);
00120   
00121   protected:
00122   
00123   double d0;     // signed distance of closest approach (of helix to z axis)
00124   double phi0;   // direction
00125   double omega;  // signed 1/r
00126   double z0;     // z value (at DOCA of helix to z axis)
00127   double tanl;   // tangent of dip angle
00128   double t0;     // zero of time
00129   double xref;   // x of ref pt of fit
00130   double yref;   // y of ref pt of fit
00131   double cphi0;  // cos(phi0)
00132   double sphi0;  // sin(phi0)
00133   double x0;
00134   double y0;
00135   double xc;
00136   double yc;
00137   int  code;   // derivative control 
00138                // specify which derivatives to calculate
00139                // digits -> t0 tanl z0 omega phi0 d0
00140                // 11111  is standard 5 parameter helix fit
00141                // 111111 includes t0
00142                // 11     is a 2D straight line fit (if omega=0.0)
00143                // 111    is the Dahl-Lynch 2D circle fit
00144                // 11011  is a 3D straight line fit (if omega=0.0)
00145   int  mode;   // 0=>unsign drift time; mode=1=>signed drift time
00146                // free in fit if q-variable non-zero (true)
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   //static control parameters
00158     double omin;        // omega straight line <-> helix cut-off
00159   
00160   //invisible data (calculated by Doca; used by other fcns which first call
00161   //Doca or assume Doca is already called)
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   //utility functions
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   }//endof CalcPhi
00170   int deltaq(int i,int j) const { return i==j?0:i==0?1:-1; } //integer comparisons 
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 //endof MdcxHel
00177 
00178 #endif

Generated on Tue Nov 29 23:13:36 2016 for BOSS_7.0.2 by  doxygen 1.4.7