Hello,
I have the following problem. I tried to store my pdfs to a TFile in order to read them out later. My problem is that I need an integral over a subrange of the pdf. But when performing the integral I always get the integral of the full range (1). I do the following:
[code] TFile f(“FitTuple/pdf.root”)
root [1] f.ls()
TFile** FitTuple/pdf.root
TFile* FitTuple/pdf.root
KEY: RooKeysPdf D0Pi_mm2_D1lnu_pdf;1 D0Pi_mm2_D1lnu_pdf
KEY: RooKeysPdf D0Pi_mm2_D2lnu_DPi_pdf;1 D0Pi_mm2_D2lnu_DPi_pdf
…
root [2] RooRealVar mm2(“mm2”,“mm2”, 1, -2, 2)
//I plotted the pdf to check if it looks right (it does)
root [3] RooPlot * p = mm2.frame()
root [4] D0Pi_mm2_D1lnu_pdf->plotOn§
[#1] INFO:NumericIntegration – RooRealIntegral::init(D0Pi_mm2_D1lnu_pdf_Int[mm2]) using numeric integrator RooIntegrator1D to calculate Int(mm2)
(const class RooPlot*)0x284cdd0
root [5] p->Draw()
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
root [6] mm2.setRange(“test”, 0, 0.2)
[#1] INFO:Eval – RooRealVar::setRange(mm2) new range named ‘test’ created with bounds [0,0.2]
root [7]
root [7] RooRealVar * i = D0Pi_mm2_D1lnu_pdf->createIntegral(mm2, mm2, “test”)
[#1] INFO:NumericIntegration – RooRealIntegral::init(D0Pi_mm2_D1lnu_pdf_Int[mm2]) using numeric integrator RooIntegrator1D to calculate Int(mm2)
root [8] i->getVal()
[#1] INFO:NumericIntegration – RooRealIntegral::init(D0Pi_mm2_D1lnu_pdf_Int[mm2|test]_Norm[mm2]) using numeric integrator RooIntegrator1D to calculate Int(mm2)
(const Double_t)9.99999999999999889e-01
root [9]
root [10] D0Pi_mm2_D1lnu_pdf->Print(“v”)
— RooAbsArg —
Value State: DIRTY
Shape State: clean
Attributes:
Address: 0x2928480
Clients:
(0x2f224c0,–) RooRealIntegral::D0Pi_mm2_D1lnu_pdf_Int[mm2|test]_Norm[mm2] “Integral of D0Pi_mm2_D1lnu_pdf”
(0x2f493d0,–) RooRealIntegral::D0Pi_mm2_D1lnu_pdf_Int[mm2] "Integral of D0Pi_mm2_D1lnu_pdf"
Servers:
(0x2a31e20,V-) RooRealVar::mm2 "mm2"
Proxies:
x -> mm2
— RooAbsReal —
Plot label is “D0Pi_mm2_D1lnu_pdf”
— RooAbsPdf —
Cached value = 0.061351
Normalization integral:
0x2f493d0 D0Pi_mm2_D1lnu_pdf_Int[mm2][ Int D0Pi_mm2_D1lnu_pdf dNum ] = 0.333332 “Integral of D0Pi_mm2_D1lnu_pdf”
[/code]
The used pdf is defined between -2 and 2. The code to do the integral shown above worked in the case I do not load the pdf from a file but create it from a RooDataset. My root version is ROOT 5.28/00h (branches/v5-28-00-patches@42209), with RooFit v3.14.
Best regards,
Thomas