Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: 6.04/02
-
Fix Version/s: 6.22/00
-
Component/s: RooFit/RooStats
-
Labels:None
-
Environment:
Fedora 21
Description
Hello this is a follow up of this thread:
https://root.cern.ch/phpBB3/viewtopic.php?p=90676&sid=d2e046daca69338c4df999ab43b335e3#p90676
I have the simple on/off workspace (attached), without any systematics, and I want to extend it adding one systematics using EDIT. I don't understand the message I receive:
[#0] ERROR:ObjectHandling -- RooWorkSpace::import(ws_onoff) ERROR object named model_constrained: component(s) (N_CR_model_with_sys,alpha_x_b_model_with_sys) already in the workspace and no conflict resolution protocol specified
|
[#0] ERROR:ObjectHandling -- RooFactoryWSTool::processExpression() ERRORS detected, transaction to workspace aborted, no objects committed
|
on the last line:
import ROOT
|
f = ROOT.TFile.Open("onoff.root")
|
ws = f.Get("ws_onoff")
|
|
# create the term kalpha = (1 + sigma * theta)
|
ws.factory('expr:kalpha("1 + @0 * @1", {sigma_alpha[0.1], theta_alpha[0, -5, 5]})')
|
# create new pdf model replacing alpha -> kalpha
|
model_with_sys = ws.factory('EDIT:model_with_sys(model, alpha=kalpha)')
|
# create the constraint
|
ws.factory("Gaussian:constraint_alpha(global_alpha[0, -5, 5], theta_alpha, 1)")
|
ws.var("global_alpha").setConstant(True)
|
# final pdf
|
ws.factory("PROD:model_constrained(model_with_sys, constraint_alpha)")
|
I don't see the problem: it is true that (N_CR_model_with_sys,alpha_x_b_model_with_sys) are already in the workspace, but why it is a problem?