TCut used as TCutG

Hi rooters,
is there a way to declare a TCut so that it can be used in the same way of a TCutG?

I other words, when I create a TCutG with the graphics editor, I can name it “mycutg” for example.
Afterwords I can use “mycutg” as second argument in the TTree::Draw method to apply such selection:

TTree::Draw("","mycutg","")

On the other hand, when I create a TCut variable and I name it “mycut”, in the second argument of the TTree::Draw method I have to write the variable itself and I cannot use its name “mycut”:

TCut sel("mycut","x>0")
TTree::Draw("",sel,"")            <-- this works
TTree::Draw("","mycut","")     <--this is not working

Or at least this is my actual understanding.

Is there a way of declaring the TCut so that I can use its name instead of its variable in the TTree:Draw method?


ROOT Version (6.08/06):
Platform, compiler (Linux Debian 3.16.43, gcc 4.9.2):


Dear mmoo,

Your understanding is correct, you cannot pass the TCut by name to TTree::Draw. You can however do operations, see TCut.

G Ganis

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.