# RooUnfold: Bayesian method gives same unfolded distribution

Hi all,

I am checking out the RooUnfold package. My problem is with the bayesian option. I ask for the algorithm to iterate 1,2,3,4 times however I get the same unfolded distribution. Is a loop terminating because the chi2 is already low enough? In any case, below is the code and the output.

Regards,
Ronan

TFile *f = new TFile(“bayeshisties.root”);
TH1D h1ameas = (TH1D)f->Get(“h1ameas”);
RooUnfoldResponse &h1ameas_h1atrue = (RooUnfoldResponse&)f->Get(“h1ameas_h1atrue”);

RooUnfoldBayes unfold1(&h1ameas_h1atrue, h1ameas, 1);
RooUnfoldBayes unfold2(&h1ameas_h1atrue, h1ameas, 2);
RooUnfoldBayes unfold3(&h1ameas_h1atrue, h1ameas, 3);
RooUnfoldBayes unfold4(&h1ameas_h1atrue, h1ameas, 4);

TH1D* hist_reco1= (TH1D*)unfold1.Hreco();
TH1D* hist_reco2= (TH1D*)unfold2.Hreco();
TH1D* hist_reco3= (TH1D*)unfold3.Hreco();
TH1D* hist_reco4= (TH1D*)unfold4.Hreco();

cout<<"1 iteration "<< "2 iterations "<< "3 iterations "<< "4 iterations " <<endl;
for(Int_t i=1;i<15;i++){

cout<<hist_reco1->GetBinContent(i)<< " "<<hist_reco2->GetBinContent(i)<< " "<<hist_reco3->GetBinContent(i)<< " "<<hist_reco4->GetBinContent(i)<< " "<<endl;

}

Now unfolding…
Iteration : 0
Chi^2 of change 5.46832e-28
Calculating covariances due to number of measured events
Now unfolding…
Iteration : 0
Chi^2 of change 5.46832e-28
Iteration : 1
Chi^2 of change 1.43363e-27
Calculating covariances due to number of measured events
Now unfolding…
Iteration : 0
Chi^2 of change 5.46832e-28
Iteration : 1
Chi^2 of change 1.43363e-27
Iteration : 2
Chi^2 of change 1.5818e-27
Calculating covariances due to number of measured events
Now unfolding…
Iteration : 0
Chi^2 of change 5.46832e-28
Iteration : 1
Chi^2 of change 1.43363e-27
Iteration : 2
Chi^2 of change 1.5818e-27
Iteration : 3
Chi^2 of change 1.34025e-27
Calculating covariances due to number of measured events
1 iteration 2 iterations 3 iterations 4 iterations
8346 8346 8346 8346
7316 7316 7316 7316
7090 7090 7090 7090
6208 6208 6208 6208
6312 6312 6312 6312
5806 5806 5806 5806
6044 6044 6044 6044
6064 6064 6064 6064
5326 5326 5326 5326
5580 5580 5580 5580
5884 5884 5884 5884
5666 5666 5666 5666
5988 5988 5988 5988
1664 1664 1664 1664