31 std::shared_ptr<fptype>
lowerlimit{std::make_shared<fptype>(0)};
34 std::shared_ptr<fptype>
upperlimit{std::make_shared<fptype>(0)};
37 std::shared_ptr<int>
index{std::make_shared<int>(-1)};
47 , lowerlimit(
std::make_shared<
fptype>(lowerlimit))
48 , upperlimit(
std::make_shared<
fptype>(upperlimit)) {}
53 if(value.use_count() == 1)
103 operator bool()
const {
114 std::shared_ptr<size_t> numbins{std::make_shared<size_t>(100)};
117 bool is_event_number{
false};
169 , error(
std::make_shared<
fptype>(0.002)) {
176 , error(
std::make_shared<
fptype>(0.1 * (up - dn))) {}
182 , fixed(
std::make_shared<bool>(fix)) {}
227 std::shared_ptr<fptype> blind{std::make_shared<fptype>(0)};
230 std::shared_ptr<bool> changed_{std::make_shared<bool>(
true)};
233 std::shared_ptr<bool> fixed{std::make_shared<bool>(
false)};
236 std::shared_ptr<int> fitter_index{std::make_shared<int>(-1)};
244 static constexpr
fptype maxint{1L << std::numeric_limits<fptype>::digits};
248 is_event_number =
true;
264 int max_index(
const std::vector<Variable> &vars);
265 int max_index(
const std::vector<Observable> &vars);
bool operator!=(const Indexable &other) const
Support for comparison - only if really the same object, not just the same value. ...
void setFitterIndex(int value)
Set the index (should be done by the fitter)
fptype getBinSize() const
Get the bin size, (upper-lower) / bins.
void setFixed(bool fix)
Set the fixedness of a variable.
void setNumBins(size_t num)
Set the number of bins.
bool operator<(const Indexable &other) const
Support for using as key in map - Notice this does NOT sort by index!
bool isEventNumber() const
Check to see if this is an event number.
int getFitterIndex() const
Get the index from the fitter.
const Variable & operator=(const fptype &val)
Support var = 3.
void setIndex(int value)
Set the GooFit index.
const EventNumber & operator=(const fptype &val)
Support var = 3.
bool getChanged() const
Check to see if the value has changed this iteration (always true the first time) ...
std::shared_ptr< fptype > value
The value of the variable.
void setValue(fptype val)
Set the value.
bool operator==(const Indexable &other) const
Support for comparison - only if really the same object, not just the same value. ...
Special class for observables. Used in DataSets.
std::shared_ptr< int > index
The goofit index, -1 if unset.
EventNumber(std::string name, fptype min=0, fptype max=EventNumber::maxint)
size_t getNumBins() const
Get the number of bins.
Observable(std::string name, fptype lowerlimit, fptype upperlimit)
std::shared_ptr< fptype > lowerlimit
The lower limit.
void setUpperLimit(fptype val)
Set the upper limit.
std::string name
The variable name. Should be unique.
#define GOOFIT_DEBUG(...)
Variable(std::string n, fptype v, fptype dn, fptype up)
This is a normal variable, with value and upper/lower limits.
int max_fitter_index(const std::vector< Variable > &vars)
Get the max fitter index of a variable from a list.
const Observable & operator=(const fptype &val)
Support var = 3.
const Indexable & operator=(const fptype &val)
Support var = 3.
void setChanged(bool val=true)
Check to see if this has been changed since last iteration.
int getIndex() const
Get the GooFit index.
fptype getLowerLimit() const
Get the lower limit.
int max_index(const std::vector< Variable > &vars)
Get the max index of a variable from a list.
fptype getValue() const
Get the value.
Variable(std::string n, fptype v, fptype e, fptype dn, fptype up, bool fix=false)
This is a full variable with error scale as well (Fix added to allow single interface to fixed/free v...
fptype getUpperLimit() const
Get the upper limit.
Indexable(std::string n, fptype val=0)
void setBlind(fptype val)
Hides the number; the real value is the result minus this value. Cannot be retreived once set...
static constexpr fptype maxint
bool IsFixed() const
Check to see if this is a constant.
std::istream & operator>>(std::istream &i, GooFit::Observable &var)
Allow Observable to be read in.
Indexable & operator=(const Indexable &)=delete
std::shared_ptr< fptype > error
The error.
void setError(fptype val)
Set the error.
std::ostream & operator<<(std::ostream &stream, Uncertain value)
Simple << output.
Indexable(std::string n, fptype val, fptype lowerlimit, fptype upperlimit)
void setLowerLimit(fptype val)
Set the lower limit.
Variable(std::string n, fptype v)
This is a constant variable.
This provides a key for some special classes to access blind info (passkey)
std::shared_ptr< fptype > upperlimit
The upper limit.
fptype getError() const
Get the error.
fptype getBlind(const Key &)
Protected by special locked key, only a few classes have access to create a Key.
const std::string & getName() const
Get the name.