Skip to content

Conversation

@riga
Copy link
Contributor

@riga riga commented Jan 21, 2017

This PR adds 'add' functions to RooArgSet again, that were removed in 6.06/00.

Problem

This pyROOT code

import ROOT
set1 = ROOT.RooArgSet()
set2 = ROOT.RooArgSet()
set1.add(set2)

worked until 6.05/02 (included) and raises an exception since 6.06/00:

TypeError: bool RooArgSet::add(const RooAbsArg& var, bool silent = kFALSE) =>
    could not convert argument 1

Fix

RooArgSet inherits from RooAbsCollection, so it should be possible to add a RootArgSet instance to an other RootArgSet instance via add(). This used to work in versions prior to 6.06/00. From RooArgSet.h in 6.05/02:

class RooArgSet : public RooAbsCollection {
public:
    ...
    virtual Bool_t add(const RooAbsCollection& list, Bool_t silent=kFALSE) {...}
};

This was changed in commit 283f080, where e.g. the above add function was replaced by

using RooAbsCollection::add;

However, this only seems to work when the used function is implemented in the base class' header or re-implemented by the inheriting class' which both is not the case. Therefore, I added the functions again to the RooArgSet header.

@peremato
Copy link
Contributor

Thanks for the patch. This fixes issue https://sft.its.cern.ch/jira/browse/ROOT-8230
Merged to master and 6.08 branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants