Diana Software
QAverageVectorC.hh
Go to the documentation of this file.
1 #ifndef _Q_AVERAGEVECTORC_HH_
2 #define _Q_AVERAGEVECTORC_HH_
3 
19 #include "QObject.hh"
20 #include "QVectorC.hh"
21 #include <vector>
22 #include <string>
23 
24 class QAverageVectorC : public Diana::QVectorC {
25 
26 public:
34  QAverageVectorC(const QAverageVectorC& orig);
38  QAverageVectorC(const Diana::QVectorC& 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 QAverageVectorC &operator=(const Diana::QVectorC& orig);
97  const QAverageVectorC &operator=(const QAverageVectorC &orig);
103  // const QAverageVectorC &operator+=(const QAverageVectorC &alt);
109  // QAverageVectorC operator+(const QAverageVectorC &alt) const;
110 
111 
113  std::vector<int> fSourceRuns;
116 
117 protected:
119 
120 };
121 
122 #endif
average vector object
void Clear()
Clear the attributes.
const std::vector< int > & GetSourceRuns() const
Get the list of source runs.
const QAverageVectorC & operator=(const Diana::QVectorC &orig)
Assignment operator.
QError WriteOnStream(std::ostream &o) const
Write the object to a stream.
QObjectDef(QAverageVectorC, 1)
std::vector< int > & GetSourceRuns()
Get the list of source runs.
int GetNumEvents() const
Get the number of events in the average.
QAverageVectorC()
Default ctor.
QError ReadFromStream(std::istream &ob)
Read the object from a stream.
std::vector< int > fSourceRuns
Add two average vectors.
void Dump(std::ostream &o) const
void SetNumEvents(int nEvents)
Set the number of events in the average.
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.
error class with error type and description
Definition: QError.hh:115