[ROOT] Re: Filling histo in subroutines

From: Elena Vataga (vataga@fnal.gov)
Date: Fri Oct 17 2003 - 19:37:47 MEST


Hello, Rene,

Thank you for fast reply.

No, they are not named g..
I am calling this function in a loop,
so the name is always different.
I tryied to add:
g->SetName(g->GetName());
(does it make sence?)
it does not help...

regards,
	Elena

On Fri, 17 Oct 2003, Rene Brun wrote:

> Hi Elena,
>
> It looks like your histograms TH1F *f and *g are not named "f" and "g".
> When doing t->Draw("p2.pt>>g"), ROOT will fill an histogram named "g".
> If no histogram named "g" exists, one will be automatically created.
>
>
> Rene Brun
>
>  On
> Fri, 17 Oct 2003, Elena Vataga wrote:
>
> > Hello, rooters!
> >
> >
> > Could you, please, give me an advise on the following:
> >
> > I created function inside my root macro which essentialy
> > do the following:
> >
> > void make_histo(TChain *t ,  TH1F* g, TH1F* b, TCut CUT ) {
> >   t->Draw("p2.pt>>g");
> >   t->Draw("p2.pt>>b",CUT);
> >   g->Sumw2();
> >   b->Sumw2();
> > }
> >
> > Histogram I am getting on return are empty.
> > I cannot simply make:
> >
> >  t->Draw("p2.pt>>htemp");
> >  TH1F *g = (TH1F*)htemp->Clone("g")
> > because I am using non-equidistant binning and need to pass
> > booked histo into subroutine.
> >
> > Any idea how to make it work?
> >
> >         Thank you in advance,
> >                         Elena
> >
>



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