Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:14:10

0001 /*
0002  * Project: RooFit
0003  * Authors:
0004  *   Jonas Rembser, CERN 2024
0005  *
0006  * Copyright (c) 2024, CERN
0007  *
0008  * Redistribution and use in source and binary forms,
0009  * with or without modification, are permitted according to the terms
0010  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
0011  */
0012 
0013 #ifndef RooFit_Detail_CodegenImpl_h
0014 #define RooFit_Detail_CodegenImpl_h
0015 
0016 #include <RooFit/CodegenContext.h>
0017 
0018 #include <type_traits>
0019 
0020 class ParamHistFunc;
0021 class PiecewiseInterpolation;
0022 class RooAbsArg;
0023 class RooAbsReal;
0024 class RooAddPdf;
0025 class RooAddition;
0026 class RooBernstein;
0027 class RooBifurGauss;
0028 class RooCBShape;
0029 class RooChebychev;
0030 class RooConstVar;
0031 class RooConstraintSum;
0032 class RooEffProd;
0033 class RooEfficiency;
0034 class RooExponential;
0035 class RooExtendPdf;
0036 class RooFormulaVar;
0037 class RooGamma;
0038 class RooGaussian;
0039 class RooGenericPdf;
0040 class RooHistFunc;
0041 class RooHistPdf;
0042 class RooLandau;
0043 class RooLognormal;
0044 class RooMultiVarGaussian;
0045 class RooParamHistFunc;
0046 class RooPoisson;
0047 class RooPolyVar;
0048 class RooPolynomial;
0049 class RooProduct;
0050 class RooRatio;
0051 class RooRealIntegral;
0052 class RooRealSumFunc;
0053 class RooRealSumPdf;
0054 class RooRealVar;
0055 class RooRecursiveFraction;
0056 class RooUniform;
0057 class RooWrapperPdf;
0058 
0059 namespace RooStats {
0060 namespace HistFactory {
0061 class FlexibleInterpVar;
0062 }
0063 } // namespace RooStats
0064 
0065 namespace RooFit {
0066 
0067 namespace Detail {
0068 class RooFixedProdPdf;
0069 class RooNLLVarNew;
0070 class RooNormalizedPdf;
0071 } // namespace Detail
0072 
0073 namespace Experimental {
0074 
0075 class CodegenContext;
0076 
0077 void codegenImpl(RooFit::Detail::RooFixedProdPdf &arg, CodegenContext &ctx);
0078 void codegenImpl(RooFit::Detail::RooNLLVarNew &arg, CodegenContext &ctx);
0079 void codegenImpl(RooFit::Detail::RooNormalizedPdf &arg, CodegenContext &ctx);
0080 void codegenImpl(ParamHistFunc &arg, CodegenContext &ctx);
0081 void codegenImpl(PiecewiseInterpolation &arg, CodegenContext &ctx);
0082 void codegenImpl(RooAbsArg &arg, CodegenContext &ctx);
0083 void codegenImpl(RooAddPdf &arg, CodegenContext &ctx);
0084 void codegenImpl(RooAddition &arg, CodegenContext &ctx);
0085 void codegenImpl(RooBernstein &arg, CodegenContext &ctx);
0086 void codegenImpl(RooBifurGauss &arg, CodegenContext &ctx);
0087 void codegenImpl(RooCBShape &arg, CodegenContext &ctx);
0088 void codegenImpl(RooChebychev &arg, CodegenContext &ctx);
0089 void codegenImpl(RooConstVar &arg, CodegenContext &ctx);
0090 void codegenImpl(RooConstraintSum &arg, CodegenContext &ctx);
0091 void codegenImpl(RooEffProd &arg, CodegenContext &ctx);
0092 void codegenImpl(RooEfficiency &arg, CodegenContext &ctx);
0093 void codegenImpl(RooExponential &arg, CodegenContext &ctx);
0094 void codegenImpl(RooExtendPdf &arg, CodegenContext &ctx);
0095 void codegenImpl(RooFormulaVar &arg, CodegenContext &ctx);
0096 void codegenImpl(RooGamma &arg, CodegenContext &ctx);
0097 void codegenImpl(RooGaussian &arg, CodegenContext &ctx);
0098 void codegenImpl(RooGenericPdf &arg, CodegenContext &ctx);
0099 void codegenImpl(RooHistFunc &arg, CodegenContext &ctx);
0100 void codegenImpl(RooHistPdf &arg, CodegenContext &ctx);
0101 void codegenImpl(RooLandau &arg, CodegenContext &ctx);
0102 void codegenImpl(RooLognormal &arg, CodegenContext &ctx);
0103 void codegenImpl(RooMultiVarGaussian &arg, CodegenContext &ctx);
0104 void codegenImpl(RooParamHistFunc &arg, CodegenContext &ctx);
0105 void codegenImpl(RooPoisson &arg, CodegenContext &ctx);
0106 void codegenImpl(RooPolyVar &arg, CodegenContext &ctx);
0107 void codegenImpl(RooPolynomial &arg, CodegenContext &ctx);
0108 void codegenImpl(RooProduct &arg, CodegenContext &ctx);
0109 void codegenImpl(RooRatio &arg, CodegenContext &ctx);
0110 void codegenImpl(RooRealIntegral &arg, CodegenContext &ctx);
0111 void codegenImpl(RooRealSumFunc &arg, CodegenContext &ctx);
0112 void codegenImpl(RooRealSumPdf &arg, CodegenContext &ctx);
0113 void codegenImpl(RooRealVar &arg, CodegenContext &ctx);
0114 void codegenImpl(RooRecursiveFraction &arg, CodegenContext &ctx);
0115 void codegenImpl(RooStats::HistFactory::FlexibleInterpVar &arg, CodegenContext &ctx);
0116 void codegenImpl(RooUniform &arg, CodegenContext &ctx);
0117 void codegenImpl(RooWrapperPdf &arg, CodegenContext &ctx);
0118 
0119 std::string codegenIntegralImpl(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx);
0120 std::string codegenIntegralImpl(RooBernstein &arg, int code, const char *rangeName, CodegenContext &ctx);
0121 std::string codegenIntegralImpl(RooBifurGauss &arg, int code, const char *rangeName, CodegenContext &ctx);
0122 std::string codegenIntegralImpl(RooCBShape &arg, int code, const char *rangeName, CodegenContext &ctx);
0123 std::string codegenIntegralImpl(RooChebychev &arg, int code, const char *rangeName, CodegenContext &ctx);
0124 std::string codegenIntegralImpl(RooEfficiency &arg, int code, const char *rangeName, CodegenContext &ctx);
0125 std::string codegenIntegralImpl(RooExponential &arg, int code, const char *rangeName, CodegenContext &ctx);
0126 std::string codegenIntegralImpl(RooGamma &arg, int code, const char *rangeName, CodegenContext &ctx);
0127 std::string codegenIntegralImpl(RooGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
0128 std::string codegenIntegralImpl(RooHistFunc &arg, int code, const char *rangeName, CodegenContext &ctx);
0129 std::string codegenIntegralImpl(RooHistPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
0130 std::string codegenIntegralImpl(RooLandau &arg, int code, const char *rangeName, CodegenContext &ctx);
0131 std::string codegenIntegralImpl(RooLognormal &arg, int code, const char *rangeName, CodegenContext &ctx);
0132 std::string codegenIntegralImpl(RooMultiVarGaussian &arg, int code, const char *rangeName, CodegenContext &ctx);
0133 std::string codegenIntegralImpl(RooPoisson &arg, int code, const char *rangeName, CodegenContext &ctx);
0134 std::string codegenIntegralImpl(RooPolyVar &arg, int code, const char *rangeName, CodegenContext &ctx);
0135 std::string codegenIntegralImpl(RooPolynomial &arg, int code, const char *rangeName, CodegenContext &ctx);
0136 std::string codegenIntegralImpl(RooRealSumPdf &arg, int code, const char *rangeName, CodegenContext &ctx);
0137 std::string codegenIntegralImpl(RooUniform &arg, int code, const char *rangeName, CodegenContext &ctx);
0138 
0139 template <class Arg_t, int P>
0140 std::string codegenIntegralImpl(Arg_t &arg, int code, const char *rangeName, CodegenContext &ctx, Prio<P> p)
0141 {
0142    if constexpr (std::is_same<Prio<P>, PrioLowest>::value) {
0143       return codegenIntegralImpl(arg, code, rangeName, ctx);
0144    } else {
0145       return codegenIntegralImpl(arg, code, rangeName, ctx, p.next());
0146    }
0147 }
0148 
0149 template <class Arg_t>
0150 struct CodegenIntegralImplCaller {
0151 
0152    static auto call(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)
0153    {
0154       return codegenIntegralImpl(static_cast<Arg_t &>(arg), code, rangeName, ctx, PrioHighest{});
0155    }
0156 };
0157 
0158 } // namespace Experimental
0159 } // namespace RooFit
0160 
0161 #endif