Function in AddVariable

_ROOT Version: 6.04
_Platform: MacOC El Capitan 10.11.4
_Compiler:Apple LLVM version 7.3.0 (clang-703.0.31)

Dear experts,
I would like to use a delta phi function in
factory->AddVariable("deltaphi::… ") starting from px,py components.
Is it possible to use a function inside “factory->AddVariable” ?
If yes, are there some examples ?
Best, Marianna.

Maybe you can fine something useful by searching the forum, otherwise maybe @moneta can help you

Using the example provided here

You can define your DeltaPhi function and then use in DataLoader::AddVariable as you would use in TTree::Draw