map<string,result> computations;
void mean(const string& compid, vector< vector <double> > *meas, const int& ival);
+ void mean(const string& compid, vector< vector <int> > *meas, const int& ival);
};
for(vector< vector<double> >::iterator measIt = meas->begin(); measIt != meas->end(); ++measIt)
computations[compid].err += pow( (*measIt)[ival] - computations[compid].val, 2 );
- computations[compid].err /= nmeas*(nmeas-1);
+ computations[compid].err /= nmeas-1;
computations[compid].err = sqrt( computations[compid].err );
+}
+
+template <typename obstype>
+void obs<obstype>::mean(const string& compid, vector< vector<int> > *meas, const int& ival)
+{
+ computations[compid].val = 0;
+ computations[compid].err = 0;
+
+ int nmeas = meas->size();
+
+ for(vector< vector<int> >::iterator measIt = meas->begin(); measIt != meas->end(); ++measIt)
+ computations[compid].val += (*measIt)[ival];
+ computations[compid].val /= nmeas;
+
+ for(vector< vector<int> >::iterator measIt = meas->begin(); measIt != meas->end(); ++measIt)
+ computations[compid].err += pow( (*measIt)[ival] - computations[compid].val, 2 );
+ computations[compid].err /= nmeas-1;
+ computations[compid].err = sqrt( computations[compid].err );
}
template <typename obstype>