00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: MdcxFittedHel.h,v 1.5 2010/09/26 00:31:13 zhangy Exp $ 00004 // 00005 // Description: 00006 // Class Header for |MdcxFittedHel| - helix fitting class 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) 1995 BEPCII 00016 // 00017 // History: 00018 // Migration for BESIII MDC 00019 // 00020 //------------------------------------------------------------------------ 00021 #ifndef _MDCXFITTEDHEL_ 00022 #define _MDCXFITTEDHEL_ 00023 00024 //MdcxHel & MdcxFittedHel classes ... 00025 #include <iostream> 00026 #include <fstream> 00027 #include "MdcxReco/MdcxHel.h" 00028 #include "CLHEP/Alist/AList.h" 00029 00030 class MdcxHit; 00031 00032 //MdcxFittedHel follows: (fitted helix class) 00033 class MdcxFittedHel:public MdcxHel{ 00034 public: 00035 //constructors 00036 MdcxFittedHel(); 00037 00038 //hits+initial guess constructor 00039 MdcxFittedHel(HepAList<MdcxHit> &XHitList, MdcxHel &hel, double Sfac=1.0); 00040 00041 //destructor 00042 virtual ~MdcxFittedHel( ); 00043 00044 //accessors 00045 inline float Chisq()const{return chisq;} 00046 inline float Rcs()const{return rcs;} 00047 inline float Prob()const{return prob;} 00048 inline float Fittime()const{return fittime;} 00049 inline int Nhits()const {return nhits;} 00050 inline int Itofit()const {return itofit;} 00051 inline int Quality()const {return quality;} 00052 inline int Origin()const {return origin;} 00053 inline double Sfac()const {return sfac;} 00054 inline void SetQuality(const int &q) {quality=q;} 00055 inline void SetUsedOnHel(const int &i) {usedonhel=i;} 00056 inline int GetUsedOnHel()const {return usedonhel;} 00057 int SuperLayer(int hitno=0)const; // return superlayer of |hitno 00058 int Layer(int hitno=0)const; // return layer number of |hitno| 00059 inline const HepAList<MdcxHit> &XHitList() const { return xHitList; } 00060 00061 //workers 00062 float Residual(int i); 00063 float Pull(int i); 00064 int Fail(float Probmin=0.0)const; 00065 int ReFit(); 00066 int FitPrint(); 00067 int FitPrint(MdcxHel &hel, std::ostream &o); 00068 void VaryRes(); 00069 00070 //operators 00071 MdcxFittedHel& operator=(const MdcxHel&);// copy helix to fitted helix 00072 MdcxFittedHel& operator=(const MdcxFittedHel&); // copy fitted helix to fitted helix 00073 MdcxFittedHel& Grow(const MdcxFittedHel&, const HepAList<MdcxHit> &); 00074 00075 //workers 00076 00077 protected: 00078 00079 //data 00080 int fail; //fit failure codes 00081 float chisq; //chisq of hit 00082 float rcs; //chisq per dof 00083 float prob; //chisq prob of hit 00084 float fittime; //fit time in clock time (machine dep) 00085 int nhits; //number of hits 00086 int itofit; //number of iterations to convergence 00087 int quality; // bigger quality=>great purity 00088 int origin; // origin "hit", -1 if none 00089 HepAList<MdcxHit> xHitList; // list-of-hits making this |MdcxFittedHel| 00090 double sfac; // error scale factor for fit 00091 int usedonhel; 00092 00093 //functions 00094 //fitting routine 00095 int DoFit(); 00096 int IterateFit(); 00097 00098 private: 00099 00100 //data 00101 00102 //control 00103 void basics(); 00104 void basics(const HepAList<MdcxHit> &); 00105 00106 //check for included origin, if there move to end of |xHitList| 00107 //-1=>no origin; >=0 is hit number of origin 00108 int OriginIncluded(); // origin included 00109 00110 //static control parameters 00111 int bailout; // bailout if chisq/ndof too big? 00112 float chidofbail; // bailout cutoff 00113 int niter; // max number of iterations 00114 //static control sets 00115 public: 00116 static int debug; 00117 inline void SetBailOut(int i) {bailout=i;} 00118 inline void SetChiDofBail(float r) {chidofbail=r;} 00119 inline void SetNiter(int i) {niter=i;} 00120 00121 };// endof MdcxFittedHel 00122 00123 #endif 00124