Commit 3517af9b authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

debug informatique (execution OK) du fit des baselines, Reza 19/02/2019

parent 09f7aabf
......@@ -148,8 +148,12 @@ AcxDataSet::AcxDataSet(TrkInputDataSet & tkds)
AcxDataSet::AcxDataSet(AcxDataSet const & a)
: v_time_data(a.v_time_data), vv_data(a.vv_data), vv_err(a.vv_err),
v_min_data(a.v_min_data), v_max_data(a.v_max_data),
vv_cxdata(a.vv_cxdata), v_min_cxdata(a.v_min_cxdata), v_max_cxdata(a.v_max_cxdata),
tot_npoints(a.tot_npoints), zenang(a.zenang), theta_0(a.theta_0), phi_0(a.phi_0)
vv_cxdata(a.vv_cxdata), vv_cxerr(a.vv_cxerr),
v_min_cxdata(a.v_min_cxdata), v_max_cxdata(a.v_max_cxdata),
tot_npoints(a.tot_npoints), v_freqs(a.v_freqs),
zenang(a.zenang), theta_0(a.theta_0), phi_0(a.phi_0),
v_acbeams(a.v_acbeams), v_cxbeams(a.v_cxbeams),
v_phase(a.v_phase), v_Acx(a.v_Acx), v_Bcx(a.v_Bcx)
{
}
......@@ -157,8 +161,13 @@ AcxDataSet & AcxDataSet::operator = (AcxDataSet const & a)
{
v_time_data=a.v_time_data; vv_data=a.vv_data; vv_err=a.vv_err;
v_min_data=a.v_min_data; v_max_data=a.v_max_data;
vv_cxdata=a.vv_cxdata; v_min_cxdata=a.v_min_cxdata; v_max_cxdata=a.v_max_cxdata;
tot_npoints=a.tot_npoints; zenang=a.zenang; theta_0=a.theta_0; phi_0=a.phi_0;
vv_cxdata=a.vv_cxdata; vv_cxerr=a.vv_cxerr;
v_min_cxdata=a.v_min_cxdata; v_max_cxdata=a.v_max_cxdata;
tot_npoints=a.tot_npoints; v_freqs=a.v_freqs;
zenang=a.zenang; theta_0=a.theta_0; phi_0=a.phi_0;
v_acbeams=a.v_acbeams; v_cxbeams=a.v_cxbeams;
v_phase=a.v_phase; v_Acx=a.v_Acx; v_Bcx=a.v_Bcx;
return (*this);
}
......@@ -740,14 +749,18 @@ int CxBaselineFitter::dofit(string outfilename, string outcheckfilename)
tot_npoints_fit += 2*(v_acxd[i].v_time_data[j].size())*NB_CXCORS;
cout << " Total number of data points for fit="<< tot_npoints_fit<<endl;
GeneralFitData gdata(1, tot_npoints_fit);
int npoints2=0;
for(size_t i=0; i<v_acxd.size(); i++)
for(size_t kcx=0; kcx<NB_CXCORS; kcx++) {
for(size_t j=0; j<v_acxd[i].NbTrk(); j++) {
vector< vector< complex<double> > > & v_cxdata = v_acxd[i].vv_cxdata[j];
vector< vector<double> > & v_cxerr = v_acxd[i].vv_cxerr[j];
for(size_t l=0; l<v_acxd[i].v_time_data[j].size(); l++) {
for(size_t l=0; l<v_acxd[i].v_time_data[j].size(); l++) {
double xg=v_acxd[i].v_time_data[j][l];
double yg=v_cxdata[kcx][l].real();
gdata.AddData1(v_acxd[i].v_time_data[j][l],v_cxdata[kcx][l].real(),v_cxerr[kcx][l]); // Fill x, y and error on y
gdata.AddData1(v_acxd[i].v_time_data[j][l],v_cxdata[kcx][l].imag(),v_cxerr[kcx][l]); // Fill x, y and error on y
gdata.AddData1(v_acxd[i].v_time_data[j][l],v_cxdata[kcx][l].imag(),v_cxerr[kcx][l]); // Fill x, y and error on y
npoints2+=2;
}
}
}
......@@ -763,15 +776,16 @@ int CxBaselineFitter::dofit(string outfilename, string outcheckfilename)
for(size_t i=0; i<(NB_ANTENNES-1); i++) {
char pname[32];
sprintf(pname,"Phase_%d",(int)(i+2));
mFit.SetParam(i,pname,v_acxd[0].v_phase[i],M_PI/360.,0.,2.2*M_PI);
mFit.SetParam(i,pname,v_acxd[0].v_phase[i],M_PI/180.,0.,2.5*M_PI);
sprintf(pname,"BaselineShift_X_%d",(int)(i+2));
mFit.SetParam(3+3*i,pname,0.,0.01,-0.25,0.25);
mFit.SetParam(3+3*i,pname,0.,0.02,-0.25,0.25);
sprintf(pname,"BaselineShift_Y_%d",(int)(i+2));
mFit.SetParam(4+3*i,pname,0.,0.01,-0.25,0.25);
mFit.SetParam(4+3*i,pname,0.,0.02,-0.25,0.25);
sprintf(pname,"BaselineShift_Z_%d",(int)(i+2));
mFit.SetParam(5+3*i,pname,0.,0.01,-0.25,0.25);
mFit.SetParam(5+3*i,pname,0.,0.02,-0.25,0.25);
mFit.SetFix(3+3*i); mFit.SetFix(4+3*i); mFit.SetFix(5+3*i);
}
cout << " Performing the fit ... " << endl;
cout << " Performing the fit (tot_npoints_fit= "<<tot_npoints_fit<<" ?= (npoints2="<<npoints2<<") ..."<< endl;
rcfit = mFit.Fit(); xi2red=-99999.;
cout<< "------ Fit result Reduce_Chisquare = " << mFit.GetChi2Red()<< " nstep="<<mFit.GetNStep() << " rc="<<rcfit<<endl;
mFit.PrintFit();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment