From 6c0fdb6ab8fe26145f5bfeaddcdb5207b078a2b7 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Mon, 24 Sep 2012 11:02:06 +0000 Subject: [PATCH] fixed wrong chisq output in musrview if expected chisq ispresent --- ChangeLog | 2 ++ src/classes/PMsrHandler.cpp | 24 +++++++++++++++++------- src/musrfit_startup.xml | 1 + 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2aef541..8030305b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ NEW 2012-05-12 added dump_header. This is a little program which dumps the NEW 2012-04-24 added a first version for negative muon fitting. At the same time substaintial bug fixing has been carried out (mainly the logx/logy handling). +FIXED 2012-09-23 fixed wrong chisq output in musrview if expected chisq is + present. FIXED 2012-05-30 fixed RRF bug in single histo plotting. FIXED 2012-05-18 fixed wrong forward/backward tag for ROOT-PPC (MUSR-215) CHANGED 2012-08-28 prevent LF from allocating too much memory diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index e110e1ee..9bf458ef 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -3928,13 +3928,23 @@ Bool_t PMsrHandler::HandleStatisticEntry(PMsrLines &lines) } // extract chisq if (lines[i].fLine.Contains("chisq =")) { - fStatistic.fValid = true; - strncpy(str, lines[i].fLine.Data(), sizeof(str)); - status = sscanf(str+lines[i].fLine.Index("chisq = ")+8, "%lf", &dval); - if (status == 1) { - fStatistic.fMin = dval; - } else { - fStatistic.fMin = -1.0; + if (lines[i].fLine.Contains("expected")) { // expected chisq + strncpy(str, lines[i].fLine.Data(), sizeof(str)); + status = sscanf(str+lines[i].fLine.Index("chisq = ")+8, "%lf", &dval); + if (status == 1) { + fStatistic.fMinExpected = dval; + } else { + fStatistic.fMinExpected = -1.0; + } + } else { // chisq + fStatistic.fValid = true; + strncpy(str, lines[i].fLine.Data(), sizeof(str)); + status = sscanf(str+lines[i].fLine.Index("chisq = ")+8, "%lf", &dval); + if (status == 1) { + fStatistic.fMin = dval; + } else { + fStatistic.fMin = -1.0; + } } } // extract maxLH diff --git a/src/musrfit_startup.xml b/src/musrfit_startup.xml index cd27b09a..b06da4e7 100644 --- a/src/musrfit_startup.xml +++ b/src/musrfit_startup.xml @@ -13,6 +13,7 @@ /afs/psi.ch/project/bulkmusr/data/gpd /afs/psi.ch/project/bulkmusr/data/ltf /afs/psi.ch/project/bulkmusr/data/alc + /afs/psi.ch/project/bulkmusr/data/hifi n Gauss