Re: how to get mean of a variable in a Tree

From: Arne Vandenbroucke <arnevdb_at_stanford.edu>
Date: Wed, 7 Oct 2009 12:59:05 -0700


Hi Luca,

  I would suggest this:

  TTree *data = ....

data->Draw("variable>>his");
TH1F *his = gDirectory->Get("his");
his->GetRMS();
his->GetMean();
etc....

Arne.

On 10/07/2009 12:48 AM, Luca Grandi wrote:
> Dear ROOT users,
>
> I am looking for a way to get mean, rms, min and max of a variable in
> a tree once applied some cuts on the events. Apart from plotting the
> distribution and extracting the info from the Stat box, is there a
> different way to do it?
> regards
>
> luca
>

-- 
  Arne Vandenbroucke,
  Stanford University
  Dept. of Radiology,
  Alway Building M001
  300 Pasteur Drive,
  STANFORD, CA 94305-5128
  Tel : +1 650 498 4591
Received on Wed Oct 07 2009 - 21:59:15 CEST

This archive was generated by hypermail 2.2.0 : Thu Oct 08 2009 - 11:50:02 CEST