Logo ROOT  
Reference Guide
 
Loading...
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 *
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()
25 {
26 // In the future, it should better do this:
27 // return std::numeric_limits<double>::infinity();
28
29 // This assumes a well behaved IEEE-754 floating point implementation.
30 // The next line may generate a compiler warning that can be ignored.
31 return 1.0e30; // 1./0.;
32 }
33 /// Return true if x is infinite by RooNumber internal specification.
34 constexpr static int isInfinite(double x) { return (x >= +infinity()) ? +1 : ((x <= -infinity()) ? -1 : 0); }
35
36 /// Set the relative epsilon that is used by range checks in RooFit,
37 /// e.g., in RooAbsRealLValue::inRange().
38 inline static void setRangeEpsRel(double epsRel) { staticRangeEpsRel() = epsRel; }
39 /// Get the relative epsilon that is used by range checks in RooFit,
40 /// e.g., in RooAbsRealLValue::inRange().
41 inline static double rangeEpsRel() { return staticRangeEpsRel(); }
42
43 /// Set the absolute epsilon that is used by range checks in RooFit,
44 /// e.g., in RooAbsRealLValue::inRange().
45 inline static void setRangeEpsAbs(double epsRel) { staticRangeEpsAbs() = epsRel; }
46 /// Get the absolute epsilon that is used by range checks in RooFit,
47 /// e.g., in RooAbsRealLValue::inRange().
48 inline static double rangeEpsAbs() { return staticRangeEpsAbs(); }
49
50private:
51 static double &staticRangeEpsRel();
52 static double &staticRangeEpsAbs();
53};
54
55#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:41
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:48
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
Definition RooNumber.h:34
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:38
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:45
Double_t x[n]
Definition legend1.C:17