cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
N/A
Central exclusive processes event generator
Toggle main menu visibility
Main Page
Related Pages
Packages
Package List
Package Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
x
y
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
x
y
Variables
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
b
c
d
e
g
h
i
l
m
n
p
r
t
u
w
x
y
z
Related Symbols
d
g
h
o
u
v
Files
File List
File Members
All
_
a
b
c
d
e
h
o
p
r
s
Functions
Variables
Macros
_
b
c
d
e
p
r
s
▼
CepGen
Reference manual
Bibliography
►
Packages
►
Classes
▼
Files
▼
File List
▼
include
▼
CepGen
►
Cards
►
Core
►
Event
►
EventFilter
►
FormFactors
►
Integration
►
Modules
►
PartonFluxes
►
Physics
►
Process
►
StructureFunctions
▼
Utils
►
AbortHandler.h
►
Algebra.h
►
ArgumentsParser.h
►
Caller.h
►
Collections.h
►
Derivator.h
►
DocumentationGenerator.h
►
Drawable.h
►
Drawer.h
►
Environment.h
►
EventUtils.h
►
Filesystem.h
►
Functional.h
►
FunctionWrapper.h
►
Graph.h
►
GridDrawer.h
►
GridHandler.h
►
GSLFunctionWrapper.h
►
GSLMonteFunctionWrapper.h
►
Hasher.h
►
Histogram.h
►
Limits.h
►
Logger.h
►
Math.h
►
Message.h
►
Piper.h
►
ProcessVariablesAnalyser.h
►
ProgressBar.h
►
RandomGenerator.h
►
StreamCollector.h
►
String.h
►
Test.h
►
TimeKeeper.h
►
Timer.h
►
Value.h
►
Generator.h
►
Version.h
►
CepGenBoost
►
CepGenHepMC2
►
CepGenHepMC3
►
CepGenHerwig6
►
CepGenMadGraph
►
CepGenPythia6
►
CepGenPythia8
►
CepGenPython
►
CepGenRoot
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
Limits.h
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2018-2024 Laurent Forthomme
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef CepGen_Utils_Limits_h
20
#define CepGen_Utils_Limits_h
21
22
#include <iosfwd>
23
#include <utility>
24
#include <vector>
25
26
namespace
cepgen
{
28
class
Limits
:
private
std::pair<double, double> {
29
public
:
30
Limits
(
double
min
=
INVALID
,
double
max
=
INVALID
);
31
Limits
(
const
Limits
&);
32
33
static
Limits
constant
(
double
);
34
35
bool
operator<
(
const
Limits
&)
const
;
36
Limits
operator-
()
const
;
37
Limits
&
operator=
(
const
Limits
&) =
default
;
39
inline
bool
operator==
(
const
Limits
& oth)
const
{
return
*
this
==
static_cast<
std::pair<double, double>
>
(oth); }
40
inline
bool
operator!=
(
const
Limits
& oth)
const
{
return
!
operator==
(oth); }
41
Limits
&
operator+=
(
double
);
42
Limits
&
operator-=
(
double
);
43
Limits
&
operator*=
(
double
);
44
friend
Limits
operator+
(
Limits
,
double
);
45
friend
Limits
operator-
(
Limits
,
double
);
46
friend
Limits
operator*
(
Limits
,
double
);
47
friend
double
operator/
(
double
,
const
Limits
&);
48
49
Limits
&
validate
();
50
51
bool
hasMin
()
const
;
52
bool
hasMax
()
const
;
53
inline
double
min
()
const
{
return
first; }
54
inline
double
&
min
() {
return
first; }
55
inline
double
max
()
const
{
return
second; }
56
inline
double
&
max
() {
return
second; }
57
58
double
x
(
double
v)
const
;
59
void
in
(
double
low,
double
up);
60
double
range
()
const
;
61
62
Limits
truncate
(
const
Limits
&)
const
;
63
double
trim
(
double
)
const
;
64
bool
contains
(
double
val,
bool
exclude_boundaries =
false
)
const
;
65
Limits
&
apply
(
double
(*)(
double
));
66
67
Limits
compute
(
double
(*)(
double
))
const
;
69
template
<
typename
F>
70
inline
Limits
compute
(
const
F& op)
const
{
71
return
Limits
{
hasMin
() ? op(
min
()) :
INVALID
,
hasMax
() ? op(
max
()) :
INVALID
};
72
}
70
inline
Limits
compute
(
const
F& op)
const
{
…
}
73
bool
valid
()
const
;
74
inline
const
std::pair<double, double>&
raw
()
const
{
return
*
this
; }
75
79
std::vector<double>
generate
(
size_t
num_bins,
bool
log_scale =
false
)
const
;
83
std::vector<Limits>
split
(
size_t
num_bins,
bool
log_scale =
false
)
const
;
84
85
friend
std::ostream&
operator<<
(std::ostream&,
const
Limits
&);
86
87
static
constexpr
double
INVALID
= -999.999;
88
};
89
}
// namespace cepgen
90
91
#endif
79
std::vector<double>
generate
(
size_t
num_bins,
bool
log_scale =
false
)
const
; {
…
}
58
double
x
(
double
v)
const
; {
…
}
56
inline
double
&
max
() {
return
second; } {
…
}
55
inline
double
max
()
const
{
return
second; } {
…
}
54
inline
double
&
min
() {
return
first; } {
…
}
41
Limits
&
operator+=
(
double
); {
…
}
28
class
Limits
:
private
std::pair<double, double> {
…
};
cepgen::Limits
Validity interval for a variable.
Definition
Limits.h:28
cepgen::Limits::apply
Limits & apply(double(*)(double))
Apply an operator on limits boundaries.
cepgen::Limits::split
std::vector< Limits > split(size_t num_bins, bool log_scale=false) const
Split the limits into sub-limits objects.
cepgen::Limits::x
double x(double v) const
Find the [0,1] value scaled between minimum and maximum.
cepgen::Limits::operator+=
Limits & operator+=(double)
Add a constant to this limit.
cepgen::Limits::operator==
bool operator==(const Limits &oth) const
Definition
Limits.h:39
cepgen::Limits::operator!=
bool operator!=(const Limits &oth) const
Inequality operator.
Definition
Limits.h:40
cepgen::Limits::max
double & max()
Upper limit to apply on the variable.
Definition
Limits.h:56
cepgen::Limits::operator<
bool operator<(const Limits &) const
Comparison operator.
cepgen::Limits::valid
bool valid() const
Is there a lower and upper limit?
cepgen::Limits::operator*
friend Limits operator*(Limits, double)
Multiply a limit by a constant.
cepgen::Limits::INVALID
static constexpr double INVALID
Invalid value placeholder (single-edged or invalid limits)
Definition
Limits.h:87
cepgen::Limits::constant
static Limits constant(double)
Build dimension-0 limits (constant)
cepgen::Limits::generate
std::vector< double > generate(size_t num_bins, bool log_scale=false) const
Generate a collection of values from a number of bins.
cepgen::Limits::operator-
Limits operator-() const
Invert this limit.
cepgen::Limits::range
double range() const
Full variable range allowed.
cepgen::Limits::operator/
friend double operator/(double, const Limits &)
Find the [0,1] fraction of range.
cepgen::Limits::hasMin
bool hasMin() const
Have a lower limit?
cepgen::Limits::hasMax
bool hasMax() const
Have an upper limit?
cepgen::Limits::operator*=
Limits & operator*=(double)
Multiply this limit by a constant.
cepgen::Limits::Limits
Limits(const Limits &)
Copy constructor.
cepgen::Limits::operator-
friend Limits operator-(Limits, double)
Subtract a constant to a limit.
cepgen::Limits::operator+
friend Limits operator+(Limits, double)
Add a constant to a limit.
cepgen::Limits::min
double min() const
Lower limit to apply on the variable.
Definition
Limits.h:53
cepgen::Limits::operator<<
friend std::ostream & operator<<(std::ostream &, const Limits &)
Human-readable expression of the limits.
cepgen::Limits::compute
Limits compute(double(*)(double)) const
Compute a copy of limits with an operator applied on boundaries Compute a copy of limits with an oper...
cepgen::Limits::trim
double trim(double) const
Limit a value to boundaries.
cepgen::Limits::operator-=
Limits & operator-=(double)
Subtract a constant to this limit.
cepgen::Limits::min
double & min()
Lower limit to apply on the variable.
Definition
Limits.h:54
cepgen::Limits::truncate
Limits truncate(const Limits &) const
Truncate limits to minimal/maximal values.
cepgen::Limits::validate
Limits & validate()
Ensure the limit object is valid by correcting it if necessary.
cepgen::Limits::contains
bool contains(double val, bool exclude_boundaries=false) const
Check if value is inside limits' boundaries.
cepgen::Limits::Limits
Limits(double min=INVALID, double max=INVALID)
Define lower and upper limits on a quantity.
cepgen::Limits::compute
Limits compute(const F &op) const
Definition
Limits.h:70
cepgen::Limits::raw
const std::pair< double, double > & raw() const
Raw value of limits.
Definition
Limits.h:74
cepgen::Limits::max
double max() const
Upper limit to apply on the variable.
Definition
Limits.h:55
cepgen::Limits::operator=
Limits & operator=(const Limits &)=default
Assignment operator Equality operator.
cepgen::Limits::in
void in(double low, double up)
Specify the lower and upper limits on the variable.
cepgen
Common namespace for this Monte Carlo generator.
Definition
Handler.h:26
include
CepGen
Utils
Limits.h
Generated on Tue Apr 22 2025 for CepGen by
1.10.0