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

[14x-comb2023] Avoid invalid proxy constructor calls in HMuMuRooPdfs #893

Merged

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Dec 21, 2023

In the HMuMuRooPdfs, there was a classic dangerous RooFit mistake.

There were constructor calls like:

RooRealProxy m("m", "m", this, 91.2);

However, this is not doing what one would naively expect, which is
having proxy to a constant. Instead, it will hit this constructor by
converting the double to bool, which is used as the valueServer
parameter:

https://root.cern/doc/v626/classRooTemplateProxy.html#a9a550633b5336561b48eb313994a68e8

So it will create a proxy to nothing! In this particular case, this was
not a problem because in evaluate(), there is a fallback for empty
proxies.

But ROOT 6.30 makes some compile-time checks to prevent these mistakes,
so this commit is necessary to compile with newer ROOT versions.

See https://root.cern/doc/v626/classRooTemplateProxy.html.

In the `HMuMuRooPdfs`, there was a classic dangerous RooFit mistake.

There were constructor calls like:
```c++
RooRealProxy m("m", "m", this, 91.2);
```

However, this is not doing what one would naively expect, which is
having proxy to a constant. Instead, it will hit this constructor by
converting the `double` to `bool`, which is used as the `valueServer`
parameter:

https://root.cern/doc/v626/classRooTemplateProxy.html#a9a550633b5336561b48eb313994a68e8

So it will create a proxy to nothing! In this particular case, this was
not a problem because in `evaluate()`, there is a fallback for empty
proxies.

But ROOT 6.30 makes some compile-time checks to prevent these mistakes,
so this commit is necessary to compile with newer ROOT versions.

See https://root.cern/doc/v626/classRooTemplateProxy.html.
@guitargeek guitargeek changed the title [14x-comb2023] Fix HMuMuRooPdfs that were broken because of bad proxy c'tor calls Avoid invalid proxy constructor calls in HMuMuRooPdfs Dec 21, 2023
@guitargeek guitargeek changed the title Avoid invalid proxy constructor calls in HMuMuRooPdfs [14x-comb2023] Avoid invalid proxy constructor calls in HMuMuRooPdfs Dec 21, 2023
@jonathon-langford jonathon-langford merged commit 01df9a6 into cms-analysis:14x-comb2023 Apr 11, 2024
1 of 5 checks passed
anigamova pushed a commit that referenced this pull request Jun 6, 2024
In the `HMuMuRooPdfs`, there was a classic dangerous RooFit mistake.

There were constructor calls like:
```c++
RooRealProxy m("m", "m", this, 91.2);
```

However, this is not doing what one would naively expect, which is
having proxy to a constant. Instead, it will hit this constructor by
converting the `double` to `bool`, which is used as the `valueServer`
parameter:

https://root.cern/doc/v626/classRooTemplateProxy.html#a9a550633b5336561b48eb313994a68e8

So it will create a proxy to nothing! In this particular case, this was
not a problem because in `evaluate()`, there is a fallback for empty
proxies.

But ROOT 6.30 makes some compile-time checks to prevent these mistakes,
so this commit is necessary to compile with newer ROOT versions.

See https://root.cern/doc/v626/classRooTemplateProxy.html.
anigamova pushed a commit that referenced this pull request Jun 6, 2024
In the `HMuMuRooPdfs`, there was a classic dangerous RooFit mistake.

There were constructor calls like:
```c++
RooRealProxy m("m", "m", this, 91.2);
```

However, this is not doing what one would naively expect, which is
having proxy to a constant. Instead, it will hit this constructor by
converting the `double` to `bool`, which is used as the `valueServer`
parameter:

https://root.cern/doc/v626/classRooTemplateProxy.html#a9a550633b5336561b48eb313994a68e8

So it will create a proxy to nothing! In this particular case, this was
not a problem because in `evaluate()`, there is a fallback for empty
proxies.

But ROOT 6.30 makes some compile-time checks to prevent these mistakes,
so this commit is necessary to compile with newer ROOT versions.

See https://root.cern/doc/v626/classRooTemplateProxy.html.
kcormi pushed a commit to kcormi/HiggsAnalysis-CombinedLimit that referenced this pull request Jun 24, 2024
In the `HMuMuRooPdfs`, there was a classic dangerous RooFit mistake.

There were constructor calls like:
```c++
RooRealProxy m("m", "m", this, 91.2);
```

However, this is not doing what one would naively expect, which is
having proxy to a constant. Instead, it will hit this constructor by
converting the `double` to `bool`, which is used as the `valueServer`
parameter:

https://root.cern/doc/v626/classRooTemplateProxy.html#a9a550633b5336561b48eb313994a68e8

So it will create a proxy to nothing! In this particular case, this was
not a problem because in `evaluate()`, there is a fallback for empty
proxies.

But ROOT 6.30 makes some compile-time checks to prevent these mistakes,
so this commit is necessary to compile with newer ROOT versions.

See https://root.cern/doc/v626/classRooTemplateProxy.html.
@guitargeek guitargeek deleted the HMuMuRooPdf_fixes branch July 9, 2024 07:06
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