Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RF] Constructors RooProdPdf and RooProduct #7809

Closed
cburgard opened this issue Apr 9, 2021 · 7 comments · Fixed by #10797
Closed

[RF] Constructors RooProdPdf and RooProduct #7809

cburgard opened this issue Apr 9, 2021 · 7 comments · Fixed by #10797

Comments

@cburgard
Copy link
Contributor

cburgard commented Apr 9, 2021

Explain what you would like to see improved

RooProdPdf and RooProduct have different constructor interfaces.
In a workspace like this:

RooWorkspace w;
w.factory("RooGaussian::a(x[-10,10],0.,1.)")
w.factory("RooGaussian::b(y[-10,10],0.,1.)")

Now, consider this:

w.factory("RooProdPdf::p1({a,b})")
w.factory("RooProduct::p2({x,y})")

p2 does what you think it would.
p1 does not.

On the other hand:

w.factory("RooProdPdf::p3(a,b)")
w.factory("RooProduct::p4(x,y)")

p3 works.
p4 does not.

How it could be improved

The constructor interfaces of these classes should be harmonized.

@guitargeek
Copy link
Contributor

Linking a conversation that is connected to the issue: #7766 (comment)

@cburgard
Copy link
Contributor Author

After a discussion with Wouter, it seems that the constructors of RooProdPdf and RooProduct should all be changed to use RooArgSet instead of RooArgList

@lmoneta lmoneta self-assigned this Apr 12, 2021
@guitargeek guitargeek changed the title constructors RooProdPdf and RooProduct [RF] Constructors RooProdPdf and RooProduct Dec 3, 2021
guitargeek added a commit to guitargeek/root that referenced this issue Dec 3, 2021
guitargeek added a commit to guitargeek/root that referenced this issue Jun 21, 2022
This commit fixes three issues:

1. Introduce `RooProduct` constructor from two RooAbsReals to be
   consistent with the `RooRrodPdf`, which has a constructor from two
   RooAbsPdfs.

2. Remove a useless dummy constructor for a `RooProdPdf` with no
   factors, which somehow prevented the constructor from a RooFit
   collection to be picked up correctly by `RooWorkspace::factory()`

3. Change the interfaces of the RooProduct and RooProdPdf constructors
   from RooFit collections to take RooArgSets and not RooArgLists,
   because all factors should be forced to have unique names. This
   change is completely  backwards compatible, because a RooArgSet can
   be implicitely constructed from a RooArgList, in which case it also
   does the duplicate checking.

A unit test for the issue was also implemented.

Closes root-project#7809.
guitargeek added a commit to guitargeek/root that referenced this issue Jun 21, 2022
This commit fixes three issues:

1. Introduce `RooProduct` constructor from two RooAbsReals to be
   consistent with the `RooRrodPdf`, which has a constructor from two
   RooAbsPdfs.

2. Remove a useless dummy constructor for a `RooProdPdf` with no
   factors, which somehow prevented the constructor from a RooFit
   collection to be picked up correctly by `RooWorkspace::factory()`

The request to change the RooProduct and RooProdPdf constructors from
RooFit collections to take RooArgSets and not RooArgLists was not
followed. This would be a breaking change for people that use
`RooProduct` to square a function for example.

A unit test for the issue was also implemented.

Closes root-project#7809.
guitargeek added a commit to guitargeek/root that referenced this issue Jun 21, 2022
This commit fixes two issues:

1. Introduce `RooProduct` constructor from two RooAbsReals to be
   consistent with the `RooRrodPdf`, which has a constructor from two
   RooAbsPdfs.

2. Remove a useless dummy constructor for a `RooProdPdf` with no
   factors, which somehow prevented the constructor from a RooFit
   collection to be picked up correctly by `RooWorkspace::factory()`

The request to change the RooProduct and RooProdPdf constructors from
RooFit collections to take RooArgSets and not RooArgLists was not
followed. This would be a breaking change for people that use
`RooProduct` to square a function for example.

A unit test for the issue was also implemented.

Closes root-project#7809.
guitargeek added a commit that referenced this issue Jun 22, 2022
This commit fixes two issues:

1. Introduce `RooProduct` constructor from two RooAbsReals to be
   consistent with the `RooRrodPdf`, which has a constructor from two
   RooAbsPdfs.

2. Remove a useless dummy constructor for a `RooProdPdf` with no
   factors, which somehow prevented the constructor from a RooFit
   collection to be picked up correctly by `RooWorkspace::factory()`

The request to change the RooProduct and RooProdPdf constructors from
RooFit collections to take RooArgSets and not RooArgLists was not
followed. This would be a breaking change for people that use
`RooProduct` to square a function for example.

A unit test for the issue was also implemented.

Closes #7809.
@github-actions
Copy link

Hi @guitargeek, @lmoneta,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

2 similar comments
@github-actions
Copy link

Hi @guitargeek, @lmoneta,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

@github-actions
Copy link

Hi @guitargeek, @lmoneta,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

@guitargeek guitargeek added this to the 6.28/00 milestone Jun 27, 2022
@github-actions
Copy link

Hi @guitargeek, @lmoneta,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

1 similar comment
@github-actions
Copy link

Hi @guitargeek, @lmoneta,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

j-mathe pushed a commit to j-mathe/root that referenced this issue Jul 26, 2022
This commit fixes two issues:

1. Introduce `RooProduct` constructor from two RooAbsReals to be
   consistent with the `RooRrodPdf`, which has a constructor from two
   RooAbsPdfs.

2. Remove a useless dummy constructor for a `RooProdPdf` with no
   factors, which somehow prevented the constructor from a RooFit
   collection to be picked up correctly by `RooWorkspace::factory()`

The request to change the RooProduct and RooProdPdf constructors from
RooFit collections to take RooArgSets and not RooArgLists was not
followed. This would be a breaking change for people that use
`RooProduct` to square a function for example.

A unit test for the issue was also implemented.

Closes root-project#7809.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants