35#ifndef TSUMOFSQUARES_H
36#define TSUMOFSQUARES_H
43#include "TVirtualFitter.h"
45#include "Minuit2/FCNBase.h"
56#include "TDataServer.h"
76 URANIE::Launcher::TCode *code) :
95 Int_t niter =
_tds->getTuple()->GetEntries();
96 Double_t fval = -0.123456789;
100 Double_t dObjectives = 0.;
106 cout << endl <<
" ****** Step[" << niter <<
"]" << endl;
113 Double_t valcrt = 1.23456789;
118 for (
int i = 0; i <
_ninput; i++)
121 URANIE::DataServer::TAttribute *att =
_tds->getAttribute(i);
123 cout <<
" ** " << i <<
"/" <<
_ninput <<
" name ["
124 << att->GetName() <<
"]";
125 URANIE::DataServer::TAttribute::EOrigin norigin =
129 case URANIE::DataServer::TAttribute::kConstant:
131 cout <<
" Origin[kConstant]";
132 att->getDefaultValue(valcrt);
134 case URANIE::DataServer::TAttribute::kAttribute:
136 cout <<
" Origin[kAttribute]";
137 valcrt = par[ncpt++];
155 cout << endl <<
"*************************************" << endl
156 <<
" *** TSumOfSquares operator () _noutput["
157 <<
_noutput <<
"] ind[" << ind <<
"]" << endl;
158 for (Int_t ii = 0; ii <=
_noutput; ii++)
159 cout <<
" ** ii(" << ii <<
"/" <<
_noutput <<
") val("
161 cout <<
" *** End Of TFCNCode operator ()" << endl
162 <<
"*************************************" << endl;
165 TMatrixT<double> *lastmat =
168 lastmat->Print(Form(
"Matrice de sortie iteration[%d]", niter));
169 Int_t nrows = lastmat->GetNrows();
170 Int_t ncols = lastmat->GetNcols();
172 cout <<
" ** nrows[" << nrows <<
"] ncols[" << ncols <<
"]"
174 Double_t *allvalues =
new Double_t[nrows * ncols];
175 Double_t *dvalues =
new Double_t[nrows];
176 allvalues = lastmat->GetMatrixArray();
180 <<
" **********************************************************"
184 for (Int_t indx = 0; indx < nObjectives; indx++)
192 for (Int_t indy = 0; indy < nrows; indy++)
194 dvalues[indy] = allvalues[ncrt];
200 Double_t dvalcrt =
_objectives[indx]->getObjective(dvalues,
202 dObjectives += dweight * dvalcrt;
203 cout <<
" ** Objective [" << indx + 1 <<
"/" << nObjectives
205 <<
"] dweight[" << dweight <<
"] val[" << dvalcrt
206 <<
"] Sum [" << dObjectives <<
"]" << endl;
210 <<
" **********************************************************"
212 dObjectives /= (Double_t)(nObjectives);
213 cout <<
" ** Objective [" << dObjectives <<
"] nObjectives["
214 << nObjectives <<
"]" << endl;
216 <<
" **********************************************************"
228 _tds->getIteratorName()),
"",
"lp");
257 URANIE::DataServer::TDataServer *
_tds;
Interface of class URANIE::Optimize::TObjective.
Description of the class TObjective. This class computes the ojective (from L2 point of view).
Definition TObjective.h:62
Definition TSumOfSquares.h:64
URANIE::DataServer::TDataServer * _tds
Definition TSumOfSquares.h:257
Int_t getNObjectives()
Definition TSumOfSquares.h:247
TList * _listOfDataOutput
Pointer vers un TCode.
Definition TSumOfSquares.h:259
URANIE::Launcher::TCode * _code
Pointer vers un TDS.
Definition TSumOfSquares.h:258
int _noutput
Definition TSumOfSquares.h:255
TSumOfSquares()
Definition TSumOfSquares.h:70
double * _doutputValue
Definition TSumOfSquares.h:256
TSumOfSquares(URANIE::DataServer::TDataServer *tds, URANIE::Launcher::TCode *code)
Constructor with a dataserver.
Definition TSumOfSquares.h:75
double Up() const
Definition TSumOfSquares.h:236
double operator()(const vector< double > &par) const
Definition TSumOfSquares.h:93
~TSumOfSquares()
Definition TSumOfSquares.h:82
int _ninput
Definition TSumOfSquares.h:253
vector< TObjective * > _objectives
vector of objectives
Definition TSumOfSquares.h:66
void addObjective(TObjective *tobj)
Definition TSumOfSquares.h:243
TString _sCriteria
List of matrix.
Definition TSumOfSquares.h:260
double * _dinputValue
Definition TSumOfSquares.h:254
Rosenbrock's function (n=2) with first and second order derivatives.
Definition TBestEstimate.h:58