Re: [ROOT] TH1D

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Aug 14 2003 - 09:34:09 MEST


Hi Sergey,

Anufriev Sergey Valentinovich wrote:
> 
> On Wed, 13 Aug 2003, Rene Brun wrote:
> Thank you for your help. I'd like to know two points more:
> 
> 1. Is there a difference between h2.Draw() and h2->Draw()

CINT allows both forms. However, we recommend to follow standard C++.
Note that the new version of CINT 5.15.98 will automatically generate
a warning.

> 
> 2. To return to the previous question: if i have NTuple with the column
> E_t, how can I get the TH1D I need  (with the XAxis = X_t) from it. It is
> not clear for me how to work with NTuple, I need an exsample.

If you have a TNtuple/TTree with columns x,y,z,etc, you can do things like
ntuple.Draw("x");
ntuple.Draw("sqrt(x)")
ntuple.Draw("2*x/sqrt(200)")
ntuple.Draw("sqrt(x):y");
ntuple.Draw("x:sqrt(y)","z<0"); etc

for more information, see the documentation of TTree::Draw and the Users Guide.

Rene Brun

> 
> > Well, in this case, you have to
> >   -create a new histogram with the right limits in X_t
> >   - loop on the original histogram bins
> >     - getting the bin content
> >     - computing the new bin in the new histogram
> >     - call SetBinContent(newbin,bincontent)
> >
> > You must be careful with bin edge effects. A reason to start from the
> > original data (Tree or..) instead of the above procedure.
> >
> > Rene Brun
> >
> > Anufriev Sergey Valentinovich wrote:
> > >
> > > But, in fact E_t is the XAxis. And I need XAxis will be X_t. I  need not
> > > to normalize my histogram.
> > >
> > > > Hi Sergey,
> > > >
> > > > Having TH1D* h, do
> > > >   h->Scale(2/sqrt(s));
> > > >
> > > > see also TH1::DrawNormalized
> > > >
> > > > Rene Brun
> > > >
> > > > Anufriev Sergey Valentinovich wrote:
> > > > >
> > > > > Dear ROOTers!
> > > > >
> > > > > I have the next problem: I can draw TH1D which shows dependense CROSS
> > > > > SECTION (E_transeverse), but in fact I need histogram  CROSS
> > > > > SECTION(X_transeverse), where X_transeverse=2*E_transeverse/SQRT(s) (just
> > > > > one can say X_t=f(E_t)). Question is: how can I get it?
> > > > >
> > > > > Thank you in advance, Sergey.
> > > >
> >



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET