In my code I build a RooBDecay including a self written class DecRateCoeff_Bd which inherits from RooAbsReal. So to compile the code properly I created a dictionary using rootcint. This compiles fine, and it works as well at runtime.
Additionally now I do not want to give only a RooRealVar to this the DecRateCoeff_Bd class but a RooGLMFunction class which inherits as well from RooAbsReal and depends on several other self written classes. What I did so far is to create a dictionary for this RooGLMFunction in the same way as for the DecRateCoeff_Bd class using rootcint. Again the code seems to compile fine, but at runtime when I try to import the RooBDecay into the workspace I get a segfault with the following backtrace:
===========================================================
#5 0x0000000000000000 in ?? ()
#6 0x00007f8bca0aa9dc in RooAbsArg::addServer(RooAbsArg&, bool, bool) () from /cvmfs/lhcb.cern.ch/lib/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#7 0x00007f8bca0ab161 in RooAbsArg::registerProxy(RooArgProxy&) () from /cvmfs/lhcb.cern.ch/lib/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#8 0x00007f8bc9ffc57e in RooArgProxy::RooArgProxy(char const*, RooAbsArg*, RooArgProxy const&) () from /cvmfs/lhcb.cern.ch/lib/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#9 0x00007f8bca0eddc9 in RooRealProxy::RooRealProxy(char const*, RooAbsArg*, RooRealProxy const&) () from /cvmfs/lhcb.cern.ch/lib/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#10 0x00007f8bc75e015c in CPfitter::DecRateCoeff_Bd::DecRateCoeff_Bd(CPfitter::DecRateCoeff_Bd const&, char const*) () from /home/abirnkraut/build_CPTimeFit/lib/libdecratecoeff_bd.so
#11 0x00007f8bc75edbd1 in CPfitter::DecRateCoeff_Bd::clone(char const*) const () from /home/abirnkraut/build_CPTimeFit/lib/libdecratecoeff_bd.so
#12 0x00007f8bca0971c8 in RooAbsCollection::addServerClonesToList(RooAbsArg const&) () from /cvmfs/lhcb.cern.ch/lib/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#13 0x00007f8bca0972f5 in RooAbsCollection::snapshot(RooAbsCollection&, bool) const () from /cvmfs/lhcb.cern.ch/lib/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#14 0x00007f8bca09752e in RooAbsCollection::snapshot(bool) const () from /cvmfs/lhcb.cern.ch/lib/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#15 0x00007f8bca0c214e in RooWorkspace::import(RooAbsArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&) () from /cvmfs/lhcb.cern.ch/lib/lcg/releases/LCG_79/ROOT/6.04.02/x86_64-slc6-gcc49-opt/lib/libRooFitCore.so
#16 0x00000000004c242e in CPTimeFit::build_PDF(bool) ()
#17 0x00000000004b641e in main ()
===========================================================
I did tests like importing all “subobjects” as the RooGLMFunction directly and all four DecRateCoeff_Bd as well without any problem. It’s also possible to print the full pdf, only when trying to import the pdf into the workspace I get problems. I assume I’m still making a mistake when creating the dictionary for the RooGLMFunction but I don’t see what I’m doing wrong.
I posted the code snippet where I try to import the pdf into the workspace and my own RooFit classes below. Let me know if you need something else.
Thanks in advance!
RooRealVar C_f = RooRealVar(“C_f”,“C_f”,0.9995,-5.0,5.0);
RooFormulaVar C_fbar = RooFormulaVar(“C_fbar”, “C_fbar”, “-1.0*@0”, RooArgSet(C_f));
RooRealVar *S_f = new RooRealVar(“S_f”,“S_{f}”,-0.031,-5.0,5.0);
RooRealVar *S_fbar = new RooRealVar(“S_fbar”,“S_{#bar f}”,0.029,-5.0,5.0);
RooRealVar sinh_f = RooRealVar(“sinh_f”,“D_{f}”,0.0,-5.0,5.0);
RooRealVar sinh_fbar = RooRealVar(“sinh_fbar”,“D_{#bar f}”,0.0,-5.0,5.0);
RooRealVar cosh_f = RooRealVar(“cosh_f”,“cosh_f”,1.0,-5.0,5.0);
RooRealVar cosh_fbar = RooRealVar(“cosh_fbar”,“cosh_fbar”,1.0,-5.0,5.0);
RooRealVar production_asym = RooRealVar(“production_asym”,“a_{prod}”,0);
RooRealVar detection_asym = RooRealVar(“detection_asym”,“a_{det}”,0);
RooRealVar tageff_os = RooRealVar(“tageff_os”, “#varepsilon_{tag}^{OS}”, 0.37, 0.0, 1.0);
RooRealVar tageff_asym_os = RooRealVar(“tageff_asym_os”,“tageff_asym_os”,0.0);
RooRealVar tageff_ss = RooRealVar(“tageff_ss”, “#varepsilon_{tag}^{SS}”, 0.71, 0.0, 1.0);
RooRealVar tageff_asym_ss = RooRealVar(“tageff_asym_ss”,“tageff_asym_ss”,0.0);
Espresso::GLMBuilder glm = Espresso::GLMBuilder(“GLMCalibration_for_the_OS”,“OS_GLMCalibration”,*MistagOS,“GLMCalibration_not_used_name”,
“/home/abirnkraut/tank/CPTimeFit_BD2Dpi/GLMCalibrations/OS_Combination_Bu2D0Pi_MC_rlogitLink.xml”);
Espresso::RooGLMFunction omega_b = glm.b_mistag();
Espresso::RooGLMFunction omega_bbar = glm.bbar_mistag();
coeff_c_fit = new CPfitter::DecRateCoeff_Bd(“coef_cos_fit”,“coef_cos_fit”,CPfitter::DecRateCoeff_Bd::kCos,*BacCharge,C_f,C_fbar,*TagDecOS,omega_b,omega_bbar,tageff_os,tageff_asym_os,production_asym,detection_asym);
coeff_s_fit = new CPfitter::DecRateCoeff_Bd(“coef_sin_fit”,“coef_sin_fit”,CPfitter::DecRateCoeff_Bd::kSin,*BacCharge,*S_f,*S_fbar,*TagDecOS,omega_b,omega_bbar,tageff_os,tageff_asym_os,production_asym,detection_asym);
coeff_sh_fit = new CPfitter::DecRateCoeff_Bd(“coef_sinh_fit”,“coef_sinh_fit”,CPfitter::DecRateCoeff_Bd::kSinh,*BacCharge,sinh_f,sinh_fbar,*TagDecOS,omega_b,omega_bbar,tageff_os,tageff_asym_os,production_asym,detection_asym);
coeff_ch_fit = new CPfitter::DecRateCoeff_Bd(“coef_cosh_fit”,“coef_cosh_fit”,CPfitter::DecRateCoeff_Bd::kCosh,*BacCharge,cosh_f,cosh_fbar,*TagDecOS,omega_b,omega_bbar,tageff_os,tageff_asym_os,production_asym,detection_asym);
RooRealVar tau = RooRealVar(“tau”,“#tau”,1.519,1.0,2.0);
RooRealVar dgamma = RooRealVar(“dgamma”,“dgamma”,0.0);
RooRealVar deltaM = RooRealVar(“deltaM”,“#Delta m”,0.51);
RooBDecay pdfSigTime_noExtension_fit = RooBDecay(“pdfSigTime_noExtension_fit”,“pdfSigTime_noExtension_fit”,*BeautyTime,tau,dgamma,*coeff_ch_fit,*coeff_sh_fit,*coeff_c_fit,*coeff_s_fit,deltaM,*resolution,RooBDecay::SingleSided);
ws_.import(pdfSigTime_noExtension_fit, RooFit::RecycleConflictNodes());
DecRateCoeff_Bd.h (7.5 KB)
RooGLMFunction.hh (1.4 KB)