Logo ROOT  
Reference Guide
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 *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_NUMBER
17#define ROO_NUMBER
18
19#include <limits>
20
21class RooNumber {
22public:
23 /// Return internal infinity representation.
24 constexpr static double infinity() { return std::numeric_limits<double>::infinity(); }
25 /// Return true if x is infinite by RooNumber internal specification.
26 constexpr static int isInfinite(double x) { return (x >= +infinity()) ? +1 : ((x <= -infinity()) ? -1 : 0); }
27
28 /// Set the relative epsilon that is used by range checks in RooFit,
29 /// e.g., in RooAbsRealLValue::inRange().
30 inline static void setRangeEpsRel(double epsRel) { staticRangeEpsRel() = epsRel; }
31 /// Get the relative epsilon that is used by range checks in RooFit,
32 /// e.g., in RooAbsRealLValue::inRange().
33 inline static double rangeEpsRel() { return staticRangeEpsRel(); }
34
35 /// Set the absolute epsilon that is used by range checks in RooFit,
36 /// e.g., in RooAbsRealLValue::inRange().
37 inline static void setRangeEpsAbs(double epsRel) { staticRangeEpsAbs() = epsRel; }
38 /// Get the absolute epsilon that is used by range checks in RooFit,
39 /// e.g., in RooAbsRealLValue::inRange().
40 inline static double rangeEpsAbs() { return staticRangeEpsAbs(); }
41
42private:
43 static double &staticRangeEpsRel();
44 static double &staticRangeEpsAbs();
45};
46
47#endif
Class RooNumber implements numeric constants used by RooFit.
Definition: RooNumber.h:21
static double rangeEpsRel()
Get the relative epsilon that is used by range checks in RooFit, e.g., in RooAbsRealLValue::inRange()...
Definition: RooNumber.h:33
static double & staticRangeEpsRel()
Definition: RooNumber.cxx:27
static constexpr double infinity()
Return internal infinity representation.
Definition: RooNumber.h:24
static double rangeEpsAbs()
Get the absolute epsilon that is used by range checks in RooFit, e.g., in RooAbsRealLValue::inRange()...
Definition: RooNumber.h:40
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
Definition: RooNumber.h:26
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:30
static double & staticRangeEpsAbs()
Definition: RooNumber.cxx:33
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:37
Double_t x[n]
Definition: legend1.C:17