Combining TCut and and a factor

Hi,

I am trying to draw a histogram from a TTree with TCut and a filling factor, my code looks like this :

my_tcut = ROOT.TCut(‘Y>0.3’)
my_tree.Draw(‘Y’,‘Y’*my_tcut,’’,500)

I get the following message:

TypeError: can’t multiply sequence to non-int

But in standard ROOT the following code works :

TCut my_tcut = “Y>0.3”;
my_tree->Draw(“Y”,“Y”*my_tcut,"",500);

Any suggestion?

I use :
Python 2.3.4
5.12/00e

Hi,

sorry, but the global operator overloads for TCut are not available in python (there is no such thing, although I probably could parse the friend statements and make proper operators out of that to be attached to the TCut class). You’ll have to use a temporary variable:mul = TCut("Y") mul *= my_tcut my_tree.Draw('Y', mul, '', 500)
HTH,
Wim

Thanks,

I should have tried it myself! Actually this is even better (because more flexible) than what I ask for.

Jean-Francois