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;
52class RooPoisson;
53class RooPolyVar;
54class RooPolynomial;
55class RooProduct;
56class RooRatio;
57class RooRealIntegral;
58class RooRealSumFunc;
59class RooRealSumPdf;
60class RooRealVar;
62class RooUniform;
63class RooWrapperPdf;
64
65namespace RooStats {
66namespace HistFactory {
68}
69} // namespace RooStats
70
71namespace RooFit {
72
73namespace Detail {
74class RooFixedProdPdf;
75class RooNLLVarNew;
77} // namespace Detail
78
79namespace Experimental {
80
81class CodegenContext;
82
84void codegenImpl(RooFit::Detail::RooNLLVarNew &arg, CodegenContext &ctx);
88void codegenImpl(RooAbsArg &arg, CodegenContext &ctx);
89void codegenImpl(RooAddPdf &arg, CodegenContext &ctx);
107void codegenImpl(RooGamma &arg, CodegenContext &ctx);
108void codegenImpl(RooGaussian &arg, CodegenContext &ctx);
110void codegenImpl(RooHistFunc &arg, CodegenContext &ctx);
111void codegenImpl(RooHistPdf &arg, CodegenContext &ctx);
112void codegenImpl(RooLandau &arg, CodegenContext &ctx);
116void codegenImpl(RooPoisson &arg, CodegenContext &ctx);
117void codegenImpl(RooPolyVar &arg, CodegenContext &ctx);
119void codegenImpl(RooMultiPdf &arg, CodegenContext &ctx);
120void codegenImpl(RooProduct &arg, CodegenContext &ctx);
121void codegenImpl(RooRatio &arg, CodegenContext &ctx);
125void codegenImpl(RooRealVar &arg, CodegenContext &ctx);
128void codegenImpl(RooUniform &arg, CodegenContext &ctx);
130
131std::string codegenIntegralImpl(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx);
132std::string codegenIntegralImpl(RooBernstein &arg, int code, const char *rangeName, CodegenContext &ctx);
133std::string codegenIntegralImpl(RooBifurGauss &arg, int code, const char *rangeName, CodegenContext &ctx);
134std::string codegenIntegralImpl(RooCBShape &arg, int code, const char *rangeName, CodegenContext &ctx);
135std::string codegenIntegralImpl(RooChebychev &arg, int code, const char *rangeName, CodegenContext &ctx);
136std::string codegenIntegralImpl(RooEfficiency &arg, int code, const char *rangeName, CodegenContext &ctx);
137std::string codegenIntegralImpl(RooExponential &arg, int code, const char *rangeName, CodegenContext &ctx);
138std::string codegenIntegralImpl(RooGamma &arg, int code, const char *rangeName, CodegenContext &ctx);
139std::string codegenIntegralImpl(RooGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
140std::string codegenIntegralImpl(RooHistFunc &arg, int code, const char *rangeName, CodegenContext &ctx);
141std::string codegenIntegralImpl(RooHistPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
142std::string codegenIntegralImpl(RooLandau &arg, int code, const char *rangeName, CodegenContext &ctx);
143std::string codegenIntegralImpl(RooLognormal &arg, int code, const char *rangeName, CodegenContext &ctx);
144std::string codegenIntegralImpl(RooMultiVarGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
145std::string codegenIntegralImpl(RooPoisson &arg, int code, const char *rangeName, CodegenContext &ctx);
146std::string codegenIntegralImpl(RooPolyVar &arg, int code, const char *rangeName, CodegenContext &ctx);
147std::string codegenIntegralImpl(RooPolynomial &arg, int code, const char *rangeName, CodegenContext &ctx);
148std::string codegenIntegralImpl(RooRealSumPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
149std::string codegenIntegralImpl(RooUniform &arg, int code, const char *rangeName, CodegenContext &ctx);
150
151template <class Arg_t, int P>
152std::string codegenIntegralImpl(Arg_t &arg, int code, const char *rangeName, CodegenContext &ctx, Prio<P> p)
153{
154 if constexpr (std::is_same<Prio<P>, PrioLowest>::value) {
155 return codegenIntegralImpl(arg, code, rangeName, ctx);
156 } else {
157 return codegenIntegralImpl(arg, code, rangeName, ctx, p.next());
158 }
159}
160
161template <class Arg_t>
163
164 static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)
165 {
166 return codegenIntegralImpl(static_cast<Arg_t &>(arg), code, rangeName, ctx, PrioHighest{});
167 }
168};
169
170} // namespace Experimental
171} // namespace RooFit
172
173#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.
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:71
Namespace for the RooStats classes.
Definition CodegenImpl.h:65
static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)