GooFit  v2.1.3
Public Member Functions | Static Public Attributes | List of all members
GooFit::EventNumber Class Reference

#include <Variable.h>

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

Public Member Functions

 EventNumber (std::string name, fptype min=0, fptype max=EventNumber::maxint)
 
 ~EventNumber () override=default
 
EventNumberoperator= (const EventNumber &)=delete
 
const EventNumberoperator= (const fptype &val)
 Support var = 3. More...
 
- Public Member Functions inherited from GooFit::Observable
 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...
 

Static Public Attributes

static constexpr fptype maxint {1L << std::numeric_limits<fptype>::digits}
 

Additional Inherited Members

- Protected Attributes inherited from GooFit::Observable
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...
 

Detailed Description

This is used to track event number for MPI versions. A cast is done to know whether the values need to be fixed. Ugly hack because this internally stores a floating point number!

Definition at line 242 of file Variable.h.

Constructor & Destructor Documentation

◆ EventNumber()

GooFit::EventNumber::EventNumber ( std::string  name,
fptype  min = 0,
fptype  max = EventNumber::maxint 
)
inline

Definition at line 246 of file Variable.h.

References GooFit::Indexable::operator=(), and GooFit::Indexable::value.

247  : GooFit::Observable(name, min, max) {
248  is_event_number = true;
249  *value = 0; // Start with 0 event number by default
250  }
std::shared_ptr< fptype > value
The value of the variable.
Definition: Variable.h:28
Special class for observables. Used in DataSets.
Definition: Variable.h:109
std::string name
The variable name. Should be unique.
Definition: Variable.h:25
bool is_event_number
This identifies this as an EventNumber if copies are made.
Definition: Variable.h:117

◆ ~EventNumber()

GooFit::EventNumber::~EventNumber ( )
overridedefault

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Support var = 3.

Definition at line 257 of file Variable.h.

References GooFit::max_fitter_index(), GooFit::max_index(), GooFit::operator<<(), GooFit::operator>>(), and GooFit::Indexable::setValue().

257  {
258  setValue(val);
259  return *this;
260  }
void setValue(fptype val)
Set the value.
Definition: Variable.h:70

Member Data Documentation

◆ maxint

constexpr fptype GooFit::EventNumber::maxint {1L << std::numeric_limits<fptype>::digits}
static

Definition at line 244 of file Variable.h.


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