How to automatically redefine rooformulavar on variable name change?

I have a rooformulavar present in a workspace (defined by the roofit factory string expression). When I import the contents of a higher level pdf to another workspace, while renaming the variables, the string expression of the formulavar does not change, causing a compilation issue.

What is the correct way to handle this? The workspace is attached here: dt_belle_mr1.root - Google Drive

The code

import ROOT as R

reso_path = f'dt_belle_mr1.root'
reso_ws = R.TFile(reso_path).Get('dt_workspace')

cont_ws = R.RooWorkspace('contdt_workspace', 'contdt_workspace')
cont_ws.Import(reso_ws.pdf("res_core"), R.RooFit.RenameAllVariablesExcept("cont", "deltat, deltaterr"), R.RooFit.RenameAllNodes("cont"))

cont_ws.Print("t")

The expression of formulavar frac_tail_cont still points to old naming of the variables. When I finally import this into another workspace, the expression basically fails to compile. What can be done about this?

Hi,

Thanks for posting. We are very interested in supporting Belle precision studies!
I add the RooFit expert in the loop, @jonas , but mind, the answer might come with some latency.

Best,
D

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.