Text from TCut

Hi,

Is there a way of extracting the text associated with a TCut from the TCut itself? I ask as I am drawing histograms using the TTree Draw command using a TCut, and piping the result to histogram. I would however like to be to able set the title of the histogram using the text from the TCut first. Something along the lines of:

TCut cut("y>10");
TH1D* h1 = new TH1D("h1", "text_from_tcut", 100, -10, 10);
T->Draw("x>>h1", cut);

Thanks

“cut.GetTitle()” should display “y>10” but I am not sure this is what you asked.
So, your example may be

TCut cut("y>10"); TH1D* h1 = new TH1D("h1", TString::Format("h_%s",cut.GetTitle()), 100, -10, 10); T->Draw("x>>h1", cut);

Perfect, thanks!