diff --git a/src/classes/PFitter.cpp b/src/classes/PFitter.cpp index a29eb5b0..520f1615 100644 --- a/src/classes/PFitter.cpp +++ b/src/classes/PFitter.cpp @@ -279,7 +279,8 @@ bool PFitter::SetParameters() // check if there is an unused parameter, if so, fix it for (unsigned int i=0; iParameterInUse(i) == 0) { // parameter not used in the whole theory!! + // parameter not used in the whole theory and not already fixed!! + if ((fRunInfo->ParameterInUse(i) == 0) && (fParams[i].fStep != 0.0)) { fMnUserParams.Fix(i); // fix the unused parameter so that minuit will not vary it cout << endl << "**WARNING** : Parameter No " << i+1 << " is not used at all, will fix it" << endl; } diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 61d3bdb3..ee0ab0d9 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -1848,7 +1848,7 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi str = ostr->GetString(); if (str.IsDigit()) { // parameter number ival = str.Atoi(); - if ((ival > 0) && (ival < (int)fParam.size())) { + if ((ival > 0) && (ival < (int)fParam.size()+1)) { fParamInUse[ival-1]++; //cout << endl << ">>>> theo: param no : " << ival; } @@ -1856,6 +1856,7 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi if (FilterFunMapNumber(str, "map", ival)) map.push_back(ival-MSR_PARAM_MAP_OFFSET); } else if (str.Contains("fun")) { // fun +//cout << endl << "theo:fun: " << str.Data(); if (FilterFunMapNumber(str, "fun", ival)) fun.push_back(ival-MSR_PARAM_FUN_OFFSET); } @@ -1878,6 +1879,8 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi // everything to lower case str.ToLower(); +//cout << endl << ">> " << str.Data(); + tokens = str.Tokenize(" /t"); if (!tokens) continue; @@ -1892,6 +1895,7 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi // check if fun number is used, and if yes, filter parameter numbers and maps TString sstr; for (unsigned int i=0; i> funNo: " << fun[i]; if (fun[i] == ival) { // function number found // filter for parX sstr = iter->fLine; @@ -1899,6 +1903,7 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi while (sstr.Index("par") != -1) { memset(sval, 0, sizeof(sval)); sstr = &sstr[sstr.Index("par")+3]; // trunc sstr +//cout << endl << ">> par:sstr: " << sstr.Data(); for (int j=0; j> map:sstr: " << sstr.Data(); for (int j=0; j> " << str.Data(); // tokenize string tokens = str.Tokenize(" \t"); if (!tokens) continue; // get the parameter number via map +//cout << endl << ">> map.size() = " << map.size(); for (unsigned int i=0; iGetEntries()) { ostr = dynamic_cast(tokens->At(map[i])); @@ -2094,7 +2103,7 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi /* cout << endl << ">> fParamInUse: "; for (unsigned int i=0; i