Re: TProfile2D

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Sat, 25 Feb 2006 09:33:38 +0100 (MET)


see example below for a TProfile. You can change the example to produce a TProfile2D in the same way.

Rene Brun

void profile() {

    TProfile *p = new TProfile("p","test profile",50,-3,3);     p->SetErrorOption("s");
    TRandom r;

    for (Int_t i=0;i<10000;i++) {
       Double_t x = r.Gaus(0,1);
       Double_t y = r.Gaus(0,1);
       p->Fill(x,x*x+y*y);

    }
    p->Draw();
    for (Int_t i=1;i<=50;i++) {
       printf("bin: %2d, mean = %g, rms = %g\n",i,
          p->GetBinContent(i),p->GetBinError(i));
    }
}

On Wed, 22 Feb
2006, FAIGL Zoltán wrote:

> Dear all,
>
> I have created TProfile2D histograms in my work to analyse graphically
> the dependencies between different data.
>
> The root user guide writes this about TProfile2D histograms:
>
> Profile histograms:
> . TProfile: one dimensional profiles
> . TProfile2D: two dimensional profiles
> Profile histograms are used to display the mean value of Y and its RMS for
> each bin in X. Profile histograms are
> in many cases an elegant replacement of two-dimensional histograms. The
> inter-relation of two measured
> quantities X and Y can always be visualized with a two-dimensional
> histogram or scatter-plot. If Y is an
> unknown but single-valued approximate function of X, it will have greater
> precisions in a profile histogram than
> in a scatter plot.
>
>
>
> My question is the following:
> Is it true, that by default, when I draw a TProfile histogram, then I get
> the mean of the values in each bin?
>
> How can we plot only the RMS of the values in each bin? I didn't
> find this imformation anywhere.
>
> Thank you for your help.
> Br.
> Zoltan
>
Received on Sat Feb 25 2006 - 09:33:52 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:57 MET