How to pass a variable to a TSelector

let’s say I generated a Selector using the command MakeSelector(“Whatever”).
Then let’ s say I have a script which uses the Selctor mentioned above, using the command

TChain *ch = new TChain("events");

How can I pass a variable to be used inside the Begin(TTree * /tree/) function of the Selector?
Namely, how should I modify the selector Whatever in order to let it accept as “input” a variable given by the script I mentioned above?
How should I modify then the script?
I guess something like:

TString variable="no-clue";

Thanks for your help and attention

Can it be that you’re looking for something like a “public_attribute” trick shown in the “ROOT User’s Guide” -> “Trees” -> “Using TTree::MakeSelector”?

Yes, thanks a lot. It actually helped.