Filling histos when running on TBranches automatically

################################## EDIT################################
I realized that it makes no sense to try to import in this way the content of a TBranch to a TH1F, so forget about the question below.
#######################################################################

Dear experts,

I’m facing a little issue to fill Histos assuming that I have a loop running over the TBranches in a TTree. More specifically:

[quote]f = new TFile(“SoftElectronMVA__BDTG_1_0_0.root”);
t = (TTree*)f->Get(“TrainTree”);
it = new TIter(t->GetListOfBranches());
while (TBranch br = static_cast<TBranch>(it->Next())) {
h= new TH1F();
h->SetName(“h”));
t->Draw(Form("%s>>h",br->GetName()),“classID==0”,"");
h->SetFillColor(2);
h->SetFillStyle(3003);
h->Draw();
c1.Print(Form(“hsimple_%d.ps”,indexplot);
indexplot++;
}[/quote]

The plot remains empty in that case. If I remove the last Draw, then I got the histo filled in the *.ps files.
Somehow it seems that even if the first Draw sends the histos to “h”, the TH1F defined with the Name “h” seems not filled.

Is there anything obvious I do wrongly?

Thanks in advance.

Simon