PAASS
Software suite to Acquire and Analyze Data from Pixie16
poll2_stats.h
Go to the documentation of this file.
1 // Small class to handle the statistics information from pixies
2 
3 #ifndef POLL2_STATS_H
4 #define POLL2_STATS_H
5 
6 #define NUM_CHAN_PER_MOD 16
7 
8 class Client;
9 
11  public:
12  StatsHandler(size_t nCards = 1);
13 
14  ~StatsHandler();
15 
16  void AddEvent(unsigned int mod, unsigned int ch, size_t size, int delta_=1);
17 
18  bool AddTime(double dtime);
19 
21  void SetDumpInterval(double interval) {dumpTime = interval;};
22 
23  double GetDataRate(size_t mod);
24 
25  double GetTotalDataRate();
26 
27  double GetEventRate(size_t mod);
28 
30  double GetTotalTime();
31 
33  void SetXiaRates(int mod, std::vector<std::pair<double,double>> *xiaRates);
34 
35  bool CanSend(){ return is_able_to_send; }
36 
38  void Clear();
39  void ClearRates();
40  void ClearTotals();
41 
42  void Dump();
43 
44  private:
45  Client *client; // UDP client for network access
46 
48  unsigned int **nEventsDelta;
49 
51  unsigned int **nEventsTotal;
52 
54  size_t *dataDelta;
55 
57  size_t *dataTotal;
58 
60  double **calcEventRate;
61 
62  double **inputCountRate;
63  double **outputCountRate;
64 
66  size_t *calcDataRate;
67 
69  double timeElapsed;
70 
72  double totalTime;
73 
75  double dumpTime;
76 
78  unsigned int numCards;
79 
81 
82 };
83 
84 #endif
double ** outputCountRate
The XIA Module output count rate.
Definition: poll2_stats.h:63
double ** inputCountRate
The XIA Module input count rate.
Definition: poll2_stats.h:62
bool is_able_to_send
Definition: poll2_stats.h:80
unsigned int numCards
Definition: poll2_stats.h:78
void ClearTotals()
double ** calcEventRate
Definition: poll2_stats.h:60
double GetDataRate(size_t mod)
double GetTotalDataRate()
double dumpTime
Definition: poll2_stats.h:75
unsigned int ** nEventsTotal
Definition: poll2_stats.h:51
void ClearRates()
void SetDumpInterval(double interval)
Set the amount of time between scalers dumps in seconds.
Definition: poll2_stats.h:21
void SetXiaRates(int mod, std::vector< std::pair< double, double >> *xiaRates)
Set the ICR and OCR from the XIA module.
size_t * dataTotal
Definition: poll2_stats.h:57
bool CanSend()
Definition: poll2_stats.h:35
StatsHandler(size_t nCards=1)
Definition: poll2_stats.cpp:9
double GetEventRate(size_t mod)
double totalTime
Definition: poll2_stats.h:72
void Clear()
Clear the stats.
unsigned int ** nEventsDelta
Definition: poll2_stats.h:48
double timeElapsed
Definition: poll2_stats.h:69
size_t * calcDataRate
Definition: poll2_stats.h:66
Client * client
Definition: poll2_stats.h:45
void AddEvent(unsigned int mod, unsigned int ch, size_t size, int delta_=1)
Definition: poll2_stats.cpp:78
bool AddTime(double dtime)
Definition: poll2_stats.cpp:96
double GetTotalTime()
Return the total run time.
size_t * dataDelta
Definition: poll2_stats.h:54