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 RooONNXFunc;
53class RooPoisson;
54class RooPolyVar;
55class RooPolynomial;
56class RooProduct;
57class RooRatio;
58class RooRealIntegral;
59class RooRealSumFunc;
60class RooRealSumPdf;
61class RooRealVar;
63class RooSimultaneous;
64class RooUniform;
65class RooWrapperPdf;
66
67namespace RooStats {
68namespace HistFactory {
70}
71} // namespace RooStats
72
73namespace RooFit {
74
75namespace Detail {
76class RooFixedProdPdf;
77class RooNLLVarNew;
79} // namespace Detail
80
81namespace Experimental {
82
83class CodegenContext;
84
86void codegenImpl(RooFit::Detail::RooNLLVarNew &arg, CodegenContext &ctx);
90void codegenImpl(RooAbsArg &arg, CodegenContext &ctx);
91void codegenImpl(RooAddPdf &arg, CodegenContext &ctx);
100void codegenImpl(RooEffProd &arg, CodegenContext &ctx);
109void codegenImpl(RooGamma &arg, CodegenContext &ctx);
110void codegenImpl(RooGaussian &arg, CodegenContext &ctx);
112void codegenImpl(RooHistFunc &arg, CodegenContext &ctx);
113void codegenImpl(RooHistPdf &arg, CodegenContext &ctx);
114void codegenImpl(RooLandau &arg, CodegenContext &ctx);
116void codegenImpl(RooMultiPdf &arg, CodegenContext &ctx);
118void codegenImpl(RooONNXFunc &arg, CodegenContext &ctx);
119// Support for the deprecated RooParamHistFunc, to be removed in ROOT 6.46
120#ifdef _MSC_VER
121#pragma warning(push)
122#pragma warning(disable : 4996)
123#else
124#pragma GCC diagnostic push
125#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
126#endif
128#ifdef _MSC_VER
129#pragma warning(pop)
130#else
131#pragma GCC diagnostic pop
132#endif
133void codegenImpl(RooPoisson &arg, CodegenContext &ctx);
134void codegenImpl(RooPolyVar &arg, CodegenContext &ctx);
136void codegenImpl(RooProduct &arg, CodegenContext &ctx);
137void codegenImpl(RooRatio &arg, CodegenContext &ctx);
141void codegenImpl(RooRealVar &arg, CodegenContext &ctx);
145void codegenImpl(RooUniform &arg, CodegenContext &ctx);
147
148std::string codegenIntegralImpl(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx);
149std::string codegenIntegralImpl(RooBernstein &arg, int code, const char *rangeName, CodegenContext &ctx);
150std::string codegenIntegralImpl(RooBifurGauss &arg, int code, const char *rangeName, CodegenContext &ctx);
151std::string codegenIntegralImpl(RooCBShape &arg, int code, const char *rangeName, CodegenContext &ctx);
152std::string codegenIntegralImpl(RooChebychev &arg, int code, const char *rangeName, CodegenContext &ctx);
153std::string codegenIntegralImpl(RooEfficiency &arg, int code, const char *rangeName, CodegenContext &ctx);
154std::string codegenIntegralImpl(RooExponential &arg, int code, const char *rangeName, CodegenContext &ctx);
155std::string codegenIntegralImpl(RooGamma &arg, int code, const char *rangeName, CodegenContext &ctx);
156std::string codegenIntegralImpl(RooGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
157std::string codegenIntegralImpl(RooHistFunc &arg, int code, const char *rangeName, CodegenContext &ctx);
158std::string codegenIntegralImpl(RooHistPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
159std::string codegenIntegralImpl(RooLandau &arg, int code, const char *rangeName, CodegenContext &ctx);
160std::string codegenIntegralImpl(RooLognormal &arg, int code, const char *rangeName, CodegenContext &ctx);
161std::string codegenIntegralImpl(RooMultiVarGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
162std::string codegenIntegralImpl(RooPoisson &arg, int code, const char *rangeName, CodegenContext &ctx);
163std::string codegenIntegralImpl(RooPolyVar &arg, int code, const char *rangeName, CodegenContext &ctx);
164std::string codegenIntegralImpl(RooPolynomial &arg, int code, const char *rangeName, CodegenContext &ctx);
165std::string codegenIntegralImpl(RooRealSumPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
166std::string codegenIntegralImpl(RooUniform &arg, int code, const char *rangeName, CodegenContext &ctx);
167
168template <class Arg_t, int P>
169std::string codegenIntegralImpl(Arg_t &arg, int code, const char *rangeName, CodegenContext &ctx, Prio<P> p)
170{
171 if constexpr (std::is_same<Prio<P>, PrioLowest>::value) {
172 return codegenIntegralImpl(arg, code, rangeName, ctx);
173 } else {
174 return codegenIntegralImpl(arg, code, rangeName, ctx, p.next());
175 }
176}
177
178template <class Arg_t>
180
181 static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)
182 {
183 return codegenIntegralImpl(static_cast<Arg_t &>(arg), code, rangeName, ctx, PrioHighest{});
184 }
185};
186
187} // namespace Experimental
188} // namespace RooFit
189
190#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:63
Efficient implementation of a sum of PDFs of the form.
Definition RooAddPdf.h:32
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:209
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:29
A probability density function sampled from a multidimensional histogram.
Definition RooHistPdf.h:29
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.
RooONNXFunc wraps an ONNX model as a RooAbsReal, allowing it to be used as a building block in likeli...
Definition RooONNXFunc.h:21
Poisson pdf.
Definition RooPoisson.h:18
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 ...
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
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:73
Namespace for the RooStats classes.
Definition CodegenImpl.h:67
static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)