diff --git a/configure.ac b/configure.ac index 339a75c5..6e43f26f 100644 --- a/configure.ac +++ b/configure.ac @@ -1354,7 +1354,6 @@ AC_CONFIG_FILES([Makefile \ src/musredit_qt5/Makefile \ src/musredit/Makefile \ src/musrgui/Makefile \ - src/musredit_qt5/musredit_startup.xml \ src/musredit/musredit_startup.xml \ src/musrgui/musrgui_startup.xml]) @@ -1522,3 +1521,16 @@ echo " Programs: ${INSTALLDIR}/bin" echo " XML configuration files: ${HOME}/.musrfit" echo " Documentation: ${DOCDIR}" echo "" + +dnl -------------- +dnl create header file that musredit knows at runtime where to find the documentation +dnl -------------- +if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit_qt5"; then + echo \#define MUSRFIT_PREFIX \"${INSTALLDIR}\" > src/musredit_qt5/musrfit-info.h + echo \#define MUSRFIT_DOC_DIR \"${DOCDIR}\" >> src/musredit_qt5/musrfit-info.h +fi +if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit"; then + echo \#define MUSRFIT_PREFIX \"${INSTALLDIR}\" > src/musredit/musrfit-info.h + echo \#define MUSRFIT_DOC_DIR \"${DOCDIR}\" >> src/musredit/musrfit-info.h +fi + diff --git a/src/Makefile.am b/src/Makefile.am index cdf6d372..3dc8c8fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -60,9 +60,6 @@ write_musrRoot_runHeader_SOURCES = write_musrRoot_runHeader.cpp musrRootValidation_SOURCES = musrRootValidation.cpp dump_header_SOURCES = dump_header.cpp -xmldir = $(HOME)/.musrfit -xml_DATA = musrfit_startup.xml - LIBADD = $(PMUSR_LIBS) $(MUSR_ROOT_LIBS) $(LEM_LIBS) $(PSIBIN_LIBS) $(MUD_LIBS) $(PNEXUS_LIBS) $(DKS_LIB) AM_CXXFLAGS = $(LOCAL_BIN_CXXFLAGS) @@ -74,43 +71,4 @@ AM_CPPFLAGS += $(HDF5_CFLAGS) $(NEXUS_CFLAGS) $(PNEXUS_CXXFLAGS) endif LIBS = $(PMUSR_LIBS) $(USERFCN_LIBS) $(MUSR_ROOT_LIBS) $(LEM_LIBS) $(PSIBIN_LIBS) $(MUD_LIBS) $(PNEXUS_LIBS) \ - $(FFTW3_LIBS) $(GSL_LIBS) $(DKS_CFLAGS) $(ROOT_LIBS) $(LIBXML2_LIBS) - -install-xmlDATA: $(xml_DATA) - test -z "$(xmldir)" || $(mkdir_p) "$(DESTDIR)$(xmldir)" - @if test -e "$(DESTDIR)$(xmldir)/$(xml_DATA)"; then \ - DIFF="$$(diff "$(DESTDIR)$(xmldir)/$(xml_DATA)" "$(xml_DATA)" 2>&1)"; \ - if test "x$$DIFF" != "x"; then \ - echo " " && \ - echo " musrfit_startup.xml in $(xmldir)" && \ - echo " is different from the distribution's version." && \ - echo " Do you want to overwrite it? [y/N]" && \ - read OVERWRITE && \ - if test "$$OVERWRITE" = "y" || test "$$OVERWRITE" = "Y"; then \ - echo "$(INSTALL_DATA) '$(xml_DATA)' '$(DESTDIR)$(xmldir)'" && \ - $(INSTALL_DATA) '$(xml_DATA)' '$(DESTDIR)$(xmldir)'; \ - fi; \ - fi; \ - else \ - echo "$(INSTALL_DATA) '$(xml_DATA)' '$(DESTDIR)$(xmldir)'" && \ - $(INSTALL_DATA) '$(xml_DATA)' '$(DESTDIR)$(xmldir)'; \ - fi - -uninstall-xmlDATA: - @if test -e "$(DESTDIR)$(xmldir)/$(xml_DATA)"; then \ - DIFF="$$(diff "$(DESTDIR)$(xmldir)/$(xml_DATA)" "$(xml_DATA)" 2>&1)"; \ - if test "x$$DIFF" != "x"; then \ - echo " " && \ - echo " musrfit_startup.xml in $(xmldir)" && \ - echo " is different from the distribution's version." && \ - echo " Do you want to remove it? [y/N]" && \ - read REMOVE && \ - if test "$$REMOVE" = "y" || test "$$REMOVE" = "Y"; then \ - echo "$(RM) '$(DESTDIR)$(xmldir)/$(xml_DATA)'" && \ - $(RM) "$(DESTDIR)$(xmldir)/$(xml_DATA)"; \ - fi; \ - else \ - echo "$(RM) '$(DESTDIR)$(xmldir)/$(xml_DATA)'" && \ - $(RM) "$(DESTDIR)$(xmldir)/$(xml_DATA)"; \ - fi; \ - fi + $(FFTW3_LIBS) $(GSL_LIBS) $(DKS_CFLAGS) $(ROOT_LIBS) $(LIBXML2_LIBS ) $(BOOST_LIBS) diff --git a/src/classes/PStartupHandler.cpp b/src/classes/PStartupHandler.cpp index 9a46190a..f8bb572d 100644 --- a/src/classes/PStartupHandler.cpp +++ b/src/classes/PStartupHandler.cpp @@ -27,6 +27,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include +#include + #include #include #include @@ -140,6 +143,23 @@ PStartupHandler::PStartupHandler() } } } + + // if musrfit_startup.xml is still not found, will create a default one + if (!fStartupFileFound) { + cout << endl << "**INFO** no musrfit_startup.xml file found, will write a default one." << endl; + if (!WriteDefaultStartupFile()) { + cerr << endl << "**ERROR** couldn't write default musrfit_startup.xml." << endl; + } else { + home = getenv("HOME"); + if (home != 0) { + sprintf(startup_path_name, "%s/.musrfit/musrfit_startup.xml", home); + if (StartupFileExists(startup_path_name)) { + fStartupFilePath = TString(startup_path_name); + fStartupFileFound = true; + } + } + } + } } //-------------------------------------------------------------------------- @@ -577,6 +597,107 @@ Bool_t PStartupHandler::StartupFileExists(Char_t *fln) return result; } +//-------------------------------------------------------------------------- +// WriteDefaulStartupFile +//-------------------------------------------------------------------------- +Bool_t PStartupHandler::WriteDefaultStartupFile() +{ + // get home + Char_t startup_path_name[256]; + Char_t *home=0; + home = getenv("HOME"); + if (home == 0) { + cerr << endl << "**ERROR** couldn't obtain $HOME." << endl; + return false; + } + + // first check that $HOME/.musrfit exists and if NOT create it + struct stat info; + + sprintf(startup_path_name, "%s/.musrfit", home); + if (!stat(startup_path_name, &info)) { + if (!(info.st_mode & S_IFDIR)) + return false; + } else { + if (mkdir(startup_path_name, 0777)) { + cerr << endl << "**ERROR** couldn't create '" << startup_path_name << "'" << endl; + return false; + } + } + + // set path-name for musrfit_startup.xml + sprintf(startup_path_name, "%s/.musrfit/musrfit_startup.xml", home); + + ofstream fout(startup_path_name, ofstream::out); + if (!fout.is_open()) { + cerr << endl << "**ERROR** couldn't open '" << startup_path_name << "' for writing." << endl; + return false; + } + + // write default musrfit_startup.xml + fout << "" << endl; + fout << "" << endl; + fout << " " << endl; + fout << " Defines default settings for the musrfit package" << endl; + fout << " " << endl; + fout << " /mnt/data/nemu/his" << endl; + fout << " /mnt/data/nemu/wkm" << endl; + fout << " /afs/psi.ch/project/nemu/data/his" << endl; + fout << " /afs/psi.ch/project/nemu/data/wkm" << endl; + fout << " /afs/psi.ch/project/bulkmusr/data/gps" << endl; + fout << " /afs/psi.ch/project/bulkmusr/data/dolly" << endl; + fout << " /afs/psi.ch/project/bulkmusr/data/gpd" << endl; + fout << " /afs/psi.ch/project/bulkmusr/data/ltf" << endl; + fout << " /afs/psi.ch/project/bulkmusr/data/alc" << endl; + fout << " /afs/psi.ch/project/bulkmusr/data/hifi" << endl; + fout << " /afs/psi.ch/project/bulkmusr/data/lem" << endl; + fout << " " << endl; + fout << " Gauss" << endl; + fout << " 0" << endl; + fout << " none" << endl; + fout << " real_and_imag" << endl; + fout << " 0.0" << endl; + fout << " 1.0" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 24 " << endl; + fout << " 25 " << endl; + fout << " 26 " << endl; + fout << " 27 " << endl; + fout << " 28 " << endl; + fout << " 29 " << endl; + fout << " 30 " << endl; + fout << " 20 " << endl; + fout << " 21 " << endl; + fout << " 22 " << endl; + fout << " 23 " << endl; + fout << " 2 " << endl; + fout << " 3 " << endl; + fout << " 5 " << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 0,0,0 " << endl; + fout << " 255,0,0 " << endl; + fout << " 0,255,0 " << endl; + fout << " 0,0,255 " << endl; + fout << " 255,0,255 " << endl; + fout << " 0,255,255 " << endl; + fout << " 153,0,255 " << endl; + fout << " 102,102,51 " << endl; + fout << " 51,102,51 " << endl; + fout << " 153,0,0 " << endl; + fout << " " << endl; + fout << " " << endl; + fout << "" << endl; + + fout.close(); + + return true; +} + // ------------------------------------------------------------------------- // end // ------------------------------------------------------------------------- diff --git a/src/include/PStartupHandler.h b/src/include/PStartupHandler.h index 5e007c39..f9e01c82 100644 --- a/src/include/PStartupHandler.h +++ b/src/include/PStartupHandler.h @@ -96,6 +96,7 @@ class PStartupHandler : public TObject, public TQObject PStartupOptions fStartupOptions; ///< collects all startup options which will be requested by PMsrFileHandler Bool_t StartupFileExists(Char_t *fln); + Bool_t WriteDefaultStartupFile(); ClassDef(PStartupHandler, 1) }; diff --git a/src/musredit_qt5/PAdmin.cpp b/src/musredit_qt5/PAdmin.cpp index 4a1f2fa1..1a7755a6 100644 --- a/src/musredit_qt5/PAdmin.cpp +++ b/src/musredit_qt5/PAdmin.cpp @@ -36,9 +36,10 @@ using namespace std; #include #include #include - +#include #include +#include "musrfit-info.h" #include "PAdmin.h" //-------------------------------------------------------------------------- @@ -296,6 +297,7 @@ bool PAdminXMLParser::characters(const QString& str) flag = true; else flag = false; + fAdmin->fMsr2DataParam.estimateN0 = flag; fAdmin->setEstimateN0Flag(flag); break; case eChisqPreRunBlock: @@ -303,6 +305,7 @@ bool PAdminXMLParser::characters(const QString& str) flag = true; else flag = false; + fAdmin->fMsr2DataParam.perRunBlockChisq = flag; fAdmin->setChisqPerRunBlockFlag(flag); break; case eRecentFile: @@ -641,8 +644,6 @@ PAdmin::PAdmin() : QObject() fEstimateN0 = true; fChisqPreRunBlock = false; - fMsr2DataParam.firstRun = -1; - fMsr2DataParam.lastRun = -1; fMsr2DataParam.runList = QString(""); fMsr2DataParam.runListFileName = QString(""); fMsr2DataParam.msrFileExtension = QString(""); @@ -651,10 +652,12 @@ PAdmin::PAdmin() : QObject() fMsr2DataParam.writeDbHeader = true; fMsr2DataParam.ignoreDataHeaderInfo = false; fMsr2DataParam.keepMinuit2Output = false; + fMsr2DataParam.estimateN0 = fEstimateN0; fMsr2DataParam.writeColumnData = false; fMsr2DataParam.recreateDbFile = false; fMsr2DataParam.chainFit = true; fMsr2DataParam.openFilesAfterFitting = true; + fMsr2DataParam.perRunBlockChisq = fChisqPreRunBlock; fMsr2DataParam.titleFromDataFile = true; fMsr2DataParam.createMsrFileOnly = false; fMsr2DataParam.fitOnly = false; @@ -679,6 +682,12 @@ PAdmin::PAdmin() : QObject() // 4th: check $ROOTSYS/bin/musredit_startup.xml path = procEnv.value("ROOTSYS", ""); pathFln = path + "/bin/" + fln; + if (!QFile::exists(pathFln)) { + // 5th: not found anyware hence create it + path = procEnv.value("HOME", ""); + pathFln = path + "/.musrfit/musredit/" + fln; + createMusreditStartupFile(); + } } } } @@ -983,6 +992,302 @@ void PAdmin::saveRecentFiles() } } +//-------------------------------------------------------------------------- +/** + * @brief PAdmin::createMusreditStartupFile + */ +void PAdmin::createMusreditStartupFile() +{ + // get $HOME + QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment(); + QString pathName = procEnv.value("HOME", ""); + pathName += "/.musrfit/musredit"; + + // check if the directory $HOME/.musrfit/musredit exists if not create it + QDir dir(pathName); + if (!dir.exists()) { + // directory $HOME/.musrfit/musredit does not exist hence create it + dir.mkpath(pathName); + } + + // create default musredit_startup.xml file in $HOME/.musrfit/musredit + pathName += "/musredit_startup.xml"; + QFile file(pathName); + + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return; + + QTextStream fout(&file); + + fout << "" << endl; + fout << "" << endl; + fout << " " << endl; + fout << " This is handling default setting parameters for the musredit." << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << MUSRFIT_PREFIX << "/bin" << endl; + fout << " ./" << endl; + fout << " " << MUSRFIT_DOC_DIR << "/templates" << endl; + fout << " 3600" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << MUSRFIT_DOC_DIR << "/examples/test-histo-PSI-BIN.msr" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTitle" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFitparameterBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTheoryBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFunctionsBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheRunBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheCommandsBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFourierBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#ThePlotBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheStatisticBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/Msr2Data.html" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#A_2.3_musrFT" << endl; + fout << " " << endl; + fout << " " << endl; +#ifdef Q_OS_MAC + fout << " Courier New" << endl; + fout << " 16" << endl; +#else + fout << " Monospace" << endl; + fout << " 12" << endl; +#endif + fout << " " << endl; + fout << " " << endl; + fout << " mue4" << endl; + fout << " psi" << endl; + fout << " root-npp" << endl; + fout << " y" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " y" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " " << endl; + fout << " " << MUSRFIT_DOC_DIR << "/latex_images" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " asymmetry" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " asymmetry.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " simplExpo" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " simpleExp.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " generExpo" << endl; + fout << " (rate exponent)" << endl; + fout << " " << endl; + fout << " generalExp.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " simpleGss" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " simpleGauss.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statGssKT" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " statGssKT.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statGssKTLF" << endl; + fout << " (frequency damping)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynGssKTLF" << endl; + fout << " (frequency damping hopping-rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statExpKT" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " statExpKT.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statExpKTLF" << endl; + fout << " (frequency damping)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynExpKTLF" << endl; + fout << " (frequency damping hopping-rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " combiLGKT" << endl; + fout << " (lorentzRate gaussRate)" << endl; + fout << " " << endl; + fout << " combiLGKT.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " strKT" << endl; + fout << " (rate beta)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " spinGlass" << endl; + fout << " (rate hopping-rate order)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " rdAnisoHf" << endl; + fout << " (frequency rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " abragam" << endl; + fout << " (rate hopping-rate)" << endl; + fout << " " << endl; + fout << " abragam.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " TFieldCos" << endl; + fout << " (phase frequency)" << endl; + fout << " " << endl; + fout << " tfCos.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFld" << endl; + fout << " (fraction phase frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalField.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFldGK" << endl; + fout << " (fraction frequency Trate Lrate beta)" << endl; + fout << " " << endl; + fout << " internalFieldGK.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFldLL" << endl; + fout << " (fraction frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalFieldLL.png" << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " bessel" << endl; + fout << " (phase frequency)" << endl; + fout << " " << endl; + fout << " bessel.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internBsl" << endl; + fout << " (fraction phase frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalBessel.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " skewedGss" << endl; + fout << " (phase frequency rate_m rate_p)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " staticNKZF" << endl; + fout << " (damping_D0 R_b)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " staticNKTF" << endl; + fout << " (phase frequency damping_D0 R_b)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynamicNKZF" << endl; + fout << " (damping_D0 R_b nu_c)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynamicNKTF" << endl; + fout << " (phase frequency damping_D0 R_b nu_c)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " polynom" << endl; + fout << " (tshift p0 p1 ... pn)" << endl; + fout << " " << endl; + fout << " polynom.png" << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " userFcn" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 0" << endl; + fout << " " << endl; + fout << " " << endl; + fout << "" << endl; + + file.close(); +} + //-------------------------------------------------------------------------- // END //-------------------------------------------------------------------------- diff --git a/src/musredit_qt5/PAdmin.h b/src/musredit_qt5/PAdmin.h index b966ef78..d9b05051 100644 --- a/src/musredit_qt5/PAdmin.h +++ b/src/musredit_qt5/PAdmin.h @@ -209,6 +209,7 @@ class PAdmin : public QObject QVector fTheory; ///< stores all known theories. Needed when generating theory blocks from within musredit. void saveRecentFiles(); ///< save recent file list + void createMusreditStartupFile(); ///< create default musredit_startup.xml }; #endif // _PADMIN_H_ diff --git a/src/musredit_qt5/PDumpOutputHandler.cpp b/src/musredit_qt5/PDumpOutputHandler.cpp index 69cb11e4..5ad86078 100644 --- a/src/musredit_qt5/PDumpOutputHandler.cpp +++ b/src/musredit_qt5/PDumpOutputHandler.cpp @@ -60,6 +60,11 @@ PDumpOutputHandler::PDumpOutputHandler(QVector &cmd) // QProcess related code fProc = new QProcess( this ); + // make sure that the system environment variables are properly set + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + env.insert("LD_LIBRARY_PATH", env.value("ROOTSYS") + "/lib:" + env.value("LD_LIBRARY_PATH")); + fProc->setProcessEnvironment(env); + // Set up the command and arguments. QString program = cmd[0]; QStringList arguments; @@ -69,6 +74,7 @@ PDumpOutputHandler::PDumpOutputHandler(QVector &cmd) connect( fProc, SIGNAL( readyReadStandardOutput() ), this, SLOT( readFromStdOut() ) ); connect( fProc, SIGNAL( readyReadStandardError() ), this, SLOT( readFromStdErr() ) ); + fProc->start(program, arguments); if ( !fProc->waitForStarted() ) { // error handling diff --git a/src/musredit_qt5/PMsr2DataDialog.cpp b/src/musredit_qt5/PMsr2DataDialog.cpp index 2a2b2f4e..6a1c66fc 100644 --- a/src/musredit_qt5/PMsr2DataDialog.cpp +++ b/src/musredit_qt5/PMsr2DataDialog.cpp @@ -54,18 +54,6 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he fRunTag = -1; - fFirst_lineEdit->setValidator( new QIntValidator(fFirst_lineEdit) ); - if (fMsr2DataParam->firstRun != -1) { - str = QString("%1").arg(fMsr2DataParam->firstRun); - fFirst_lineEdit->setText(str); - } - - fLast_lineEdit->setValidator( new QIntValidator(fLast_lineEdit) ); - if (fMsr2DataParam->lastRun != -1) { - str = QString("%1").arg(fMsr2DataParam->lastRun); - fLast_lineEdit->setText(str); - } - if (!fMsr2DataParam->runListFileName.isEmpty()) { fRunListFileName_lineEdit->setText(fMsr2DataParam->runListFileName); } @@ -95,10 +83,12 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he fWriteDataHeader_checkBox->setChecked(fMsr2DataParam->writeDbHeader); fIgnoreDataHeaderInfo_checkBox->setChecked(fMsr2DataParam->ignoreDataHeaderInfo); fKeepMinuit2Output_checkBox->setChecked(fMsr2DataParam->keepMinuit2Output); + fEstimateN0_checkBox->setChecked(fMsr2DataParam->estimateN0); fWriteColumnData_checkBox->setChecked(fMsr2DataParam->writeColumnData); fRecreateDataFile_checkBox->setChecked(fMsr2DataParam->recreateDbFile); fChainFit_checkBox->setChecked(fMsr2DataParam->chainFit); fOpenFilesAfterFitting_checkBox->setChecked(fMsr2DataParam->openFilesAfterFitting); + fWritePerRunBlockChisq_checkBox->setChecked(fMsr2DataParam->perRunBlockChisq); fTitleFromData_checkBox->setChecked(fMsr2DataParam->titleFromDataFile); fCreateMsrFileOnly_checkBox->setChecked(fMsr2DataParam->createMsrFileOnly); fFitOnly_checkBox->setChecked(fMsr2DataParam->fitOnly); @@ -117,16 +107,6 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he */ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam() { - if (fFirst_lineEdit->text().isEmpty()) { - fMsr2DataParam->firstRun = -1; - } else { - fMsr2DataParam->firstRun = fFirst_lineEdit->text().toInt(); - } - if (fLast_lineEdit->text().isEmpty()) { - fMsr2DataParam->lastRun = -1; - } else { - fMsr2DataParam->lastRun = fLast_lineEdit->text().toInt(); - } fMsr2DataParam->runList = fRunList_lineEdit->text(); fMsr2DataParam->runListFileName = fRunListFileName_lineEdit->text(); fMsr2DataParam->msrFileExtension = fMsrFileExtension_lineEdit->text(); @@ -140,10 +120,12 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam() fMsr2DataParam->writeDbHeader = fWriteDataHeader_checkBox->isChecked(); fMsr2DataParam->ignoreDataHeaderInfo = fIgnoreDataHeaderInfo_checkBox->isChecked(); fMsr2DataParam->keepMinuit2Output = fKeepMinuit2Output_checkBox->isChecked(); + fMsr2DataParam->estimateN0 = fEstimateN0_checkBox->isChecked(); fMsr2DataParam->writeColumnData = fWriteColumnData_checkBox->isChecked(); fMsr2DataParam->recreateDbFile = fRecreateDataFile_checkBox->isChecked(); fMsr2DataParam->chainFit = fChainFit_checkBox->isChecked(); fMsr2DataParam->openFilesAfterFitting = fOpenFilesAfterFitting_checkBox->isChecked(); + fMsr2DataParam->perRunBlockChisq = fWritePerRunBlockChisq_checkBox->isChecked(); fMsr2DataParam->titleFromDataFile = fTitleFromData_checkBox->isChecked(); fMsr2DataParam->createMsrFileOnly = fCreateMsrFileOnly_checkBox->isChecked(); fMsr2DataParam->fitOnly = fFitOnly_checkBox->isChecked(); @@ -153,50 +135,6 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam() return fMsr2DataParam; } -//---------------------------------------------------------------------------------------------------- -/** - *

