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 "AtlfastEvent/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 
00035   using std::fstream;
00036 
00037   class SimpleTestStatistic;
00038   MsgStream& operator <<( MsgStream&, const SimpleTestStatistic& s) ;
00039   MsgStream& operator <<( MsgStream&, const SimpleTestStatistic* const s) ;
00040   //  MsgStream& operator <<( MsgStream&, const SimpleTestStatistic** s) ;
00041 
00047   //........................................
00048   class SimpleTestStatisticLabel;
00049   class SimpleTestStatistic: 
00050     public ContainedObject {
00051     
00052   public:
00053     
00054     // Constructors
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     //keep variable label, number of occurences, sum and sum square
00102     Quartet<std::string, int, double, double> m_quartet;
00103     bool m_noTerminate;
00104   };
00105   fstream& operator <<( fstream& stream, const SimpleTestStatistic& s) ;
00106 } // end of namespace 
00107 #endif
00108 
00109   
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00119 
00120 
00121 
00122 

Generated on Wed May 1 14:35:47 2002 for AtlfastEvent by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001