Segmentation Violation in Frequentist and Hybrid Calculator

Hi,

I am experiencing segmentation violations when I try to calculate an upper limit for the number of signal events which are in my data sample. The output of root looks as follows:

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5  RooAbsTestStatistic::setData (this=0x4c4acc0, indata=..., cloneData=<optimized out>) at /home/tobias/Software/Root/root-6.06.02/roofit/roofitcore/src/RooAbsTestStatistic.cxx:654
#6  0x00007fb318bcaffb in RooStats::ProfileLikelihoodTestStat::EvaluateProfileLikelihood (this=0x7fff4be3c230, type=0, data=..., paramsOfInterest=...) at /home/tobias/Software/Root/root-6.06.02/roofit/roostats/src/ProfileLikelihoodTestStat.cxx:82
#7  0x00007fb318b9fe29 in RooStats::ToyMCSampler::EvaluateAllTestStatistics (this=this
entry=0x4a9f630, data=..., poi=..., detOutAgg=...) at /home/tobias/Software/Root/root-6.06.02/roofit/roostats/src/ToyMCSampler.cxx:264
#8  0x00007fb318ba0480 in RooStats::ToyMCSampler::GetSamplingDistributionsSingleWorker (this=0x4a9f630, paramPointIn=...) at /home/tobias/Software/Root/root-6.06.02/roofit/roostats/src/ToyMCSampler.cxx:408
#9  0x00007fb318ba0b61 in RooStats::ToyMCSampler::GetSamplingDistributions (this=0x4a9f630, paramPointIn=...) at /home/tobias/Software/Root/root-6.06.02/roofit/roostats/src/ToyMCSampler.cxx:306
#10 0x00007fb318bd0cc2 in RooStats::HypoTestCalculatorGeneric::GetHypoTest (this=0x7fff4be3c360) at /home/tobias/Software/Root/root-6.06.02/roofit/roostats/src/HypoTestCalculatorGeneric.cxx:171
#11 0x00007fb324cb6315 in ?? ()
#12 0x00007fff4be3c368 in ?? ()
#13 0x00007fb324c5088f in _dl_lookup_symbol_x (undef_name=0x7fb320a4a301 <cling::ValueExtractionSynthesizer::FindAndCacheRuntimeDecls()+3121> "351334371377377I215177(I215w
271b", undef_map=0x7fb324cb5174, ref=0x7fff4be3c3d0, symbol_scope=0x0, version=0x7fb31820a740 <RooArgSet::~RooArgSet()>, type_class=32691, flags=57001320, skip_map=0x7fff4be3ca10) at dl-lookup.c:829
#14 0x00007fb324cb6042 in ?? ()
#15 0x000000000365c568 in ?? ()
#16 0x00007fff4be3ca10 in ?? ()
#17 0x00007fff4be3c620 in ?? ()
#18 0x00007fb3209e43c3 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /opt/root/v6/lib/libCling.so
#19 0x00007fb3209e9a27 in cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /opt/root/v6/lib/libCling.so
#20 0x00007fb3209e9bbf in cling::Interpreter::echo(std::string const&, cling::Value*) () from /opt/root/v6/lib/libCling.so
#21 0x00007fb320a88289 in cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) () from /opt/root/v6/lib/libCling.so
#22 0x00007fb320a913d9 in cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) () from /opt/root/v6/lib/libCling.so
#23 0x00007fb320a923be in cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) () from /opt/root/v6/lib/libCling.so
#24 0x00007fb320a81dbb in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /opt/root/v6/lib/libCling.so
===========================================================

I have added some files as an attachment. SimulFitFunctions.py and SimultaneousFitData.py contain the fit model I use for the fit to the data sample. The workspace and fit result are saved in data_Fit.root. Fitting and plotting of the data works fine. If I run the scripts CalculateUpperLimit.C or EstimateSignificance.C on this root file I get the given error. I already tried the ProfileLikelihood Calculator to get a Confidence Interval which worked without crashing.

I also tried the scripts with the output file of SimultaneousFit_Test.py. Here it works everything works fine. So it seems the calculators are working and its probably something wrong with my model. But I do not know where to look for the error.

I would appreciate any help!

Cheers,

Tobias
Frequentist Calculator Error.tar.gz (1.19 MB)

Hi,

I tried to gain insight into the problem and modified the RooAbsTestStatistic::setData function to print some additional information

cout << "NONEMPTY DATASET WITHOUT FAST SPLIT SUPPORT! "<< indata.GetName() << endl;
indata.Print("v");
const RooAbsCategoryLValue* indexCat = & ((RooSimultaneous*)_func)->indexCat();
cout<<"Index category at "<<indexCat<<endl;
indexCat->Print("v");
TList* dlist = indata.split(*indexCat, kTRUE);
cout<<"dlist at "<<dlist<<endl;

The ouput I get is the following

NONEMPTY DATASET WITHOUT FAST SPLIT SUPPORT! fitModel_KK2PiPiData
DataStore fitModel_KK2PiPiData (Generated From fitModel_KK2PiPi)
  Contains 151 entries
  Observables: 
    1)  etacMass = 3.00316  L(2.65 - 3.15) B(50) // [GeV/c^{2}] "etacMass"
Index category at 0x3664040 
--- RooAbsArg ---
  Value State: clean
  Shape State: clean
  Attributes: 
  Address: 0x3664040
  Clients: 
    (0x3658910,V-) RooSimultaneous::jointModel "jointModel"
  Servers: 
  Proxies: 
--- RooAbsCategory ---
  Value is "index_KK2PiPi" (12)
  Has the following possible values:
        index_KKPiPi = 0
        index_2KK = 1
        index_2PiPi = 2
        index_3PiPi = 3
        index_KsKPi = 4
        index_KsK3Pi = 5
        index_KKPi0 = 6
        index_KKEta = 7
        index_PiPiEta = 8
        index_PiPi2Pi0 = 9
        index_2PiPiEta = 10
        index_2PiPiPi0 = 11
        index_KK2PiPi = 12
dlist at 0

So the reason for the crash seems to be that the indata.split(*indexCat, kTRUE) returns a null pointer, because indata misses a category entry?! I do not know why. Maybe a roofit expert can give some additional insight. Another question is why my dataset does not support fast splits which is the reason why this region of code is entered at all.

Cheers,

Tobias