Thank you @StephanH for the reply
So I am telling you all the details here (Reality! ).
First of all my real model has to check more than one variable and it has to fit in 2-dimensions.
My Dataset is like this :
RooDataSet [ m, x, y ] => Three-dimensional dataset
My model is 2-dimensional (which fits m and x) like this :
Model (m,x) = fsig . Msig(m) . Fsig(x) + (1-fsig) . Mbkg(m) . Fbkg(x)
where Fsig(x) = f . Fb(x) + (1-f) . R(x)
There are total 5-pdfs in the model. And you can see it depends only on either m or x.
I have already implemented my code until here, but now I have to modify it in the following way.
I want to put two-selections here -
- Selection based on y β
I donβt have to fit over βyβ. It is just used as a selection-flag for PDFs. It has value either 1 or 2. (Answer to your question)
y=1 or y=2 will decide, which R(x) to be used. I have two choices in R(x) { lets say R1(x) & R2(x) }
YES, RooFit has to check the value of βyβ in each entry before it fits βxβ and make a selection from R1(x) or R2(x). - Selection based on M β
(I didnβt mention it before, because I was only interested in the feasibility of this approach.)
I have to make a selection of Fbkg(x) on the basis of βmβ, which is our fitting variable also.
There are 3-choices of Fbkg(x) = {Fbkg1(x), Fbkg2(x), Fbkg3(x)}
If (2.2 < m < 2.6) Fbkg(x) = Fbkg1(x)
If (2.6 < m < 3.2) Fbkg(x) = Fbkg2(x)
If (3.2 < m < 4.0) Fbkg(x) = Fbkg3(x)
// Range of m is [2.2 - 4.0] and fully covered in three choices.
// I have all PDFs ready.
Here RooFit has to check the m-value of the current entry and determine in which m-range it lies then it has to make one choice out of 3-Fbkg(x) and then fit it.
In the end, I would get two-parameters from this whole fitting procedure, which are f and fsig.