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 RooCategory;
29class RooCBShape;
30class RooChebychev;
31class RooConstVar;
33class RooEffProd;
34class RooEfficiency;
35class RooExponential;
36class RooExtendPdf;
37class RooFormulaVar;
38class RooGamma;
39class RooGaussian;
40class RooGenericPdf;
41class RooHistFunc;
42class RooHistPdf;
43class RooLandau;
44class RooLognormal;
47class RooPoisson;
48class RooPolyVar;
49class RooPolynomial;
50class RooProduct;
51class RooRatio;
52class RooRealIntegral;
53class RooRealSumFunc;
54class RooRealSumPdf;
55class RooRealVar;
57class RooUniform;
58class RooMultiPdf;
59class RooWrapperPdf;
60
61namespace RooStats {
62namespace HistFactory {
64}
65} // namespace RooStats
66
67namespace RooFit {
68
69namespace Detail {
70class RooFixedProdPdf;
71class RooNLLVarNew;
73} // namespace Detail
74
75namespace Experimental {
76
77class CodegenContext;
78
80void codegenImpl(RooFit::Detail::RooNLLVarNew &arg, CodegenContext &ctx);
84void codegenImpl(RooAbsArg &arg, CodegenContext &ctx);
85void codegenImpl(RooAddPdf &arg, CodegenContext &ctx);
99void codegenImpl(RooGamma &arg, CodegenContext &ctx);
100void codegenImpl(RooGaussian &arg, CodegenContext &ctx);
102void codegenImpl(RooHistFunc &arg, CodegenContext &ctx);
103void codegenImpl(RooHistPdf &arg, CodegenContext &ctx);
104void codegenImpl(RooLandau &arg, CodegenContext &ctx);
108void codegenImpl(RooPoisson &arg, CodegenContext &ctx);
109void codegenImpl(RooPolyVar &arg, CodegenContext &ctx);
111void codegenImpl(RooMultiPdf &arg, CodegenContext &ctx);
112void codegenImpl(RooProduct &arg, CodegenContext &ctx);
113void codegenImpl(RooRatio &arg, CodegenContext &ctx);
117void codegenImpl(RooRealVar &arg, CodegenContext &ctx);
120void codegenImpl(RooUniform &arg, CodegenContext &ctx);
122
123std::string codegenIntegralImpl(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx);
124std::string codegenIntegralImpl(RooBernstein &arg, int code, const char *rangeName, CodegenContext &ctx);
125std::string codegenIntegralImpl(RooBifurGauss &arg, int code, const char *rangeName, CodegenContext &ctx);
126std::string codegenIntegralImpl(RooCBShape &arg, int code, const char *rangeName, CodegenContext &ctx);
127std::string codegenIntegralImpl(RooChebychev &arg, int code, const char *rangeName, CodegenContext &ctx);
128std::string codegenIntegralImpl(RooEfficiency &arg, int code, const char *rangeName, CodegenContext &ctx);
129std::string codegenIntegralImpl(RooExponential &arg, int code, const char *rangeName, CodegenContext &ctx);
130std::string codegenIntegralImpl(RooGamma &arg, int code, const char *rangeName, CodegenContext &ctx);
131std::string codegenIntegralImpl(RooGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
132std::string codegenIntegralImpl(RooHistFunc &arg, int code, const char *rangeName, CodegenContext &ctx);
133std::string codegenIntegralImpl(RooHistPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
134std::string codegenIntegralImpl(RooLandau &arg, int code, const char *rangeName, CodegenContext &ctx);
135std::string codegenIntegralImpl(RooLognormal &arg, int code, const char *rangeName, CodegenContext &ctx);
136std::string codegenIntegralImpl(RooMultiVarGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
137std::string codegenIntegralImpl(RooPoisson &arg, int code, const char *rangeName, CodegenContext &ctx);
138std::string codegenIntegralImpl(RooPolyVar &arg, int code, const char *rangeName, CodegenContext &ctx);
139std::string codegenIntegralImpl(RooPolynomial &arg, int code, const char *rangeName, CodegenContext &ctx);
140std::string codegenIntegralImpl(RooRealSumPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
141std::string codegenIntegralImpl(RooUniform &arg, int code, const char *rangeName, CodegenContext &ctx);
142
143template <class Arg_t, int P>
144std::string codegenIntegralImpl(Arg_t &arg, int code, const char *rangeName, CodegenContext &ctx, Prio<P> p)
145{
146 if constexpr (std::is_same<Prio<P>, PrioLowest>::value) {
147 return codegenIntegralImpl(arg, code, rangeName, ctx);
148 } else {
149 return codegenIntegralImpl(arg, code, rangeName, ctx, p.next());
150 }
151}
152
153template <class Arg_t>
155
156 static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)
157 {
158 return codegenIntegralImpl(static_cast<Arg_t &>(arg), code, rangeName, ctx, PrioHighest{});
159 }
160};
161
162} // namespace Experimental
163} // namespace RooFit
164
165#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:219
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 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.
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:67
Namespace for the RooStats classes.
Definition CodegenImpl.h:61
static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)