 # RooRealSumPdf inside a RooAddPdf and Generation of toys

Dear all
I am using a RooRealSumPdf with custom “fractions” definition and i enforce via RooFormulaVars that the sum of component fractions is always 1.
Doing so i can achieve a morphing of the shape scaling with negative and positive factors one of the sub-pdf of a RooRealSumPdf ensuring it still normalize to 1.
I.e

``````PDF_1 = frac1 * PDF1_1 + (1-frac1) * PDF1_2 + ( 1- frac1 -frac2) * PDF1_3
``````

, and my morphing is achieved applying

``````frac1 --> ScaleFactor * frac1
``````

and when i do this i propagate

``````frac2 --> ( 1- ScaleFactor * frac1 ) * frac2Original
frac3 --> ( 1-  newFrac1 - newFrac2 )
``````

Now this PDF morphed (`PDF_1 --> PDF_1_Scaled` (and another one where the same is done (`PDF_1_Scaled`), like this is used inside a `RooAddPdf` with fixed fractions assignments and passing n-1 coefficiencies :

``````FULL MODEL =   RooAddPdf( fracFull1[fix] , fracFull2[fix]  ,  PDF_1_Scaled , PDF_2_Scaled, OtherPDF)
``````

My question is if the scale factor goes negative for some reason in the scaled PDF morphed shapes,
Is this an issue when `FULL_MODEL.Generate` is executed?

( The question is a continuation of what i proposed as solution in RooSumPdf and RecursiveFraction with a scale factor on one of sub-components - #5 by jblomer ) with the difference that i encountered some bias in the `Scale` factor parameter when running toys and using RooAddPdf, since sometimes that parameter converged to 0 , the boundary. When that was left to go negative, but still using RooAddPdf i instead observed other weird behaviours.
So in practice, the use case i am doing of a negative yield is to achieve a morphing of the shape rather than actually fit its amount. Is this something safe one can achieve with RooRealSumPdf ?

Cheers
Renato

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Is there anyone which can provide some feedback based on experience for toys using RooRealSumPdfs models?