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

SctData::ScanPoints Class Reference

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

#include <ScanPoints.h>

Inheritance diagram for SctData::ScanPoints:

Inheritance graph
[legend]
Collaboration diagram for SctData::ScanPoints:

Collaboration graph
[legend]

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 * getEdgesAscending () const throw (LogicError)
 Returns an array that contains bin lower edges for this ScanPoints in ascending order.

bool ascending () const
 Returns true if sorted ascending, false if sorted descending,
Exceptions:
LogicError if not sorted.


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
Note:
does not take ownership of arguments - copies them;

Definition at line 11 of file ScanPoints.cpp.

SctData::ScanPoints::ScanPoints  )  throw ()
 

Create an empty ScanPoints.

Definition at line 18 of file ScanPoints.cpp.

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

Virtual destructor.

Definition at line 43 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 48 of file ScanPoints.cpp.

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

bool SctData::ScanPoints::ascending  )  const
 

Returns true if sorted ascending, false if sorted descending,

Exceptions:
LogicError if not sorted.

Definition at line 52 of file ScanPoints.cpp.

References getNPoints(), and getPoint().

Referenced by SctAnalysis::RxThresholdAlgorithm::analyze(), SctAnalysis::RxDelayAlgorithm::analyze(), SctData::IO::RawScanResultStreamer_v2::readRawData(), SctData::IO::RawScanResultStreamer_v1::readRawData(), SctData::IO::RawScanResultStreamer_v2::readSliceData(), and SctData::IO::RawScanResultStreamer_v1::readSliceData().

Here is the call graph for this function:

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

override

Implements Sct::Streamable.

Definition at line 20 of file ScanPoints.cpp.

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

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

Can be used for setting axes.

Exceptions:
Throws an exception if number of points is <2, or points are neither ascending or descending.

Definition at line 68 of file ScanPoints.cpp.

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

Get the number of error events at a point.

Definition at line 44 of file ScanPoints.cpp.

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

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

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

Definition at line 40 of file ScanPoints.cpp.

Referenced by SctAnalysis::RxThresholdAlgorithm::analyze(), SctAnalysis::RxDelayAlgorithm::analyze(), and SctData::IO::ScanPointsStreamer_v1::write().

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

Get the number of scan points.

Definition at line 24 of file ScanPoints.cpp.

Referenced by ascending(), SctData::IO::RawScanResultStreamer_v2::readRawData(), SctData::IO::RawScanResultStreamer_v1::readRawData(), SctData::IO::RawScanResultStreamer_v2::readRootData(), SctData::IO::RawScanResultStreamer_v1::readRootData(), SctData::IO::RawScanResultStreamer_v2::readSliceData(), SctData::IO::RawScanResultStreamer_v1::readSliceData(), and SctData::IO::ScanPointsStreamer_v1::write().

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

Get the value of the variable at a point.

Definition at line 28 of file ScanPoints.cpp.

Referenced by ascending().

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 36 of file ScanPoints.cpp.

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

Returns getPoint(i).

Definition at line 32 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 89 of file ScanPoints.cpp.


Field Documentation

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

vector of ScanPoint.

Definition at line 103 of file ScanPoints.h.


The documentation for this class was generated from the following files:
Generated on Thu Jul 8 11:42:26 2004 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5