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 RooCategory;
30class RooChebychev;
31class RooConstVar;
33class RooEffProd;
34class RooEfficiency;
35class RooExponential;
36class RooExtendPdf;
37class RooFormulaVar;
42class RooGamma;
43class RooGaussian;
44class RooGenericPdf;
45class RooHistFunc;
46class RooHistPdf;
47class RooLandau;
48class RooLognormal;
49class RooMultiPdf;
51class RooONNXFunction;
53class RooPoisson;
54class RooPolyVar;
55class RooPolynomial;
56class RooProduct;
57class RooRatio;
58class RooRealIntegral;
59class RooRealSumFunc;
60class RooRealSumPdf;
61class RooRealVar;
63class RooUniform;
64class RooWrapperPdf;
65
66namespace RooStats {
67namespace HistFactory {
69}
70} // namespace RooStats
71
72namespace RooFit {
73
74namespace Detail {
75class RooFixedProdPdf;
76class RooNLLVarNew;
78} // namespace Detail
79
80namespace Experimental {
81
82class CodegenContext;
83
85void codegenImpl(RooFit::Detail::RooNLLVarNew &arg, CodegenContext &ctx);
89void codegenImpl(RooAbsArg &arg, CodegenContext &ctx);
90void codegenImpl(RooAddPdf &arg, CodegenContext &ctx);
108void codegenImpl(RooGamma &arg, CodegenContext &ctx);
109void codegenImpl(RooGaussian &arg, CodegenContext &ctx);
111void codegenImpl(RooHistFunc &arg, CodegenContext &ctx);
112void codegenImpl(RooHistPdf &arg, CodegenContext &ctx);
113void codegenImpl(RooLandau &arg, CodegenContext &ctx);
115void codegenImpl(RooMultiPdf &arg, CodegenContext &ctx);
119void codegenImpl(RooPoisson &arg, CodegenContext &ctx);
120void codegenImpl(RooPolyVar &arg, CodegenContext &ctx);
122void codegenImpl(RooProduct &arg, CodegenContext &ctx);
123void codegenImpl(RooRatio &arg, CodegenContext &ctx);
127void codegenImpl(RooRealVar &arg, CodegenContext &ctx);
130void codegenImpl(RooUniform &arg, CodegenContext &ctx);
132
133std::string codegenIntegralImpl(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx);
134std::string codegenIntegralImpl(RooBernstein &arg, int code, const char *rangeName, CodegenContext &ctx);
135std::string codegenIntegralImpl(RooBifurGauss &arg, int code, const char *rangeName, CodegenContext &ctx);
136std::string codegenIntegralImpl(RooCBShape &arg, int code, const char *rangeName, CodegenContext &ctx);
137std::string codegenIntegralImpl(RooChebychev &arg, int code, const char *rangeName, CodegenContext &ctx);
138std::string codegenIntegralImpl(RooEfficiency &arg, int code, const char *rangeName, CodegenContext &ctx);
139std::string codegenIntegralImpl(RooExponential &arg, int code, const char *rangeName, CodegenContext &ctx);
140std::string codegenIntegralImpl(RooGamma &arg, int code, const char *rangeName, CodegenContext &ctx);
141std::string codegenIntegralImpl(RooGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
142std::string codegenIntegralImpl(RooHistFunc &arg, int code, const char *rangeName, CodegenContext &ctx);
143std::string codegenIntegralImpl(RooHistPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
144std::string codegenIntegralImpl(RooLandau &arg, int code, const char *rangeName, CodegenContext &ctx);
145std::string codegenIntegralImpl(RooLognormal &arg, int code, const char *rangeName, CodegenContext &ctx);
146std::string codegenIntegralImpl(RooMultiVarGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
147std::string codegenIntegralImpl(RooPoisson &arg, int code, const char *rangeName, CodegenContext &ctx);
148std::string codegenIntegralImpl(RooPolyVar &arg, int code, const char *rangeName, CodegenContext &ctx);
149std::string codegenIntegralImpl(RooPolynomial &arg, int code, const char *rangeName, CodegenContext &ctx);
150std::string codegenIntegralImpl(RooRealSumPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
151std::string codegenIntegralImpl(RooUniform &arg, int code, const char *rangeName, CodegenContext &ctx);
152
153template <class Arg_t, int P>
154std::string codegenIntegralImpl(Arg_t &arg, int code, const char *rangeName, CodegenContext &ctx, Prio<P> p)
155{
156 if constexpr (std::is_same<Prio<P>, PrioLowest>::value) {
157 return codegenIntegralImpl(arg, code, rangeName, ctx);
158 } else {
159 return codegenIntegralImpl(arg, code, rangeName, ctx, p.next());
160 }
161}
162
163template <class Arg_t>
165
166 static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)
167 {
168 return codegenIntegralImpl(static_cast<Arg_t &>(arg), code, rangeName, ctx, PrioHighest{});
169 }
170};
171
172} // namespace Experimental
173} // namespace RooFit
174
175#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:76
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
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
Object to represent discrete states.
Definition RooCategory.h:28
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:212
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...
RooCFunction1Binding is a templated implementation of class RooAbsReal that binds generic C(++) funct...
RooFunctorBinding makes math functions from ROOT usable in RooFit.
RooFunctorPdfBinding makes math functions from ROOT usable as PDFs in RooFit.
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 probability density function sampled from a multidimensional histogram.
Definition RooHistPdf.h:30
Landau distribution p.d.f.
Definition RooLandau.h:24
RooFit Lognormal PDF.
The class RooMultiPdf allows for the creation of a RooMultiPdf object, which can switch between previ...
Definition RooMultiPdf.h:9
Multivariate Gaussian p.d.f.
RooONNXFunction wraps an ONNX model as a RooAbsReal, allowing it to be used as a building block in li...
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
The RooWrapperPdf is a class that can be used to convert a function into a PDF.
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:72
Namespace for the RooStats classes.
Definition CodegenImpl.h:66
static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)