RE: Draw/Projetc

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 03 Jun 2005 15:30:38 -0500


Hi,

Indeed this is not supposed to work! :)

Instead you need to add an addition function to your myfunc.C:

void myfunc_SlaveBegin(TTree*)
{

   TH1* your_hist_ptr = gROOT->FindObject("histoname");    fObject = htemp = your_histo_ptr;
}

I.e. in myfunc_SlaveBegin assign to the variable htemp the value of the address to your histogram.

'htemp' is this context will be a data member of the TSelector object automatically generated for you (see the file generatedSel.h left after execution).

We should somehow make this automatic.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Jean-Eric Campagne
Sent: Friday, June 03, 2005 10:35 AM
To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] Draw/Projetc

Hi,
There is a TTree->Draw("myfunc.C+") to plot user-defined function based on TTree variables, but I have some problems with TTree->Project(histo,"myfunc.C+") as there is no entries in it! DO you have an idea?
Cheers
Jean-Eric

...........................................................................
.LAL - IN2P3 - CNRS
.LAL - B.P 34 - 91898 Orsay Cedex - France
.Piece 108
.Tel +33 (0)1 64 46 84 29
.Fax +33 (0)1 64 46 83 97
...........................................................................
Received on Fri Jun 03 2005 - 22:31:02 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:09 MET