-
Notifications
You must be signed in to change notification settings - Fork 429
Schema evolution for RooDoubleCBFast #1235
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,12 @@ | ||
| #ifndef ROODOUBLECB | ||
| #define ROODOUBLECB | ||
|
|
||
| #include "RooAbsPdf.h" | ||
| #include "RooRealProxy.h" | ||
| #include "RooCrystalBall.h" | ||
| #include "RooAbsReal.h" | ||
|
|
||
| class RooDoubleCBFast : public RooAbsPdf { | ||
| class RooDoubleCBFast : public RooCrystalBall { | ||
| public: | ||
| RooDoubleCBFast(); | ||
| RooDoubleCBFast() = default; | ||
| RooDoubleCBFast(const char *name, const char *title, | ||
| RooAbsReal& _x, | ||
| RooAbsReal& _mean, | ||
|
|
@@ -17,26 +16,7 @@ class RooDoubleCBFast : public RooAbsPdf { | |
| RooAbsReal& _alpha2, | ||
| RooAbsReal& _n2 | ||
| ); | ||
| RooDoubleCBFast(const RooDoubleCBFast& other, const char* name=0) ; | ||
| TObject* clone(const char* newname) const override { return new RooDoubleCBFast(*this,newname); } | ||
| inline ~RooDoubleCBFast() override { } | ||
| Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const override ; | ||
| Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const override ; | ||
|
|
||
| protected: | ||
|
|
||
| RooRealProxy x ; | ||
| RooRealProxy mean; | ||
| RooRealProxy width; | ||
| RooRealProxy alpha1; | ||
| RooRealProxy n1; | ||
| RooRealProxy alpha2; | ||
| RooRealProxy n2; | ||
|
|
||
| Double_t evaluate() const override ; | ||
|
|
||
| private: | ||
|
|
||
| ClassDefOverride(RooDoubleCBFast,1) | ||
| ClassDefOverride(RooDoubleCBFast, 2) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🤖 Prompt for AI Agents |
||
| }; | ||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,6 +219,24 @@ | |
| <class name="RooExpPdf" /> | ||
| <class name="RooSumTwoExpPdf" /> | ||
| <class name="RooPowerLawPdf" /> | ||
| <class name="RooSumTwoPowerLawPdf" /> | ||
| <class name="CombineUtils" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs to be kept - its removal here I think comes from the fact that it was added in the time between now and the first attempt at this schema evolution a few hackathons ago |
||
| <class name="RooSumTwoPowerLawPdf" /> | ||
| <read sourceClass="RooDoubleCBFast" targetClass="RooDoubleCBFast" version="[1]" | ||
| source="RooRealProxy x; RooRealProxy mean; RooRealProxy width; RooRealProxy alpha1; RooRealProxy n1; RooRealProxy alpha2; RooRealProxy n2" | ||
| target=""> | ||
| <![CDATA[ | ||
| std::cout << \"Translating RooDoubleCBFast using proper constructor\" << std::endl; | ||
| std::string newName(newObj->GetName()); | ||
| std::string newTitle(newObj->GetTitle()); | ||
| newObj->~RooDoubleCBFast(); | ||
| new (newObj) RooDoubleCBFast(newName.c_str(), newTitle.c_str(), | ||
| const_cast<RooAbsReal&>(onfile.x.arg()), | ||
| const_cast<RooAbsReal&>(onfile.mean.arg()), | ||
| const_cast<RooAbsReal&>(onfile.width.arg()), | ||
| const_cast<RooAbsReal&>(onfile.alpha1.arg()), | ||
| const_cast<RooAbsReal&>(onfile.n1.arg()), | ||
| const_cast<RooAbsReal&>(onfile.alpha2.arg()), | ||
| const_cast<RooAbsReal&>(onfile.n2.arg())); | ||
| ]]> | ||
| </read> | ||
|
Comment on lines
+224
to
+241
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Escaped quotes inside Inside a Additionally, the Proposed fix for the escaped quotes <![CDATA[
- std::cout << \"Translating RooDoubleCBFast using proper constructor\" << std::endl;
+ std::cout << "Translating RooDoubleCBFast using proper constructor" << std::endl;
std::string newName(newObj->GetName());🤖 Prompt for AI Agents |
||
| </lcgdict> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
ROOT RooCrystalBall final declaration💡 Result:
In ROOT/RooFit,
RooCrystalBallis declared as afinalC++ class in its header:This
finalspecifier means you cannot derive/inherit fromRooCrystalBall(i.e.,class MyPdf : public RooCrystalBall { ... }is not allowed). [1], [2]Sources: ROOT v6.34.10 reference + header source. [1], [2]
References
RooCrystalBallheader source (RooCrystalBall.h, line 11) (root.cern.ch)RooCrystalBallclass reference (shows “Class Reference final”) (root.cern.ch)Citations:
🏁 Script executed:
Repository: cms-analysis/HiggsAnalysis-CombinedLimit
Length of output: 66
RooCrystalBallis declaredfinal— inheritance is illegal.RooCrystalBallis markedfinalin ROOT (v6.34.10+), soclass RooDoubleCBFast : public RooCrystalBallwill not compile. This blocks the PR.Possible paths forward:
RooAbsPdfand internally delegate to aRooCrystalBallinstance for evaluation and integration.RooAbsPdfand replicate or call into the crystal ball logic.finalfromRooCrystalBall(outside your control).🤖 Prompt for AI Agents