I have the dataset with three variables.
I would like to obtain the fraction of three states with the three variables as well.
I know total 9 pdfs for each variable of each state.
state A state B state C
Yield Y_A Y_B Y_C
pdf for 1st variable pdf_A1 pdf_B1 pdf_C1
pdf for 2nd variable pdf_A2 pdf_B2 pdf_C2
pdf for 3rd variable pdf_A3 pdf_B3 pdf_C3
The composite pdf for each variable is as follows.
You can use RooAddPdf to construct the pdfs pdf_1, pdf_2 and pdf_3
in your mail. (Note that with the formalism you used you have constructed
these p.d.f.s to be extended pdfs so be sure to include the extended likelihood
term in the fit using the “e” option. Otherwise omit and explicit coefficient for
the last term, which is then taken to be 1-sum(otherCoefs))
Then you should make sure that your dataset contains a fourth discrete variable
that labels to which state each event belongs:i.e. add a RooCategory observable
named ‘state’ and define three labels to it, e.g. ‘A’ and ‘B’ and ‘C’ .
Once that is done you can construct the simulateneous fit as follows
RooSimultaneous simPdf(“simPdf”,“simPdf”,state) ; // ‘state’ is index observable
simPdf.addPdf(pdf_1,“A”) ; // Associate pdf_1 with state “A” (which must be previously definted in 'state’
simPdf.addPdf(pdf_2,“B”) ;
simPdf.addPdf(pdf_3,“C”) ;
and then you can perform the fit as usual, e.g.
simpdf.fitTo(data,“e”) ; // “e” option added here to add extended ML term