Getting no.of background events in signal region

Dear Experts,

I have fitted the Bs mass(it’s PDG mass 5.367 GeV) with gaussian(for signal) and exponential function(for combinatorial background). The fitted plot isattached with this post. I want to get the no.of background events in the signal region. Could you please tell me how to do this?


Try to calculate the integral of your background function using, for example, something similar to (instead of “gaus” use the name of your “red dots” background function):

I tried "std::cout << Bmass->GetFunction("bkgExpo")->Integral(5.287, 5.447) /Bmass->GetBinWidth(1) << std::endl;". It is showing error as below.

Error: Can't call RooRealVar::GetFunction("bkgExpo") in current scope
Possible candidates are...
(in RooRealVar)
(in RooAbsRealLValue)
(in RooAbsReal)
(in RooAbsArg)
(in RooPrintable)
(in RooAbsLValue)
Error: non class,struct,union object GetFunction("bkgExpo") used with . or ->
Error: operator '/' divided by zero
*** Interpreter error recovered ***


This is a question for some RooFit expert.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.