Error with RooArgSet on ROOT 6.22/06

Hi I have a simple RooFit code which I usually run on ROOT 6.24/02 without any issues. I recently ran the same code on another computer using 6.22/06 and I got the error for RooArgSet:

error: no matching constructor for initialization of ‘RooArgSet’
…RooArgSet(RecCosThetaKK, RecCosTheta_BKK, RecDelRKK, RecDelR_BKK, RecPtKK, RecPt_BKK, RecMassKK, RecMass_BKK, RecMassLambdaKK, RecMassLambda_BKK, invMKK…

Here is the bit of code that concerns me:

 TChain* ch = new TChain("KsValidation");
  ch->Add("/people/apaul/Data/data1501.root");
 
  
  RooRealVar RecCosThetaKK("RecCosThetaKK", "RecCosThetaKK", 0.9998,1.);
  RooRealVar RecCosTheta_BKK("RecCosTheta_BKK", "RecCosTheta_BKK", 0.9998, 1.);
  RooRealVar RecDelRKK("RecDelRKK", "RecDelRKK", 3, 400);
  RooRealVar RecDelR_BKK("RecDelR_BKK", "RecDelR_BKK", 3, 400);
  RooRealVar RecPtKK("RecPtKK", "RecPtKK", 300, 2000);
  RooRealVar RecPt_BKK("RecPt_BKK", "RecPt_BKK", 300, 2000);
  RooRealVar RecMassKK("RecMassKK", "RecMassKK", 350, 650); //RecMassKK here
  RooRealVar RecMass_BKK("RecMass_BKK", "RecMass_BKK", 350, 650);
  RooRealVar RecMassLambdaKK("RecMassLambdaKK", "RecMassLambdaKK", 900, 5000);
  RooRealVar RecMassLambda_BKK("RecMassLambda_BKK", "RecMassLambda_BKK", 900, 5000);
  RooRealVar invMKK("invMKK", "invMKK", 3000, 7000);

  
  RooDataSet data("data", "data", RooArgSet(RecCosThetaKK, RecCosTheta_BKK, RecDelRKK, RecDelR_BKK, RecPtKK, RecPt_BKK, RecMassKK, RecMass_BKK, RecMassLambdaKK, RecMassLambda_BKK, invMKK), Import(*ch), Cut("RecCosThetaKK > 0.9999 && RecDelRKK > 4 &&  RecDelRKK < 300 && RecMassLambdaKK > 1125 && RecPtKK > 300 && RecPtKK < 2000 && RecCosTheta_BKK > 0.9999 && RecDelR_BKK > 4 &&  RecDelR_BKK < 300 && RecMassLambda_BKK > 1125 && RecPt_BKK > 300 && RecPt_BKK < 2000 && invMKK > 0 && RecMass_BKK > 478 && RecMassKK > 478 && RecMass_BKK < 518 && RecMassKK < 518"));

Could anyone help me to solve the issue?

Maybe @jonas or @moneta can take a look

Hi! Before ROOT 6.24, there was a limit on how many elements the RooArgSet constructor can take.

If you want your code to run also with older ROOT versions, you have to manually fill the RooArgSet in the case of many variables. I think the code would look like this:

RooArgSet variables;

for(auto& var : {RecCosThetaKK, RecCosTheta_BKK, RecDelRKK, RecDelR_BKK,
                 RecPtKK, RecPt_BKK, RecMassKK, RecMass_BKK,
                 RecMassLambdaKK, RecMassLambda_BKK, invMKK}) {
    variables.add(var);
}

RooDataSet data("data", "data", variables, ...et cetera...);

Hope that helps!

Jonas

Hi @jonas, I did what you suggested. The error doesn’t show up now but root crashes. Here are the lines:

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007f9a6cf531c6 in wait4 () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f9a6ced0aa7 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007f9a6d53e71d in TUnixSystem::StackTrace() () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#3  0x00007f9a6d53bb25 in TUnixSystem::DispatchSignals(ESignals) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#4  <signal handler called>
#5  0x00007f9a6cfe7b71 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007f9a6d43d315 in TString::TString(char const*) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#7  0x00007f9a6d49e40d in TList::NewOptLink(TObject*, char const*, std::shared_ptr<TObjLink> const&) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#8  0x00007f9a6d49edb0 in TList::AddLast(TObject*, char const*) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#9  0x00007f9a6d423c6f in TObject::AppendPad(char const*) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#10 0x00007f9a6156c045 in RooAbsData::RooAbsData(char const*, char const*, RooArgSet const&, RooAbsDataStore*) () from /usr/lib/x86_64-linux-gnu/root/libRooFitCore.so.6.22.06
#11 0x00007f9a6163ab43 in RooDataSet::RooDataSet(char const*, char const*, RooArgSet const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&) () from /usr/lib/x86_64-linux-gnu/root/libRooFitCore.so.6.22.06
#12 0x00007f9a61d73c7c in ?? ()
#13 0x00007ffc12484a28 in ?? ()
#14 0x00007ffc124848d8 in ?? ()
#15 0x00007ffc12484788 in ?? ()
#16 0x00007ffc12484638 in ?? ()
#17 0x00007ffc124844e8 in ?? ()
#18 0x00007ffc12484398 in ?? ()
#19 0x000055ccd1683f00 in ?? ()
#20 0x00007ffc12480618 in ?? ()
#21 0x000055ccd2283940 in ?? ()
#22 0x000055ccd2288320 in ?? ()
#23 0x00007ffc124805b0 in ?? ()
#24 0x000055ccd29df210 in ?? ()
#25 0x00007ffc124806f0 in ?? ()
#26 0xc90038e2d0c45600 in ?? ()
#27 0x000055ccd166e540 in ?? ()
#28 0x0000000000000000 in ?? ()
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum https://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://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  0x00007f9a6cfe7b71 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007f9a6d43d315 in TString::TString(char const*) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#7  0x00007f9a6d49e40d in TList::NewOptLink(TObject*, char const*, std::shared_ptr<TObjLink> const&) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#8  0x00007f9a6d49edb0 in TList::AddLast(TObject*, char const*) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#9  0x00007f9a6d423c6f in TObject::AppendPad(char const*) () from /usr/lib/x86_64-linux-gnu/root/libCore.so.6.22
#10 0x00007f9a6156c045 in RooAbsData::RooAbsData(char const*, char const*, RooArgSet const&, RooAbsDataStore*) () from /usr/lib/x86_64-linux-gnu/root/libRooFitCore.so.6.22.06
#11 0x00007f9a6163ab43 in RooDataSet::RooDataSet(char const*, char const*, RooArgSet const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&) () from /usr/lib/x86_64-linux-gnu/root/libRooFitCore.so.6.22.06
#12 0x00007f9a61d73c7c in ?? ()
#13 0x00007ffc12484a28 in ?? ()
#14 0x00007ffc124848d8 in ?? ()
#15 0x00007ffc12484788 in ?? ()
#16 0x00007ffc12484638 in ?? ()
#17 0x00007ffc124844e8 in ?? ()
#18 0x00007ffc12484398 in ?? ()
#19 0x000055ccd1683f00 in ?? ()
#20 0x00007ffc12480618 in ?? ()
#21 0x000055ccd2283940 in ?? ()
#22 0x000055ccd2288320 in ?? ()
#23 0x00007ffc124805b0 in ?? ()
#24 0x000055ccd29df210 in ?? ()
#25 0x00007ffc124806f0 in ?? ()
#26 0xc90038e2d0c45600 in ?? ()
#27 0x000055ccd166e540 in ?? ()
#28 0x0000000000000000 in ?? ()
===========================================================

Not sure why it would crash. Thanks for the help!

Hi @jonas , I was wondering if I could still get some help with the crash. Sorry for any inconvenience but I couldn’t sort it out yet.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.