Skip to content

Commit 5d22f24

Browse files
committed
[RF] Optimize RooProduct codegen
1 parent 0afbe58 commit 5d22f24

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

roofit/codegen/src/CodegenImpl.cxx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,14 @@ void codegenImpl(RooPolynomial &arg, CodegenContext &ctx)
557557

558558
void codegenImpl(RooProduct &arg, CodegenContext &ctx)
559559
{
560-
ctx.addResult(&arg, ctx.buildCall(mathFunc("product"), arg.realComponents(), arg.realComponents().size()));
560+
std::stringstream ss;
561+
std::size_t n = arg.realComponents().size();
562+
for (std::size_t i = 0; i < n; ++i) {
563+
ss << ctx.getResult(arg.realComponents()[i]);
564+
if (i != n - 1)
565+
ss << " * " << std::endl;
566+
}
567+
ctx.addResult(&arg, ss.str());
561568
}
562569

563570
void codegenImpl(RooRatio &arg, CodegenContext &ctx)

0 commit comments

Comments
 (0)