Diana Software
QAverageVector.hh
Go to the documentation of this file.
1 #ifndef _Q_AVERAGEVECTOR_HH_
2 #define _Q_AVERAGEVECTOR_HH_
3 
19 #include "QObject.hh"
20 #include "QVector.hh"
21 #include <vector>
22 #include <string>
23 
24 class QAverageVector : public Diana::QVector {
25 
26 public:
34  QAverageVector(const QAverageVector& orig);
38  QAverageVector(const Diana::QVector& orig);
44  void Clear();
48  void SetNumEvents(int nEvents) { fNumEvents=nEvents; }
52  int GetNumEvents() const { return fNumEvents; }
56  void SetSourceRuns(const std::vector<int> &sourceRuns)
57  { fSourceRuns=sourceRuns; }
61  std::vector<int> &GetSourceRuns() { return fSourceRuns; }
65  const std::vector<int> &GetSourceRuns() const { return fSourceRuns; }
71  QError WriteOnStream (std::ostream &o) const;
77  QError ReadFromStream (std::istream &ob);
81  void Dump(std::ostream& o) const { WriteOnStream(o); }
85  void Print() const { Dump(std::cout); }
91  const QAverageVector &operator=(const Diana::QVector& orig);
97  const QAverageVector &operator=(const QAverageVector &orig);
103  // const QAverageVector &operator+=(const QAverageVector &alt);
109  // QAverageVector operator+(const QAverageVector &alt) const;
110 
111 
113  std::vector<int> fSourceRuns;
116 
117 protected:
119 
120 };
121 
122 #endif
average vector object
QObjectDef(QAverageVector, 2)
void SetSourceRuns(const std::vector< int > &sourceRuns)
Set the list of source runs.
void Print() const
Print vector to stdout.
int fNumEvents
The number of events contributing to this average.
const QAverageVector & operator=(const Diana::QVector &orig)
Assignment operator.
std::vector< int > & GetSourceRuns()
Get the list of source runs.
QError WriteOnStream(std::ostream &o) const
Write the object to a stream.
void Dump(std::ostream &o) const
const std::vector< int > & GetSourceRuns() const
Get the list of source runs.
QError ReadFromStream(std::istream &ob)
Read the object from a stream.
QAverageVector()
Default ctor.
int GetNumEvents() const
Get the number of events in the average.
void SetNumEvents(int nEvents)
Set the number of events in the average.
void Clear()
Clear the attributes.
std::vector< int > fSourceRuns
Add two average vectors.
error class with error type and description
Definition: QError.hh:115