GooFit  v2.1.3
Public Member Functions | Protected Attributes | Friends | List of all members
GooFit::Observable Class Reference

Special class for observables. Used in DataSets. More...

#include <Variable.h>

Inheritance diagram for GooFit::Observable:
GooFit::Indexable GooFit::EventNumber

Public Member Functions

 Observable (std::string name, fptype lowerlimit, fptype upperlimit)
 
 ~Observable () override=default
 
Observableoperator= (const Observable &)=delete
 
void setNumBins (size_t num)
 Set the number of bins. More...
 
size_t getNumBins () const
 Get the number of bins. More...
 
fptype getBinSize () const
 Get the bin size, (upper-lower) / bins. More...
 
bool isEventNumber () const
 Check to see if this is an event number. More...
 
const Observableoperator= (const fptype &val)
 Support var = 3. More...
 
- Public Member Functions inherited from GooFit::Indexable
 Indexable (std::string n, fptype val=0)
 
 Indexable (std::string n, fptype val, fptype lowerlimit, fptype upperlimit)
 
Indexableoperator= (const Indexable &)=delete
 
virtual ~Indexable ()
 
int getIndex () const
 Get the GooFit index. More...
 
void setIndex (int value)
 Set the GooFit index. More...
 
const std::string & getName () const
 Get the name. More...
 
fptype getValue () const
 Get the value. More...
 
void setValue (fptype val)
 Set the value. More...
 
fptype getUpperLimit () const
 Get the upper limit. More...
 
void setUpperLimit (fptype val)
 Set the upper limit. More...
 
fptype getLowerLimit () const
 Get the lower limit. More...
 
void setLowerLimit (fptype val)
 Set the lower limit. More...
 
const Indexableoperator= (const fptype &val)
 Support var = 3. More...
 
 operator fptype () const
 Support fptype val = var. More...
 
bool operator< (const Indexable &other) const
 Support for using as key in map - Notice this does NOT sort by index! More...
 
bool operator== (const Indexable &other) const
 Support for comparison - only if really the same object, not just the same value. More...
 
bool operator!= (const Indexable &other) const
 Support for comparison - only if really the same object, not just the same value. More...
 
 operator bool () const
 Check to see if in range. More...
 

Protected Attributes

std::shared_ptr< size_t > numbins {std::make_shared<size_t>(100)}
 The number of bins (mostly for BinnedData, or plotting help) More...
 
bool is_event_number {false}
 This identifies this as an EventNumber if copies are made. More...
 
- Protected Attributes inherited from GooFit::Indexable
std::string name
 The variable name. Should be unique. More...
 
std::shared_ptr< fptypevalue
 The value of the variable. More...
 
std::shared_ptr< fptypelowerlimit {std::make_shared<fptype>(0)}
 The lower limit. More...
 
std::shared_ptr< fptypeupperlimit {std::make_shared<fptype>(0)}
 The upper limit. More...
 
std::shared_ptr< int > index {std::make_shared<int>(-1)}
 The goofit index, -1 if unset. More...
 

Friends

std::istream & operator>> (std::istream &o, Observable &var)
 Allow Observable to be read in. More...
 

Detailed Description

Special class for observables. Used in DataSets.

Definition at line 109 of file Variable.h.

Constructor & Destructor Documentation

◆ Observable()

GooFit::Observable::Observable ( std::string  name,
fptype  lowerlimit,
fptype  upperlimit 
)
inline

Definition at line 120 of file Variable.h.

References GooFit::Indexable::operator=().

std::shared_ptr< fptype > lowerlimit
The lower limit.
Definition: Variable.h:31
std::string name
The variable name. Should be unique.
Definition: Variable.h:25
std::shared_ptr< fptype > upperlimit
The upper limit.
Definition: Variable.h:34

◆ ~Observable()

GooFit::Observable::~Observable ( )
overridedefault

Member Function Documentation

◆ getBinSize()

fptype GooFit::Observable::getBinSize ( ) const
inline

Get the bin size, (upper-lower) / bins.

Definition at line 133 of file Variable.h.

References GooFit::Indexable::getLowerLimit(), and GooFit::Indexable::getUpperLimit().

Referenced by GooFit::DalitzPlotter::DalitzPlotter(), GooFit::DalitzPlotter::fillDataSetMC(), GooFit::fillDataSetMC1D(), runEfficiencyFit(), and runSigmaFit().

133 { return (getUpperLimit() - getLowerLimit()) / getNumBins(); }
size_t getNumBins() const
Get the number of bins.
Definition: Variable.h:130
fptype getLowerLimit() const
Get the lower limit.
Definition: Variable.h:78
fptype getUpperLimit() const
Get the upper limit.
Definition: Variable.h:73

◆ getNumBins()

size_t GooFit::Observable::getNumBins ( ) const
inline

◆ isEventNumber()

bool GooFit::Observable::isEventNumber ( ) const
inline

Check to see if this is an event number.

Definition at line 136 of file Variable.h.

Referenced by GooFit::make_a_grid().

136 { return is_event_number; }
bool is_event_number
This identifies this as an EventNumber if copies are made.
Definition: Variable.h:117

◆ operator=() [1/2]

Observable& GooFit::Observable::operator= ( const Observable )
delete

◆ operator=() [2/2]

const Observable& GooFit::Observable::operator= ( const fptype val)
inline

Support var = 3.

Definition at line 139 of file Variable.h.

References GooFit::Indexable::setValue().

139  {
140  setValue(val);
141  return *this;
142  }
void setValue(fptype val)
Set the value.
Definition: Variable.h:70

◆ setNumBins()

void GooFit::Observable::setNumBins ( size_t  num)
inline

Set the number of bins.

Definition at line 128 of file Variable.h.

Referenced by main(), makeBkg3Eff(), makeFullFitVariables(), makeOverallSignal(), makeTimePlots(), runCanonicalFit(), runEfficiencyFit(), runGeneratedMCFit(), and runToyFit().

128 { *numbins = num; }
std::shared_ptr< size_t > numbins
The number of bins (mostly for BinnedData, or plotting help)
Definition: Variable.h:114

Friends And Related Function Documentation

◆ operator>>

std::istream& operator>> ( std::istream &  o,
GooFit::Observable var 
)
friend

Allow Observable to be read in.

Definition at line 59 of file Variable.cpp.

59 { return i >> *var.value; }
std::shared_ptr< fptype > value
The value of the variable.
Definition: Variable.h:28

Member Data Documentation

◆ is_event_number

bool GooFit::Observable::is_event_number {false}
protected

This identifies this as an EventNumber if copies are made.

Definition at line 117 of file Variable.h.

◆ numbins

std::shared_ptr<size_t> GooFit::Observable::numbins {std::make_shared<size_t>(100)}
protected

The number of bins (mostly for BinnedData, or plotting help)

Definition at line 114 of file Variable.h.


The documentation for this class was generated from the following file: