Hi,everyone.
I’m trying to use RooFit to fit a ROOT file “Bs2JpsiPhiData” to get the mass. However, I was troubled with segmentation violation when I called RooDataHist, and the fitting code is the following:
root [0] #include “RooRealVar.h”
RooFit v3.60 – Developed by Wouter Verkerke and David Kirkby
Copyright © 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
root [1] #include “RooGaussian.h”
root [2] #include “TH1.h”
root [3] #include “RooDataHist.h”
root [4] #include “RooAbsPdf.h”
root [5] #include “RooPlot.h”
root [6] using namespace RooFit;
root [7] RooRealVar x(“x”,“x”,-10,10);
root [8] RooRealVar mean(“mean”,“Mean of Gaussian”,0,-10,10);
root [9] RooRealVar sigma(“sigma”,“Width of Gaussian”,3,-10,10);
root [10] RooGaussian gauss(“gauss”,“gauss(x,mean,sigma)”,x,mean,sigma);
root [11] TH1* hh = (TH1*) gDirectory->Get(“Bs2JpsiPhiData”);
root [12] RooDataHist data(“data”,“dataset with x”,x,hh);
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
#0 0x00007f55c4be241b in waitpid () from /lib64/libc.so.6
#1 0x00007f55c4b5e7ef in do_system () from /lib64/libc.so.6
#2 0x00007f55c5203e28 in TUnixSystem::StackTrace() () from /usr/lib64/root/libCore.so.6.16
#3 0x00007f55c5206a54 in TUnixSystem::DispatchSignals(ESignals) () from /usr/lib64/root/libCore.so.6.16
#4
#5 0x00007f55b8ce7829 in RooDataHist::RooDataHist(char const*, char const*, RooArgList const&, TH1 const*, double) () from /usr/lib64/root/libRooFitCore.so.6.16.00
#6 0x00007f55b8ff3095 in ?? ()
#7 0x0000000000000000 in ?? ()
The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
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 0x00007f55b8ce7829 in RooDataHist::RooDataHist(char const*, char const*, RooArgList const&, TH1 const*, double) () from /usr/lib64/root/libRooFitCore.so.6.16.00
#6 0x00007f55b8ff3095 in ?? ()
#7 0x0000000000000000 in ?? ()
My platform is Fedora 29, and I build ROOT by using dnf install root and dnf install root-* python{2,3}-root . Is there something wrong with my code or ROOT?
Please help, thanks a lot.
LQS