00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015 #include "MessageService/MsgService.h"
00016 #include "MessageService/MsgFormat.h"
00017
00018 #include "TMatrixD.h"
00019
00020 #include "CandFitTrackSA/DataFT.h"
00021 #include "CandFitTrackSA/ConstFT.h"
00022 #include "CandFitTrackSA/TracerSA.h"
00023
00024 #include "CandFitTrackSA/FitResult.h"
00025
00026 #include <cmath>
00027
00028 CVSID("$Id: FitResult.cxx,v 1.5 2007/02/04 06:10:47 rhatcher Exp $");
00029
00030 using namespace ConstFT;
00031
00032
00036 FitResult::FitResult() :
00037 fFitErrM(NTrackParams, NTrackParams),
00038 ftrackout(NTrackParams), fChi2(0), fdchi2(0),
00039 fNPlanes(0), fNHits(0)
00040 {
00041 TracerSA trace("FitResult::FitResult()");
00042 }
00043
00044
00048 FitResult::FitResult(const TMatrixD& fitErrMatrix, const TVectorD& fitParams,
00049 Double_t chi2, Double_t dchi2, Int_t nplanes, Int_t nhits) :
00050 fFitErrM(fitErrMatrix), ftrackout(fitParams),
00051 fChi2(chi2), fdchi2(dchi2),
00052 fNPlanes(nplanes), fNHits(nhits)
00053 {
00054 TracerSA trace(
00055 "FitResult::FitResult(const TMatrixD&,const TVectorD&,double,double,int)"
00056 );
00057 }
00058
00059
00063 Int_t FitResult::GetQ() const
00064 {
00065 TracerSA trace("FitResult::GetQ()");
00066 return (Int_t) TMath::Sign(1., ftrackout[kQoverP]);
00067 }
00068
00069
00073 Double_t FitResult::GetP() const
00074 {
00075 TracerSA trace("FitResult::GetP()");
00076 if ( TMath::Abs(ftrackout[kQoverP]) > TinyNumber ) {
00077 return TMath::Abs(1./ftrackout[kQoverP]);
00078 } else {
00079 return -1.;
00080 }
00081 }
00082
00083
00087 Double_t FitResult::GetEP() const
00088 {
00089 TracerSA trace("FitResult::GetEP()");
00090 if ( fFitErrM[kQoverP][kQoverP] > TinyNumber &&
00091 TMath::Abs(ftrackout[kQoverP]) > TinyNumber ) {
00092 return pow(ftrackout[kQoverP],-2)*sqrt(fFitErrM[kQoverP][kQoverP]);
00093 } else {
00094 return -1.;
00095 }
00096 }
00097
00098
00102 Double_t FitResult::GetFitParameterError(int i) const
00103 {
00104 return pow( TMath::Max(TinyNumber,fFitErrM(i,i)), 0.5 );
00105 }