Apply cut to tree where variable is an integer


I read in a TTree from a file and declare several of the fields as integer type:


The code I use to read in the tree looks like this: ({}-style macro)

TTree* mt = new TTree("mine", "A Tree");
long long int qr = mt->ReadFile("log.txt");
cout << "Read in " << qr << " rows" << endl;

But now when I try to apply a cut on the “Year” variable, I get a bad numerical expression:

root [49] mt->Draw("TotRetn/Length", "Year=1996")               

*ERROR 30 : 
 Bad numerical expression : "Year=1996"

What am I missing?


“==” instead of “=”


As they say in the States: “Duh!” Thanks for the rapid reply; it was driving me nuts.