I have two data sets (DS1 and DS2) that I am fitting simultaneously. Each data set has different run time lengths and different selection cuts, and therefore different efficiencies. Say there is a background that is common between both of them, for example, the solar neutrino flux. The solar neutrino flux is well-measured and so I know how many solar neutrino events I expect in each data set. The PDFs of the solar neutrinos are obtainable from Monte Carlo simulations. The events generated from these simulations are subjected to the same selection cuts unique to each data set.
I would like to constrain the expected number of solar neutrinos in my fit as a single parameter common to both data sets. In RooFit, I can do this by including a single Gaussian constrain term in my likelihood. However, due to the fact that each data set has different efficiencies and live times (assume these values are known), I am not sure how to include the efficiencies and live times into RooFit in Extended() mode.
One way I was considering is to fit for an overall event rate rather than the number of events, and constrain the expected solar neutrino rate instead of the expected number of solar neutrino events. That way, the live time and selection efficiencies are included. But I am not sure how to do this using RooFit. Is it possible?
In short, I have the parameter n_solar that is floated in both DS1 and DS2 but each DS1 and DS2 have their own efficiencies and livetimes such that after taken into account, would return the expected solar neutrino rate (which is constrained). Any comments and guidance is appreciated!
Thanks for your response! I created a working example based on your suggestion by modifying tutorial rf_202. I attach the code here test_simul_eventrate.cpp (8.4 KB) . I think it is working, as it is returning a rate that I gave it. But I want to make sure if I understood your suggestion. Does this look right? The plot output from my code is here. The left plot is the first dataset. The right plot is the second dataset. (
Also, in the code, I generate some fake data from the model to perform the tests. But I am unsure of how the routine determines how many events to generate in this context. In the usual case, the RooRealVar passed is the number of events (nsig, nbkg), but in the context of this code, they don’t get passed around. About 145 events seem to be generated in the code but I am not sure where RooFit gets this number from.
I see that they have a common rate, but different efficiencies. If I’m not mistaken, that’s what you asked for. If you want to check the values of such variables yourself, I suggest to print them.