Hi Annalisa,
ntuple->Draw("zpos"); produces an histogram named "htemp" by default
You can get a pointer to "htemp", its x axis, etc in the following way
TH1F *htemp = (TH1F*)gPad->GetPrimitive("htemp");
TAxis *xaxis = htemp->GetXaxis();
TH1F *h110 = new TH1F("h110","Beam position (z)",
xaxis->GetNbins(),xaxis->GetXmin(),xaxis->GetXmax());
Rene Brun
Annalisa De Caro wrote:
>
> Hi rooters,
> i would ask you if is it possible have in ROOT the translation of:
>
> nt/pl 8.zpos
> nbinsz=$hinfo(1000000,'xbins')
> zmin=$hinfo(1000000,'xmin')
> zmax=$hinfo(1000000,'xmax')
> 1d 110 'Beam position (z)' [nbinsz] [zmin] [zmax]
> ?
>
> I think that it can be similary to:
>
> ntuple->Draw("xpos");
> zmin = ???->GetMinimum();
> zmax = ???->GetMaximum();
> nbinsz = ???->GetNbins();
> c2_2->cd();
> THF1 *h110 = new THF1("h110","Beam position (z)",nbinsz,zmin,zmax);
> ntuple->Draw("zpos>>h110");
>
> ...but i do not know what can it be ???...
> GetMinimum,GetMaximum,GetNbins are the methods for histogram class...
> ...but who is it number or name histogram for a nt/pl ?
> Thank you
> Annalisa
> *************************************************************************
> * University of Bologna | | decaro@bo.infn.it *
> * Physics Department | +39 051 20 91103 | *
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> * University of Salerno | | *
> * Physics Sciences Department | +39 089 96 5359 | *
> * (INFN of Napoli) | | *
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> * CERN - EP division | | decaro@mail.cern.ch *
> * (Bld.29 R019) | +41 22 76 77767 | *
> *************************************************************************
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:40 MET