based on your screnshot, the MVA_BDT histogram is located in the TMVAppbdt1.root, but your code
TFile *f1 = new TFile("1cut.root");
tries to open a different file. Why?
It’s usually a very good idea to check if your file exists, can be opened, and does contain the wanted histogram. To do this you should modify your code to something like this:
TFile *f1 = TFile::Open("1cut.root");
if (!f1 || f1->IsZombie())
{
printf("f1 can not be opened\n");
return;
}
TH1F* h1 = static_cast<TH1F*>(f1->Get("MVA_BDT"));
if (!h1)
{
printf("MVA_BDT can not be fetched from f1\n");
return;
}