I have a question concerning how to properly seed in the NLL variable for a simultaneous fit with gaussian constraints on some variables which are changing the yields.
Let me give a bit more contest.
I want to have the freedom to define N observables for N datasets with N different ranges.
I want to have the freedom to define the N fits to the N datasets to be binned/unbinned.
Let’s say I can split the N datasets in CAT1 and CAT2 representing 2 different decay modes.
Now my parameter of interest is
Ratio = SignalYield in CAT1/SignalYield in CAT2 * effCAT1/effCAT2
Each CAT1 has sub categories and each sub category has its own effCAT1_X effCAT2_X.
Now, the final likelihood I build in case of no effCAT1_X and effCAT2_X gauss constraint is to do a bare sum of the outcome of the NLL of each models with the extended option.
I do that because each Model for CAT1_X and CAT2_X are given by a RooAddPdf with explicit yields defined ( so no fractions )
What I do is then
nllSet.add ( MODEL_CAT1_X.createNLL( DS1_X, Extended() ) );
… and a add for each CAT(I)_X
final I create the likelihood as nLL = RooAddition( nLLSet) ;
Now, as I said, i have that YIELD_CAT1_X = YIELD_CAT2_X * EFF1_X/EFF2_X * RMeas
Where RMeas can be defined for each CAT(I)_X (so RMeas_X) or it can be shared among all CAT(I)_X .
I am wondering what is the correct way to add the gaussian constraints for the EFF1_X, and EFF2_X to the final likelihood.
Would it be enough to just create the NLL for the all the effCAT(I)_X constraints and add it to the final NLL or for each call in the createNLL( ) I have to pass the ExternalConstraints( ).
If the correct procedure is the latter , given that I do
PDF_CAT1_X.createNLL( Extended(), ExternalConstraint( ListOfVars ) )
can I put in ListOfVars also the CAT1_X’ with X’ != X or do I need to be careful that in ListOfVars I feed only the ones related to PDF_CAT1_X ( so only EFFCAT1_X and EFFCAT2_X since I re-define the YieldsCAT1_X) ?
Thanks in advance for any suggestion and help.