RooSimultaneous plot sum of categories / labels

Dear Experts,
I’m trying to plot plot a sum of multiple category-labels of my simultaneous fit. Basically I have a fit that follows the structure of this tutorial:
However with a bunch more category-labels for different years, signal and normalisation channel and additionally for a few D0-modes. Each with different or slightly different pdf-shapes.
Now the tutorial enables me to plot either one label at a time or the sum of all.
I haven’t found a solution to e.g. plot the sum of all years for my signal mode.

Lets say I have the labels: “a1, a2, b1, b2” and I want to plot “a1+a2”. I then could modify the tutorials plotting-section:

combData.plotOn(frame2,Cut(**"sample==sample::a1||sample==sample::a2"**)) ;
simPdf.plotOn(frame2,**Slice( no clue )**,ProjWData(sample,combData)) ;
simPdf.plotOn(frame2,**Slice( no clue )**,Components(**"model_a1,model_a2"**),ProjWData(sample,combData),LineStyle(kDashed)) ;

How can I plot the sum of two or more slices?

Hi there,
is there really no-one who can help out or at least can point me into a direction?

HI @hviemann ,

Sorry for the delay, maybe @StephanH can help you here.


I didn’t solve my Problem, but maybe the follwing leads to some spark anywhere:
Digging a bit around, I found a few category possibilities, I missed out. One would be a RooSuperCategory, that takes a set of RooCategory objects and generates all possible superpositions, thus I could do like:

RooCategory aCat("aCat","aCat");
RooCategory bCat("bCat","bCat");
RooSuperCategory fitCat("fitCat","fitCat",RooArgList(aCat,bCat));

fitCat then now holds the categories "{a1;b1},{a1,b2},...". This would come close to my need as I then should be able to Slice(aCat), I guess. The RooSimultaneous object can take the RooSuperCategory as input.
I’m hover struggling with the setup of my RooDataSet. Lets say I have the trees for each superposition in the RooSuperCategory, how can I link these to each other?
As I know I can link category labels like:

RooDataSet combData("combData","combData",myVar,
                    Import("a1;b2",data_a1b2), ... );

This however would require, according to my understanding, the use the previously defined fitCat (RooSuperCategory) as input. RooDataSet's however seem to only take RooCategory objects.
Does anybody have an Idea?

Hello @hviemann,

I don’t see a way to plot two categories at the same time. I think this wasn’t foreseen, as categories were meant to be fit and plotted separately.

As you describe in your second post, you can indeed create a second category, and for plotting slice in one while doing nothing for the other, which enables you to plot the state a1 + a2. You would slice in b, though, and not select anything for a.

I don’t exactly know how to get two categories into one dataset. I could imagine these two options:

    • Create a dataset, and add two category variables to the observables. RooArgSet(x, catA, catB).
    • Select category a1;b1 in the category variables, and fill all events from this category into the dataset.
    • Select category a2;b1, and fill all from this tree.
      This method requires to set the values the values of x, catA, catB manually for each entry, and save this entry into the dataset.

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