StandardHypoTestInvDemoProof with Custom PDF containing TH1

Hi,

We’re using StandardHypoTestInvDemoProof as a template to run the HypoTestInverter with PROOF. The code runs fine when PROOF is disabled, but the results just gives a constant observed CLs+b value of 1 for all nSig events. The expected limits seems to come out okay, but I can’t be sure since the obs CLs+b sets the scale of the plot.

I see that PROOF will create an instance of the custom PDF for each worker, but it seems to be trying to replace the histograms in the PDF class. I am not sure if this causing the result to come out weird. I don’t have a deep understanding on how PROOF actually work. Has anyone else use custom PDF that using histograms to keep track of values for the evaluate()?

Warning in TFile::Append: Replacing existing TH1: WimpSpectrumHist (Potential memory leak).
Warning in TFile::Append: Replacing existing TH1: WimpSpectrumHist (Potential memory leak).
Warning in TFile::Append: Replacing existing TH1: WimpSpectrumHist (Potential memory leak).
Warning in TFile::Append: Replacing existing TH1: S1log10S2Hist (Potential memory leak).
Warning in TFile::Append: Replacing existing TH1: S1log10S2Hist (Potential memory leak).
Warning in TFile::Append: Replacing existing TH1: S1log10S2Hist (Potential memory leak).

HI,

PROOF will cloned the PDF in each worker. So if your PDF can be correctly cloned (using the ROOT I/O system), it should work fine. If the histograms are filled by each worker, you would need to add them in the output list of Proof to be merged. This is controlled in the RooStats class RooStats::ToyMCStudy. You would need probably to include your histograms there in this case.

Best Regards

Lorenzo