Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooRatio.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Author:
4 * Rahul Balasubramanian, Nikhef 01 Apr 2021
5 *
6 * Copyright (c) 2023, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef RooFit_RooRatio_h
14#define RooFit_RooRatio_h
15
16#include <RooAbsReal.h>
17#include <RooRealProxy.h>
18
19class RooArgList;
20
21class RooRatio : public RooAbsReal {
22public:
23 RooRatio();
24 RooRatio(const char *name, const char *title, double numerator, double denominator);
25 RooRatio(const char *name, const char *title, double numerator, RooAbsReal &denominator);
26 RooRatio(const char *name, const char *title, RooAbsReal &numerator, double denominator);
27 RooRatio(const char *name, const char *title, RooAbsReal &numerator, RooAbsReal &denominator);
28 RooRatio(const char *name, const char *title, const RooArgList &num, const RooArgList &denom);
29
30 RooRatio(const RooRatio &other, const char *name = nullptr);
31 TObject *clone(const char *newname) const override { return new RooRatio(*this, newname); }
32 ~RooRatio() override;
33
34protected:
35 double evaluate() const override;
36 void computeBatch(double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override;
37 inline bool canComputeBatchWithCuda() const override { return true; }
38
39 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
40
43
44 ClassDefOverride(RooRatio, 2) // Ratio of two RooAbsReal and/or numbers
45};
46
47#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
A class to maintain the context for squashing of RooFit models into code.
Represents the ratio of two RooAbsReal objects.
Definition RooRatio.h:21
void computeBatch(double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override
Evaluate in batch mode.
Definition RooRatio.cxx:121
RooRealProxy _numerator
Definition RooRatio.h:41
~RooRatio() override
Definition RooRatio.cxx:101
void translate(RooFit::Detail::CodeSquashContext &ctx) const override
This function defines a translation for each RooAbsReal based object that can be used to express the ...
Definition RooRatio.cxx:127
bool canComputeBatchWithCuda() const override
Definition RooRatio.h:37
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition RooRatio.cxx:114
TObject * clone(const char *newname) const override
Definition RooRatio.h:31
RooRealProxy _denominator
Definition RooRatio.h:42
Mother of all ROOT objects.
Definition TObject.h:41
static void output()