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_H
00017 #define ATLFAST_SIMPLETESTSTATISTICABSDIFF_H
00018 #include <string>
00019 #include <cmath>
00020 #include "AtlfastEvent/SimpleTestStatistic.h"
00021 namespace Atlfast {
00022   using std::string;
00023   using std::abs;
00027   class SimpleTestStatisticAbsDiff{
00028   public:
00029 
00030     SimpleTestStatisticAbsDiff(const SimpleTestStatistic* s):
00031       m_val( s->val()){}
00032 
00033     SimpleTestStatisticAbsDiff(const SimpleTestStatistic* const * const s):
00034       m_val( (*s)->val()){}
00035 
00036     bool operator()(const SimpleTestStatistic s, const SimpleTestStatistic t) 
00037       { 
00038         return ( abs(s.val()-m_val) < abs(t.val()-m_val) );
00039       }
00040 
00041     bool operator()(const SimpleTestStatistic* const s, 
00042                     const SimpleTestStatistic* const t) { 
00043       return ( abs(s->val()-m_val) < abs(t->val()-m_val) );
00044     }
00045 
00046     bool operator()(const SimpleTestStatistic** const s, 
00047                     const SimpleTestStatistic** const t) { 
00048       return ( abs( (*s)->val()-m_val) < abs((*t)->val()-m_val) );
00049     }
00050   private:
00051     const double m_val;
00052   };
00053 } // end of namespace 
00054 #endif
00055 
00056 

Generated on Wed May 1 14:11:32 2002 for AtlfastAlgs by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001