Re: Array parameters for function used in Draw

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 20 Jan 2011 08:27:22 -0600


Hi,

> Double_t partest(Double_t* energy) {

TTree::Draw explicitly supports only function that takes simple numerical argument. You can not use this function. If you really need this type of control, you will need to migrate to the more complex case of passing a script to TTree::Draw or creating a skeleton with MakeProxy or MakeSelector.

Cheers,
Philippe.

On 1/20/11 3:21 AM, Dmitry A. Shtol wrote:
> Hello!
>
> Let's I need to use in Draw function a function with parameter.
> Just as example:
>
> Double_t partest(Double_t energy) {
> return energy;
> }
>
> I can use:
> chain->Draw("partest(energy)");
>
> And it works.
>
> Now I have a vector parameter in tree, which normally is used:
>
> chain->Draw("energy[0]")
>
> How to use it in function? If I write
>
> Double_t partest(Double_t* energy) {
> return energy[0];
> }
>
> chain->Draw("partest(energy)")
>
> This doesn't work.
>
> Thanks in advance,
Received on Thu Jan 20 2011 - 15:27:29 CET

This archive was generated by hypermail 2.2.0 : Sun Jan 23 2011 - 11:50:01 CET