Is there any way to transform TCut in bool type?

Hello!

I want to transform TCut in bool type, but I don’t know how to do this.
The next code illustrates my problem:

//create and fill chain
TChain chain("t1");
chain.Add("D:\\tree.root");

//Set branches
Double_t a;
TMultiGraph* graph = 0;

chain.SetBranchAddress("a", &a);
chain.SetBranchAddress("gr", &graph);

//Create cut and draw "a"
TCut cut = "a > 0";
chain.Draw("a", cut);

//Create Hlist in order to save graphs
TObjArray Hlist(0);
Hlist.SetOwner(kTRUE);


for (int i = 0; i < chain.GetEntries(); ++i)
{
	chain.GetEntry(i);
	
	bool cut_bool = a > 0; //It is very conveniently to transform "cut" variable in bool type. But how to do this? 
	if(cut_bool )
	{
		Hlist.Add(graph->Clone());
	}
	
}

//save graphs
TFile ofile("D:\\graphs.root", "RECREATE");
Hlist.Write();
ofile.Close();

So, it will be very conveniently to transform “cut” variable in bool type because in real program I have complex conditions I don’t want to use copy-paste technique.

Coud you help me?
Thank you in advance.

The doc says:

“A specialized string object used for TTree selections.”

root.cern.ch/doc/master/classTCut.html

In your loop I do not see where you are using the TCut .
You have a normal boolean “cut_bool”… which is fine .

Hello!

I want to draw “a” variable and save graphs with equal cut conditions at the same time.
As I undestand, I have to use loop if I want to save graphs.
Yes, I can move draw method in the loop, but maybe there is a more simple solution.

The graph is generated by the TTree::Draw() method.
In your macro you have only one call to Draw().
So will have on one graph.