Skip to content

Commit 294f6ad

Browse files
committed
[RF] Fix invalid proxy and memory leak in RooNonCPEigenDecay
There was an invalid proxy in `RooNonCPEigenDecay`, because it was initialized via move assignement which is not supported for proxies. Furthermore, there was a memory leak of the arg that this proxy points to, which is fixed by making the proxy own that arg.
1 parent b3c8804 commit 294f6ad

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

roofit/roofit/inc/RooNonCPEigenDecay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class RooNonCPEigenDecay : public RooAbsAnaConvPdf {
108108
RooCategoryProxy _tag;
109109
RooCategoryProxy _rhoQ;
110110
RooRealProxy _correctQ;
111-
RooRealProxy _wQ;
111+
RooRealProxy _wQ; ///< dummy mischarge (must be set to zero!)
112112
double _genB0Frac;
113113
double _genRhoPlusFrac;
114114

roofit/roofit/src/RooNonCPEigenDecay.cxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,11 @@ RooNonCPEigenDecay::RooNonCPEigenDecay( const char *name, const char *title,
147147
_tag ( "tag", "CP state", this, tag ),
148148
_rhoQ ( "rhoQ", "Charge of the rho", this, rhoQ ),
149149
_correctQ ( "correctQ", "correction of rhoQ", this, correctQ ),
150+
_wQ ( "wQ", "mischarge", this, *(new RooRealVar( "wQ", "wQ", 0 )), true, false, true ),
150151
_genB0Frac ( 0 ),
151152
_genRhoPlusFrac( 0 ),
152153
_type ( type )
153154
{
154-
// dummy mischarge (must be set to zero!)
155-
_wQ = RooRealProxy( "wQ", "mischarge", this, *(new RooRealVar( "wQ", "wQ", 0 )) );
156-
157155
switch(type) {
158156
case SingleSided:
159157
_basisExp = declareBasis( "exp(-@0/@1)", RooArgList( tau ) );

0 commit comments

Comments
 (0)