00001
00009 #ifndef __PARTICLEFITOBJECT_H
00010 #define __PARTICLEFITOBJECT_H
00011
00012 #include "BaseFitObject.h"
00013
00014
00015
00017
00062 class ParticleFitObject: public BaseFitObject {
00063 public:
00065 ParticleFitObject();
00067 virtual ~ParticleFitObject();
00068
00070 virtual bool setParam (int ilocal,
00071 double par_,
00072 bool measured_,
00073 bool fixed_ = false
00074 );
00076 virtual bool setParam (int ilocal,
00077 double par_
00078 );
00080 virtual bool setMParam (int i, double mpar_ );
00082 virtual bool setError (int ilocal,
00083 double err_
00084 );
00086 virtual bool setCov (int ilocal,
00087 int jlocal,
00088 double cov_
00089 );
00091 virtual bool setMass (double mass_);
00094 virtual bool setGlobalParNum (int ilocal, int iglobal);
00096 virtual bool fixParam (int ilocal,
00097 bool fix=true
00098 );
00099
00101 virtual double *getCovMatrix() {return cov[0];};
00103 virtual double getParam (int ilocal
00104 ) const;
00106 virtual double getMParam (int iocal
00107 ) const;
00109 virtual double getError (int ilocal
00110 ) const;
00112 virtual double getCov (int ilocal,
00113 int jlocal
00114 ) const;
00116 virtual bool isParamMeasured (int ilocal) const;
00118 virtual bool isParamFixed (int ilocal) const;
00120 virtual int getGlobalParNum(int ilocal) const;
00122 virtual int getNPar() const {return NPAR;};
00123
00125 virtual void addToGlobCov(double *globCov,
00126 int idim
00127 ) const;
00128
00130 virtual std::ostream& print4Vector (std::ostream& os
00131 ) const;
00132
00134 virtual double getPx() const = 0;
00135 virtual double getPy() const = 0;
00136 virtual double getPz() const = 0;
00137 virtual double getE() const = 0;
00138
00139 virtual double getP() const = 0;
00140 virtual double getP2() const = 0;
00141 virtual double getPt() const = 0;
00142 virtual double getPt2() const = 0;
00143
00144 virtual double getDPx(int ilocal) const = 0;
00145 virtual double getDPy(int ilocal) const = 0;
00146 virtual double getDPz(int ilocal) const = 0;
00147 virtual double getDE(int ilocal) const = 0;
00148
00151 virtual void addToDerivatives (double der[],
00152 int idim,
00153 double pxfact=0,
00154 double pyfact=0,
00155 double pzfact=0,
00156 double efact=0
00157 ) const = 0;
00160 virtual void addTo2ndDerivatives (double der2[],
00161 int idim,
00162 double pxfact,
00163 double pyfact,
00164 double pzfact,
00165 double efact
00166 ) const = 0;
00167
00169 virtual double getChi2() const;
00171 virtual double getDChi2DParam (int ilocal
00172 ) const;
00174 virtual double getD2Chi2DParam2(int ilocal,
00175 int jlocal
00176 ) const;
00177
00179 virtual void addToGlobalChi2DerMatrix (int idim,
00180 double *M
00181 ) const;
00183 virtual void addToGlobalDerMatrix (int idim,
00184 double c,
00185 double *M
00186 ) const = 0;
00187
00189 virtual void invalidateCache() const {};
00190
00192 virtual std::ostream& print (std::ostream& os
00193 ) const;
00194
00195 protected:
00197 virtual bool calculateCovInv() const;
00198
00200 enum {NPAR = 3};
00202 double mass;
00204 double par[NPAR];
00206 double mpar[NPAR];
00208 bool measured[NPAR];
00210 bool fixed[NPAR];
00212 int globalParNum [NPAR];
00214 double cov [NPAR][NPAR];
00216 mutable double covinv [NPAR][NPAR];
00218 mutable bool covinvvalid;
00219
00220 };
00221
00222 #endif // __PARTICLEFITOBJECT_H
00223