Commit df765ff6 authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

Ajout option pour fixer les baselines ds le fit simultane des 6-cross-cor , Reza 20/02/2019

parent 080707b4
......@@ -88,7 +88,9 @@ static int prtlevel=0; // print level
static string default_input_path;
static vector<string> trksetfiles; // datacard files defining the track/data sets
// ---- fit simultane sur les 6 cross-correlations
static bool do_baselinefit = false; // if true , perform baseline fit
static bool fg_fixbaseline = false; // if true , do phases fit with fixed baselines
//--- End of list of global parameters
......@@ -140,7 +142,7 @@ int main (int narg, char* arg[])
CxBaselineFitter cxbfit(v_acxd, v_trk);
string cxbofile = "cxb6_"+outfilename;
string cxbckfile = "cxb6_"+checkfilename;
cxbfit.dofit(cxbofile);
cxbfit.dofit(cxbofile,fg_fixbaseline);
cxbfit.saveExpectedCx(cxbckfile);
}
Timer tm("trkacxfit");
......@@ -178,7 +180,7 @@ int decode_args(int narg, char* arg[])
cout << " trkacxfit : fit array geometry and \n"
<< " Usage: trkacxfit [-options] track_Set_1 [track_Set_2] [track_Set_3 ...] \n"
<< " options: -inp def_input_path -out OutFileName -ckf CheckFileName \n"
<< " -doblf -ngb -D dish_diameter -prt PrintLevel \n"<<endl;
<< " -docx6f -fixb -ngb -D dish_diameter -prt PrintLevel \n"<<endl;
if (!fglonghelp) {
cout << " trkacxfit -h to get option description " << endl;
return 2;
......@@ -189,7 +191,8 @@ int decode_args(int narg, char* arg[])
<< " -ckf CheckFileName : Output file (PPF) to save expected signals (def chktrkfit.ppf) \n"
<< " Output file names are constructed from OutFileName and CheckFileName prepending \n"
<< " ac_JJ_ or cx_JJ_ where JJ=1...n is the track_set number \n"
<< " -doblf : Perform baseline determination (fit) - default NO \n"
<< " -docx6f : Perform simultaneous fit over 6 cross-corr (baseline and phases determination) - default NO \n"
<< " -fixb : perform the previous fit (docx6f) with fixed baselines - default NO \n"
<< " -ngb : Use non gaussian beam profile (Bessel j1(angle) - default Gaussian beam) \n"
<< " -D dish_diameter : define effective dish diameter (in meter D*eff , def=4.5) \n"
<< " -prt PrintLevel: specify print level \n"
......@@ -205,6 +208,8 @@ int decode_args(int narg, char* arg[])
prtlevel=0;
D_dish = 4.5;
fggaussbeam=true;
do_baselinefit=false;
fg_fixbaseline=false;
vector<string> lastargs;
while (narg>1) {
......@@ -216,9 +221,12 @@ int decode_args(int narg, char* arg[])
else if (fbo=="-ngb") { // Use Non gaussian beam
fggaussbeam=false; arg++; narg--; lastargs.clear();
}
else if (fbo=="-doblf") { // Use Non gaussian beam
else if (fbo=="-docx6f") { // Perform simultaneous fit over 6 cross-corr
do_baselinefit=true; arg++; narg--; lastargs.clear();
}
else if (fbo=="-fixb") { // Perform the previous docx6f fit with fixed baselines (phases only)
fg_fixbaseline=true; arg++; narg--; lastargs.clear();
}
else if (fbo=="-inp") { // output file name
if (narg<2) { cout << "trkacxfit/decode_args missing/bad argument, -h for help " << endl; return -1; }
default_input_path=arg[2]; arg+=2; narg-=2; lastargs.clear();
......@@ -246,7 +254,8 @@ int decode_args(int narg, char* arg[])
cout << " ------------------- trkacxfit/run parameters:"<<endl;
cout << " Beam: D_dish (initial guess)="<<D_dish<<" GaussianBeam ? "<<(fggaussbeam?"Yes":"No")<<endl;
cout << " OutFileName= "<<outfilename<<" CheckFileName= "<<checkfilename<<endl;
cout << " Perform baseline fit ? " << (do_baselinefit?"Yes":"No")<<endl;
cout << " Perform baseline fit ? " << (do_baselinefit?"Yes":"No")
<<(fg_fixbaseline?" With FIXED baselines":" (Phases & baselines)")<<endl;
cout << " --- TrackSetFiles: (NbFiles="<<lastargs.size()<<" default directory: "<<default_input_path<<")"<<endl;
trksetfiles = lastargs;
for (size_t i=0; i<trksetfiles.size(); i++) {
......
......@@ -770,7 +770,7 @@ CxBaselineFitter::~CxBaselineFitter()
if (err_bestfitparam) delete[] err_bestfitparam;
}
int CxBaselineFitter::dofit(string outfilename)
int CxBaselineFitter::dofit(string outfilename, bool fgfixbaseline)
{
size_t NB_ANTENNES=v_acxd[0].getNbAutoCor(); // nombre d'antennes
size_t NB_CXCORS=v_acxd[0].getNbCrossCor();
......@@ -827,7 +827,10 @@ int CxBaselineFitter::dofit(string outfilename)
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.02,-0.25,0.25);
mFit.SetFix(3+3*i); mFit.SetFix(4+3*i); mFit.SetFix(5+3*i);
if (fgfixbaseline) {
cout << " ... fitting phases only, fixed baselines "<<endl;
mFit.SetFix(3+3*i); mFit.SetFix(4+3*i); mFit.SetFix(5+3*i);
}
}
cout << " Performing the fit (tot_npoints_fit= "<<tot_npoints_fit<<" ?= (npoints2="<<npoints2<<") ..."<< endl;
rcfit = mFit.Fit(); xi2red=-99999.;
......
......@@ -173,7 +173,7 @@ public:
CxBaselineFitter(vector<AcxDataSet> & v_data, vector<TrackSet> & v_tks);
~CxBaselineFitter();
int dofit(string outfilename);
int dofit(string outfilename, bool fgfixbaseline=false); // if fgfixbaseline = true, fit phases only
int saveExpectedCx(string outcheckfilename); // outfilename PPF (or fits ?) file with the expected signals
......
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