Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooBifurGauss.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitModels *
4 * @(#)root/roofit:$Id$
5 * Authors: *
6 * Abi Soffer, Colorado State University, abi@slac.stanford.edu *
7 * *
8 * Copyright (c) 2000-2005, Regents of the University of California, *
9 * Colorado State University *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/** \class RooBifurGauss
18 \ingroup Roofit
19
20Bifurcated Gaussian p.d.f with different widths on left and right
21side of maximum value.
22**/
23
24#include <RooBifurGauss.h>
25
26#include "RooBatchCompute.h"
27
29
30
31////////////////////////////////////////////////////////////////////////////////
32
33RooBifurGauss::RooBifurGauss(const char *name, const char *title, RooAbsReal &_x, RooAbsReal &_mean,
34 RooAbsReal &_sigmaL, RooAbsReal &_sigmaR)
35 : RooAbsPdf(name, title),
36 x("x", "Dependent", this, _x),
37 mean("mean", "Mean", this, _mean),
38 sigmaL("sigmaL", "Left Sigma", this, _sigmaL),
39 sigmaR("sigmaR", "Right Sigma", this, _sigmaR)
40
41{
42}
43
44////////////////////////////////////////////////////////////////////////////////
45
48 x("x", this, other.x),
49 mean("mean", this, other.mean),
50 sigmaL("sigmaL", this, other.sigmaL),
51 sigmaR("sigmaR", this, other.sigmaR)
52{
53}
54
55////////////////////////////////////////////////////////////////////////////////
56
61
62////////////////////////////////////////////////////////////////////////////////
63/// Compute multiple values of BifurGauss distribution.
65{
67 {ctx.at(x),ctx.at(mean),ctx.at(sigmaL),ctx.at(sigmaR)});
68}
69
70////////////////////////////////////////////////////////////////////////////////
71
72Int_t RooBifurGauss::getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char * /*rangeName*/) const
73{
74 if (matchArgs(allVars, analVars, x))
75 return 1;
76 if (matchArgs(allVars, analVars, mean))
77 return 2;
78 return 0;
79}
80
81////////////////////////////////////////////////////////////////////////////////
82
83double RooBifurGauss::analyticalIntegral(Int_t code, const char *rangeName) const
84{
85 auto &constant = code == 1 ? mean : x;
86 auto &integrand = code == 1 ? x : mean;
87
88 return RooFit::Detail::MathFuncs::bifurGaussIntegral(integrand.min(rangeName), integrand.max(rangeName),
90}
char name[80]
Definition TGX11.cxx:110
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Bifurcated Gaussian p.d.f with different widths on left and right side of maximum value.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
void doEval(RooFit::EvalContext &) const override
Compute multiple values of BifurGauss distribution.
RooRealProxy mean
RooRealProxy sigmaL
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
RooRealProxy sigmaR
RooRealProxy x
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
std::span< double > output()
RooBatchCompute::Config config(RooAbsArg const *arg) const
Double_t x[n]
Definition legend1.C:17
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})
double bifurGaussIntegral(double xMin, double xMax, double mean, double sigmaL, double sigmaR)
Definition MathFuncs.h:480
double bifurGauss(double x, double mean, double sigmaL, double sigmaR)
Definition MathFuncs.h:107