Main Page   Class Hierarchy   Compound List   File List   Compound Members  

kfitterbase.h

00001 //
00002 // $Id: kfitterbase.h,v 1.11 2002/04/22 11:07:44 jtanaka Exp $
00003 //
00004 // $Log: kfitterbase.h,v $
00005 // Revision 1.11  2002/04/22 11:07:44  jtanaka
00006 // bug fix for virtual functions (Kataoka-san's info.).
00007 //
00008 // Revision 1.10  2002/03/27 23:42:30  jtanaka
00009 // Add new fitter to the mass-constraint fit.
00010 //
00011 // Revision 1.9  2002/01/03 11:04:36  katayama
00012 // Point3D and other header files are cleaned
00013 //
00014 // Revision 1.8  2001/12/23 09:58:22  katayama
00015 // removed Strings.h
00016 //
00017 // Revision 1.7  2000/06/07 12:31:45  jtanaka
00018 // add m_errorMsgFlag to control "dump error message".
00019 // Default is ON. errorMsg(0) --> OFF.
00020 //
00021 // Revision 1.6  2000/03/07 17:09:12  jtanaka
00022 // bug fixed, use "similarity" etc.
00023 //
00024 // Revision 1.5  2000/03/07 10:52:37  katayama
00025 // compatibility with CC5.0
00026 //
00027 // Revision 1.4  1999/07/19 18:06:56  jtanaka
00028 // bug fix : chisq
00029 //
00030 // Revision 1.3  1999/07/19 15:58:35  jtanaka
00031 // added Mdst_charged
00032 //
00033 // Revision 1.2  1999/05/26 12:02:29  jtanaka
00034 // speed up etc.
00035 //
00036 // Revision 1.1  1999/03/29 05:38:15  jtanaka
00037 // new class structure, new+old interfaces
00038 //
00039 //
00040 //
00041 // kfitterbase of KFitter
00042 //
00043 // ver3.0  : 1999/03
00044 //
00045 // author  : jtanaka
00046 // e-mail  : jtanaka@hep.phys.s.u-tokyo.ac.jp
00047 //
00048 #ifndef KFITTERBASE_H
00049 #define KFITTERBASE_H
00050 #include "kfitter/kfitterparticle.h"
00051 #include "kfitter/kfittererror.h"
00052 #include <iostream>
00053 #include <vector>
00054 #include "CLHEP/Matrix/Matrix.h"
00055 #include "CLHEP/Matrix/SymMatrix.h"
00056 #include "CLHEP/Vector/ThreeVector.h"
00057 #include "CLHEP/Vector/LorentzVector.h"
00058 #ifndef CLHEP_POINT3D_H
00059 #include "CLHEP/Geometry/Point3D.h"
00060 #endif
00061 #if KF_WITH_BELLE_INTERFACE
00062 class Mdst_charged;
00063 #endif
00064 
00065 class kfitterbase {
00066 public:
00067   kfitterbase(void);
00068   virtual ~kfitterbase(void);
00069 
00070   //input interface
00071   void addTrack(const HepLorentzVector &p, 
00072                 const HepPoint3D &x,
00073                 const HepSymMatrix &e, 
00074                 const double q);
00075 #if KF_WITH_OLD_INTERFACE
00076   void addTrack(const HepLorentzVector&,
00077                 const HepPoint3D&,
00078                 const HepSymMatrix&, 
00079                 const double,
00080                 const double); // obsolete
00081 #endif
00082   void addTrack(const kfitterparticle&);
00083 #if KF_WITH_BELLE_INTERFACE
00084   void addTrack(const Mdst_charged&, 
00085                 const double mass = 0.139570,
00086                 const unsigned id = 2);
00087 #endif
00088   void magneticField(const double);
00089   virtual void correlation(const HepMatrix&);
00090   virtual void correlation(void);
00091   void errorMsg(unsigned int);
00092   
00093   //fit
00094   virtual unsigned fit(void);
00095 
00096   //output interface
00097   unsigned          error(void);
00098   unsigned          tracks(void);
00099   unsigned          iteration(void);
00100   virtual unsigned  dgf(void);
00101   virtual double    chisq(void);
00102   virtual double    cl(void);
00103   virtual double    chisq(const unsigned);
00104   double            magneticField(void);
00105   HepLorentzVector  momentum(const unsigned);
00106   HepPoint3D        position(const unsigned);
00107   HepSymMatrix      error(const unsigned);
00108   kfitterparticle   track(const unsigned);
00109   virtual HepMatrix         correlation(const unsigned, 
00110                                         const unsigned, 
00111                                         const unsigned = KF_AFTER_FIT);
00112 
00113   virtual void clear(void);
00114   virtual void dump(const unsigned = KF_DUMP_MEASUREMENT);
00115 
00116 #if KF_WITH_OLD_INTERFACE
00117   void add_track(const HepLorentzVector &p, const Hep3Vector &x,
00118                  const HepSymMatrix &e, double q, double m) { addTrack(p,static_cast<const HepPoint3D&>(x),e,q,m); }
00119   void add_track(const kfitterparticle &kp) { addTrack(kp); }
00120   void set_magneticfield(double m){ magneticField(m); }
00121   void set_correlation(const HepMatrix &e) { correlation(e); }
00122   void set_correlation() { correlation(); }
00123 
00124   int start() { return static_cast<int>(fit()); }
00125 
00126   int               get_dgf() { return static_cast<int>(dgf()); }
00127   double            get_chisq() { return chisq(); }
00128   double            get_CL() { return cl(); }
00129   HepLorentzVector  get_4momentum(int i) { return momentum(i); }
00130   Hep3Vector        get_position(int i) { return static_cast<Hep3Vector>(position(i)); }
00131   HepSymMatrix      get_err_track(int i) { return error(i); }
00132   kfitterparticle   get_track(int i) { return track(i); }
00133   HepMatrix         get_err_track(int i, int j) { return correlation(i,j); }
00134 #endif //KF_WITH_OLD_INTERFACE
00135 
00136 protected:
00137   std::vector<kfitterparticle> m_plist;
00138   double                       m_magneticField;
00139   std::vector<HepMatrix>       m_correlation_b;
00140   
00141   //statistic parameter
00142   unsigned m_dgf;
00143   double   m_chisq;
00144   double   m_cl;
00145   
00146   //other parameters
00147   unsigned m_trackNum;
00148   unsigned m_necessaryTrackNum;
00149   unsigned m_errorFlag;
00150   unsigned m_correlationFlag;
00151   unsigned m_overIterationFlag;
00152   unsigned m_errorMsgFlag;
00153 
00154   //input functions
00155   virtual unsigned m_setInputMatrix(void) = 0;
00156   virtual unsigned m_setCorrelation(void);
00157 
00158   //output functions
00159   virtual unsigned m_setOutputMatrix(void) = 0;
00160   HepSymMatrix m_makeError(const HepLorentzVector&,
00161                            const HepMatrix&);
00162   HepMatrix    m_makeError(const HepLorentzVector&,
00163                            const HepLorentzVector&,
00164                            const HepMatrix&);
00165   HepMatrix    m_makeError2(const HepLorentzVector&,
00166                             const HepMatrix&);
00167 
00168   HepSymMatrix m_makeError3(const HepLorentzVector &,
00169                             const HepMatrix &,
00170                             const int isFixMass);
00171   HepMatrix m_makeError3(const HepLorentzVector &p1,
00172                          const HepLorentzVector &p2,
00173                          const HepMatrix &e,
00174                          const int isFixMass1,
00175                          const int isFixMass2);
00176   HepMatrix    m_makeError4(const HepLorentzVector &p,
00177                             const HepMatrix &e);
00178 
00179   //fit functions
00180   virtual unsigned m_makeCoreMatrix(void) = 0;
00181   virtual unsigned m_calDgf(void) = 0;
00182 
00183   //matrix
00184   HepSymMatrix m_V_al_0;
00185   HepMatrix    m_al_0;
00186   HepMatrix    m_al_1;
00187   HepMatrix    m_al_a;
00188   HepMatrix    m_property;
00189 
00190   HepMatrix    m_D;
00191   HepMatrix    m_d;
00192 
00193   HepMatrix    m_V_D;
00194 
00195   HepMatrix    m_V_al_1;
00196   HepMatrix    m_lam;
00197 };
00198 
00199 #endif /* KFITTERBASE_H */

Generated on Tue Apr 13 13:25:32 2004 for ATLAS JAPAN by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002