Cutting on TObjString

Hi,

I have a simple TTree containing a float and a TObjString (as leaves - not embedded in a data class or struct)

Is there anyway in which I can use the TObjString within the selector for TTree::Draw ? For example, could I do

myTree->Draw(“myFloat”, “myTObjString==hello”)

I tried this and I get
Error in TTreeFormula::Compile: Bad numerical expression : “hello”

Is there anyway around this

many thanks

root 5.22/00 on Linux

Hi,

You can trymyTree->Draw("myFloat", "myTObjString.GetString().Data()==hello");

Cheers,
Philippe.

Hi Philippe,

ok - that almost worked- I needed to do the following

myTree->Draw(“myFloat”, “myTObjString.GetString().Data()==“hello””);

thanks as always for the help
Peter