Diana Software
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
QAverageVectorC Class Reference

average vector object More...

Inheritance diagram for QAverageVectorC:

Public Member Functions

 QAverageVectorC ()
 Default ctor. More...
 
 QAverageVectorC (const QAverageVectorC &orig)
 Copy ctor. More...
 
 QAverageVectorC (const Diana::QVectorC &orig)
 Construct from a QVectorC(). 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 QAverageVectorCoperator= (const Diana::QVectorC &orig)
 Assignment operator. More...
 
const QAverageVectorCoperator= (const QAverageVectorC &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 (QAverageVectorC, 1)
 

Detailed Description

average vector object

Author
Claudia Tomei, J. Ouellet

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 QAverageVectorC.hh.

Constructor & Destructor Documentation

◆ QAverageVectorC() [1/3]

QAverageVectorC::QAverageVectorC ( )

Default ctor.

Definition at line 14 of file QAverageVectorC.cc.

◆ QAverageVectorC() [2/3]

QAverageVectorC::QAverageVectorC ( const QAverageVectorC orig)

Copy ctor.

Definition at line 17 of file QAverageVectorC.cc.

References fNumEvents, and fSourceRuns.

◆ QAverageVectorC() [3/3]

QAverageVectorC::QAverageVectorC ( const Diana::QVectorC &  orig)

Construct from a QVectorC().

Definition at line 24 of file QAverageVectorC.cc.

Member Function Documentation

◆ Clear()

void QAverageVectorC::Clear ( )

Clear the attributes.

Calls QVectorC::Clear() and frees all internal memory.

Definition at line 28 of file QAverageVectorC.cc.

References QVectorC::Clear(), fNumEvents, and fSourceRuns.

Referenced by operator=().

◆ Dump()

void QAverageVectorC::Dump ( std::ostream &  o) const
inline

\breif Same as WriteOnStream().

Definition at line 81 of file QAverageVectorC.hh.

References WriteOnStream().

Referenced by Print().

◆ GetNumEvents()

int QAverageVectorC::GetNumEvents ( ) const
inline

Get the number of events in the average.

Definition at line 52 of file QAverageVectorC.hh.

References fNumEvents.

◆ GetSourceRuns() [1/2]

std::vector<int>& QAverageVectorC::GetSourceRuns ( )
inline

Get the list of source runs.

Definition at line 61 of file QAverageVectorC.hh.

References fSourceRuns.

◆ GetSourceRuns() [2/2]

const std::vector<int>& QAverageVectorC::GetSourceRuns ( ) const
inline

Get the list of source runs.

Definition at line 65 of file QAverageVectorC.hh.

References fSourceRuns.

◆ operator=() [1/2]

const QAverageVectorC & QAverageVectorC::operator= ( const Diana::QVectorC &  orig)

Assignment operator.

Clears the data and copies from the QVectorC orig.

Definition at line 155 of file QAverageVectorC.cc.

References Clear(), and QVectorC::operator=().

◆ operator=() [2/2]

const QAverageVectorC & QAverageVectorC::operator= ( const QAverageVectorC orig)

Assignment operator.

Clears the data and copies from the orig.

Definition at line 161 of file QAverageVectorC.cc.

References Clear(), fNumEvents, fSourceRuns, and QVectorC::operator=().

◆ Print()

void QAverageVectorC::Print ( ) const
inline

Print vector to stdout.

Definition at line 85 of file QAverageVectorC.hh.

References Dump().

◆ QObjectDef()

QAverageVectorC::QObjectDef ( QAverageVectorC  ,
 
)
protected

◆ ReadFromStream()

QError QAverageVectorC::ReadFromStream ( std::istream &  ob)

Read the object from a stream.

Used for reading from txt files.

Definition at line 56 of file QAverageVectorC.cc.

References err, fNumEvents, fSourceRuns, QVectorC::operator=(), QERR_SUCCESS, QERR_UNKNOWN_ERR, and vec.

◆ SetNumEvents()

void QAverageVectorC::SetNumEvents ( int  nEvents)
inline

Set the number of events in the average.

Definition at line 48 of file QAverageVectorC.hh.

References fNumEvents.

Referenced by MNoiseFrequencyCoherence::Done().

◆ SetSourceRuns()

void QAverageVectorC::SetSourceRuns ( const std::vector< int > &  sourceRuns)
inline

Set the list of source runs.

Definition at line 56 of file QAverageVectorC.hh.

References fSourceRuns.

Referenced by MNoiseFrequencyCoherence::Done().

◆ WriteOnStream()

QError QAverageVectorC::WriteOnStream ( std::ostream &  o) const

Write the object to a stream.

Used for writing to txt files.

Definition at line 35 of file QAverageVectorC.cc.

References err, fNumEvents, fSourceRuns, QERR_SUCCESS, and vec.

Referenced by Dump().

Member Data Documentation

◆ fNumEvents

int QAverageVectorC::fNumEvents

The number of events contributing to this average.

Definition at line 115 of file QAverageVectorC.hh.

Referenced by Clear(), GetNumEvents(), operator=(), QAverageVectorC(), ReadFromStream(), SetNumEvents(), and WriteOnStream().

◆ fSourceRuns

std::vector<int> QAverageVectorC::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 QAverageVectorC.hh.

Referenced by Clear(), GetSourceRuns(), operator=(), QAverageVectorC(), ReadFromStream(), SetSourceRuns(), and WriteOnStream().


The documentation for this class was generated from the following files: