ATLAS Offline Software
Loading...
Searching...
No Matches
TileSimpleStat.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TileCalibObjects_TileSimpleStat_h
6#define TileCalibObjects_TileSimpleStat_h
7
8#include <cmath>
9
11 public:
13 }
14
15 inline void add(double val) {
16 m_entries++;
17 m_sum += val;
18 m_sqSum += val*val;
19 }
20
21 inline void getStat(double &mean, double &sigma) {
22 mean = m_sum/static_cast<double>(m_entries);
23 sigma = sqrt((m_sqSum - static_cast<double>(m_entries)*mean*mean)/static_cast<double>(m_entries-1));
24 }
25
26 private:
27 unsigned int m_entries;
28 double m_sum;
29 double m_sqSum;
30};
31
32#endif // TileCalibObjects_TileSimpleStat_h
void getStat(double &mean, double &sigma)
unsigned int m_entries
void add(double val)
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")