Skip to content
Snippets Groups Projects
Commit 3170a81b authored by Lorenzo Moneta's avatar Lorenzo Moneta
Browse files

from Grabriel: mke printing of the "." as a Progress message in RooFit. Remove...

from Grabriel: mke printing of the "." as a Progress message in RooFit. Remove suppression of messages below Error


git-svn-id: http://root.cern.ch/svn/root/trunk@44140 27541ba8-7e3a-0410-8455-c3a389f83636
parent 184d6dc7
No related branches found
No related tags found
No related merge requests found
...@@ -152,9 +152,11 @@ MarkovChain* MetropolisHastings::ConstructChain() ...@@ -152,9 +152,11 @@ MarkovChain* MetropolisHastings::ConstructChain()
Int_t weight = 0; Int_t weight = 0;
Double_t xL = 0.0, xPrimeL = 0.0, a = 0.0; Double_t xL = 0.0, xPrimeL = 0.0, a = 0.0;
// ibucur: i think the user should have the possiblity to display all the message
// levels should he/she want to; maybe a setPrintLevel would be appropriate
// (maybe for the other classes that use this approach as well)?
RooFit::MsgLevel oldMsgLevel = RooMsgService::instance().globalKillBelow(); RooFit::MsgLevel oldMsgLevel = RooMsgService::instance().globalKillBelow();
RooMsgService::instance().setGlobalKillBelow(RooFit::ERROR); RooMsgService::instance().setGlobalKillBelow(RooFit::PROGRESS);
// We will need to check if log-likelihood evaluation left an error status. // We will need to check if log-likelihood evaluation left an error status.
// Now using faster eval error logging with CountErrors. // Now using faster eval error logging with CountErrors.
...@@ -197,16 +199,16 @@ MarkovChain* MetropolisHastings::ConstructChain() ...@@ -197,16 +199,16 @@ MarkovChain* MetropolisHastings::ConstructChain()
"MetropolisHastings::ConstructChain() " << endl; "MetropolisHastings::ConstructChain() " << endl;
} }
ooccoutP((TObject *)0, Generation) << "Metropolis-Hastings progress: ";
// do main loop // do main loop
for (i = 0; i < fNumIters; i++) { for (i = 0; i < fNumIters; i++) {
// reset error handling flag // reset error handling flag
hadEvalError = false; hadEvalError = false;
if (i % (fNumIters / 100) == 0) { // print a dot every 1% of the chain construction
// print a dot every 1% of the chain construction if (i % (fNumIters / 100) == 0) ooccoutP((TObject*)0, Generation) << ".";
fprintf(stdout, ".");
fflush(NULL);
}
fPropFunc->Propose(xPrime, x); fPropFunc->Propose(xPrime, x);
...@@ -264,7 +266,7 @@ MarkovChain* MetropolisHastings::ConstructChain() ...@@ -264,7 +266,7 @@ MarkovChain* MetropolisHastings::ConstructChain()
// make sure to add the last point // make sure to add the last point
if (weight != 0.0) if (weight != 0.0)
chain->Add(x, CalcNLL(xL), (Double_t)weight); chain->Add(x, CalcNLL(xL), (Double_t)weight);
printf("\n"); ooccoutP((TObject *)0, Generation) << endl;
RooMsgService::instance().setGlobalKillBelow(oldMsgLevel); RooMsgService::instance().setGlobalKillBelow(oldMsgLevel);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment