/////////////////////////////////////////////////////////////////////// // // Simple direction likelihood method // // Author: Ian Coulter --contact person // // REVISION HISTORY: // - 26/04/2011 : I Coulter - New file // - 10/09/2013 : K Majumdar - Adding in ability to do asymmetric // errors and errors in Spherical coordinates // - 2014-12-09 : P G Jones - Allow chained PMTSelectors // // The direction likelihood method uses a maximum likelihood method // to fit the direction of an event. Its designed for use with // a PDF to which it provides a seed vertex which is then optimised // according to the criterea in the PDF, e.g. angular distribution of ///the PMT hits. It then returns an fit vertex with direction, errors // and a validity. // Requires Seeding, optimising and a pdf // /////////////////////////////////////////////////////////////////////// #ifndef __RAT_Method_DirectionLikelihood_ #define __RAT_Method_DirectionLikelihood_ #include #include #include #include #include #include namespace RAT { namespace DS { class FitResult; } namespace Methods { class DirectionLikelihood : public SeededMethod, public OptimisedMethod, public PDFMethod, public SelectorMethod { public: // Returns the name of the direction likelihood method virtual std::string GetName() const { return DirectionLikelihood::Name(); } // Returns the name of the direction likelihood method static std::string Name() { return std::string( "directionLikelihood" ); } // Initialises the direction likelihood method (requires no init string) void Initialise( const std::string& ) { } void BeginOfRun( DS::Run& ) { } void EndOfRun( DS::Run& ) { } // Sets the seed to the default void DefaultSeed(); // Invokes the method's algorithm virtual DS::FitResult GetBestFit(); // Called by the optimiser to get the starting/seed params to optimise virtual std::vector GetParams() const; // Called by the optimiser to get the starting/seed errors to optimise virtual std::vector GetPositiveErrors() const; virtual std::vector GetNegativeErrors() const; // Converts the vector of params into the fFitResult virtual void SetParams( const std::vector& params ); // Converts the vector of errors into the fFitResult virtual void SetPositiveErrors( const std::vector& errors ); virtual void SetNegativeErrors( const std::vector& errors ); // Called by the optimiser to invoke the method algorithm, optimiser will pass current parameters virtual double operator()( const std::vector& params ); }; } //::Methods } //::RAT #endif