Logo ROOT   6.16/01
Reference Guide
MyPdfV3.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * *
4 * This code was autogenerated by RooClassFactory *
5 *****************************************************************************/
6
7// Your description goes here...
8
9#include "Riostream.h"
10
11#include "MyPdfV3.h"
12#include "RooAbsReal.h"
13#include "RooAbsCategory.h"
14#include <math.h>
15#include "TMath.h"
16
18
19 MyPdfV3::MyPdfV3(const char *name, const char *title,
20 RooAbsReal& _x,
21 RooAbsReal& _A,
22 RooAbsReal& _B) :
23 RooAbsPdf(name,title),
24 x("x","x",this,_x),
25 A("A","A",this,_A),
26 B("B","B",this,_B)
27 {
28 }
29
30
31 MyPdfV3::MyPdfV3(const MyPdfV3& other, const char* name) :
32 RooAbsPdf(other,name),
33 x("x",this,other.x),
34 A("A",this,other.A),
35 B("B",this,other.B)
36 {
37 }
38
39
40
42 {
43 // ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
44 return A*fabs(x)+pow(x-B,2) ;
45 }
46
47
48
49 Int_t MyPdfV3::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
50 {
51 // LIST HERE OVER WHICH VARIABLES ANALYTICAL INTEGRATION IS SUPPORTED,
52 // ASSIGN A NUMERIC CODE FOR EACH SUPPORTED (SET OF) PARAMETERS
53 // THE EXAMPLE BELOW ASSIGNS CODE 1 TO INTEGRATION OVER VARIABLE X
54 // YOU CAN ALSO IMPLEMENT MORE THAN ONE ANALYTICAL INTEGRAL BY REPEATING THE matchArgs
55 // EXPRESSION MULTIPLE TIMES
56
57 if (matchArgs(allVars,analVars,x)) return 1 ;
58 return 0 ;
59 }
60
61
62
63 Double_t MyPdfV3::analyticalIntegral(Int_t code, const char* rangeName) const
64 {
65 // RETURN ANALYTICAL INTEGRAL DEFINED BY RETURN CODE ASSIGNED BY getAnalyticalIntegral
66 // THE MEMBER FUNCTION x.min(rangeName) AND x.max(rangeName) WILL RETURN THE INTEGRATION
67 // BOUNDARIES FOR EACH OBSERVABLE x
68
69 if (code==1) { return ((A/2)*(pow(x.max(rangeName),2)+pow(x.min(rangeName),2))+(1./3)*(pow(x.max(rangeName)-B,3)-pow(x.min(rangeName)-B,3))) ; }
70 return 0 ;
71 }
72
73
74
int Int_t
Definition: RtypesCore.h:41
double Double_t
Definition: RtypesCore.h:55
#define ClassImp(name)
Definition: Rtypes.h:363
double pow(double, double)
RooRealProxy x
Definition: MyPdfV3.h:32
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition: MyPdfV3.cxx:41
MyPdfV3()
Definition: MyPdfV3.h:18
RooRealProxy B
Definition: MyPdfV3.h:34
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Definition: MyPdfV3.cxx:63
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Definition: MyPdfV3.cxx:49
RooRealProxy A
Definition: MyPdfV3.h:33
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
Bool_t 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:28
Double_t min(const char *rname=0) const
Definition: RooRealProxy.h:56
Double_t max(const char *rname=0) const
Definition: RooRealProxy.h:57
Double_t x[n]
Definition: legend1.C:17
static double B[]
static double A[]
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)