Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 73480ac0 authored by Jérémie Dudouet's avatar Jérémie Dudouet
Browse files

correct a bug in the BgFit

parent 430f6be7
...@@ -106,7 +106,6 @@ void CXBgdFit::Update() ...@@ -106,7 +106,6 @@ void CXBgdFit::Update()
arr->SetLineColor(kBlue); arr->SetLineColor(kBlue);
arr->SetFillColor(kBlue); arr->SetFillColor(kBlue);
fBackgd.push_back(E); fBackgd.push_back(E);
cout<<E<<endl;
} }
fPlayer->GetMainWindow()->RefreshPads(); fPlayer->GetMainWindow()->RefreshPads();
...@@ -175,7 +174,10 @@ void CXBgdFit::Fit() ...@@ -175,7 +174,10 @@ void CXBgdFit::Fit()
Int_t binmin = fHistogram->GetXaxis()->FindBin(fBackgd.at(i)); Int_t binmin = fHistogram->GetXaxis()->FindBin(fBackgd.at(i));
Int_t binmax = fHistogram->GetXaxis()->FindBin(fBackgd.at(i+1)); Int_t binmax = fHistogram->GetXaxis()->FindBin(fBackgd.at(i+1));
for(int ibin=binmin ; ibin<=binmax ; ibin++) HistoToFit->SetBinContent(ibin,fHistogram->GetBinContent(ibin)); for(int ibin=binmin ; ibin<=binmax ; ibin++) {
HistoToFit->SetBinContent(ibin,fHistogram->GetBinContent(ibin));
HistoToFit->SetBinError(ibin,fHistogram->GetBinError(ibin));
}
} }
HistoToFit->GetXaxis()->SetRangeUser(fBackgd.front(), fBackgd.back()); HistoToFit->GetXaxis()->SetRangeUser(fBackgd.front(), fBackgd.back());
...@@ -196,10 +198,15 @@ void CXBgdFit::Fit() ...@@ -196,10 +198,15 @@ void CXBgdFit::Fit()
TString FitOpt = "R0S"; TString FitOpt = "R0S";
if(fPlayer->GetPrintLevel()>0) FitOpt +="V"; if(fPlayer->GetPrintLevel()>0) FitOpt +="V";
TFitResultPtr r = HistoToFit->Fit(fBackFunction,FitOpt.Data()); TFitResultPtr r = HistoToFit->Fit(fBackFunction,FitOpt.Data(),FitOpt.Data());
ostringstream text; ostringstream text;
cout<<r<<endl;
if(r==-1) {
WARN_MESS << "Oups... Error in fitting histogram" << ENDL;
return;
}
text << "Fit results :"; text << "Fit results :";
cout<<text.str()<<endl;fPlayer->PrintInListBox(text.str(),kPrint);text.str(""); cout<<text.str()<<endl;fPlayer->PrintInListBox(text.str(),kPrint);text.str("");
text << "Status: "; text << "Status: ";
......
...@@ -516,7 +516,6 @@ void CXHist1DPlayer::DoBgdFit() ...@@ -516,7 +516,6 @@ void CXHist1DPlayer::DoBgdFit()
{ {
fFitResultsBox->RemoveAll(); fFitResultsBox->RemoveAll();
fListOfBgdFitObjects->ls();
for(int i=0 ; i<fListOfBgdFitObjects->GetEntries() ; i++) { for(int i=0 ; i<fListOfBgdFitObjects->GetEntries() ; i++) {
CXBgdFit *fit = (CXBgdFit*)fListOfBgdFitObjects->At(i); CXBgdFit *fit = (CXBgdFit*)fListOfBgdFitObjects->At(i);
fit->Fit(); fit->Fit();
......
...@@ -893,7 +893,6 @@ TH1 *CXMainWindow::GetHisto(TVirtualPad *pad, bool GetFirst) ...@@ -893,7 +893,6 @@ TH1 *CXMainWindow::GetHisto(TVirtualPad *pad, bool GetFirst)
obj = lnk->GetObject(); obj = lnk->GetObject();
if (obj->InheritsFrom(TH1::Class()) && strcmp(obj->GetName() ,"hframe") != 0) { if (obj->InheritsFrom(TH1::Class()) && strcmp(obj->GetName() ,"hframe") != 0) {
hist = dynamic_cast<TH1*>(obj); hist = dynamic_cast<TH1*>(obj);
hist->Print();
if(GetFirst) return hist; if(GetFirst) return hist;
} }
lnk = (TObjOptLink*)lnk->Next(); lnk = (TObjOptLink*)lnk->Next();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment