18 data.resize(vars.size());
23 data.resize(vars.size());
28 data.resize(vars.size());
33 throw GooFit::GeneralError(
"UnbinnedDataSet: Attepted to find {} in event {} when only {} events exits",
41 return data[var_idx].at(idx);
47 v.setValue(data.at(i++).at(idx));
62 data.at(i++).push_back(v.getValue());
71 if(eventNum !=
nullptr)
92 for(
const auto &dat : data)
94 throw GeneralError(
"The dataset must be empty to fill with grid!");
101 if(val.isEventNumber())
Thrown when a general error is encountered.
size_t getNumEvents() const
bool isEventNumber() const
Check to see if this is an event number.
void fillWithGrid()
Replace the current dataset with a grid.
std::vector< Observable > observables
UnbinnedDataSet(const Observable &var, std::string n="")
void setValue(fptype val)
Set the value.
void checkAllVars() const
Throw an error if any variables are out of range, call in addEvent.
Special class for observables. Used in DataSets.
fptype getValue(const Observable &var, size_t idx) const
Get the value at a specific variable and event number.
size_t getNumBins() const
Get the number of bins.
size_t indexOfVariable(const Observable &var) const
fptype getLowerLimit() const
Get the lower limit.
const std::vector< Observable > & getObservables() const
fptype getValue() const
Get the value.
fptype getUpperLimit() const
Get the upper limit.
void setValueForAllEvents(const Observable &var)
Set all entries to a constant value (note: this is kind of ugly)
void loadEvent(size_t idx)
Set all the variables to the current event values.
void make_a_grid(std::vector< Observable > ret, UnbinnedDataSet *grid, Observable *eventNum)
const std::string & getName() const
Get the name.