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_H
00022 #define ATLFAST_SIMPLETESTSTATISTIC_H
00023 
00024 #include "GaudiKernel/ContainedObject.h"
00025 #include <string>
00026 #include <fstream>
00027 #include "AtlfastCode/Quartet.h"
00028 //#include "GaudiKernel/MsgStream.h"
00029 class MsgStream;
00030 
00031 static const CLID CLID_SIMPLE_TEST_STATISTIC = 2311;
00032 
00033 namespace Atlfast {
00034   class SimpleTestStatistic;
00035   MsgStream& operator <<( MsgStream&, const SimpleTestStatistic& s) ;
00036   MsgStream& operator <<( MsgStream&, const SimpleTestStatistic* const s) ;
00037   //  MsgStream& operator <<( MsgStream&, const SimpleTestStatistic** s) ;
00038 
00044   //........................................
00045   class SimpleTestStatisticLabel;
00046   class SimpleTestStatistic: 
00047     public ContainedObject {
00048     
00049   public:
00050     
00051     // Constructors
00052     
00053     SimpleTestStatistic( std::string label):
00054       ContainedObject(),
00055       m_quartet(label,0,0.,0.){m_noTerminate=false;}
00056 
00057     SimpleTestStatistic( std::string label,
00058                          int count,
00059                          double mean,
00060                          double sigma):
00061       ContainedObject(),
00062       m_quartet(label, count, mean, sigma){m_noTerminate=false;}
00063 
00064 
00065     SimpleTestStatistic( std::string label, double mean):
00066       ContainedObject(),
00067       m_quartet(label, 1, mean, 0.){m_noTerminate=false;}
00068 
00069     ~SimpleTestStatistic(){};
00070 
00071     static const CLID& classID() {return CLID_SIMPLE_TEST_STATISTIC;}
00072     virtual const CLID& clID() const  {return CLID_SIMPLE_TEST_STATISTIC;}
00073 
00074     void increment(double val);
00075     void setNoTerminate(){m_noTerminate=true;}
00076     SimpleTestStatistic getTerminated();
00077 
00078     std::string label()const{return m_quartet.first;}
00079     double val()const{return m_quartet.third;}
00080 
00081     friend SimpleTestStatisticLabel;
00082     fstream& writeout(fstream& stream) const;
00083     MsgStream& writeout(MsgStream& stream) const;
00084     
00085     bool operator ==(const SimpleTestStatistic& rhs){
00086       return m_quartet.first==rhs.m_quartet.first;}
00087 
00088     bool isNull(){
00089       return  m_quartet.second==0   &&
00090         m_quartet.third ==0.         &&
00091         m_quartet.fourth==0.;
00092     }
00093                     
00094     SimpleTestStatistic operator -(const SimpleTestStatistic& rhs);
00095     SimpleTestStatistic diff (const SimpleTestStatistic& rhs) const;
00096     
00097   private:
00098     //keep variable label, number of occurences, sum and sum square
00099     Quartet<std::string, int, double, double> m_quartet;
00100     bool m_noTerminate;
00101   };
00102   fstream& operator <<( fstream& stream, const SimpleTestStatistic& s) ;
00103 } // end of namespace 
00104 #endif
00105 
00106   
00107 
00108 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00119 

Generated on Mon Feb 4 15:54:24 2002 for Atlfast by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001