SLOT: called when in the 'Run List Input', the 'First' text field is activated. It clears any - * entries in 'Run List' and 'Run List File Name'. It furthermore sets the run tag. - * - * \param str string content of the QTextEdit field. - */ -void PMsr2DataDialog::runFirstEntered(const QString &str) -{ - - if (str.length() == 0) - return; - - fRunTag = 0; - - if (!fRunList_lineEdit->text().isEmpty()) - fRunList_lineEdit->clear(); - if (!fRunListFileName_lineEdit->text().isEmpty()) - fRunListFileName_lineEdit->clear(); -} - -//---------------------------------------------------------------------------------------------------- -/** - *

SLOT: called when in the 'Run List Input', the 'Last' text field is activated. It clears any - * entries in 'Run List' and 'Run List File Name'. It furthermore sets the run tag. - * - * \param str string content of the QTextEdit field. - */ -void PMsr2DataDialog::runLastEntered(const QString &str) -{ - if (str.length() == 0) - return; - - fRunTag = 0; - - if (!fRunList_lineEdit->text().isEmpty()) - fRunList_lineEdit->clear(); - if (!fRunListFileName_lineEdit->text().isEmpty()) - fRunListFileName_lineEdit->clear(); - - if (fLast_lineEdit->text().length() == 1) - fLast_lineEdit->update(); -} - //---------------------------------------------------------------------------------------------------- /** *

