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