From 82ba938c2d14c3fa32da74086d73c27aedbf4ebd Mon Sep 17 00:00:00 2001 From: Suter Andreas Date: Mon, 11 Apr 2016 11:11:31 +0200 Subject: [PATCH 1/2] make sure that N0 is only estimated if N0 is NOT fixed. --- src/classes/PRunSingleHisto.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/classes/PRunSingleHisto.cpp b/src/classes/PRunSingleHisto.cpp index 2881a32d..020c31e6 100644 --- a/src/classes/PRunSingleHisto.cpp +++ b/src/classes/PRunSingleHisto.cpp @@ -1555,7 +1555,7 @@ void PRunSingleHisto::EstimateN0() if (paramNo > 10000) // i.e. fun or map return; - // still missing: set this value in the parameters + // get the parameters PMsrParamList *param = fMsrInfo->GetMsrParamList(); assert(param); @@ -1564,6 +1564,11 @@ void PRunSingleHisto::EstimateN0() return; } + // check if N0 is fixed. If this is the case, do NOT estimate N0 + if (param->at(paramNo-1).fStep == 0.0) // N0 parameter fixed + return; + + // check that 'backgr.fit' in the msr-file run block is indeed a parameter number. // in case it is a function, nothing will be done. Int_t paramNoBkg = fRunInfo->GetBkgFitParamNo(); From 2339ee9b80071e5093db22c8a74e57921f6d2e08 Mon Sep 17 00:00:00 2001 From: Suter Andreas Date: Mon, 11 Apr 2016 12:14:40 +0200 Subject: [PATCH 2/2] musredit: improved path-file handling needed for musrview --- src/musredit/PTextEdit.cpp | 7 +++++++ src/musredit_qt5/PTextEdit.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/musredit/PTextEdit.cpp b/src/musredit/PTextEdit.cpp index 0d4fb735..d22e4294 100644 --- a/src/musredit/PTextEdit.cpp +++ b/src/musredit/PTextEdit.cpp @@ -2186,6 +2186,9 @@ void PTextEdit::musrView() cmd = str + " \""; str = *fFilenames.find( currentEditor() ); + int pos = str.lastIndexOf("/"); + if (pos != -1) + str.remove(0, pos+1); QString numStr; numStr.setNum(fAdmin->getTimeout()); cmd += str + "\" --timeout " + numStr; @@ -2194,6 +2197,10 @@ void PTextEdit::musrView() cmd += " &"; int status=system(cmd.toLatin1()); + + if (status != 0) { + cerr << "**WARNING** musrView: something went wrong ..." << endl; + } } //---------------------------------------------------------------------------------------------------- diff --git a/src/musredit_qt5/PTextEdit.cpp b/src/musredit_qt5/PTextEdit.cpp index 6069529e..a31bc17e 100644 --- a/src/musredit_qt5/PTextEdit.cpp +++ b/src/musredit_qt5/PTextEdit.cpp @@ -2184,6 +2184,9 @@ void PTextEdit::musrView() cmd = str + " \""; str = *fFilenames.find( currentEditor() ); + int pos = str.lastIndexOf("/"); + if (pos != -1) + str.remove(0, pos+1); QString numStr; numStr.setNum(fAdmin->getTimeout()); cmd += str + "\" --timeout " + numStr; @@ -2192,6 +2195,10 @@ void PTextEdit::musrView() cmd += " &"; int status=system(cmd.toLatin1()); + + if (status != 0) { + cerr << "**WARNING** musrView: something went wrong ..." << endl; + } } //----------------------------------------------------------------------------------------------------