SLOT: called when in the 'Run List Input', the 'Run List' text field is activated. It clears any @@ -209,12 +147,8 @@ void PMsr2DataDialog::runListEntered(const QString &str) if (str.length() == 0) return; - fRunTag = 1; + fRunTag = 0; - if (!fFirst_lineEdit->text().isEmpty()) - fFirst_lineEdit->clear(); - if (!fLast_lineEdit->text().isEmpty()) - fLast_lineEdit->clear(); if (!fRunListFileName_lineEdit->text().isEmpty()) fRunListFileName_lineEdit->clear(); } @@ -231,12 +165,8 @@ void PMsr2DataDialog::runListFileNameEntered(const QString &str) if (str.length() == 0) return; - fRunTag = 2; + fRunTag = 1; - if (!fFirst_lineEdit->text().isEmpty()) - fFirst_lineEdit->clear(); - if (!fLast_lineEdit->text().isEmpty()) - fLast_lineEdit->clear(); if (!fRunList_lineEdit->text().isEmpty()) fRunList_lineEdit->clear(); } diff --git a/src/musredit_qt5/PMsr2DataDialog.h b/src/musredit_qt5/PMsr2DataDialog.h index 06eeaf11..28099740 100644 --- a/src/musredit_qt5/PMsr2DataDialog.h +++ b/src/musredit_qt5/PMsr2DataDialog.h @@ -51,8 +51,6 @@ class PMsr2DataDialog : public QDialog, private Ui::PMsr2DataDialog virtual PMsr2DataParam* getMsr2DataParam(); public slots: - void runFirstEntered(const QString&); - void runLastEntered(const QString&); void runListEntered(const QString&); void runListFileNameEntered(const QString&); void templateRunEntered(const QString&); @@ -65,7 +63,7 @@ class PMsr2DataDialog : public QDialog, private Ui::PMsr2DataDialog void globalPlusOptionSet(bool checked); private: - int fRunTag; ///< -1 = not valid, 0 = first last, 1 = run list, 2 = run list file name + int fRunTag; ///< -1 = not valid, 0 = run list, 1 = run list file name PMsr2DataParam *fMsr2DataParam; ///< data structure used to handle the necessary input for msr2data. QString fHelpUrl; ///< help url for the Fourier block }; diff --git a/src/musredit_qt5/PPrefsDialog.cpp b/src/musredit_qt5/PPrefsDialog.cpp index 1b40a423..48ceca65 100644 --- a/src/musredit_qt5/PPrefsDialog.cpp +++ b/src/musredit_qt5/PPrefsDialog.cpp @@ -27,6 +27,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include "PChangeDefaultPathsDialog.h" #include "PPrefsDialog.h" //---------------------------------------------------------------------------------------------------- @@ -66,6 +67,8 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin) fTimeout_lineEdit->setText(QString("%1").arg(fAdmin->getTimeout())); fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit)); + + QObject::connect(fDefaultPath_pushButton, SIGNAL(clicked()), this, SLOT(handleDefaultPaths())); } //---------------------------------------------------------------------------------------------------- @@ -106,6 +109,22 @@ void PPrefsDialog::dumpRoot() fDumpAscii_checkBox->setChecked(false); } +//---------------------------------------------------------------------------------------------------- +/** + *

SLOT: called when the QPushButton 'Change Default Search Paths' is clicked. Will call a + * dialog which allows to deal with the default search paths to look for data files. + */ +void PPrefsDialog::handleDefaultPaths() +{ + PChangeDefaultPathsDialog *dlg = new PChangeDefaultPathsDialog(); + + if (dlg->exec() == QDialog::Accepted) { + + } + + delete dlg; +} + //---------------------------------------------------------------------------------------------------- // END //---------------------------------------------------------------------------------------------------- diff --git a/src/musredit_qt5/PPrefsDialog.h b/src/musredit_qt5/PPrefsDialog.h index edba329f..ffaca305 100644 --- a/src/musredit_qt5/PPrefsDialog.h +++ b/src/musredit_qt5/PPrefsDialog.h @@ -8,7 +8,7 @@ *****************************************************************************/ /*************************************************************************** - * Copyright (C) 2010-2016 by Andreas Suter * + * Copyright (C) 2010-2017 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -59,6 +59,7 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog public slots: void dumpAscii(); void dumpRoot(); + void handleDefaultPaths(); private: PAdmin *fAdmin; diff --git a/src/musredit_qt5/PSubTextEdit.cpp b/src/musredit_qt5/PSubTextEdit.cpp index 0d0cd836..7c705d9d 100644 --- a/src/musredit_qt5/PSubTextEdit.cpp +++ b/src/musredit_qt5/PSubTextEdit.cpp @@ -62,6 +62,31 @@ PSubTextEdit::PSubTextEdit(PAdmin *admin, QWidget *parent) : { } +//---------------------------------------------------------------------------------------------------- +/** + * @brief PSubTextEdit::getFitType + * @return + */ +int PSubTextEdit::getFitType() +{ + QString str = toPlainText(); + int idx = str.indexOf("fittype"); + if (idx == -1) + return -1; + + bool ok; + for (int i=idx+7; iStarts the msr-title input dialog window. diff --git a/src/musredit_qt5/PSubTextEdit.h b/src/musredit_qt5/PSubTextEdit.h index cf8ca495..0c774f50 100644 --- a/src/musredit_qt5/PSubTextEdit.h +++ b/src/musredit_qt5/PSubTextEdit.h @@ -46,6 +46,7 @@ class PSubTextEdit : public QPlainTextEdit public: PSubTextEdit(PAdmin *admin = 0, QWidget *parent = 0); virtual ~PSubTextEdit() {} + int getFitType(); public slots: void insertTitle(); diff --git a/src/musredit_qt5/PTextEdit.cpp b/src/musredit_qt5/PTextEdit.cpp index c0285d1d..e94651e5 100644 --- a/src/musredit_qt5/PTextEdit.cpp +++ b/src/musredit_qt5/PTextEdit.cpp @@ -850,7 +850,9 @@ void PTextEdit::fileOpen() } // in case there is a 1st empty tab "noname", remove it - if (fTabWidget->tabText(0) == "noname") { // has to be the first, otherwise do nothing + QString tabStr = fTabWidget->tabText(0); + tabStr.remove('&'); // this is needed since the QTabWidget adds short-cut info as '&' to the tab name + if (tabStr == "noname") { // has to be the first, otherwise do nothing fFileSystemWatcher->removePath("noname"); delete fTabWidget->widget(0); @@ -864,12 +866,15 @@ void PTextEdit::fileOpen() void PTextEdit::fileOpenRecent() { QAction *action = qobject_cast(sender()); + if (action) { // check if this file is already open and if so, switch the tab QFileInfo finfo1, finfo2; QString tabFln; bool alreadyOpen = false; - finfo1.setFile(action->text()); + QString fln = action->text(); + fln.remove('&'); + finfo1.setFile(fln); for (int i=0; icount(); i++) { tabFln = *fFilenames.find( dynamic_cast(fTabWidget->widget(i))); @@ -881,17 +886,25 @@ void PTextEdit::fileOpenRecent() } } - if (!alreadyOpen) - load(action->text()); - else + if (!alreadyOpen) { + // make sure the file exists + if (!finfo1.exists()) { + QMessageBox::critical(this, "ERROR", QString("File '%1' does not exist.\nWill not do anything.").arg(fln)); + return; + } + load(fln); + } else { fileReload(); - } + } - // in case there is a 1st empty tab "noname", remove it - if (fTabWidget->tabText(0) == "noname") { // has to be the first, otherwise do nothing - fFileSystemWatcher->removePath("noname"); + // in case there is a 1st empty tab "noname", remove it + fln = fTabWidget->tabText(0); + fln.remove("&"); + if (fln == "noname") { // has to be the first, otherwise do nothing + fFileSystemWatcher->removePath("noname"); - delete fTabWidget->widget(0); + delete fTabWidget->widget(0); + } } } @@ -1714,7 +1727,8 @@ void PTextEdit::musrCalcChisq() return; int result = 0; - if (fAdmin->getEstimateN0Flag()) + int fittype = currentEditor()->getFitType(); + if (fAdmin->getEstimateN0Flag() && ((fittype==0) || (fittype==4))) result = QMessageBox::question(this, "Estimate N0 active", "Do you wish a chisq/mlh evaluation with an automatic N0 estimate?"); @@ -1735,7 +1749,7 @@ void PTextEdit::musrCalcChisq() cmd.append(str); cmd.append(QFileInfo(*fFilenames.find( currentEditor())).fileName() ); cmd.append("--chisq-only"); - if (fAdmin->getEstimateN0Flag() && (result == QMessageBox::Yes)) + if (fAdmin->getEstimateN0Flag() && (result == QMessageBox::Yes) && ((fittype==0) || (fittype==4))) cmd.append("--estimateN0"); PFitOutputHandler fitOutputHandler(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath(), cmd); fitOutputHandler.setModal(true); @@ -1866,6 +1880,8 @@ void PTextEdit::musrMsr2Data() // init fMsr2DataParam fMsr2DataParam->keepMinuit2Output = fAdmin->getKeepMinuit2OutputFlag(); fMsr2DataParam->titleFromDataFile = fAdmin->getTitleFromDataFileFlag(); + fMsr2DataParam->estimateN0 = fAdmin->getEstimateN0Flag(); + fMsr2DataParam->perRunBlockChisq = fAdmin->getChisqPerRunBlockFlag(); PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data")); @@ -1887,6 +1903,8 @@ void PTextEdit::musrMsr2Data() fMsr2DataParam = dlg->getMsr2DataParam(); fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output); fAdmin->setTitleFromDataFileFlag(fMsr2DataParam->titleFromDataFile); + fAdmin->setEstimateN0Flag(fMsr2DataParam->estimateN0); + fAdmin->setChisqPerRunBlockFlag(fMsr2DataParam->perRunBlockChisq); // analyze parameters switch (dlg->getRunTag()) { @@ -1896,20 +1914,10 @@ void PTextEdit::musrMsr2Data() QMessageBox::Ok, QMessageBox::NoButton); return; break; - case 0: // first last - first = QString("%1").arg(fMsr2DataParam->firstRun); - last = QString("%1").arg(fMsr2DataParam->lastRun); - if (first.isEmpty() || last.isEmpty()) { - QMessageBox::critical(this, "**ERROR**", - "If you choose the first/last option,\nfirst AND last needs to be provided.", - QMessageBox::Ok, QMessageBox::NoButton); - return; - } - break; - case 1: // run list + case 0: // run list runList = fMsr2DataParam->runList; break; - case 2: // run list file name + case 1: // run list file name runListFileName = fMsr2DataParam->runListFileName; fi.setFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + runListFileName); if (!fi.exists()) { @@ -1936,10 +1944,6 @@ void PTextEdit::musrMsr2Data() // run list argument switch (dlg->getRunTag()) { case 0: - cmd.append(first); - cmd.append(last); - break; - case 1: end = 0; while (!runList.section(' ', end, end, QString::SectionSkipEmpty).isEmpty()) { end++; @@ -1960,7 +1964,7 @@ void PTextEdit::musrMsr2Data() cmd.append(str); } break; - case 2: + case 1: cmd.append(runListFileName); break; default: @@ -2025,6 +2029,16 @@ void PTextEdit::musrMsr2Data() cmd.append("-t"); } + // estimate N0 (makes sence for single histo and muMinus fits only). Add flag only if a fit is done + if (fMsr2DataParam->estimateN0 && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) { + cmd.append("-e"); + } + + // write per-run-block chisq. Add flag only if a fit is done + if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) { + cmd.append("-p"); + } + // DB output wished if (!fMsr2DataParam->dbOutputFileName.isEmpty()) { str = "-o" + fMsr2DataParam->dbOutputFileName; @@ -2068,19 +2082,7 @@ void PTextEdit::musrMsr2Data() if (!fMsr2DataParam->global) { // standard fits switch(dlg->getRunTag()) { - case 0: // first run / last run list - if (fMsr2DataParam->firstRun != -1) { - for (int i=fMsr2DataParam->firstRun; i<=fMsr2DataParam->lastRun; i++) { - if (fMsr2DataParam->msrFileExtension.isEmpty()) - fln = QString("%1").arg(i) + ".msr"; - else - fln = QString("%1").arg(i) + fMsr2DataParam->msrFileExtension + ".msr"; - - load(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fln); - } - } - break; - case 1: // run list + case 0: // run list list = getRunList(runList, ok); if (!ok) return; @@ -2094,7 +2096,7 @@ void PTextEdit::musrMsr2Data() load(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fln); } break; - case 2: // run list file + case 1: // run list file file = new QFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fMsr2DataParam->runListFileName); if (!file->open(QIODevice::ReadOnly)) { str = QString("Couldn't open run list file %1, sorry.").arg(fMsr2DataParam->runListFileName); @@ -2130,13 +2132,10 @@ void PTextEdit::musrMsr2Data() // get the first run number needed to build the global fit file name fln = QString(""); switch(dlg->getRunTag()) { - case 0: // first/last run - fln = QString("%1").arg(fMsr2DataParam->firstRun) + QString("+global") + fMsr2DataParam->msrFileExtension + QString(".msr"); - break; - case 1: // run list + case 0: // run list fln = runList.section(" ", 0, 0, QString::SectionSkipEmpty) + QString("+global") + fMsr2DataParam->msrFileExtension + QString(".msr"); break; - case 2: // run list file name + case 1: // run list file name file = new QFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fMsr2DataParam->runListFileName); if (!file->open(QIODevice::ReadOnly)) { str = QString("Couldn't open run list file %1, sorry.").arg(fMsr2DataParam->runListFileName); @@ -2237,7 +2236,7 @@ void PTextEdit::musrView() tr("Quit") ); return; } -} + } //---------------------------------------------------------------------------------------------------- /** @@ -2490,6 +2489,7 @@ void PTextEdit::musrDump() QVector cmd; QString str = fAdmin->getExecPath() + "/dump_header"; cmd.append(str); + cmd.append("-fn"); cmd.append(fileName); PDumpOutputHandler dumpOutputHandler(cmd); diff --git a/src/musredit_qt5/forms/PMsr2DataDialog.ui b/src/musredit_qt5/forms/PMsr2DataDialog.ui index 4c5c2703..1685008c 100644 --- a/src/musredit_qt5/forms/PMsr2DataDialog.ui +++ b/src/musredit_qt5/forms/PMsr2DataDialog.ui @@ -9,7 +9,7 @@ 0 0 - 552 + 585 594 @@ -25,8 +25,8 @@ 0 0 - 551 - 131 + 581 + 111 @@ -44,96 +44,16 @@ false - + 10 30 - 531 - 97 + 561 + 70 - - - - - - First - - - - - - - start run number - - - start run number - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Last - - - - - - - end run number - - - end run number - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 200 - 20 - - - - - - - - <b>OR</b> - - - Qt::AutoText - - - - - @@ -219,8 +139,8 @@ 0 - 130 - 551 + 110 + 581 71 @@ -232,8 +152,8 @@ 10 30 - 531 - 29 + 561 + 31 @@ -249,9 +169,12 @@ Qt::Horizontal + + QSizePolicy::Fixed + - 40 + 30 20 @@ -284,8 +207,8 @@ 0 - 200 - 551 + 180 + 581 80 @@ -297,8 +220,8 @@ 10 30 - 531 - 29 + 561 + 31 @@ -346,8 +269,8 @@ 0 - 280 - 551 + 260 + 581 80 @@ -359,8 +282,8 @@ 10 30 - 531 - 29 + 561 + 31 @@ -401,9 +324,9 @@ 0 - 360 - 551 - 171 + 340 + 581 + 191 @@ -414,8 +337,8 @@ 6 20 - 541 - 116 + 560 + 131 @@ -451,6 +374,13 @@ + + + + Estimate N0 + + + @@ -485,6 +415,13 @@ + + + + Write per-run-block Chisq + + + @@ -551,7 +488,7 @@ 9 - 143 + 160 141 16 @@ -566,9 +503,9 @@ - 150 - 140 - 395 + 164 + 157 + 401 23 @@ -582,7 +519,7 @@ 5 540 - 541 + 571 51 @@ -636,8 +573,6 @@ - fFirst_lineEdit - fLast_lineEdit fRunList_lineEdit fRunListFileName_lineEdit fMsrFileExtension_lineEdit @@ -712,38 +647,6 @@ - - fFirst_lineEdit - textChanged(QString) - PMsr2DataDialog - runFirstEntered(QString) - - - 82 - 44 - - - 113 - 504 - - - - - fLast_lineEdit - textChanged(QString) - PMsr2DataDialog - runLastEntered(QString) - - - 229 - 44 - - - 348 - 500 - - - fRunList_lineEdit textChanged(QString) diff --git a/src/musredit_qt5/musredit.h b/src/musredit_qt5/musredit.h index ffc06cd5..680b8e3c 100644 --- a/src/musredit_qt5/musredit.h +++ b/src/musredit_qt5/musredit.h @@ -41,8 +41,6 @@ * parameters see msr2data --help and the online documentation. */ typedef struct { - int firstRun; ///< first run number of a sequence of runs (usage 2 of msr2data) - int lastRun; ///< last run number of a sequence of runs (usage 2 of msr2data) QString runList; ///< list of run numbers (usage 3 of msr2data) QString runListFileName; ///< run list filename (usage 4 of msr2data) QString msrFileExtension; ///< msr filename extension, e.g. '0100_h13.msr' -> '_h13' @@ -57,6 +55,8 @@ typedef struct { bool chainFit; ///< flag: true = chain fit, i.e. the template for a fit is the preceeding run. false = the template is always the source for the new msr-file bool openFilesAfterFitting; ///< flag: true = open msr-file after fit in musredit. false = do not open msr-file after fit. bool titleFromDataFile; ///< flag indicating if the title for the msr-file shall be extracted from the data-file ('-t' in msr2data) + bool estimateN0; ///< flag indicating if the N0 shall be estimated for single histogram fitting + bool perRunBlockChisq; ///< flag indicating if per-run-block-chisq shall be dumped into the msr-file bool createMsrFileOnly; ///< flag: true = just create the msr-files without any fitting ('msr-