00001 #ifndef SCANPOINTS_H 00002 #define SCANPOINTS_H 00003 00004 #include <vector> 00005 #include <string> 00006 #include "Sct/Streamable.h" 00007 #include "Sct/Exception.h" 00008 #include "Sct/RangedVector.h" 00009 00010 using Sct::Streamable; 00011 using Sct::LogicError; 00012 using std::vector; 00013 using std::string; 00014 00015 class TAxis; 00016 00017 namespace SctData { 00018 00025 class ScanPoints : public virtual Streamable{ 00026 public: 00033 ScanPoints(const unsigned nPoints, 00034 const float* points, 00035 const unsigned* nEvents, 00036 const unsigned* nErrorEvents) throw() ; 00037 00039 ScanPoints() throw() ; 00040 00042 virtual ~ScanPoints() throw() {} 00043 00045 unsigned getNPoints() const throw(); 00046 00048 double getPoint(const unsigned i) const throw(LogicError); 00049 00051 double operator[] (const unsigned i) const throw(LogicError); 00052 00054 double& operator[] (const unsigned i) throw(LogicError); 00055 00057 unsigned getNEvents(const unsigned i) const throw(LogicError); 00058 00060 unsigned getNErrorEvents(const unsigned i) const throw(LogicError); 00061 00063 void addPoint(const double point, const unsigned nEvents, const unsigned nErrorEvents) throw() ; 00064 00070 double* getEdges() const throw(LogicError) ; 00071 00075 void setAxis(TAxis& axis) const throw(LogicError); 00076 00078 virtual string getClassName() const throw(); 00079 00080 private: 00082 class ScanPoint{ 00083 public: 00084 ScanPoint(const double point, const unsigned nEv, const unsigned nErr) throw() : 00085 point(point), nEvents(nEv), nErrorEvents(nErr) {} 00087 ~ScanPoint() throw() {} 00089 operator double&() throw() {return point;} 00091 operator const double() const throw() {return point;} 00092 double point; 00093 unsigned nEvents; 00094 unsigned nErrorEvents; 00095 }; 00096 00097 Sct::RangedVector<ScanPoint> points; 00098 }; 00099 } 00100 #endif //#ifndef SCANPOINTS_H