From 7de725500f99d8c8dedc46a65b4b459e6f92352a Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sun, 23 Aug 2026 19:31:52 +0200 Subject: [PATCH] fix 'musrfit arguments not passed from msr2data with golbal+' bug report #17 gitea --- src/classes/PMsr2Data.cpp | 5 +++-- src/include/PMsr2Data.h | 3 ++- src/msr2data.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/classes/PMsr2Data.cpp b/src/classes/PMsr2Data.cpp index df6c20f4..b29db270 100644 --- a/src/classes/PMsr2Data.cpp +++ b/src/classes/PMsr2Data.cpp @@ -775,8 +775,9 @@ bool compare_parameters(const PMsrParamStructure &par1, const PMsrParamStructure * - 0: simple global mode with the same template starting parameters for each run * - 1: global mode including single run fits and data extraction for the global msr-file (same template for all runs) * - 2: global mode including single run fits and data extraction for the global msr-file (successive template generation) + * \param musrfitOptions options to be passed to musrfit for the single run fits (global+ mode) */ -bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &msrOutFile, unsigned int globalPlus) const +bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &msrOutFile, unsigned int globalPlus, const std::string &musrfitOptions) const { const TString alpha("alpha"), beta("beta"), norm("norm"), bkgfit("bkgfit"), lifetime("lifetime"); @@ -1423,7 +1424,7 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string & std::cerr << std::endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << std::endl; } std::ostringstream oss; - oss << path << "musrfit" << " " << *fRunVectorIter << "-OneRunFit" << fFileExtension << ".msr"; + oss << path << "musrfit" << " " << *fRunVectorIter << "-OneRunFit" << fFileExtension << ".msr" << " " << musrfitOptions; std::cout << std::endl << ">> msr2data: **INFO** Calling " << oss.str() << std::endl; if (system(oss.str().c_str()) == -1) { std::cerr << std::endl << "**ERROR** system call: " << oss.str().c_str() << " failed." << std::endl; diff --git a/src/include/PMsr2Data.h b/src/include/PMsr2Data.h index dfb0c025..a7ca3149 100644 --- a/src/include/PMsr2Data.h +++ b/src/include/PMsr2Data.h @@ -212,9 +212,10 @@ class PMsr2Data * \param templateNumber Template identifier number * \param globalOutputFile Path to output global msr-file * \param runListSize Number of runs in the global fit + * \param musrfitOptions Options to be passed to musrfit for the single run fits (global+ mode) * \return true on success, false on failure */ - bool PrepareGlobalInputFile(unsigned int templateNumber, const std::string& globalOutputFile, unsigned int runListSize) const; + bool PrepareGlobalInputFile(unsigned int templateNumber, const std::string& globalOutputFile, unsigned int runListSize, const std::string& musrfitOptions = "") const; //----------------------------------------------------------------------- /** diff --git a/src/msr2data.cpp b/src/msr2data.cpp index adc74de3..6044e1e8 100644 --- a/src/msr2data.cpp +++ b/src/msr2data.cpp @@ -819,7 +819,7 @@ int main(int argc, char *argv[]) // if fitting should be done, prepare a new input file if (temp) { if (temp > 0) { // if it is smaller no input file should be generated - bool success(msr2dataHandler->PrepareGlobalInputFile(temp, strInfile.str(), globalMode)); + bool success(msr2dataHandler->PrepareGlobalInputFile(temp, strInfile.str(), globalMode, musrfitOptions)); if (!success) { std::cerr << std::endl << ">> msr2data: **ERROR** Input file generation has not been successful! Quitting..." << std::endl;