Nicer stats box as for CS_analysis.

This commit is contained in:
redford_s
2019-01-18 14:34:45 +01:00
parent 71a3404495
commit 2f4ffb730d

View File

@ -708,7 +708,24 @@ int main(int argc, char* argv[]) {
g0overg1_hist->Draw();
sprintf(savename,"plots/M%s/BackplanePulsing/g0overg1_hist_M%s.png", module_str.c_str(), module_str.c_str());
c1->SaveAs((const char *)(savename));
TPaveText *pave2 = new TPaveText(0.6,0.8,0.94,0.94,"blNDC");
pave2->SetBorderSize(0);
pave2->SetFillStyle(0);
pave2->SetTextSize(0.04);
pave2->SetTextAlign(32);
g0overg1_hist->Fit("gaus");
g0overg1_hist->Draw();
c1->Update();
TF1* g0overg1hist_gaus = g0overg1_hist->GetFunction("gaus");
if (g0overg1hist_gaus) {
sprintf(savename,"Mean %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(1), g0overg1hist_gaus->GetParError(1));
pave2->AddText((const char *)(savename));
sprintf(savename,"Sigma %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(2), g0overg1hist_gaus->GetParError(2));
pave2->AddText((const char *)(savename));
pave2->Draw();
}
g0overg1_hist->SetStats(kFALSE);
sprintf(savename,"plots/M%s/BackplanePulsing/g0overg1_histfit_M%s.png", module_str.c_str(), module_str.c_str());
c1->SaveAs((const char *)(savename));