Sure. At the code location where I call gROOT->ProcessLine(), handler is already defined. In fact, if I replace the ProcessLine() code by its argument, it works. It just doesn’t when using ProcessLine().
(But I can’t avoid ProcessLine() in general because I would like to do this multiple times, based on what’s in the “cuts” vector.)
That’s a bug in CINT: “h” should not be visible, CINT confuses the scopes.
Now - I don’t understand yet why you need to go through code that you pass to the interpreter, instead of simply creating TCut-s. But if it’s really needed, then just use a global variable, or use the name of a variable: ROOT 6, just like ROOT 5, checks for names of objects registered in the current directory (gDirectory), for instance histograms.