forked from GooFit/GooFit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Variable.cc
98 lines (90 loc) · 1.99 KB
/
Variable.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "Variable.hh"
#include <cmath>
Variable::Variable (std::string n)
: Indexable(n)
, numbins(100)
, fixed(false)
, dominos(false)
, blind(0)
, error(0.0)
, error_pos(0.0)
, lowerlimit(0.0)
, upperlimit(0.0)
, error_neg(0.0)
, gcc(0.0)
{
}
Variable::Variable (std::string n, fptype v)
: Indexable(n, v)
, error(0.002)
, error_pos(0.0)
, error_neg(0.0)
, gcc(0.0)
, lowerlimit(v - 0.01)
, upperlimit(v + 0.01)
, numbins(100)
, fixed(true)
, dominos(false)
, blind(0)
{
}
Variable::Variable (std::string n, fptype dn, fptype up)
: Indexable(n)
, upperlimit(up)
, lowerlimit(dn)
, numbins(100)
, fixed(false)
, dominos(false)
, blind(0)
, error_pos(0.0)
, error_neg(0.0)
, gcc(0.0)
, error(0.0)
{
}
Variable::Variable (std::string n, fptype v, fptype dn, fptype up)
: Indexable(n, v)
, error(0.1*(up-dn))
, error_pos(0.0)
, error_neg(0.0)
, gcc(0.0)
, upperlimit(up)
, lowerlimit(dn)
, numbins(100)
, fixed(false)
, dominos(false)
, blind(0)
{
}
Variable::Variable (std::string n, fptype v, fptype e, fptype dn, fptype up)
: Indexable(n, v)
, error(e)
, error_pos(0.0)
, error_neg(0.0)
, gcc(0.0)
, upperlimit(up)
, lowerlimit(dn)
, numbins(100)
, fixed(false)
, dominos(false)
, blind(0)
{
}
Variable::~Variable () {
}
std::ostream& operator<<(std::ostream &oss, const Variable &var)
{
oss << "Variable with:" << std::endl
<< "\tname = " << var.name << std::endl
<< "\tvalue = " << var.value << std::endl
<< "\terror = " << var.error << std::endl
<< "\terror_neg = " << var.error_neg << std::endl
<< "\terror_pos = " << var.error_pos << std::endl
<< "\tlowerlimit = " << var.lowerlimit << std::endl
<< "\tupperlimit = " << var.upperlimit << std::endl
<< "\tnumbins = " << var.numbins << std::endl
<< "\tindex = " << var.index << std::endl
<< "\tdominos = " << (var.dominos ? "true" : "false") << std::endl
<< "\tfixed = " << (var.fixed ? "true" : "false") << std::endl;
return oss;
}