ROOT   Reference Guide
Searching...
No Matches
RooNumber.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooNumber.h,v 1.7 2007/05/11 09:11:30 verkerke Exp$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
15 *****************************************************************************/
16#ifndef ROO_NUMBER
17#define ROO_NUMBER
18
19#include <limits>
20#include <string>
21
22class RooNumber {
23public:
24 /// Return internal infinity representation.
25 constexpr static double infinity() { return std::numeric_limits<double>::infinity(); }
26 /// Return true if x is infinite by RooNumber internal specification.
27 constexpr static int isInfinite(double x) { return (x >= +infinity()) ? +1 : ((x <= -infinity()) ? -1 : 0); }
28
29 /// Set the relative epsilon that is used by range checks in RooFit,
30 /// e.g., in RooAbsRealLValue::inRange().
31 inline static void setRangeEpsRel(double epsRel) { staticRangeEpsRel() = epsRel; }
32 /// Get the relative epsilon that is used by range checks in RooFit,
33 /// e.g., in RooAbsRealLValue::inRange().
34 inline static double rangeEpsRel() { return staticRangeEpsRel(); }
35
36 /// Set the absolute epsilon that is used by range checks in RooFit,
37 /// e.g., in RooAbsRealLValue::inRange().
38 inline static void setRangeEpsAbs(double epsRel) { staticRangeEpsAbs() = epsRel; }
39 /// Get the absolute epsilon that is used by range checks in RooFit,
40 /// e.g., in RooAbsRealLValue::inRange().
41 inline static double rangeEpsAbs() { return staticRangeEpsAbs(); }
42 static std::string toString(double x);
43
44private:
45 static double &staticRangeEpsRel();
46 static double &staticRangeEpsAbs();
47};
48
49#endif
Provides numeric constants used in RooFit.
Definition RooNumber.h:22
static double rangeEpsRel()
Get the relative epsilon that is used by range checks in RooFit, e.g., in RooAbsRealLValue::inRange()...
Definition RooNumber.h:34
static double & staticRangeEpsRel()
Definition RooNumber.cxx:40
static constexpr double infinity()
Return internal infinity representation.
Definition RooNumber.h:25
static double rangeEpsAbs()
Get the absolute epsilon that is used by range checks in RooFit, e.g., in RooAbsRealLValue::inRange()...
Definition RooNumber.h:41
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
Definition RooNumber.h:27
static void setRangeEpsRel(double epsRel)
Set the relative epsilon that is used by range checks in RooFit, e.g., in RooAbsRealLValue::inRange()...
Definition RooNumber.h:31
static double & staticRangeEpsAbs()
Definition RooNumber.cxx:46
static std::string toString(double x)
Returns an std::to_string compatible number (i.e.
Definition RooNumber.cxx:31
static void setRangeEpsAbs(double epsRel)
Set the absolute epsilon that is used by range checks in RooFit, e.g., in RooAbsRealLValue::inRange()...
Definition RooNumber.h:38
Double_t x[n]
Definition legend1.C:17