28 for (Int_t n = 0; n < iNDimension; n++)
31 for (Int_t n = 0; n < iNDimension; n++)
34 for (Int_t n = 0; n < iNDimension; n++)
37 for (Int_t n1 = 0; n1 < iNDimension; n1++)
38 for (Int_t n2 = n1 + 1; n2 < iNDimension; n2++)
65 res.Form(
"Pos%d", naxis);
72 res.Form(
"Width%d", naxis);
79 res.Form(
"Cov%d_%d", naxis1, naxis2);
86 if ((naxis < 0) || (oldnaxis == naxis))
88 if (naxis < oldnaxis) {
89 for (Int_t n = naxis; n < oldnaxis; n++) {
93 for (Int_t n1 = 0; n1 < oldnaxis; n1++)
94 for (Int_t n2 = n1 + 1; n2 < oldnaxis; n2++)
95 if ((n1 >= naxis) || (n2 >= naxis))
100 for (Int_t n = oldnaxis; n < naxis; n++) {
107 for (Int_t n1 = 0; n1 < naxis; n1++)
108 for (Int_t n2 = n1 + 1; n2 < naxis; n2++) {
117 for (Int_t n = oldnaxis; n < naxis; n++) {
122 for (Int_t n1 = 0; n1 < n; n1++)
139 for (Int_t n =
fxIndexes.GetSize() - 1; n >= 0; n--) {
143 Bool_t find, first = kTRUE;
146 for (Int_t n1 = 0; n1 <
fxIndexes.GetSize(); n1++)
147 if ((n != n1) && (test ==
fxIndexes[n1])) {
158 res = res || (!first);
165 for (Int_t n = 0; n <
fxIndexes.GetSize(); n++)
173 for (Int_t n = 0; n <
fxIndexes.GetSize(); n++)
183 for (Int_t n = 0; n < ndim; n++)
190 Sigma.ResizeTo(ndim, ndim);
191 for (Int_t n = 0; n < ndim; n++)
193 Int_t indx = 1 + 2 * ndim;
194 for (Int_t n1 = 0; n1 < ndim; n1++)
195 for (Int_t n2 = n1 + 1; n2 < ndim; n2++) {
206 for (Int_t i = 0; i <
Par_ndim; i++)
208 std::cout <<
"TGo4FitModelGaussN:: invalid index " << std::endl;
222 std::cout <<
"TGo4FitModelGaussN:: Invalid sigma matrice " << std::endl;
232 for (Int_t n = 0; n <
Par_ndim; n++)
238 return TMath::Exp(-0.5 * z);
264 std::cout <<
" N-dimensional Gauss" << std::endl;
265 std::cout <<
" axis indexes:";
266 for (Int_t i = 0; i <
fxIndexes.GetSize(); i++)
268 std::cout << std::endl;
TGo4FitParameter * NewParameter(const char *Name, const char *Title, Double_t iValue=0., Bool_t Fixed=kFALSE, Int_t AtIndx=-1)
Create new parameter with provided properties and add to parameters list.
void FillMuVector(TVectorD &Mu)
Fills vector of gaussian position from parameters values.
TMatrixD * Matr_sig
Temporary variable for EvalN() function.
TString GetPosParName(Int_t naxis)
Int_t GetAxisNumbers() const
Returns number of dimensions (number of axes), where gaussian will be build.
void Print(Option_t *option="") const override
Print information on standard output.
Double_t EvalN(const Double_t *v) override
Calculates value of model according current parameters values and provided axes values.
void FillSigmaMatrix(TMatrixD &Sigma)
Fill covariance matrix from parameters values.
TGo4FitModelGaussN()
Default constructor.
TVectorD * Vect_mu
Temporary variable for EvalN() function.
void AfterEval() override
Clear buffers, which were created by BeforeEval() method.
TString GetWidthParName(Int_t naxis)
Bool_t BeforeEval(Int_t) override
Prepares (if necessary) some intermediate variables to be able calculate values of model via EvalN() ...
TVectorD * Vect_dx
Temporary variable for EvalN() function.
Int_t GetWidthParIndex(Int_t naxis) override
Return index of parameter (if exist), which represent width of model component for given axis.
TString GetCovarParName(Int_t naxis1, Int_t naxis2)
TArrayI fxIndexes
Array of axis indexes, where n-dim gaussian will be build.
virtual ~TGo4FitModelGaussN()
Destroys TGo4FitModelGaussN object.
Int_t * Par_indx
Temporary variable for EvalN() function.
Bool_t SetAxisNumbers(Int_t naxis)
Sets number of axes (dimensions), where gaussian will be build.
TVectorD * Vect_x
Temporary variable for EvalN() function.
Bool_t ResortIndexes(Int_t leaveaxis=-1)
Checks duplicates in axis numbers, associated to different gaussian dimensions.
Int_t GetPosParIndex(Int_t naxis) override
Return index of parameter (if exist), which represent position of model for given axis.
Int_t Par_ndim
Temporary variable for EvalN() function.
void Print(Option_t *option="") const override
Print information about model object on standard output.
TGo4FitModel()
Default constructor.
Model and data objects parameter.
Double_t GetValue() const
Return parameter value.
TGo4FitParameter * FindPar(const char *ParName)
Find parameter object with given name.
Int_t GetParIndex(const TGo4FitParameter *par)
Return index of given parameter in list.
Bool_t RemovePar(const char *name)
Remove parameter from list with given name.
TGo4FitParameter * GetPar(Int_t n)
Return parameter according given index.