Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
CodegenImpl.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Jonas Rembser, CERN 2024
5 *
6 * Copyright (c) 2024, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef RooFit_Detail_CodegenImpl_h
14#define RooFit_Detail_CodegenImpl_h
15
17
18#include <type_traits>
19
20class ParamHistFunc;
22class RooAbsArg;
23class RooAbsReal;
24class RooAddPdf;
25class RooAddition;
26class RooBernstein;
27class RooBifurGauss;
28class RooCBShape;
29class RooChebychev;
30class RooConstVar;
32class RooEffProd;
33class RooEfficiency;
34class RooExponential;
35class RooExtendPdf;
36class RooFormulaVar;
37class RooGamma;
38class RooGaussian;
39class RooGenericPdf;
40class RooHistFunc;
41class RooHistPdf;
42class RooLandau;
43class RooLognormal;
46class RooPoisson;
47class RooPolyVar;
48class RooPolynomial;
49class RooProduct;
50class RooRatio;
51class RooRealIntegral;
52class RooRealSumFunc;
53class RooRealSumPdf;
54class RooRealVar;
56class RooUniform;
57
58namespace RooStats {
59namespace HistFactory {
61}
62} // namespace RooStats
63
64namespace RooFit {
65
66namespace Detail {
67class RooFixedProdPdf;
68class RooNLLVarNew;
70} // namespace Detail
71
72namespace Experimental {
73
74class CodegenContext;
75
77void codegenImpl(RooFit::Detail::RooNLLVarNew &arg, CodegenContext &ctx);
81void codegenImpl(RooAbsArg &arg, CodegenContext &ctx);
82void codegenImpl(RooAddPdf &arg, CodegenContext &ctx);
95void codegenImpl(RooGamma &arg, CodegenContext &ctx);
100void codegenImpl(RooLandau &arg, CodegenContext &ctx);
104void codegenImpl(RooPoisson &arg, CodegenContext &ctx);
105void codegenImpl(RooPolyVar &arg, CodegenContext &ctx);
107void codegenImpl(RooProduct &arg, CodegenContext &ctx);
108void codegenImpl(RooRatio &arg, CodegenContext &ctx);
112void codegenImpl(RooRealVar &arg, CodegenContext &ctx);
115void codegenImpl(RooUniform &arg, CodegenContext &ctx);
116
117std::string codegenIntegralImpl(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx);
118std::string codegenIntegralImpl(RooBernstein &arg, int code, const char *rangeName, CodegenContext &ctx);
119std::string codegenIntegralImpl(RooBifurGauss &arg, int code, const char *rangeName, CodegenContext &ctx);
120std::string codegenIntegralImpl(RooCBShape &arg, int code, const char *rangeName, CodegenContext &ctx);
121std::string codegenIntegralImpl(RooChebychev &arg, int code, const char *rangeName, CodegenContext &ctx);
122std::string codegenIntegralImpl(RooEfficiency &arg, int code, const char *rangeName, CodegenContext &ctx);
123std::string codegenIntegralImpl(RooExponential &arg, int code, const char *rangeName, CodegenContext &ctx);
124std::string codegenIntegralImpl(RooGamma &arg, int code, const char *rangeName, CodegenContext &ctx);
125std::string codegenIntegralImpl(RooGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
126std::string codegenIntegralImpl(RooHistFunc &arg, int code, const char *rangeName, CodegenContext &ctx);
127std::string codegenIntegralImpl(RooHistPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
128std::string codegenIntegralImpl(RooLandau &arg, int code, const char *rangeName, CodegenContext &ctx);
129std::string codegenIntegralImpl(RooLognormal &arg, int code, const char *rangeName, CodegenContext &ctx);
130std::string codegenIntegralImpl(RooMultiVarGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
131std::string codegenIntegralImpl(RooPoisson &arg, int code, const char *rangeName, CodegenContext &ctx);
132std::string codegenIntegralImpl(RooPolyVar &arg, int code, const char *rangeName, CodegenContext &ctx);
133std::string codegenIntegralImpl(RooPolynomial &arg, int code, const char *rangeName, CodegenContext &ctx);
134std::string codegenIntegralImpl(RooRealSumPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
135std::string codegenIntegralImpl(RooUniform &arg, int code, const char *rangeName, CodegenContext &ctx);
136
137template <class Arg_t, int P>
138std::string codegenIntegralImpl(Arg_t &arg, int code, const char *rangeName, CodegenContext &ctx, Prio<P> p)
139{
140 if constexpr (std::is_same<Prio<P>, PrioLowest>::value) {
141 return codegenIntegralImpl(arg, code, rangeName, ctx);
142 } else {
143 return codegenIntegralImpl(arg, code, rangeName, ctx, p.next());
144 }
145}
146
147template <class Arg_t>
149
150 static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)
151 {
152 return codegenIntegralImpl(static_cast<Arg_t &>(arg), code, rangeName, ctx, PrioHighest{});
153 }
154};
155
156} // namespace Experimental
157} // namespace RooFit
158
159#endif
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
A class which maps the current values of a RooRealVar (or a set of RooRealVars) to one of a number of...
The PiecewiseInterpolation is a class that can morph distributions into each other,...
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
Efficient implementation of a sum of PDFs of the form.
Definition RooAddPdf.h:33
Calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
Definition RooAddition.h:27
Bernstein basis polynomials are positive-definite in the range [0,1].
Bifurcated Gaussian p.d.f with different widths on left and right side of maximum value.
PDF implementing the Crystal Ball line shape.
Definition RooCBShape.h:24
Chebychev polynomial p.d.f.
Represents a constant real-valued object.
Definition RooConstVar.h:23
Calculates the sum of the -(log) likelihoods of a set of RooAbsPfs that represent constraint function...
The class RooEffProd implements the product of a PDF with an efficiency function.
Definition RooEffProd.h:19
A PDF helper class to fit efficiencies parameterized by a supplied function F.
Exponential PDF.
RooExtendPdf is a wrapper around an existing PDF that adds a parameteric extended likelihood term to ...
A RooProdPdf with a fixed normalization set can be replaced by this class.
Definition RooProdPdf.h:206
A class to maintain the context for squashing of RooFit models into code.
A RooFormulaVar is a generic implementation of a real-valued object, which takes a RooArgList of serv...
Implementation of the Gamma PDF for RooFit/RooStats.
Definition RooGamma.h:20
Plain Gaussian p.d.f.
Definition RooGaussian.h:24
Implementation of a probability density function that takes a RooArgList of servers and a C++ express...
A real-valued function sampled from a multidimensional histogram.
Definition RooHistFunc.h:31
A propability density function sampled from a multidimensional histogram.
Definition RooHistPdf.h:30
Landau distribution p.d.f.
Definition RooLandau.h:24
RooFit Lognormal PDF.
Multivariate Gaussian p.d.f.
A histogram function that assigns scale parameters to every bin.
Poisson pdf.
Definition RooPoisson.h:19
A RooAbsReal implementing a polynomial in terms of a list of RooAbsReal coefficients.
Definition RooPolyVar.h:25
RooPolynomial implements a polynomial p.d.f of the form.
Represents the product of a given set of RooAbsReal objects.
Definition RooProduct.h:29
Represents the ratio of two RooAbsReal objects.
Definition RooRatio.h:21
Performs hybrid numerical/analytical integrals of RooAbsReal objects.
Implements a PDF constructed from a sum of functions:
Variable that can be changed from the outside.
Definition RooRealVar.h:37
A RooAbsReal implementation that calculates the plain fraction of sum of RooAddPdf components from a ...
Flat p.d.f.
Definition RooUniform.h:24
void codegenImpl(RooFit::Detail::RooFixedProdPdf &arg, CodegenContext &ctx)
std::string codegenIntegralImpl(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)
This function defines the analytical integral translation for the class.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:64
Namespace for the RooStats classes.
Definition CodegenImpl.h:58
static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)