16 #include "Riostream.h"
21 Vect_mu(0),Matr_sig(0), Vect_x(0), Vect_dx(0) {
25 TGo4FitModel(iName,
"N-dimensional Gaussian", kTRUE), fxIndexes(iNDimension),
26 Vect_mu(0),Matr_sig(0), Vect_x(0), Vect_dx(0) {
27 for(Int_t n=0;n<iNDimension;n++)
fxIndexes[n] = n;
29 for(Int_t n=0;n<iNDimension;n++)
32 for(Int_t n=0;n<iNDimension;n++)
35 for(Int_t n1=0;n1<iNDimension;n1++)
36 for(Int_t n2=n1+1;n2<iNDimension;n2++)
50 res.Form(
"Pos%d",naxis);
57 res.Form(
"Width%d",naxis);
64 res.Form(
"Cov%d_%d",naxis1,naxis2);
72 if ((naxis<0) || (oldnaxis==naxis))
return kFALSE;
74 for(Int_t n=naxis;n<oldnaxis;n++) {
78 for(Int_t n1=0;n1<oldnaxis;n1++)
79 for(Int_t n2=n1+1;n2<oldnaxis;n2++)
80 if((n1>=naxis) || (n2>=naxis))
85 for(Int_t n=oldnaxis;n<naxis;n++) {
92 for(Int_t n1=0;n1<naxis;n1++)
93 for(Int_t n2=n1+1;n2<naxis;n2++) {
100 for (Int_t n=oldnaxis;n<naxis;n++) {
105 for (Int_t n1=0;n1<n;n1++)
106 if(test==
fxIndexes[n1]) { find=kTRUE; test++;
break; }
117 for (Int_t n=
fxIndexes.GetSize()-1;n>=0;n--) {
118 if (n==leaveaxis)
continue;
120 Bool_t find, first = kTRUE;
123 for (Int_t n1=0;n1<
fxIndexes.GetSize();n1++)
125 if (first) test=0;
else test++;
132 res = res || (!first);
153 for(Int_t n=0;n<ndim;n++)
160 Sigma.ResizeTo(ndim,ndim);
161 for(Int_t n=0;n<ndim;n++)
163 Int_t indx = 1+2*ndim;
164 for(Int_t n1=0;n1<ndim;n1++)
165 for(Int_t n2=n1+1;n2<ndim;n2++) {
178 { std::cout <<
"TGo4FitModelGaussN:: invalid index " << std::endl;
return kFALSE; }
180 Vect_mu =
new TVectorD(Par_ndim);
181 Matr_sig =
new TMatrixD(Par_ndim,Par_ndim);
182 Vect_x =
new TVectorD(Par_ndim);
183 Vect_dx =
new TVectorD(Par_ndim);
190 { std::cout <<
"TGo4FitModelGaussN:: Invalid sigma matrice " << std::endl;
AfterEval();
return kFALSE; }
202 return TMath::Exp(-0.5*z);
215 std::cout <<
" N-dimensional Gauss" << std::endl;
216 std::cout <<
" axis indexes:";
217 for (Int_t i=0;i<
fxIndexes.GetSize();i++)
219 std::cout << std::endl;
Bool_t ResortIndexes(Int_t leaveaxis=-1)
TString GetPosParName(Int_t naxis)
virtual Double_t EvalN(const Double_t *v)
TGo4FitParameter * GetPar(Int_t n)
void FillMuVector(TVectorD &Mu)
TGo4FitParameter * NewParameter(const char *Name, const char *Title, Double_t iValue=0., Bool_t Fixed=kFALSE, Int_t AtIndx=-1)
void FillSigmaMatrix(TMatrixD &Sigma)
Bool_t SetAxisNumbers(Int_t naxis)
virtual Int_t GetWidthParIndex(Int_t naxis)
Bool_t RemovePar(const char *name)
virtual Bool_t BeforeEval(Int_t)
TString GetCovarParName(Int_t naxis1, Int_t naxis2)
TGo4FitParameter * FindPar(const char *ParName)
virtual void Print(Option_t *option) const
TString GetWidthParName(Int_t naxis)
Int_t GetParIndex(const TGo4FitParameter *par)
Double_t GetValue() const
virtual ~TGo4FitModelGaussN()
virtual Int_t GetPosParIndex(Int_t naxis)
virtual void Print(Option_t *option) const