Extracting signal shape from templates?

Hi all,

since i’m pretty unfamiliar with RooFit i would like to ask the following:

I have let’s say 2 templates saved in a workspace with fitted data, signal & bkg shapes
How can i extract the shape of signal (a RooAddPdf *signal for example) from all these different workspaces
so that i can create a plot with the superimposed signal shapes of all?

I tried to create a new workspace and import the workspaces from my .root files this way:

templates_workspace.root:w:*signa");

where w is the workspace i’ve created in the templates_workspace.root file
and then plotting it:

 RooPlot *frame = signal->frame();
  signal->plotOn(frame);
  frame->Draw();

but it doesn’t work at all

Any help would be much appreciated!
Thanks,
Emma

Hi Emma,

I’ve asked @moneta for help. While waiting for his answer: did you post the first code snippet correctly? The code after

looks cut off. Can you check and if needed edit it (using the light gray pen below your post)?

And for the future: if you enclose code by `code` - i.e. backticks, and multiple lines by a line of ``` before and after, then your code becomes much more readable. See how I edited you post above.

Cheers, Axel.

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