BAT  0.9.4
The Bayesian analysis toolkit
 All Classes Namespaces Functions Variables Enumerations
BCDataSet Class Reference

A class representing a set of data points. More...

#include <BCDataSet.h>

Public Member Functions

Constructors and destructors
 BCDataSet ()
 
 BCDataSet (const BCDataSet &bcdataset)
 
virtual ~BCDataSet ()
 
Assignment operators
BCDataSetoperator= (const BCDataSet &bcdataset)
 
Member functions (get)
unsigned int GetNDataPoints ()
 
unsigned int GetNValuesPerPoint ()
 
BCDataPointGetDataPoint (unsigned int index)
 
std::vector< double > GetDataComponents (int index)
 
Member functions (miscellaneous methods)
int ReadDataFromFile (const char *filename, const char *treename, const char *branchnames)
 
int ReadDataFromFile (const char *filename, int nvariables)
 
int ReadDataFromFileTree (const char *filename, const char *treename, const char *branchnames)
 
int ReadDataFromFileTxt (const char *filename, int nvariables)
 
void AddDataPoint (BCDataPoint *datapoint)
 
void Reset ()
 
void Dump ()
 

Detailed Description

A class representing a set of data points.

Author
Daniel Kollar
Kevin Kröninger
Version
1.0
Date
08.2008 This class represents a data set containing a set of data points. The data points are organized in a vector. The class provides functions to read in data from a file.

Definition at line 37 of file BCDataSet.h.

Constructor & Destructor Documentation

BCDataSet::BCDataSet ( )

Default constructor

Definition at line 24 of file BCDataSet.cxx.

BCDataSet::BCDataSet ( const BCDataSet bcdataset)

The copy constructor

Definition at line 43 of file BCDataSet.cxx.

BCDataSet::~BCDataSet ( )
virtual

Default destructor

Definition at line 31 of file BCDataSet.cxx.

Member Function Documentation

void BCDataSet::AddDataPoint ( BCDataPoint datapoint)

Adds a data point to the data set.

Parameters
datapointThe data point to be added

Definition at line 358 of file BCDataSet.cxx.

void BCDataSet::Dump ( )

Dump the data to the standard output

Definition at line 385 of file BCDataSet.cxx.

std::vector< double > BCDataSet::GetDataComponents ( int  index)

Viewing the data set as a table with one row per point, this method returns a specified column.

Parameters
indexThe index of the component to be returned.
Returns
The (index)th component of all data points

Definition at line 116 of file BCDataSet.cxx.

BCDataPoint * BCDataSet::GetDataPoint ( unsigned int  index)
Parameters
indexThe index of the data point to be returned.
Returns
The data point at the index.

Definition at line 98 of file BCDataSet.cxx.

unsigned int BCDataSet::GetNDataPoints ( )
Returns
The number of data points.

Definition at line 79 of file BCDataSet.cxx.

unsigned int BCDataSet::GetNValuesPerPoint ( )
Returns
number of values per data point (dimension of data).

Definition at line 86 of file BCDataSet.cxx.

BCDataSet & BCDataSet::operator= ( const BCDataSet bcdataset)

Defaut assignment operator

Definition at line 59 of file BCDataSet.cxx.

int BCDataSet::ReadDataFromFile ( const char *  filename,
const char *  treename,
const char *  branchnames 
)
inline

Reads data from a file. For a description see the following member functions.

Definition at line 96 of file BCDataSet.h.

int BCDataSet::ReadDataFromFileTree ( const char *  filename,
const char *  treename,
const char *  branchnames 
)

Reads a TTree from a .root file. Opens a .root file and gets a TTree. It creates data points containing the values read from the file.

Parameters
filenameThe name of the .root file.
treenameThe name of the TTree.
branchnamesA list of the names of the branches separated by a comma
Returns
An error code.
See Also
ReadDataFromFileTxt(char* filename, int nbranches);
ReadDataFromFileUser(const char * filename, std::vector<int> options_int, std::vector<double> options_double, const char * options_char);

Definition at line 135 of file BCDataSet.cxx.

int BCDataSet::ReadDataFromFileTxt ( const char *  filename,
int  nvariables 
)

Reads data from a .txt file. Opens a .txt file and creates data objects containing the values read from the file.

Parameters
filenameThe name of the .txt file.
nvariablesThe number of variables.
See Also
ReadDataFromFileTree(char* filename, char* treename, std::vector<char*> branchnames)
ReadDataFromFileUser(const char * filename, std::vector<int> options_int, std::vector<double> options_double, const char * options_char);

Definition at line 277 of file BCDataSet.cxx.

void BCDataSet::Reset ( )

Resets the content of the data set

Definition at line 373 of file BCDataSet.cxx.


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