Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

SimpleTestStatistic.h

Go to the documentation of this file.
00001 // ================================================
00002 // SimpleTestStatistic class description
00003 // ================================================
00004 //
00005 // THIS TEXT TO BE REPLACED BY ATLAS STANDARD FORMAT
00006 //
00007 // Namespace Atlfast::
00008 //
00009 // class: SimpleTestStatistic
00010 //
00011 // Authors: P.Clarke, H.Phillips, P.Sherwood
00012 //
00013 // Description: 
00014 //
00015 //  Class to maintain information on variables to be ables to 
00016 //  make simple calculations on diostributions of these variables
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     // Constructors
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     //keep variable label, number of occurences, sum and sum square
00093     Quartet<std::string, int, double, double> m_quartet;
00094     bool m_noTerminate;
00095   };
00096   fstream& operator <<( fstream& stream, const SimpleTestStatistic& s) ;
00097 } // end of namespace 
00098 #endif
00099 
00100   
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 
00112 
00113 

Generated on Wed Jan 23 12:58:32 2002 for Atlfast by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001