![]() |
Diana Software
|
average vector object More...
Public Member Functions | |
| QAverageVector () | |
| Default ctor. More... | |
| QAverageVector (const QAverageVector &orig) | |
| Copy ctor. More... | |
| QAverageVector (const Diana::QVector &orig) | |
| Construct from a QVector(). More... | |
| void | Clear () |
| Clear the attributes. More... | |
| void | SetNumEvents (int nEvents) |
| Set the number of events in the average. More... | |
| int | GetNumEvents () const |
| Get the number of events in the average. More... | |
| void | SetSourceRuns (const std::vector< int > &sourceRuns) |
| Set the list of source runs. More... | |
| std::vector< int > & | GetSourceRuns () |
| Get the list of source runs. More... | |
| const std::vector< int > & | GetSourceRuns () const |
| Get the list of source runs. More... | |
| QError | WriteOnStream (std::ostream &o) const |
| Write the object to a stream. More... | |
| QError | ReadFromStream (std::istream &ob) |
| Read the object from a stream. More... | |
| void | Dump (std::ostream &o) const |
| void | Print () const |
| Print vector to stdout. More... | |
| const QAverageVector & | operator= (const Diana::QVector &orig) |
| Assignment operator. More... | |
| const QAverageVector & | operator= (const QAverageVector &orig) |
| Assignment operator. More... | |
Public Attributes | |
| std::vector< int > | fSourceRuns |
| Add two average vectors. More... | |
| int | fNumEvents |
| The number of events contributing to this average. More... | |
Protected Member Functions | |
| QObjectDef (QAverageVector, 2) | |
average vector object
Contains average pulse or average nps, source runs and number of events.
Technical note: For some reason, the data attributes of this class are publicly accessible. They should not be, but will be left so for backward compatibility.
Definition at line 24 of file QAverageVector.hh.
| QAverageVector::QAverageVector | ( | ) |
Default ctor.
Definition at line 14 of file QAverageVector.cc.
| QAverageVector::QAverageVector | ( | const QAverageVector & | orig | ) |
| QAverageVector::QAverageVector | ( | const Diana::QVector & | orig | ) |
Construct from a QVector().
Definition at line 24 of file QAverageVector.cc.
| void QAverageVector::Clear | ( | ) |
Clear the attributes.
Calls QVector::Clear() and frees all internal memory.
Definition at line 28 of file QAverageVector.cc.
References QVector::Clear(), fNumEvents, and fSourceRuns.
Referenced by QAverageNoiseHandle::FillFromDB(), QAveragePulseHandle::FillFromDB(), and operator=().
|
inline |
\breif Same as WriteOnStream().
Definition at line 81 of file QAverageVector.hh.
References WriteOnStream().
Referenced by Print().
|
inline |
Get the number of events in the average.
Definition at line 52 of file QAverageVector.hh.
References fNumEvents.
Referenced by QAverageNoiseHandle::StoreOnDB(), and QAveragePulseHandle::StoreOnDB().
|
inline |
Get the list of source runs.
Definition at line 61 of file QAverageVector.hh.
References fSourceRuns.
Referenced by QAverageNoiseHandle::FillFromDB(), QAveragePulseHandle::FillFromDB(), QAverageNoiseHandle::StoreOnDB(), and QAveragePulseHandle::StoreOnDB().
|
inline |
Get the list of source runs.
Definition at line 65 of file QAverageVector.hh.
References fSourceRuns.
| const QAverageVector & QAverageVector::operator= | ( | const Diana::QVector & | orig | ) |
Assignment operator.
Clears the data and copies from the QVector orig.
Definition at line 155 of file QAverageVector.cc.
References Clear(), and QVector::operator=().
| const QAverageVector & QAverageVector::operator= | ( | const QAverageVector & | orig | ) |
Assignment operator.
Clears the data and copies from the orig.
Definition at line 161 of file QAverageVector.cc.
References Clear(), fNumEvents, fSourceRuns, and QVector::operator=().
|
inline |
|
protected |
| QError QAverageVector::ReadFromStream | ( | std::istream & | ob | ) |
Read the object from a stream.
Used for reading from txt files.
Definition at line 56 of file QAverageVector.cc.
References err, fNumEvents, fSourceRuns, QVector::operator=(), QERR_SUCCESS, QERR_UNKNOWN_ERR, and vec.
|
inline |
Set the number of events in the average.
Definition at line 48 of file QAverageVector.hh.
References fNumEvents.
Referenced by MAveragePulses::Done(), QAverageNoiseHandle::FillFromDB(), and QAveragePulseHandle::FillFromDB().
|
inline |
Set the list of source runs.
Definition at line 56 of file QAverageVector.hh.
References fSourceRuns.
Referenced by MAveragePulses::Done().
| QError QAverageVector::WriteOnStream | ( | std::ostream & | o | ) | const |
Write the object to a stream.
Used for writing to txt files.
Definition at line 35 of file QAverageVector.cc.
References err, fNumEvents, fSourceRuns, QERR_SUCCESS, and vec.
Referenced by Dump().
| int QAverageVector::fNumEvents |
The number of events contributing to this average.
Definition at line 115 of file QAverageVector.hh.
Referenced by Clear(), GetNumEvents(), operator=(), QAverageVector(), ReadFromStream(), SetNumEvents(), and WriteOnStream().
| std::vector<int> QAverageVector::fSourceRuns |
Add two average vectors.
This performs a weighted average of the two vectors.
Add two average vectors
This performs a weighted average of the two vectors.
The list of source runs
Definition at line 113 of file QAverageVector.hh.
Referenced by Clear(), GetSourceRuns(), operator=(), QAverageVector(), ReadFromStream(), SetSourceRuns(), and WriteOnStream().