//////////////////////////////////////////////////////////////////////// /// \class RAT::Classifiers::Classifier /// /// \brief Base class for classifiers /// /// \author Phil G Jones \n /// \author Evelina Arushanova -- contact person \n /// \author Matt Mottram -- contact person /// /// REVISION HISTORY:\n /// 27/04/2012 : P G Jones - New file \n /// 2013-08-23 : P G Jones - Altered to use FitterPMT class. /// 2014-03-29 : P G Jones - Updated lifetime, added BeginOfRun method\n /// /// \details All classifiers derive from this, directly or indirectly /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_Classifiers_Classifier_ #define __RAT_Classifiers_Classifier_ #include #include #include #include #include namespace RAT { namespace DS { class Run; class EV; } namespace Classifiers { class Classifier : public FitterComponent { public: class ClassifierFailError : public std::runtime_error { public: /// Just sets up a std::runtime_error ClassifierFailError( const std::string& info ) : std::runtime_error( info ) {} }; /// Constructor initialises to NULL Classifier() : fRun(NULL), fEvent(NULL) {} /// Virtual destructor virtual ~Classifier() {} /// Initialise the classifier, takes a string /// /// @param[in] param optional string to initialise the settings virtual void Initialise( const std::string& param ) = 0; /// Called to invoke the classifier algorithm virtual DS::ClassifierResult GetClassification() = 0; /// Return the internal fit result DS::ClassifierResult GetClassifierResult() { return fClassifierResult; }; /// Set the event information void SetEventData( std::vector& pmtData, DS::EV* event, DS::Run* run ) { fPMTData = pmtData; fRun = run; fEvent = event; } protected: DS::ClassifierResult fClassifierResult; ///< Internal ClassifierResult std::vector fPMTData; ///< PMT Data DS::Run* fRun; ///< Internal run DS::EV* fEvent; ///< Internal triggered event }; } //::Classifier } //::RAT #endif