ATLAS Offline Software
Loading...
Searching...
No Matches
StatDouble Class Reference

#include <TileTBStat.h>

Collaboration diagram for StatDouble:

Public Member Functions

 StatDouble ()
void addValue (double Value)
double getMean ()
double getChi2 ()
void print (const char *s, bool minMaxOnly=false)

Public Attributes

int Counter
double Min
double Max
double Sum
double SumSq

Detailed Description

Definition at line 57 of file TileTBStat.h.

Constructor & Destructor Documentation

◆ StatDouble()

StatDouble::StatDouble ( )

Definition at line 48 of file TileTBStat.cxx.

48 {
49 Min = HUGE_VAL;
50 Max = -HUGE_VAL;
51 Sum = 0;
52 SumSq = 0;
53 Counter = 0;
54}
double Max
Definition TileTBStat.h:65
double Sum
Definition TileTBStat.h:65
double SumSq
Definition TileTBStat.h:65
double Min
Definition TileTBStat.h:65

Member Function Documentation

◆ addValue()

void StatDouble::addValue ( double Value)

Definition at line 56 of file TileTBStat.cxx.

56 {
57 if (Value <= 0.0) return;
58 if (Max < Value) Max = Value;
59 if (Min > Value) Min = Value;
60 Sum += Value;
61 SumSq += Value * Value;
62 Counter++;
63}

◆ getChi2()

double StatDouble::getChi2 ( )

Definition at line 69 of file TileTBStat.cxx.

69 {
70 if (Counter <= 1) return 0;
71 return sqrt(std::max(0.0,((SumSq - ((Sum * Sum) / Counter)) / (Counter - 1))));
72}

◆ getMean()

double StatDouble::getMean ( )

Definition at line 65 of file TileTBStat.cxx.

65 {
66 return Sum / Counter;
67}

◆ print()

void StatDouble::print ( const char * s,
bool minMaxOnly = false )

Definition at line 74 of file TileTBStat.cxx.

74 {
75 if (minMaxOnly) {
76 if (Counter > 0) {
77 //coverity[RW.CONSTEVAL_CALL_NONCONSTANT:FALSE]
78 std::cout << std::format("{} {:4.1f} - {:4.1f}\n", s, Min, Max);
79 } else {
80 std::cout << std::format("{} ---- - ----\n", s);
81 }
82 } else {
83 if (Counter > 0) {
84 std::cout << std::format("{} {:4.1f} - {:4.1f} mean= {:6.3f} rms= {:5.3f}\n",
85 s,
86 Min,
87 Max,
88 getMean(),
89 getChi2());
90 } else {
91 std::cout << std::format("{} ---- - ---- mean= ------ rms= -----\n", s);
92 }
93 }
94}
double getChi2()
double getMean()

Member Data Documentation

◆ Counter

int StatDouble::Counter

Definition at line 64 of file TileTBStat.h.

◆ Max

double StatDouble::Max

Definition at line 65 of file TileTBStat.h.

◆ Min

double StatDouble::Min

Definition at line 65 of file TileTBStat.h.

◆ Sum

double StatDouble::Sum

Definition at line 65 of file TileTBStat.h.

◆ SumSq

double StatDouble::SumSq

Definition at line 65 of file TileTBStat.h.


The documentation for this class was generated from the following files: