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

Cling automatic RooFit objects always reloaded from file

    XMLWordPrintable

Details

    Description

      RooFit objects, like RooWorkspace, that are automatically loaded from the Cling command line seem to be reloaded on each use. This can have unfortunate, highly confusing, and ROOT5-incompatible side-effects, eg.

      root [0] TFile f("wsfile.root");
      root [1] f.ls()
      TFile**         wsfile.root
       TFile*         wsfile.root
        KEY: RooWorkspace     w;1     workspace
        KEY: TProcessID       ProcessID0;1    f3791360-9791-11e5-9717-692cf682beef
      root [2] w
      (class RooWorkspace *) 0x2379270
      root [3] w
      (class RooWorkspace *) 0x237f580
      root [4] w->var("mu")->Print()
      RooRealVar::mu = 1  L(0 - 10)
      root [5] w->var("mu")->setVal(0)
      root [6] w->var("mu")->Print()
      RooRealVar::mu = 1  L(0 - 10)

      For large workspaces, the reloading can also be noticeable by the time it takes to read the object each time.

      A similar effect can be seen with other RooFit objects (like RooArgSet or RooFitResult saved directly in the file, not in a workspace), but not with other ROOT objects (like TH1F or TTree).

      The object is not reloaded if used from a copied variable, eg. "RooWorkspace* w2=w".

      This was not a problem with ROOT5 (eg. 5.34.25).

      This issue was originally reported by Marc Escalier on the ATLAS Statistics eGroup.

      PS. the test workspace used here can be easily created with:

      RooWorkspace w("w","workspace");
      w.factory("mu[1,0,10]");
      w.writeToFile("wsfile.root");

      Attachments

        Issue Links

          Activity

            People

              axel Axel Naumann
              adye Tim Adye
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: