Dear all,
I have a question which might be a bit naive.
Let’s say i have a very long TCut expression which is spitted out by some code which builds the chain logic of the cuts.
Is there any tool inside ROOT which is able to “re-decompose” the cut once build?
I basically would like to avoid to refactor our CutDefinition namespaces and the way we build the selection in our C++ classes and i was looking for some regular expression and parenthesis matching tool which is maybe used inside ROOT when a TCut is applied to the TTree.
I tried with splitting by && and || but the resulting string i get is not following anymore the cut logics we have, plus it gets polluted by many parenthesis which are hard to understand.
If there are no solution , probably i will follow the path of refactoring our code.
As I said in the thread i can modify the code which generate the cut, but I need to refactor a bit the code. I just ask in case it exists some kind of tool in ROOT or in general able to interpret the math expressions and reduce the problem giving me back a list of selection or something like that.
I am not aware of such tool. But why don’t you create smaller and simpler cuts and make the complex one a composition of those ?
That might be easier to manage.
Yes, indeed, that’s a change I had in mind on our analysis code.
The reason why I asked is because this kind of change requires some deep change on how the code we have is handling selection(s) and selection building. And update this requires a deep refactoring of our code.
Thanks for the feedback!