00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
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
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);
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
00094 virtual unsigned fit(void);
00095
00096
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
00142 unsigned m_dgf;
00143 double m_chisq;
00144 double m_cl;
00145
00146
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
00155 virtual unsigned m_setInputMatrix(void) = 0;
00156 virtual unsigned m_setCorrelation(void);
00157
00158
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
00180 virtual unsigned m_makeCoreMatrix(void) = 0;
00181 virtual unsigned m_calDgf(void) = 0;
00182
00183
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