Go to the documentation of this file.00001
00005
00006
00007 #ifndef NXYTER_QUICKDAQSTATS_H
00008 #define NXYTER_QUICKDAQSTATS_H
00009
00010 #include <iostream>
00011 #include <vector>
00012
00013
00014 #include "roc/Message.h"
00015
00016 namespace nxyter {
00017
00018 class QuickDaqStats {
00019 protected:
00020 std::vector<double> fStats;
00021
00022 public:
00023
00025 enum daqStat {
00026 kNMessage = 0,
00027 kNNop,
00028 kNHit,
00029 kNHitPileup,
00030 kNHitOverflow,
00031 kNHitNx0,
00032 kNHitNx1,
00033 kNHitNx2,
00034 kNHitNx3,
00035 kNEpoch,
00036 kNEpochWithMiss,
00037 kNMissedHit,
00038 kNSync0,
00039 kNSync1,
00040 kNAux0,
00041 kNaux1,
00042 kNAux2,
00043 kNAux3,
00044 kNAuxOverflow,
00045 kNSysMesNxParErr0,
00046 kNSysMesNxParErr1,
00047 kNSysMesNxParErr2,
00048 kNSysMesNxParErr3,
00049 kNSysMesSyncParErr0,
00050 kNSysMesSyncParErr1,
00051 kNSysMesDaqRes,
00052 kNSysMesFifoReset,
00053 kNSysMesOther,
00054 kNEpoch2,
00055 kNGet4Hit,
00056 kNGet4Event,
00057 kNOther,
00058 kDimDaqStat
00059 };
00060
00062 enum plevel {
00063 kPrintAll = 0,
00064 kPrintNonZero,
00065 kPrintError
00066 };
00067
00068 QuickDaqStats();
00069 QuickDaqStats(const QuickDaqStats& obj);
00070 virtual ~QuickDaqStats();
00071
00072 void clear();
00073 void increment(roc::Message& msg);
00074
00075 double errorCount() const;
00076
00077 double operator[](int ind) const;
00078 QuickDaqStats& operator=(const QuickDaqStats& rhs);
00079 QuickDaqStats& operator-(const QuickDaqStats& rhs);
00080 QuickDaqStats& operator*(double rhs);
00081
00082 void print(std::ostream& os, double dtime=0.,
00083 int lvl=kPrintNonZero) const;
00084 static const char* counterName(int ind);
00085
00086 private:
00088 void inc(int ind)
00089 { fStats[ind] += 1.; }
00090
00091 };
00092
00093
00094 }
00095
00096 #endif