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
26
27using namespace RooFit;
28using namespace RooStats;
29
30////////////////////////////////////////////////////////////////////////////////
31
32Heaviside::Heaviside(const char *name, const char *title,
33 RooAbsReal& _x,
34 RooAbsReal& _c) :
35 RooAbsReal(name,title),
36 x("x","x",this,_x),
37 c("c","c",this,_c)
38{
39}
40
41////////////////////////////////////////////////////////////////////////////////
42
43Heaviside::Heaviside(const Heaviside& other, const char* name) :
44 RooAbsReal(other,name),
45 x("x",this,other.x),
46 c("c",this,other.c)
47{
48}
49
50////////////////////////////////////////////////////////////////////////////////
51
52double Heaviside::evaluate() const
53{
54 // ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
55 if (((double)x) >= ((double)c)) {
56 return 1.0;
57 } else {
58 return 0.0;
59 }
60}
#define c(i)
Definition RSha256.hxx:101
#define ClassImp(name)
Definition Rtypes.h:377
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:52
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 JSONIO.h:26
Namespace for the RooStats classes.
Definition Asimov.h:19