File indexing completed on 2026-08-06 09:24:28
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef MYSTATISTICS_Run_hpp_included
0009 #define MYSTATISTICS_Run_hpp_included
0010
0011 #include "Histogram.h"
0012
0013 namespace Statistics {
0014
0015
0016
0017
0018
0019 class Run {
0020
0021 public:
0022
0023
0024
0025
0026 Run();
0027
0028
0029
0030
0031 explicit Run(const std::string& newName);
0032
0033
0034
0035
0036 virtual ~Run();
0037
0038 public:
0039
0040
0041
0042
0043 void initialize();
0044
0045
0046
0047
0048 void reset();
0049
0050
0051
0052
0053 void finalize(size_t newAttemptedPoints);
0054
0055 public:
0056
0057
0058
0059
0060 void count(double weight) {
0061 theSumOfWeights += weight;
0062 theSumOfSquaredWeights += weight*weight;
0063 }
0064
0065
0066
0067
0068 Histogram& addHistogram(const std::string& newName,
0069 const std::vector<double>& newBoundaries);
0070
0071
0072
0073
0074 Histogram& addHistogram(const std::string& newName,
0075 const std::vector<double>& newBoundaries,
0076 const std::pair<double,double>& newPeriodicity);
0077
0078
0079
0080
0081 Histogram& histogram(const std::string& histoName);
0082
0083
0084
0085
0086 const Histogram& histogram(const std::string& histoName) const;
0087
0088
0089
0090
0091 const std::map<std::string,Histogram>& histograms() const { return theHistograms; }
0092
0093
0094
0095
0096 const std::string& name() const { return theName; }
0097
0098
0099
0100
0101 void name(const std::string& newName) { theName = newName; }
0102
0103
0104
0105
0106 size_t attemptedPoints() const { return theAttemptedPoints; }
0107
0108
0109
0110
0111 double sumOfWeights() const { return theSumOfWeights; }
0112
0113
0114
0115
0116 double sumOfSquaredWeights() const { return theSumOfSquaredWeights; }
0117
0118 public:
0119
0120
0121
0122
0123 Run& operator+=(const Run& other);
0124
0125 public:
0126
0127
0128
0129
0130 void fromXML(const XML::Element&);
0131
0132
0133
0134
0135 XML::Element toXML() const;
0136
0137 private:
0138
0139
0140
0141
0142 std::string theName;
0143
0144
0145
0146
0147 size_t theAttemptedPoints;
0148
0149
0150
0151
0152 double theSumOfWeights;
0153
0154
0155
0156
0157 double theSumOfSquaredWeights;
0158
0159
0160
0161
0162 std::map<std::string,Histogram> theHistograms;
0163
0164
0165 };
0166
0167 }
0168
0169 #endif