From 32eb6c0722d6bb2100c9b3697eca633274264745 Mon Sep 17 00:00:00 2001
From: Oleksandr Zenaiev <oleksandr.zenaiev@desy.de>
Date: Mon, 6 May 2019 19:53:06 +0200
Subject: [PATCH 1/2] bug fix for pdf x axis range

---
 tools/draw/src/PdfsPainter.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/draw/src/PdfsPainter.cc b/tools/draw/src/PdfsPainter.cc
index 791b9c866..a18570bbd 100644
--- a/tools/draw/src/PdfsPainter.cc
+++ b/tools/draw/src/PdfsPainter.cc
@@ -77,8 +77,14 @@ vector <TCanvas*> PdfsPainter(double q2, pdftype ipdf)
     for(const auto&graph:pdfgraphs){
       if(!graph)continue;
       TAxis*ax=graph->GetXaxis();
-      opts.xmin=min(opts.xmin,ax->GetXmin());
-      opts.xmax=max(opts.xmax,ax->GetXmax());
+      double xmin = ax->GetXmin();
+      if(xmin < 0.0 || (xmin == 0.0 && opts.logx))
+        xmin = graph->GetX()[0];
+      opts.xmin = min(opts.xmin, xmin);
+      double xmax = ax->GetXmax();
+      if(xmax > 1.0)
+        xmax = graph->GetX()[graph->GetN() - 1];
+      opts.xmax=max(opts.xmax, xmax);
     }
   }
 
-- 
GitLab


From 4bb76409af68c376283bdc4a856680bfc012e85c Mon Sep 17 00:00:00 2001
From: Oleksandr Zenaiev <oleksandr.zenaiev@desy.de>
Date: Mon, 6 May 2019 21:22:51 +0200
Subject: [PATCH 2/2] nice printout of parameters XFITTER-90

---
 src/ExtraParConstr.cc | 24 +++++++++++++++++++++++-
 src/fcn.f             |  2 +-
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/ExtraParConstr.cc b/src/ExtraParConstr.cc
index 44eb7a271..f2b5a71fd 100644
--- a/src/ExtraParConstr.cc
+++ b/src/ExtraParConstr.cc
@@ -42,7 +42,7 @@ extern "C" {
 	}
 
 	// actual routine
-	void printminuitextrapars_() {
+	void printminuitextrapars_(int& iflag) {
 
 		int len=1024;
 		char parname[len];
@@ -82,6 +82,28 @@ extern "C" {
 			}
 			printf("\n");
 		}
+    if(iflag == 3)
+    {
+      int ndigcomma = 8;
+      printf("----- Parameters in YAML format (can copy paste into parameters.yamp):\n");
+      for(int p=0; p<extrapars_.nExtraParam; p++)
+      {
+        mnpout_(extrapars_.iExtraParamMinuit+p, parname, &par, &unc, &bound_l, &bound_h, &status, len);
+        //if(status<=0) continue;
+        parname[std::string(parname).find(' ')]='\0';
+        printf("  %s : [ %.*f, %.*f", parname, ndigcomma, par, ndigcomma, unc);
+        if(bound_l!=0.0&&bound_h!=0.0) {
+          printf("%.*f%.*f", ndigcomma, bound_l, ndigcomma, bound_h);
+        }
+        if(extrapars_.ConstrUnc[p]!=0.0) {
+          double shift=(par-extrapars_.ConstrVal[p])/extrapars_.ConstrUnc[p];
+          double reduction=unc/extrapars_.ConstrUnc[p];
+          printf("%.*f%.*f", ndigcomma, shift, ndigcomma, reduction);
+        }
+        printf(" ]\n");
+      }
+      printf("----- End of parameters in YAML format\n");
+    }
 	}
 }
 
diff --git a/src/fcn.f b/src/fcn.f
index 7c7193a53..646944967 100644
--- a/src/fcn.f
+++ b/src/fcn.f
@@ -61,7 +61,7 @@ C !> Also store for each fcn=3 call:
 
 C     Print MINUIT extra parameters
 c which are actually all parameters
-      call printminuitextrapars
+      call printminuitextrapars(iflag)
 C Copy new parameter values from MINUIT to whereever parameterisations
 c will take them from
       call copy_minuit_extrapars(parminuit)
-- 
GitLab