#ifndef _utl_TimeDistributionAlgorithm_h_ #define _utl_TimeDistributionAlgorithm_h_ /** \file TimeDistributionAlgorithm \author Tom Paul \version $Id: TimeDistributionAlgorithm.h 14717 2009-09-17 20:24:36Z lukas $ \date 21 Jun 2004 */ #include #include #include namespace utl { /** \class TimeDistributionAlgorithm TimeDistributionAlgorithm.h "sevt/TimeDistributionAlgorithm.h" \brief Utility class for returning properties of a TimeDistribution \author Tom Paul \date 21 June 2004 \version $Id: TimeDistributionAlgorithm.h 14717 2009-09-17 20:24:36Z lukas $ \ingroup time stl */ class TimeDistributionAlgorithm { public: typedef boost::tuple TupleD; /// Evaluate the sum of bin1 through bin2 template static double Sum(const TimeDistribution& td, const int bin1, const int bin2); /// Evaluate mean of TimeDistribution between bin1 and bin2 template static double Mean(const TimeDistribution& td, const int bin1, const int bin2); /// Evalueate RMS of TimeDistribution between bin1 and bin2 template static double RMS(const TimeDistribution& td, const int bin1, const int bin2); /// Evalueate both mean and RMS of TimeDistribution between bin1 and bin2 template static TupleD MeanRMS(const TimeDistribution& td, const int bin1, const int bin2); /// Evaluate the centroid in slot number between bin1 and bin2 /*! Computes the centroid in number of slots. In other words, this method does not multiply by the slot size. To compute centroid in time, you need to use the GetBinning() method to get size of a slot. */ template static double Centroid(const TimeDistribution& td, const int bin1, const int bin2); }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. -k" // End: