> Hi,
>
> I want to use a function to control the weighting of histograms projected
> from an ntuple. i.e. I define some function
>
> float weight(float var) { .... return weight;}
>
> and then when I project the histogram I use this function and a variable
> from the ntuple:
>
> nt->Draw("x>>h1","weight(z)")
>
> where x and z are ntuple variables. The problem is that I get an error
> message
>
> Unknown name : "weight(z)"
>
> Now this does work if I use some library routine like sin(z). How can I
> define my own weighting functions? Thanks,
This feature is not implemented in TTree::Draw.
Only standard mathematical functions can be called.
For a more sophisticated analysis with user defined functions
use TTree::MakeCode to generate the skeleton of an analysis
function.
Rene Brun