A class representing a data point. More...
#include <BCDataPoint.h>
Public Member Functions | |
Constructors and destructor | |
BCDataPoint (int nvariables=0) | |
A constructor. More... | |
BCDataPoint (const std::vector< double > &x) | |
A constructor. More... | |
operators | |
double & | operator[] (unsigned index) |
Raw and fast access. More... | |
const double & | operator[] (unsigned index) const |
Raw and fast access. More... | |
Member functions (get) | |
double | GetValue (unsigned index) const |
Safer access, but slower. More... | |
std::vector< double > & | GetValues () |
const std::vector< double > & | GetValues () const |
unsigned int | GetNValues () const |
Returns the number of values. More... | |
Member functions (set) | |
void | SetValue (unsigned index, double value) |
Safer, but slower, value setting of a variable. More... | |
void | SetValues (const std::vector< double > &values) |
Set the values of all variables. More... | |
void | SetNValues (unsigned n, double val=0.) |
Set the number of variables. More... | |
Member functions (miscellaneous methods) | |
void | PrintSummary (void(*output)(const std::string &)=BCLog::OutSummary) const |
Print summary of data point to the string handler. More... | |
Detailed Description
A class representing a data point.
- Version
- 1.0
- Date
- 08.2008
This class represents a data point which is the basic unit of information. A data point can be an event, a bin content, etc. Each data point can store several variables of type double. The variables are organized in a vector.
Definition at line 34 of file BCDataPoint.h.
Constructor & Destructor Documentation
BCDataPoint::BCDataPoint | ( | int | nvariables = 0 | ) |
A constructor.
- Parameters
-
nvariables The number of variables stored in a data object.
Definition at line 18 of file BCDataPoint.cxx.
BCDataPoint::BCDataPoint | ( | const std::vector< double > & | x | ) |
A constructor.
- Parameters
-
x The vector containing the data.
Definition at line 24 of file BCDataPoint.cxx.
Member Function Documentation
|
inline |
Returns the number of values.
Definition at line 89 of file BCDataPoint.h.
|
inline |
Safer access, but slower.
- Parameters
-
index The index of the variable.
- Returns
- The value of the variable.
Definition at line 74 of file BCDataPoint.h.
|
inline |
- Returns
- A vector of values.
Definition at line 79 of file BCDataPoint.h.
|
inline |
- Returns
- A vector of values.
Definition at line 84 of file BCDataPoint.h.
|
inline |
Raw and fast access.
Definition at line 57 of file BCDataPoint.h.
|
inline |
Raw and fast access.
Definition at line 62 of file BCDataPoint.h.
void BCDataPoint::PrintSummary | ( | void(*)(const std::string &) | output = BCLog::OutSummary | ) | const |
Print summary of data point to the string handler.
- Parameters
-
output String handler (default = BCLog::OutSummary.
Definition at line 44 of file BCDataPoint.cxx.
|
inline |
Set the number of variables.
Use with caution!
- Parameters
-
n New dimensionality to set for data point. val Value to fill into new data values if enlarging data point size.
Definition at line 114 of file BCDataPoint.h.
|
inline |
Safer, but slower, value setting of a variable.
- Parameters
-
index The index of the variable value The value of the variable
Definition at line 101 of file BCDataPoint.h.
void BCDataPoint::SetValues | ( | const std::vector< double > & | values | ) |
Set the values of all variables.
- Parameters
-
values A vector of values
Definition at line 30 of file BCDataPoint.cxx.
The documentation for this class was generated from the following files:
- /root/bat/BAT/BCDataPoint.h
- /root/bat/src/BCDataPoint.cxx