TLine, TH and PS file

hello everybody, I have filled a TH2 histo (th) and now I would like to draw a line in which the y2 point is the maximum value of the bin that corresponds to x=0.03.
This is my wrong ( :cry: ) code:

Float_t maxnumber=th->GetXaxis()->GetX()[0.03]->GetBinContent();
Double_t alphasig=0.03;
ch=new TLine(alphasig,0,alphasig,maxnumber);
ch->Draw("");

Which is my error?
Second, I would like to save my file in a .ps format whose name is the title of my histo…
Please help!!

TString tit= “hello”;
th->SetTitle(tit);

I would like the name of the file to be hello.ps
Thank you very much!

s.

It is not GetX()[0.03] it is FindBin(0.03) see: root.cern.ch/root/html/TAxis.html#TAxis:FindBin

to save in a ps file do:

c->Print(“myfile.ps”)

c is the canvas in which you draw.

Instead of “myfile.ps” you can do:

Form("%s.ps",chhist);

where chhist is a character string containing the name of the histo.