fix 'musrfit arguments not passed from msr2data with golbal+' bug report #17 gitea

This commit is contained in:
2026-08-23 19:44:00 +02:00
parent 7f55b41822
commit 66472c979a
3 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -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;
+2 -1
View File
@@ -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;
//-----------------------------------------------------------------------
/**
+1 -1
View File
@@ -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;