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

SimpleTestStatisticAbsDiff.h

Go to the documentation of this file.
00001 // ================================================
00002 // SimpleTestStatisticAbsDiff class description
00003 // ================================================
00004 //
00005 // THIS TEXT TO BE REPLACED BY ATLAS STANDARD FORMAT
00006 //
00007 // Namespace Atlfast::
00008 //
00009 // class: SimpleTestStatisticAbsDiff
00010 //
00011 // Authors: P.Clarke, H.Phillips, E.Richter-Was, P.Sherwood, R.Steward
00012 //
00013 // Description: 
00014 //
00015 //  Function object to help use of  SimpleTestStatistic with STL calls
00016 #ifndef __Atlfast_SimpleTestStatisticAbsDiff__
00017 #define __Atlfast_SimpleTestStatisticAbsDiff__
00018 #include <string>
00019 #include <cmath>
00020 #include "AtlfastCode/SimpleTestStatistic.h"
00021 namespace Atlfast {
00025   class SimpleTestStatisticAbsDiff{
00026   public:
00027 
00028     SimpleTestStatisticAbsDiff(const SimpleTestStatistic* s):
00029       m_val( s->val()){}
00030 
00031     SimpleTestStatisticAbsDiff(const SimpleTestStatistic* const * const s):
00032       m_val( (*s)->val()){}
00033 
00034     bool operator()(const SimpleTestStatistic s, const SimpleTestStatistic t) 
00035       { 
00036         return ( abs(s.val()-m_val) < abs(t.val()-m_val) );
00037       }
00038 
00039     bool operator()(const SimpleTestStatistic* const s, 
00040                     const SimpleTestStatistic* const t) { 
00041       return ( abs(s->val()-m_val) < abs(t->val()-m_val) );
00042     }
00043 
00044     bool operator()(const SimpleTestStatistic** const s, 
00045                     const SimpleTestStatistic** const t) { 
00046       return ( abs( (*s)->val()-m_val) < abs((*t)->val()-m_val) );
00047     }
00048   private:
00049     const double m_val;
00050   };
00051 } // end of namespace 
00052 #endif
00053 
00054 

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