RooStats toys Proof-lite configuration

Dear ROOT experts,

I am trying to write a code to dump toys in Roostats in the limit configurations,
I get a crash on lxplus. I must certainly be doing something stupid, but cannot
find what :frowning:

A few lines of code copied here:

//
// 2) Test statistics definition
//
RooStats::ProfileLikelihoodTestStat profll(*mc->GetPdf());
profll.SetOneSided(1);
profll.SetReuseNLL(false);

//
// 3) Defines the calculator (asymptotic)
//
RooStats::FrequentistCalculator* hypoCalc = new RooStats::FrequentistCalculator(*data,*mcbOnly, *mc);
hypoCalc -> SetToys(m_nToys,m_nToys/10.);// null toys, alt toys
RooStats::ToyMCSampler *toymcs = (RooStats::ToyMCSampler*)hypoCalc->GetTestStatSampler();
toymcs->SetTestStatistic(testStat);
if(m_nWorkers>0) {
    RooStats::ProofConfig pc(*ws, m_nWorkers, "", false);
    toymcs->SetProofConfig(&pc);    // enable proof
}

//
// 4) Uses the HypoTestInverter class to get the confidence interval
//
RooStats::HypoTestInverter calc(*hypoCalc);
calc.SetVerbose(0);
calc.SetConfidenceLevel(0.95);
calc.UseCLs(true);
if(m_poi_scanN>-1)calc.SetFixedScan(m_poi_scanN,m_poi_scanMin,m_poi_scanMax);

//
// 5) Save the limit result into the HypoTestInverterResult object
//
m_pHTIR = calc.GetInterval();

Here is the crash I get when using PROOF (m_nWorkers = 4).

===========================================================
There was a crash.
This is the entire stack trace of all threads:

#0 0x00007f3521b1a65e in waitpid () from /lib64/libc.so.6
#1 0x00007f3521aac609 in do_system () from /lib64/libc.so.6
#2 0x00007f3526de8c5a in TUnixSystem::StackTrace() () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
#3 0x00007f3526deac2c in TUnixSystem::DispatchSignals(ESignals) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
#4
#5 0x00007f3526d3fd6e in TObject::TObject(TObject const&) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
#6 0x00007f3526d1e543 in TNamed::TNamed(TNamed const&) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libCore.so
#7 0x00007f3522fa75f1 in RooWorkspace::RooWorkspace(RooWorkspace const&) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#8 0x00007f35239221ef in RooStats::ToyMCSampler::GetSamplingDistributions(RooArgSet&) () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRooStats.so
#9 0x00007f352394771b in RooStats::HypoTestCalculatorGeneric::GetHypoTest() const () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRooStats.so
#10 0x00007f35238bc219 in RooStats::HypoTestInverter::Eval(RooStats::HypoTestCalculatorGeneric&, bool, double) const () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRooStats.so
#11 0x00007f35238bd24c in RooStats::HypoTestInverter::RunOnePoint(double, bool, double) const () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRooStats.so
#12 0x00007f35238bde14 in RooStats::HypoTestInverter::RunFixedScan(int, double, double, bool) const () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRooStats.so
#13 0x00007f35238c070e in RooStats::HypoTestInverter::GetInterval() const () from /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/libRooStats.so
#14 0x00000000004092b4 in LimitFrequentist::GetLimit(RooWorkspace*, RooStats::ModelConfig*, RooDataSet*, RooRealVar*) ()
#15 0x0000000000406ca7 in LimitManager::GetLimit() ()
#16 0x0000000000406047 in main ()

I use ROOT 6.4.14 (and it seems to be the case for various ROOT version I tested).

Is there anything I should setup when wanting to use PROOF ?

Thanks,
Best,
Loïc

Hi,

The code looks fine to me. When running without PROOF, are you still getting a crash ?
If this is the case, I would need your workspace and possibly your macro to understand the crash

Best Regards

Lorenzo

Hi Lorenzo,

I have tried to understand a bit more the issue here … but didn’t succeed :frowning:

When disabling Prooflite, the limit seems to be computed (toys are dumped as well as distributions). The code has been put here:

gitlab.cern.ch/lvalery/statistics

So that you can give it a look.

Just a few instructions:

Note that the crash happens on lxplus, and on my local t3, but not on my laptop. Not sure this can help, but I hope so.

Thanks again for your help,
Best,
Loïc

Hi,

Sorry to insist but I just cannot run this … Did anyone have time to look into this ? Is the issue related to my code (or in the Makefile, the setup, …) or to there is something else I am doing wrong ?

Thanks a lot for your help,
Best,
Loïc

HI,

I will try your code. But before doing it, dod you try using a most recent version of ROOT, e.g. 6.06 or 6.07 ?

Lorenzo

Hi Lorenzo,

Thanks for your reply :slight_smile: Unfortunately, I get the same crashes using 6.06.06 :frowning:

Best,
Loïc

Hi Lorenzo,

Back on this thread. Did you find anything wrong there ?

Once again, thanks so much for your help :slight_smile:

Cheers,
Loïc

Hi,

Sorry I have missed your previous reply. Yes, I’ll look then at your code in the next days and let you know

Cheers

Lorenzo

Cool, thanks a lot Lorenzo :slight_smile:

Hi,

Sorry for my delay in replying to you. You are creating a temporary ProofConfig class which gets deleted after having set in the ToyMCSampler class.
This patch should fix the problem

Best Regards

LorenzoLimitFrequentist.patch.txt (947 Bytes)

Ooooooh … thanks so much !!

Cheers,
Loïc