CepGen 1.2.5
Central exclusive processes event generator
|
Validity interval for a variable. More...
#include <CepGen/Utils/Limits.h>
Public Member Functions | |
Limits (double min=INVALID, double max=INVALID) | |
Define lower and upper limits on a quantity. | |
Limits (const Limits &) | |
Copy constructor. | |
bool | operator< (const Limits &) const |
Comparison operator. | |
Limits | operator- () const |
Invert this limit. | |
Limits & | operator= (const Limits &)=default |
Assignment operator Equality operator. | |
bool | operator== (const Limits &oth) const |
bool | operator!= (const Limits &oth) const |
Inequality operator. | |
Limits & | operator+= (double) |
Add a constant to this limit. | |
Limits & | operator-= (double) |
Subtract a constant to this limit. | |
Limits & | operator*= (double) |
Multiply this limit by a constant. | |
Limits & | validate () |
Ensure the limit object is valid by correcting it if necessary. | |
bool | hasMin () const |
Have a lower limit? | |
bool | hasMax () const |
Have an upper limit? | |
double | min () const |
Lower limit to apply on the variable. | |
double & | min () |
Lower limit to apply on the variable. | |
double | max () const |
Upper limit to apply on the variable. | |
double & | max () |
Upper limit to apply on the variable. | |
double | x (double v) const |
Find the [0,1] value scaled between minimum and maximum. | |
void | in (double low, double up) |
Specify the lower and upper limits on the variable. | |
double | range () const |
Full variable range allowed. | |
Limits | truncate (const Limits &) const |
Truncate limits to minimal/maximal values. | |
double | trim (double) const |
Limit a value to boundaries. | |
bool | contains (double val, bool exclude_boundaries=false) const |
Check if value is inside limits' boundaries. | |
Limits & | apply (double(*)(double)) |
Apply an operator on limits boundaries. | |
Limits | compute (double(*)(double)) const |
Compute a copy of limits with an operator applied on boundaries Compute a copy of limits with an operator applied on boundaries. | |
template<typename F > | |
Limits | compute (const F &op) const |
bool | valid () const |
Is there a lower and upper limit? | |
const std::pair< double, double > & | raw () const |
Raw value of limits. | |
std::vector< double > | generate (size_t num_bins, bool log_scale=false) const |
Generate a collection of values from a number of bins. | |
std::vector< Limits > | split (size_t num_bins, bool log_scale=false) const |
Split the limits into sub-limits objects. | |
Static Public Member Functions | |
static Limits | constant (double) |
Build dimension-0 limits (constant) | |
Static Public Attributes | |
static constexpr double | INVALID = -999.999 |
Invalid value placeholder (single-edged or invalid limits) | |
Friends | |
Limits | operator+ (Limits, double) |
Add a constant to a limit. | |
Limits | operator- (Limits, double) |
Subtract a constant to a limit. | |
Limits | operator* (Limits, double) |
Multiply a limit by a constant. | |
std::ostream & | operator<< (std::ostream &, const Limits &) |
Human-readable expression of the limits. | |
Definition at line 26 of file Limits.cpp.
Definition at line 28 of file Limits.cpp.
Limits & apply | ( | double(*)(double) | op | ) |
Definition at line 147 of file Limits.cpp.
Limits compute | ( | double(*)(double) | op | ) | const |
Definition at line 152 of file Limits.cpp.
|
static |
Definition at line 30 of file Limits.cpp.
bool contains | ( | double | val, |
bool | exclude_boundaries = false |
||
) | const |
Definition at line 77 of file Limits.cpp.
std::vector< double > generate | ( | size_t | num_bins, |
bool | log_scale = false |
||
) | const |
[in] | num_bins | number of values to generate |
[in] | log_scale | generate according to a log10 scale? |
Definition at line 113 of file Limits.cpp.
bool hasMax | ( | ) | const |
Definition at line 75 of file Limits.cpp.
bool hasMin | ( | ) | const |
Definition at line 73 of file Limits.cpp.
void in | ( | double | low, |
double | up | ||
) |
Definition at line 60 of file Limits.cpp.
Limits & operator*= | ( | double | c | ) |
Definition at line 52 of file Limits.cpp.
Limits & operator+= | ( | double | c | ) |
Definition at line 40 of file Limits.cpp.
Limits operator- | ( | ) | const |
Definition at line 38 of file Limits.cpp.
Limits & operator-= | ( | double | c | ) |
Definition at line 46 of file Limits.cpp.
bool operator< | ( | const Limits & | oth | ) | const |
Definition at line 32 of file Limits.cpp.
double range | ( | ) | const |
Definition at line 65 of file Limits.cpp.
std::vector< Limits > split | ( | size_t | num_bins, |
bool | log_scale = false |
||
) | const |
[in] | num_bins | number of sub-limits to generate |
[in] | log_scale | generate according to a log10 scale? |
Definition at line 122 of file Limits.cpp.
double trim | ( | double | val | ) | const |
Definition at line 139 of file Limits.cpp.
Definition at line 130 of file Limits.cpp.
bool valid | ( | ) | const |
Definition at line 85 of file Limits.cpp.
Limits & validate | ( | ) |
Definition at line 91 of file Limits.cpp.
double x | ( | double | v | ) | const |
Definition at line 97 of file Limits.cpp.
Definition at line 176 of file Limits.cpp.
Definition at line 166 of file Limits.cpp.
Definition at line 171 of file Limits.cpp.
|
friend |
Definition at line 156 of file Limits.cpp.