Re: [ROOT] SetBinContent for profiles

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jun 05 2001 - 11:00:36 MEST


Hi Vincent.

In case of a TH1F, you can increment only the sum of weights per bin
by calling TH1::SetBinContent.
However, in case of TProfile, this is not sufficient. You should also
increment the number of entries per bin via TProfile::SetEntries.
I would not recommend at all this procedure unless you understand well
what a TProfile is. Always use the Fill function.


Rene Brun


Vincent Boudry wrote:
> 
> Bonjour,
> 
> The following macro doesn't seem to work (Vers 2.25/03).  Replacing a
> profile by a TH1F does the job though.
> 
> Best Regards, Vincent Boudry.
> 
> {
>    TProfile* pp = new TProfile("pp","test profile",10,0.0,10.0);
>    int_t i;
>    for( i=1; i<=10; i++ ){
>         printf("i = %d\n",i);
>         Stat_t in = i;
>         pp->SetBinContent(i,in);
>    }
>    pp->Draw();
> }



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:48 MET