MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
quantity.h
1#ifndef MCXRAYTRANSPORT_QUANTITY_H
2#define MCXRAYTRANSPORT_QUANTITY_H
3
4#include <vector>
5#include <cmath>
6
11public:
12 // overloading the + operator
13 VectorValue operator+(VectorValue& other) const;
14
15 // pretty self-explanatory
16 void addValue(double value);
17 void addValues(const std::vector<double>& values);
18 std::vector<double>& getVector();
19 double getSum();
20 double getSumSTD();
21 double getMean();
22 double getMeanSTD();
23 double getCount();
24 double getCountSTD();
25 double getVariance();
26private:
27 std::vector<double> values_ = {};
28 double sum_ = 0;
29 bool summed_ = false; // prevent multiple calls to getSum()
30 double var_ = 0;
31 bool var_calculated_ = false;
32};
33
38public:
39 // overloading the + operator
40 CountValue operator+(const CountValue& other) const;
41
42 // pretty self-explanatory
43 void addCount();
44 void addCounts(int count);
45 int getCount() const;
46 double getCountSTD() const;
47public:
48 int count_= 0;
49};
50
51#endif //MCXRAYTRANSPORT_QUANTITY_H
Class which represents a count quantity. Used by the Tally classes to store simulation data.
Definition quantity.h:37
Class which represents a vector quantity. Used by the Tally classes to store simulation data.
Definition quantity.h:10