Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10411

RooFormula doesn't compile when arguments are renamed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: 6.20/00
    • Component/s: RooFit/RooStats
    • Labels:
      None
    • Environment:

      Irrelevant

      Description

      void testGenericRename() {
          RooRealVar var("var", "var", 0, 1);
          RooRealVar par("par", "par", 0.5, 0, 1);
          RooGenericPdf genPdf("genPdf", "var*(par + 1)", RooArgSet(var, par));
          
          // works
          clog << genPdf.getVal() << endl;
          
          par.SetName("par_test");
          // also works
          clog << genPdf.getVal() << endl;
          
          auto pdfClone = (RooAbsPdf*)genPdf.clone("clone");
          // crash on master, returns 0 on 6.12
          clog << pdfClone->getVal() << endl;
          
          par.SetName("par");
          
          RooWorkspace ws1("ws1");
          ws1.import(genPdf);
          auto impPdf1 = ws1.pdf("genPdf");
          
          // works again
          clog << impPdf1->getVal() << endl;
          
          RooWorkspace ws2("ws2");
          ws2.import(genPdf, RooFit::RenameAllVariablesExcept("new", "var"));
          auto impPdf2 = ws2.pdf("genPdf");
          
          // works on 6.12, crash on master
          clog << impPdf2->getVal() << endl;
      }
      

        Attachments

          Activity

            People

            • Assignee:
              shageboe Stephan Hageboeck
              Reporter:
              shageboe Stephan Hageboeck
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: