@@ -354,7 +354,6 @@ int RooMinimizer::minimize(const char *type, const char *alg)
354354
355355 bool ret = fitFCN (*_fcn->getMultiGenFcn ());
356356 determineStatus (ret);
357-
358357 }
359358 profileStop ();
360359 _fcn->BackProp ();
@@ -919,25 +918,20 @@ bool RooMinimizer::fitFCN(const ROOT::Math::IMultiGenFunction &fcn)
919918 // initiate the minimizer
920919 initMinimizer ();
921920
922-
923-
924921 // Identify floating RooCategory parameters
925922 RooArgSet floatingCats;
926923
927924 for (auto arg : _fcn->allParams ()) {
928925 if (arg->isCategory () && !arg->isConstant ())
929926 floatingCats.add (*arg);
930927 }
931-
932928
933-
934929 std::vector<RooCategory *> pdfIndices;
935930 for (auto *arg : floatingCats) {
936931 if (auto *cat = dynamic_cast <RooCategory *>(arg))
937932 pdfIndices.push_back (cat);
938933 }
939934
940-
941935 const size_t nPdfs = pdfIndices.size ();
942936
943937 // Identify floating continuous parameters (RooRealVar)
@@ -947,9 +941,8 @@ bool RooMinimizer::fitFCN(const ROOT::Math::IMultiGenFunction &fcn)
947941 floatReals.add (*arg);
948942 }
949943
950-
951944 if (nPdfs == 0 ) {
952-
945+
953946 bool isValid = _minimizer->Minimize ();
954947 if (!_result)
955948 _result = std::make_unique<FitResult>();
@@ -975,7 +968,6 @@ bool RooMinimizer::fitFCN(const ROOT::Math::IMultiGenFunction &fcn)
975968 while (improved) {
976969 improved = false ;
977970
978-
979971 auto combos = generateOrthogonalCombinations (maxIndices);
980972 reorderCombinations (combos, maxIndices, bestIndices);
981973
@@ -1006,36 +998,30 @@ bool RooMinimizer::fitFCN(const ROOT::Math::IMultiGenFunction &fcn)
1006998 bestNLL = val;
1007999 bestIndices = combo;
10081000 improved = true ;
1009-
10101001 }
1011-
1012-
1013-
10141002 }
1015-
10161003 }
10171004
1018- for (size_t i = 0 ; i < nPdfs; ++i)
1019- pdfIndices[i]->setIndex (bestIndices[i]);
1020-
1021- coutI (Minimization) << " All NLL Values per Combination:\n " << std::endl;
1022- for (const auto &entry : nllMap) {
1023- const auto &combo = entry.first ;
1024- double val = entry.second ;
1025- coutI (Minimization) << " Combo: [" << std::endl;
1026- for (size_t i = 0 ; i < combo.size (); ++i)
1027- std::cout << combo[i] << (i + 1 < combo.size () ? " , " : " " );
1028- coutI (Minimization) << " ], NLL: " << val << " \n " << std::endl;
1029- }
1005+ for (size_t i = 0 ; i < nPdfs; ++i)
1006+ pdfIndices[i]->setIndex (bestIndices[i]);
1007+
1008+ coutI (Minimization) << " All NLL Values per Combination:\n " << std::endl;
1009+ for (const auto &entry : nllMap) {
1010+ const auto &combo = entry.first ;
1011+ double val = entry.second ;
1012+ coutI (Minimization) << " Combo: [" << std::endl;
1013+ for (size_t i = 0 ; i < combo.size (); ++i)
1014+ std::cout << combo[i] << (i + 1 < combo.size () ? " , " : " " );
1015+ coutI (Minimization) << " ], NLL: " << val << " \n " << std::endl;
1016+ }
10301017
1031- coutI (Minimization) << " DP Best Indices: [" << std::endl;
1032- for (size_t i = 0 ; i < bestIndices.size (); ++i) {
1033- coutI (Minimization) << bestIndices[i] << std::endl;
1034- if (i + 1 < bestIndices.size ())
1035- coutI (Minimization)<< " , " << std::endl;
1036- }
1037- coutI (Minimization) << " ], NLL = " << bestNLL << " \n " << std::endl;
1038-
1018+ coutI (Minimization) << " DP Best Indices: [" << std::endl;
1019+ for (size_t i = 0 ; i < bestIndices.size (); ++i) {
1020+ coutI (Minimization) << bestIndices[i] << std::endl;
1021+ if (i + 1 < bestIndices.size ())
1022+ coutI (Minimization) << " , " << std::endl;
1023+ }
1024+ coutI (Minimization) << " ], NLL = " << bestNLL << " \n " << std::endl;
10391025
10401026 // Fill FitResult and update FitConfig
10411027 if (!_result)
0 commit comments