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.
double getMin () const
 smallest value
double getMax () const
 largest value
bool ascending () const
 Returns true if sorted ascending, false if sorted descending,.
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.

Data Structures

class  ScanPoint
 internal class holds data, one per point More...

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 SctTest::HighLevelApi::publishScan(), and 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 60 of file ScanPoints.cpp.

References getNPoints(), and getPoint().

Referenced by SctAnalysis::RxThresholdAlgorithm::analyze(), SctAnalysis::RxDelayAlgorithm::analyze(), getEdgesAscending(), getMax(), getMin(), SctData::IO::RawScanResultStreamer_v3::readSliceData(), 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 81 of file ScanPoints.cpp.

References ascending(), and points.

Referenced by SctData::IO::RawScanResultStreamer_v3::setHistSize(), SctData::IO::RawScanResultStreamer_v2::setHistSize(), and SctData::IO::RawScanResultStreamer_v1::setHistSize().

Here is the call graph for this function:

double SctData::ScanPoints::getMax  )  const
 

largest value

Definition at line 56 of file ScanPoints.cpp.

References ascending(), getNPoints(), and getPoint().

Here is the call graph for this function:

double SctData::ScanPoints::getMin  )  const
 

smallest value

Definition at line 52 of file ScanPoints.cpp.

References ascending(), getNPoints(), and getPoint().

Here is the call graph for this function:

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::TxCurrentAlgorithm::analyze(), SctAnalysis::RxThresholdBasedOnConfigRegisterAlgorithm::analyze(), SctAnalysis::AnalysisAlgorithm::checkForZeroTriggerBins(), 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.

References points.

Referenced by SctAnalysis::TxCurrentAlgorithm::analyze(), SctAnalysis::RxThresholdBasedOnConfigRegisterAlgorithm::analyze(), SctAnalysis::NMaskAlgorithm::analyze(), SctAnalysis::ChipCounterAlgorithm::analyze(), ascending(), SctAnalysis::AnalysisAlgorithm::checkForZeroTriggerBins(), getMax(), getMin(), SctData::IO::RawScanResultStreamer_v3::readRawData(), SctData::IO::RawScanResultStreamer_v2::readRawData(), SctData::IO::RawScanResultStreamer_v1::readRawData(), SctData::IO::RawScanResultStreamer_v3::readRootData(), SctData::IO::RawScanResultStreamer_v2::readRootData(), SctData::IO::RawScanResultStreamer_v1::readRootData(), SctData::IO::RawScanResultStreamer_v3::readSliceData(), SctData::IO::RawScanResultStreamer_v2::readSliceData(), SctData::IO::RawScanResultStreamer_v1::readSliceData(), SctData::IO::RawScanResultStreamer_v3::setHistSize(), SctData::IO::RawScanResultStreamer_v2::setHistSize(), SctData::IO::RawScanResultStreamer_v1::setHistSize(), 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 SctAnalysis::TxCurrentAlgorithm::analyze(), SctAnalysis::RxThresholdBasedOnConfigRegisterAlgorithm::analyze(), ascending(), getMax(), and getMin().

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


Field Documentation

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

vector of ScanPoint.

Definition at line 108 of file ScanPoints.h.

Referenced by getEdgesAscending(), and getNPoints().


The documentation for this class was generated from the following files:
Generated on Mon Feb 6 14:07:49 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6