//////////////////////////////////////////////////////////////////////// /// \class RAT::Optimisers::MetaDirectionSeed /// /// \brief Try multiple seeds for the direction and optimise /// /// \author I Coulter -- contact person /// /// REVISION HISTORY:\n /// 18/02/2013 : I Coulter - New file \n /// /// \details Optimises N times with N different seeds for direction and /// chooses the median value so as to ignore effect of outliers /// This class changes the seed using a gaussian spread based /// on the initial seed error. /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_Optimiser_MetaDirectionSeed__ #define __RAT_Optimiser_MetaDirectionSeed__ #include #include #include #include namespace RAT { namespace Optimisers { class MetaDirectionSeed : public MetaOptimiser { public: ~MetaDirectionSeed(); virtual std::string GetName() const { return MetaDirectionSeed::Name(); } static std::string Name() { return std::string( "metaDirectionSeed" ); } /// Minimise the method virtual double Minimise(); /// Maximise the method virtual double Maximise(); /// Initialise the MetaOptimiser virtual void Initialise( const std::string& param ); virtual void BeginOfRun( DS::Run& run ); virtual void EndOfRun( DS::Run& run ); protected: /// Produce a new seed based on the start seed virtual DS::FitResult NewSeed( const DS::FitResult& startSeed ); /// Optimize the method double Optimise(); Optimiser* fOptimiser; ///< Pointer to optimiser used by this meta optimiser, owned by this class => Must delete int fNSeeds; ///< Number of seeds to try double fMinFactor; ///< Min factor, -1 for maximise. }; } //::Optimiser } //::RAT #endif