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);

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”;

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


It is not GetX()[0.03] it is FindBin(0.03) see:

to save in a ps file do:


c is the canvas in which you draw.

Instead of “” you can do:


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