00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __Atlfast_SimpleTestStatistic__
00022 #define __Atlfast_SimpleTestStatistic__
00023
00024 #include "GaudiKernel/ContainedObject.h"
00025 #include "GaudiKernel/MsgStream.h"
00026 #include <string>
00027 #include <fstream>
00028 #include "AtlfastCode/Quartet.h"
00029
00030 static const CLID CLID_SIMPLE_TEST_STATISTIC = 2311;
00031
00032 namespace Atlfast {
00038
00039 class SimpleTestStatisticLabel;
00040 class SimpleTestStatistic:
00041 public ContainedObject {
00042
00043 public:
00044
00045
00046
00047 SimpleTestStatistic( std::string label):
00048 ContainedObject(),
00049 m_quartet(label,0,0.,0.){m_noTerminate=false;}
00050
00051 SimpleTestStatistic( std::string label,
00052 int count,
00053 double mean,
00054 double sigma):
00055 ContainedObject(),
00056 m_quartet(label, count, mean, sigma){m_noTerminate=false;}
00057
00058
00059 SimpleTestStatistic( std::string label, double mean):
00060 ContainedObject(),
00061 m_quartet(label, 1, mean, 0.){m_noTerminate=false;}
00062
00063 ~SimpleTestStatistic(){};
00064
00065 static const CLID& classID() {return CLID_SIMPLE_TEST_STATISTIC;}
00066 virtual const CLID& clID() const {return CLID_SIMPLE_TEST_STATISTIC;}
00067
00068 void increment(double val);
00069 void setNoTerminate(){m_noTerminate=true;}
00070 SimpleTestStatistic getTerminated();
00071
00072 std::string label()const{return m_quartet.first;}
00073 double val()const{return m_quartet.third;}
00074
00075 friend SimpleTestStatisticLabel;
00076 fstream& writeout(fstream& stream) const;
00077 MsgStream& writeout(MsgStream& stream) const;
00078
00079 bool operator ==(const SimpleTestStatistic& rhs){
00080 return m_quartet.first==rhs.m_quartet.first;}
00081
00082 bool isNull(){
00083 return m_quartet.second==0 &&
00084 m_quartet.third ==0. &&
00085 m_quartet.fourth==0.;
00086 }
00087
00088 SimpleTestStatistic operator -(const SimpleTestStatistic& rhs);
00089 SimpleTestStatistic diff (const SimpleTestStatistic& rhs) const;
00090
00091 private:
00092
00093 Quartet<std::string, int, double, double> m_quartet;
00094 bool m_noTerminate;
00095 };
00096 fstream& operator <<( fstream& stream, const SimpleTestStatistic& s) ;
00097 }
00098 #endif
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113