Hi,
I am getting an error “Use of Undeclared Identifier” in ROOT 6 while running a script which I didn’t have a problem with in ROOT 5. My script has something like:
if (condition 1) {
Jet *jet1 = (Jet*) branchJet->At(0);
}
if (condition 2) {
Here I use jet1 to calculate some other variable.
}
Now condition 2 is never met if condition 1 is false. However, ROOT 6 returns this:
error: use of undeclared identifier ‘jet1’
I don’t know how it is executing the second if statement and trying to use ‘jet1’ given that this statement must be false. I have seen another post complaining about a similar issue but with histograms. Hope you can help.
Many thanks,
Amin