00001 #ifndef __BCDATAPOINT__H 00002 #define __BCDATAPOINT__H 00003 00004 /*! 00005 * \class BCDataPoint 00006 * \brief A class representing a data point. 00007 * \author Daniel Kollar 00008 * \author Kevin Kröninger 00009 * \version 1.0 00010 * \date 08.2008 00011 * \detail This class represents a data point which is the basic unit 00012 * of information. A data point can be an event, a bin content, etc. 00013 * Each data point can store several variables of type double. 00014 * The variables are organized in a vector. 00015 */ 00016 00017 /* 00018 * Copyright (C) 2008-2010, Daniel Kollar and Kevin Kroeninger. 00019 * All rights reserved. 00020 * 00021 * For the licensing terms see doc/COPYING. 00022 */ 00023 00024 // --------------------------------------------------------- 00025 00026 #include <vector> 00027 00028 // --------------------------------------------------------- 00029 00030 class BCDataPoint 00031 { 00032 public: 00033 00034 /** \name Constructors and destructors */ 00035 /* @{ */ 00036 00037 /** 00038 * A constructor. 00039 * @param nvariables The number of variables stored in a data. 00040 * object */ 00041 BCDataPoint(int nvariables); 00042 00043 /** 00044 * A constructor. 00045 * @param x The vector containing the data. */ 00046 BCDataPoint(std::vector<double> x); 00047 00048 /** 00049 * A destructor. */ 00050 ~BCDataPoint(); 00051 00052 /* @} */ 00053 00054 /** \name Member functions (get) */ 00055 /* @{ */ 00056 00057 /** 00058 * @param index The index of the variable. 00059 * @return The value of the variable. */ 00060 double GetValue(int index); 00061 00062 /** 00063 * @return A vector of values. */ 00064 std::vector <double> GetValues() 00065 { return fData; }; 00066 00067 /** 00068 * Returns the number of values. */ 00069 unsigned int GetNValues() 00070 { return fData.size(); }; 00071 00072 /* @} */ 00073 00074 /** \name Member functions (set) */ 00075 /* @{ */ 00076 00077 /** 00078 * Set the value of a variable. 00079 * @param index The index of the variable 00080 * @param value The value of the variable */ 00081 void SetValue(int index, double value); 00082 00083 /** 00084 * Set the values of all variables. 00085 * @param values A vector of values */ 00086 void SetValues(std::vector <double> values); 00087 00088 /* @} */ 00089 00090 private: 00091 00092 /** 00093 * The vector containing the values of the variables. */ 00094 std::vector <double> fData; 00095 00096 }; 00097 00098 // --------------------------------------------------------- 00099 00100 #endif 00101