Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Heaviside.cxx
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Kevin Belasco, 2009
5 * Kyle Cranmer, 2009
6 *
7 * Copyright (c) 2023, CERN
8 *
9 * Redistribution and use in source and binary forms,
10 * with or without modification, are permitted according to the terms
11 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
12 */
13
14#include "RooStats/Heaviside.h"
15#include "RooAbsReal.h"
16
17/** \class RooStats::Heaviside
18 \ingroup Roostats
19
20Represents the Heaviside function.
21Evaluates to 1.0 when ((double)x) >= ((double)c), 0.0 otherwise.
22
23*/
24
25
26using namespace RooFit;
27using namespace RooStats;
28
29////////////////////////////////////////////////////////////////////////////////
30
31Heaviside::Heaviside(const char *name, const char *title,
32 RooAbsReal& _x,
33 RooAbsReal& _c) :
34 RooAbsReal(name,title),
35 x("x","x",this,_x),
36 c("c","c",this,_c)
37{
38}
39
40////////////////////////////////////////////////////////////////////////////////
41
44 x("x",this,other.x),
45 c("c",this,other.c)
46{
47}
48
49////////////////////////////////////////////////////////////////////////////////
50
51double Heaviside::evaluate() const
52{
53 // ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
54 if (((double)x) >= ((double)c)) {
55 return 1.0;
56 } else {
57 return 0.0;
58 }
59}
#define c(i)
Definition RSha256.hxx:101
char name[80]
Definition TGX11.cxx:110
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
Represents the Heaviside function.
Definition Heaviside.h:21
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition Heaviside.cxx:51
RooRealProxy c
Definition Heaviside.h:33
RooRealProxy x
Definition Heaviside.h:32
Double_t x[n]
Definition legend1.C:17
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:64
Namespace for the RooStats classes.
Definition CodegenImpl.h:58