Hi,

I have been trying for a while now to model and fit the following measurement from astronomy using RooAbsReal, RooFormula, RooProfPdf, RooAddPdf, RooExtendPdf et al., but did not succeed to have the flux norm f0 as a fit parameter.

A source with a power-law spectrum f(E)=f0*pow(E/E0,-gamma) is observed with an instrument of effective area A(E)=0 below Ethresh and A0 above for a duration t. This result in a number of detected events, which is a Poisson random variable of expectation value nexp = t * int( f*A, E=Emin…Emax ).

Let’s say for now the only free fit parameter is f0, E is an observable in some range Emin … Emax and all other parameters (E0,gamma,Ethresh,A0,t) are constants.

How can I create, toy MC generate and fit (unbinned likelihood) this model in RooFit with f0 as a free parameter?

The problem comes from the fact that I don’t want to normalize f and A, but I want to use t*f*A as an extended Pdf (which integrates to nexp, but not with free parameter nexp, but f0) for event generation and fitting.

Maybe someone has a few lines of code that does something similar, which I can adapt to my problem?

Thank you very much!

–Christoph