11 #include "TNumDeriv.h"
14 #include "TLorentzVector.h"
15 #include "THelixTrack.h"
16 #if ROOT_VERSION_CODE < 331013
27 for (
int i=0;i<5;i++) (&fBigM)[i]=
new TMatrixD;
33 for (
int i=0;i<5;i++) {*((&fBigM)[i])=0.;}
45 for (
int i=0;i<4;i++)
delete (&fBigM)[i];
51 fDat->SetFitter(
this);
57 int nBig = fUPars+fUCons;
62 fBigM->ResizeTo(nBig,nBig); (*fBigM)*=0.0;
63 fBigI->ResizeTo(nBig,nBig);
64 fBigB->ResizeTo(nBig,1);
65 fOldP->ResizeTo(nBig,1);
66 fAddP->ResizeTo(nBig,1);
68 for (
int j1=0;j1<fUMeas; j1++) {
69 int i1 = fDat->GetId(j1);
70 if (!fIter) (*fOldP )[j1][ 0] = fDat->GetPar(i1);
71 (*fBigB )[j1][ 0] = -fDat->DFcn(i1);
72 (*fBigM)[j1][j1] = fDat->DDFcn(i1,i1);
73 for (
int j2=0;j2<j1; j2++) {
74 int i2 = fDat->GetId(j2);
75 (*fBigM)[j1][j2] = fDat->DDFcn(i1,i2);
76 (*fBigM)[j2][j1] = (*fBigM)[j1][j2];
79 for (
int jc=0;jc<fUCons; jc++) {
80 int ic = fDat->GetId(jc+fUPars);
81 double cc = fDat->GetPar(ic);
82 (*fBigB )[jc+fUPars][0] = -cc;
83 for (
int jx=0;jx<fUPars; jx++) {
84 int ix = fDat->GetId(jx);
85 double cx = fDat->DCon(ic,ix);
86 (*fBigM)[fUPars+jc][jx] = cx;
87 (*fBigM)[jx][fUPars+jc] = cx;
91 for (
int jx=0; jx<fUPars;jx++) {
92 for (
int jc=0;jc<fUCons;jc++) {
93 (*fBigB )[jx][ 0] -= (*fOldP)[fUPars+jc][0]*(*fBigM)[jx][fUPars+jc];
97 fBigM->Print(
"CheckOut.BigM");
98 fBigB->Print(
"CheckOut.BigB");
99 fDat->Print(
"CheckOut.dat");
108 for (
int jx=0;jx<fUPars;jx++) {
109 int ix = fDat->GetId(jx);
110 fDat->GetPar(ix) = (*fOldP)[jx][0] + (*fAddP)[jx][0];
119 if (fDat->Ready())
return kBadAprx;
120 fUPars = fDat->GetUPars();
121 fUMeas = fDat->GetUMeas();
122 fUCons = fDat->GetUCons();
124 fCuts = 0; fFitRes=0;
126 fFcnQA[0]=3e33; fFcnQA[1]=3e33;
127 fConQA[0]=3e33; fConQA[1]=3e33;
128 fAddQA[0]=3e33; fAddQA[1]=3e33;
133 for (fIter=0; fIter < fMaxIter; fIter++)
138 case kNextStep: (*fOldP)+=(*fAddP); FitStep();
break;
140 case kNextCut: CutStep();
break;
142 case kEndFit: EndStep();
return fFitRes;
144 case kBadFit: EndStep();
return fFitRes;
148 if (fDebug>=2) PriStep(
"OneIter");
165 (*fBigI).Invert(&det);
166 (*fAddP) = (*fBigI)*(*fBigB);
174 (*fAddP)*=0.5;
return 0;
179 fDat->SetFail(fFitRes);
180 if (fDebug>=1) PriStep(
"EndStep");
181 if (fDebug>=2) fDat->Print(
"EndStep");
185 int TCFit::CheckStep()
189 if (fIter==0)
return kNextStep;
191 fFcnQA[0] = fDat->GetFcn();
194 for (
int jc=0;jc<fUCons; jc++) {
195 int ic = fDat->GetId(jc+fUPars);
196 fConQA[0]+= fabs(fDat->GetPar(ic)/fDat->GetTiny(ic));
198 if (fUCons>1) fConQA[0]/=fUCons;
199 for (
int jx=0;jx<fUMeas; jx++) {
200 int ix = fDat->GetId(jx);
201 fAddQA[0]+= fabs((*fAddP)[jx][0]/fDat->GetTiny(ix));
205 if (fAddQA[0]<1. && fConQA[0] <1.)
return kEndFit;
207 if (fFcnQA[0] > fDat->GetBigFcn() ) fFitRes |=kBadFcn;
208 if (fConQA[0] > 1e10 ) fFitRes |=kBadCon;
209 if (fFitRes)
return kBadFit;
211 if (fAddQA[0]<fAddQA[1]
212 || fConQA[0]<fConQA[1]
213 || fFcnQA[0]<fFcnQA[1]
224 double TCFit::ErMx(
int jcol,
int jrow)
const
226 return (*fBigI)[jcol][jrow];
229 int TCFit::PriStep(
const char *where)
231 if (where==0)where=
"";
232 printf(
"PriStep(%s) Iter=%d Cut=%d Akt=%d Fcn=%g(%g) Con=%g(%g) Add=%g(%g)\n"
233 ,where,fIter,fCuts,fAkt
234 ,fFcnQA[0],fFcnQA[1],fConQA[0],fConQA[1],fAddQA[0],fAddQA[1]);
250 double Con(
int icon);
252 double MyDFcn(
int ix);
253 double MyDDFcn(
int ix);
255 int Approx() {
return 0;}
263 mX[0]=mX[1]=mX[2]=1.1;
265 AddPar(0,0, mX,3,
"X",0.0001);
266 AddPar(2,3,&mC,1,
"C",0.0001);
271 return mX[0]*mX[0]/1. + mX[1]*mX[1]/4 + mX[2]*mX[2]/9;
274 double TEST0::MyDFcn(
int ix)
277 case 0:
return 2*mX[0];
278 case 1:
return 2*mX[1]/4;
279 case 2:
return 2*mX[2]/9;
281 assert(0);
return 0.;
285 double TEST0::MyDDFcn(
int ix)
292 assert(0);
return 0.;
296 double TEST0::Con(
int)
306 TCFit f0(
"Test0",&t0);
307 for (
int itst=0;itst<3;itst++) {
308 double d1 = t0.DFcn(itst);
309 double d2 = t0.MyDFcn(itst);
310 double dd1 = t0.DDFcn(itst,itst);
311 double dd2 = t0.MyDDFcn(itst);
312 printf(
"%d %g %g %g %g\n",itst,d1,d2,dd1,dd2);
324 Double_t Fcn(Double_t arg);
325 void SetKind(
int kind) { fKind=kind;}
337 Double_t Deriv1st::Fcn(Double_t arg)
339 double save = fFitData->GetPar(fIArg);
340 SetStep(fFitData->GetTiny(fIArg));
341 fFitData->GetPar(fIArg)+=arg;
342 fFitData->Update(); fFitData->Modify(0);
343 double ans = (fKind==(-1)) ? fFitData->Fcn() :fFitData->Con(fKind);
344 fFitData->GetPar(fIArg)=save;
345 fFitData->Update(); fFitData->Modify(0);
355 Double_t Fcn(Double_t arg);
356 void SetKind(
int kind) { fD1->SetKind(kind);}
357 void SetIJArg(
int i,
int j);
369 Deriv2nd::~Deriv2nd()
374 void Deriv2nd::SetIJArg(
int i,
int j)
380 Double_t Deriv2nd::Fcn(Double_t arg)
382 double save = fFitData->GetPar(fIArg);
383 fFitData->GetPar(fIArg)+=arg;
384 fFitData->Update(); fFitData->Modify(0);
385 double ans = fD1->DFcn(0.);
386 fFitData->GetPar(fIArg)=save;
387 fFitData->Update(); fFitData->Modify(0);
392 TCFitData::TCFitData(
const char *name,
const char *title):TNamed(name,title)
400 void TCFitData::Reset()
402 memset(fBeg,0,
fEnd-fBeg+1);
403 memset(fFixs,1,
sizeof(fFixs));
404 for (
int i=0; i<kMaxId;i++) fNams[i]=
"";
410 TCFitData::~TCFitData()
418 assert(0<=tyPar && tyPar<=2);
419 assert(0<=idPar && idPar+nPars<kMaxId);
420 if (fFail )
return fFail;
422 if (tiny<=0) tiny = 1e-3;
424 for (
int j=0;j<nPars;j++) {
426 if (name[0]) ts=name;
else ts=idPar;
427 if (nPars>1) { ts +=
"["; ts +=j; ts+=
"]";}
429 fTiny[idPar+j]= tiny;
430 fPars[idPar+j]= par+j;
432 fTyps[idPar+j]= tyPar;
435 assert(
fNPars[tyPar]<=kMaxId);
439 Int_t TCFitData::GetId(
const char *name)
const
442 int n = fNPars[0]+fNPars[1]+fNPars[2];
443 for (
int j=0;i<n;j++) {
444 if (!fNams[j].Length())
continue;
446 if (fNams[j]==name)
return j;
448 printf(
"TCFitData::GetId(\"%s\") UNKNOWN name\n",name);
452 const char *TCFitData::GetNam(Int_t idx)
const
454 return fNams[idx].Data();
457 int TCFitData::GetType(
int id)
const
465 int TCFitData::GetId(
int jdx)
const
470 int TCFitData::GetJd(
int idx)
const
476 void TCFitData::FixPar(
int idx,
int yes)
479 assert(fNams[idx].Length());
480 if (fFixs[idx]==yes)
return;
486 int TCFitData::IsFixed(
int idx)
const
487 {
return fFixs[idx];}
490 double TCFitData::GetPar (
int idx)
const
491 {
return *
fPars[idx];}
493 double &TCFitData::GetPar (
int idx)
498 void TCFitData::Evaluate()
500 if (Modified()) Update(); Modify(0);
502 for (
int jc=GetUPars();jc<GetUPars()+GetUCons();jc++) {
504 GetPar(ic) = Con(ic);
508 int TCFitData::Ready()
511 for (
int ity=0;ity<3;ity++) {
512 for (
int i=0;i<kMaxId;i++) {
513 if (!fNams[i].Length())
continue;
514 if ( fFixs[i])
continue;
515 if (
fTyps[i]!=ity)
continue;
524 Double_t TCFitData::DFcn(
int ipar)
527 fD1st->SetIArg(ipar);
528 return fD1st->DFcn();
532 Double_t TCFitData::DDFcn(
int ipar,
int jpar)
535 fD2nd->SetIJArg(ipar,jpar);
536 return fD2nd->DFcn();
540 Double_t TCFitData::Con(
int)
546 Double_t TCFitData::DCon(
int icon,
int ipar)
548 fD1st->SetKind(icon);
549 fD1st->SetIArg(ipar);
550 return fD1st->DFcn();
553 double TCFitData::ErMx(
int icol,
int irow)
const
555 int jcol = GetJd(icol);
556 int jrow = GetJd(irow);
557 return fFitter->ErMx(jcol,jrow);
560 void TCFitData::Print(
const char *name)
const
562 static const char *ty[3]={
"Meas",
"Slack",
"Cnsr"};
563 static const char *fx[2]={
"Used",
"Fixed"};
565 if (!name) name =
"";
566 printf(
"TCFitData::Print(%s) nMeas=%d(%d) nSlac=%d(%d) nCons=%d(%d)\n"
568 ,GetNMeas(),GetUMeas()
569 ,GetNSlac(),GetUSlac()
570 ,GetNCons(),GetUCons());
571 for (
int i=0;i<kMaxId;i++) {
572 if (!fNams[i].Length())
continue;
573 printf(
"%2d - %s\t",i,fNams[i].Data());
574 printf(
" %s.%s ",ty[
fTyps[i]],fx[fFixs[i]]);
575 printf(
" %g \n",*
fPars[i]);
582 void TkPars::Print(
const char *tit)
const
585 printf(
"TkPars::Print(%s) \tDca=%g Z=%g Phi=%g ptin=%g tanl=%g curv=%g"
593 memset(
this,0,
sizeof(
TkPars));
597 void TkPars::SetHz(
double fact)
599 hz = (0.000299792458 * 4.98478)*fact;
604 for (
int i=0;i<5;i++) Arr()[i]+=a.Arr()[i];
605 if (
phi<-M_PI)
phi+=M_PI*2;
606 if (
phi> M_PI)
phi-=M_PI*2;
610 TLorentzVector TkPars::P4()
const
612 double pt = fabs(1./
ptin);
614 TLorentzVector v(pt*cos(
phi),pt*sin(
phi),pt*
tanl,e);
618 void TkPars::P4D(
double D[4][5])
const
620 enum {Kdca,Kz,Kphi,Kptin,Ktanl};
622 memset(D[0],0,4*5*
sizeof(D[0][0]));
623 double pt = fabs(1./
ptin);
624 double dpt = -pt/
ptin;
628 D[3][Kptin] = pt*(1.+
tanl*
tanl)/e*dpt;
629 D[3][Ktanl] = pt*pt*
tanl/e*dpt;
631 D[0][Kptin] = cos(
phi)*dpt;
632 D[1][Kptin] = sin(
phi)*dpt;
633 D[2][Kptin] =
tanl*dpt;
638 void TkPars::Set(
const TVector3 &v3,
const TVector3 &d3,
double pti)
643 if ((v3.Cross(d3)).Z()<0)
dca=-
dca;
645 tanl = d3.Pz()/d3.Pt();
649 void TkPars::Get(TVector3 *v3,TVector3 *d3,
double *pts)
const
652 if (d3 ) { v3->SetXYZ(cos(
phi),sin(
phi),
tanl); v3->SetMag(1.);}
653 if (pts) {*pts = 1./
ptin ;}
656 TVector3 TkPars::V3()
const
658 TVector3 v3; Get(&v3);
return v3;
663 TLorentzVector p4 = P4();
667 p4.Vect().GetXYZ(h+3);
672 const char* TkPars::Name(
int mem)
674 static const char* nams[]={
"Dca",
"Z",
"Phi",
"Ptin",
"TanL"};
678 double TkPars::Tiny(
int mem)
680 static const double tiny[]={3.14/180/10., 0.01, 3.14/180/10, 0.01, 0.001};
684 void TkPars::Rand(
const TkErrs &errs)
686 for (
int iv=0;iv<5;iv++) {
687 Arr()[iv]+= gRandom->Gaus(0.,sqrt(errs.Get(iv,iv)));
696 static const double DX=0.3,DZ=0.3,DPhi=0.03,DPti=1.,DTan=0.05;
697 memset(emx,0,
sizeof(emx));
698 double fak = 0.3*0.3;
701 emx[ 5]=DPhi*DPhi *fak;
702 emx[ 9]=DPti*DPti *fak;
703 emx[14]=DTan*DTan *fak;
706 void TkErrs::Set(
int i,
int j,
double err)
708 if (i<j) {
int ii=i; i=j; j=ii;}
709 emx[((i+1)*i)/2+j]=err;
712 double TkErrs::Get(
int i,
int j)
const
714 if (i<j) {
int ii=i; i=j; j=ii;}
715 return emx[((i+1)*i)/2+j];
718 void TkErrs::Invert()
723 double TkErrs::Xi2(
const TkPars &pars)
const
730 void TkErrs::Mpy(
const TkPars &pars,
double der[5])
const
736 TVector3 VxPars::V3()
const
737 {
return TVector3(x); }
748 void TCFitV0::Reset()
750 for (
int i=0;i<2;i++) {
756 memset(mBeg,0,mEnd-mBeg+1);
766 for (
int itk=0;itk<2;itk++) {
767 mTkBas[itk].Update();
768 mTEBas[itk].Invert();
771 for (
int mem=0;mem<5;mem++) {
772 TString ts(TkPars::Name(mem)); ts+=itk;
773 AddPar(kMEAS,10*itk+mem,mTkDif[itk].Arr()+mem,1,ts,TkPars::Tiny(mem));
777 AddPar(kSLAC,20,mLen,3,
"Len" ,0.001);
780 AddPar(kCNSR,30, mConr,7,
"Same+Nrgy",1e-4);
783 return TCFitData::Ready();
787 void TCFitV0::Update()
789 if (!Modified())
return;
791 double pos[3],dir[3];
792 TLorentzVector P4[3];
794 for (
int itk=0;itk<2;itk++) {
797 mTkFit[itk] = mTkBas[itk];
798 mTkFit[itk]+= mTkDif[itk];
799 mTkFit[itk].Fill(th);
800 th.
Eval(mLen[itk],pos,dir);
801 memcpy(mDConDL[itk],dir,
sizeof(dir));
802 double P = mTkFit[itk].P();
803 double E = mTkFit[itk].E();
804 P4[itk].SetXYZT(dir[0]*P,dir[1]*P,dir[2]*P,E);
805 Vx[itk] = TVector3(pos);
807 mTEBas[itk].Mpy(mTkDif[itk],mDFcn[itk]);
811 (P4[2].Vect()*(-1.)).Unit().GetXYZ(mDConDL[2]);
812 Vx[2]= TVector3(mVx.x)+ P4[2].Vect().Unit()*mLen[2];
813 (Vx[0]-Vx[2]).GetXYZ(mConr+0);
814 (Vx[1]-Vx[2]).GetXYZ(mConr+3);
815 mConr[6] = P4[2].M() - mMas;
816 mTkFit[0].P4D(mP4d[0]);
817 mTkFit[1].P4D(mP4d[1]);
823 int TCFitV0::Approx()
825 static int nCall=0; nCall++;
830 for (
int itk=0;itk<2;itk++) {mTkBas[itk].Fill(th[itk]);}
833 for (
int sgn=0;sgn<4;sgn++) {
836 s[0] = th[0].Path(th[1],&s[1]);
837 if (s[0]<100 && s[1]<100) {
838 for (
int itk=0;itk<2;itk++) {
839 th[itk].
Eval(s[itk],pos); Vx[itk].SetXYZ(pos[0],pos[1],pos[2]);}
840 double dis = (Vx[1]-Vx[0]).Mag();
843 mLen[0] = (sgn&1)? -s[0]:s[0];
844 mLen[1] = (sgn&2)? -s[1]:s[1];
849 if (disMin>100)
return 1;
850 Vx[2]=(Vx[0]+Vx[1])*0.5;
851 mLen[2] = Vx[2].Mag();
855 double TCFitV0::Fcn()
859 for (
int itk=0;itk<2;itk++) {
861 chi2+=mTEBas[itk].Xi2(mTkDif[itk]);
866 double TCFitV0::Con(
int ic)
872 double TCFitV0::DFcn(
int ipar)
875 assert( itk>=0 && itk <2);
877 assert( mem>=0 && mem <5);
878 return mDFcn[itk][mem];
881 double TCFitV0::DDFcn(
int ipar,
int jpar)
884 assert( itk>=0 && itk <2);
886 assert( jtk>=0 && jtk <2);
887 if (itk != jtk)
return 0.;
890 assert(ivar<5 && jvar<5);
891 return mTEBas[itk].Get(ivar,jvar);
894 double TCFitV0::DCon(
int icon,
int ipar)
896 if (ipar <20)
return TCFitData::DCon(icon,ipar);
897 if (icon==kCNRJ)
return 0.;
898 int tcon = (icon-kCX_0)/3;
899 int jcon = (icon-kCX_0)%3;
900 int jpar = ipar-kLEN_0;
901 switch(10*tcon+jpar) {
903 case 2: ;
case 12:
return mDConDL[jpar][jcon];
904 case 1: ;
case 10:
return 0.;
910 void TCFitV0::Print(
const char *name)
const
912 static const char *ty[3]={
"Meas",
"Slack",
"Cnsr"};
913 static const char *fx[2]={
"Used",
"Fixed"};
915 if (!name) name =
"";
916 printf(
"TCFitV0::Print(%s) nMeas=%d(%d) nSlac=%d(%d) nCons=%d(%d)\n"
918 ,GetNMeas(),GetUMeas()
919 ,GetNSlac(),GetUSlac()
920 ,GetNCons(),GetUCons());
921 for (
int i=0;i<kMaxId;i++) {
922 if (!fNams[i].Length())
continue;
924 if (i< 5) { p = mTkFit[0].Arr()+i ;}
925 else if (i<15) { p = mTkFit[1].Arr()+i -10;}
927 printf(
"%2d - %s\t",i,GetNam(i));
928 printf(
" %s.%s ",ty[GetType(i)],fx[IsFixed(i)]);
932 TCFitData::Print(name);
940 static double Pdk(
double ma,
double mb,
double mc)
942 double ma2 = ma*ma,ma4=ma2*ma2;
943 double mb2 = mb*mb,mb4=mb2*mb2;
944 double mc2 = mc*mc,mc4=mc2*mc2;
945 double ans= (ma4+mb4+mc4-2*ma2*mb2-2*ma2*mc2-2*mb2*mc2);
947 ans= sqrt(ans)/(2.*ma);
951 void TCFitV0::Test(
int mode)
953 static const double D0Mass=1.8646,PiMass=.13956995,KMass=.493677;
954 static const double D0Tau=0.415e-12,C=299792458e2;
955 static const double DX=0.003;
956 static const double D0P=1
957 ,D0Beta = D0P/sqrt(D0P*D0P+D0Mass*D0Mass)
958 ,D0Gama = 1./sqrt(1.-D0Beta*D0Beta)
959 ,D0Len = D0Tau*C*D0Gama*D0Beta;
960 static const double HZ= (0.000299792458 * 4.98478);
962 static const int NHISTS = 4;
963 static TCanvas* myCanvas=0;
964 static TH1F *hh[]={0,0,0,0,0,0};
965 static const char *hNams[]= {
"dL",
"dL/L",
"Xi2",
"Mass-D0"};
966 static const double LOW[] = {-D0Len,-3, 0.,-1.5};
967 static const double UPP[] = {-D0Len, 3,10., 1.5};
971 if(!myCanvas) myCanvas=
new TCanvas(
"TCircleFitter_Test",
"",600,800);
973 myCanvas->Divide(1,NHISTS);
974 for (
int i=0;i<NHISTS;i++) {
975 delete hh[i]; hh[i]=
new TH1F(hNams[i],hNams[i],100,LOW[i],UPP[i]);
976 myCanvas->cd(i+1); hh[i]->Draw();
979 TLorentzVector p4[3];
980 TVector3 dcayPos,d0Mom;
982 double Q = Pdk(D0Mass,PiMass,KMass);
985 TCFit tc(
"TestD0",&dat);
986 dat.mTkBas[0].SetHz(1.);
987 dat.mTkBas[1].SetHz(1.);
989 for (
int iev=0; iev <500; iev++) {
990 tc.Reset(); dat.Reset();
991 double dist = gRandom->Exp(D0Len);
993 gRandom->Sphere(wk[0],wk[1],wk[2],dist);
994 dcayPos.SetXYZ(wk[0],wk[1],wk[2]);
995 d0Mom = dcayPos.Unit()*D0P;
996 p4[2].SetVectM( d0Mom,D0Mass);
997 gRandom->Sphere(wk[0],wk[1],wk[2],Q);
998 p4[0].SetXYZM(-wk[0],-wk[1],-wk[2],KMass );
999 p4[1].SetXYZM( wk[0], wk[1], wk[2],PiMass);
1000 TVector3 boost = p4[2].BoostVector();
1002 for (
int ip=0;ip<2;ip++) {
1003 p4[ip].Boost(boost);
1004 p4[ip].GetXYZT(wk+3);
1005 dcayPos.GetXYZ (wk+0);
1006 double ptin = 1./p4[ip].Pt();
1011 double s =th.Path(0.,0.);
1013 th.
Eval(0.,wk,wk+3);
1014 TVector3 pos(wk),dir(wk+3);
1015 dat.mTkBas[ip].Reset();
1016 dat.mTkBas[ip].Set(pos,dir,ptin);
1017 dat.mTkBas[ip].
mass= (ip)? PiMass:KMass;
1018 dat.mTkBas[ip].Update();
1019 dat.mTEBas[ip].Set(0,0,pow(DX,2));
1020 dat.mTEBas[ip].Set(1,1,pow(DX,2));
1021 dat.mTkBas[ip].Rand(dat.mTEBas[ip]);
1024 if (mode==1) dat.FixPar(kCNRJ);
1025 if (tc.Fit())
continue;
1026 double dL = dat.GetPar(kLEN_2)-dist;
1027 double eL = sqrt(dat.ErMx(kLEN_2,kLEN_2));
1029 hh[1]->Fill(dL/dist);
1030 hh[2]->Fill(dat.GetFcn()/dat.GetNDF());
1031 TLorentzVector D0V = dat.mTkFit[0].P4()+dat.mTkFit[1].P4();
1032 hh[3]->Fill(D0V.M()-D0Mass);
1035 myCanvas->Modified();
double Eval(double step, double *xyz, double *dir, double &rho) const
Evaluate params with given step along helix.
int fModi
fail flag, fit is impossible
double tanl
tangent of the track momentum dip angle
int fNPars[3]
&1=1 fcn calculated from error matrix
double mass
Mass of track.
short fTyps[kMaxId+1]
Tiny values still modifying fcn.
double curv
signed curvature [sign = sign(-qB)]
static float * trsa(const float *s, const float *a, float *b, int m, int n)
double hz
Z component magnetic field in units Pt(Gev) = Hz * RCurv(cm)
void Backward()
Change direction.
static float * trsinv(const float *g, float *gi, int n)
static float * trasat(const float *a, const float *s, float *r, int m, int n)
double phi
angle between track direction and X-axis in xy plane
double * fPars[kMaxId+1]
number of "slack" parameters
char fEnd[1]
Current value of fcn [1].
double ptin
signed invert pt [sign = sign(-qB)]
int fNFixs[3]
number of "measured" ,slack, constrains
double Move(double step)
Move along helix.
int AddPar(int tyPar, int idPar, double *par, int nPars=1, const char *name="", double tiny=0.)