Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

SctData::ScanPoints Class Reference

This class represents the points in a scan. More...

#include <ScanPoints.h>

Inheritance diagram for SctData::ScanPoints:

Sct::Streamable

Public Member Functions

 ScanPoints (const unsigned nPoints, const float *points, const unsigned *nEvents, const unsigned *nErrorEvents) throw ()
 Create a ScanPoints from data that is already known.

 ScanPoints () throw ()
 Create an empty ScanPoints.

virtual ~ScanPoints () throw ()
 Virtual destructor.

unsigned getNPoints () const throw ()
 Get the number of scan points.

double getPoint (const unsigned i) const throw (LogicError)
 Get the value of the variable at a point.

double operator[] (const unsigned i) const throw (LogicError)
 Returns getPoint(i).

double & operator[] (const unsigned i) throw (LogicError)
 Returns an l-value which is the value of the variable at a point,.

unsigned getNEvents (const unsigned i) const throw (LogicError)
 Get the number of events (triggers) at a point.

unsigned getNErrorEvents (const unsigned i) const throw (LogicError)
 Get the number of error events at a point.

void addPoint (const double point, const unsigned nEvents, const unsigned nErrorEvents) throw ()
 Add a new point. Takes the variable value, number of events and number of error events.

double * getEdges () const throw (LogicError)
 Returns an array that contains bin lower edges for this ScanPoints.

void setAxis (TAxis &axis) const throw (LogicError)
 Set a ROOT TAxis to the values in this ScanPoints.

virtual string getClassName () const throw ()
 override


Private Attributes

Sct::RangedVector< ScanPointpoints
 vector of ScanPoint.


Detailed Description

This class represents the points in a scan.

It contains methods to get the number of events, the number of error events and the variable value for each point. There are also some utility methods to get "bin" values for use in setting histogram axes and to set a TAxis directly.

Author:
Matthew Palmer

Definition at line 25 of file ScanPoints.h.


Constructor & Destructor Documentation

SctData::ScanPoints::ScanPoints const unsigned    nPoints,
const float *    points,
const unsigned *    nEvents,
const unsigned *    nErrorEvents
throw ()
 

Create a ScanPoints from data that is already known.

Parameters:
the number of points
pointer to float[nPoints] : scan-point values
pointer to unsigned[nPoints] : numbers of events
pointer to unsigned[nPoints] : numbers of error events

Definition at line 10 of file ScanPoints.cpp.

SctData::ScanPoints::ScanPoints   throw ()
 

Create an empty ScanPoints.

Definition at line 17 of file ScanPoints.cpp.

virtual SctData::ScanPoints::~ScanPoints   throw () [inline, virtual]
 

Virtual destructor.

Definition at line 42 of file ScanPoints.h.


Member Function Documentation

void SctData::ScanPoints::addPoint const double    point,
const unsigned    nEvents,
const unsigned    nErrorEvents
throw ()
 

Add a new point. Takes the variable value, number of events and number of error events.

Definition at line 47 of file ScanPoints.cpp.

Referenced by SctData::IO::ScanPointsStreamer::read().

string SctData::ScanPoints::getClassName   const throw () [virtual]
 

override

Implements Sct::Streamable.

Definition at line 19 of file ScanPoints.cpp.

double * SctData::ScanPoints::getEdges   const throw (LogicError)
 

Returns an array that contains bin lower edges for this ScanPoints.

Can be used for setting axes.

Exceptions:
Throws an exception if number of points is <2

Definition at line 52 of file ScanPoints.cpp.

Referenced by SctData::IO::RawScanResultStreamer::read().

unsigned int SctData::ScanPoints::getNErrorEvents const unsigned    i const throw (LogicError)
 

Get the number of error events at a point.

Definition at line 43 of file ScanPoints.cpp.

unsigned int SctData::ScanPoints::getNEvents const unsigned    i const throw (LogicError)
 

Get the number of events (triggers) at a point.

Definition at line 39 of file ScanPoints.cpp.

Referenced by SctData::IO::ScanPointsStreamer::write().

unsigned SctData::ScanPoints::getNPoints   const throw ()
 

Get the number of scan points.

Definition at line 23 of file ScanPoints.cpp.

Referenced by SctData::IO::RawScanResultStreamer::read(), and SctData::IO::ScanPointsStreamer::write().

double SctData::ScanPoints::getPoint const unsigned    i const throw (LogicError)
 

Get the value of the variable at a point.

Definition at line 27 of file ScanPoints.cpp.

double & SctData::ScanPoints::operator[] const unsigned    i throw (LogicError)
 

Returns an l-value which is the value of the variable at a point,.

Definition at line 35 of file ScanPoints.cpp.

double SctData::ScanPoints::operator[] const unsigned    i const throw (LogicError)
 

Returns getPoint(i).

Definition at line 31 of file ScanPoints.cpp.

void SctData::ScanPoints::setAxis TAxis &    axis const throw (LogicError)
 

Set a ROOT TAxis to the values in this ScanPoints.

Exceptions:
Throws an exception if number of points is <2

Definition at line 65 of file ScanPoints.cpp.


Field Documentation

Sct::RangedVector<ScanPoint> SctData::ScanPoints::points [private]
 

vector of ScanPoint.

Definition at line 97 of file ScanPoints.h.


The documentation for this class was generated from the following files:
Generated on Mon Dec 15 19:37:51 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3