//////////////////////////////////////////////////////////////////////////////// /// \class RAT::Classifiers::BerkeleyAlphaBeta /// /// \brief Classifies an event as an Alpha or a Beta /// /// \author Benjamin Land - contact person /// \author Chris Dock /// \author Kimia Haghighi /// /// REVISION HISTORY:\n /// 20/08/2014 : Benjamin Land - Implemented as RAT Classifier /// 23/05/2015 : Benjamin Land - Auto select PDF from inner_av material /// /// \detail Classifies events as alpha or beta based on likelihood that the hit /// time residuals came from a PDF of an alpha or a beta. Additionally /// includes late light in subsequent events if desired. /// /// //////////////////////////////////////////////////////////////////////////////// #ifndef __RAT_Classifiers_BerkeleyAlphaBeta_ #define __RAT_Classifiers_BerkeleyAlphaBeta_ #include #include namespace RAT { namespace Classifiers { class BerkeleyAlphaBeta : public SeededClassifier { public: /// Static Method returning Classifier Name static inline std::string Name() { return "BerkeleyAlphaBeta"; } /// Constructor (Constructs object and allocates fLastEventTime) BerkeleyAlphaBeta(); /// Destructor (Destructs object and frees fLastEventTime) virtual ~BerkeleyAlphaBeta(); /// Class Method returning Classifier Name virtual std::string GetName() const; /// Initializes fTBLName and fTBLIndex /// @param[param] String containg classifier parameters set in macro virtual void Initialise(const std::string& param); /// Load Alpha PDF and Beta PDF and convert them to logarithmic scale. /// Load fTimeStep and fTimefirst. virtual void BeginOfRun(DS::Run& run); /// Ends Classifier call virtual void EndOfRun(DS::Run& run); /// Sets fEventPos to zero vector and fEventTime to zero virtual void DefaultSeed(); /// Checks if the current event is a retrigger. If it is not, sets /// fEventTime and fEventPos from parameter seed. If it is, the current /// time is offset to the last event time. /// @seed Seed (FitResult containing event time and position) virtual void SetSeed(const DS::FitResult& seed); /// Classifies Run as an Alpha Particle or a Beta Particle using Log Likelihood /// @return ClassifierResult object containing the classification result virtual DS::ClassifierResult GetClassification(); private: std::string fTBLName; ///< Table name set in Initialise std::string fTBLIndex; ///< Table index set in Initialise double fScaleFactor; ///< Scale factor in linear to log Conversion double fTimeFirst; ///< Time of first hit double fTimeStep; ///< Time step between hits size_t fNEntries; ///< Number of entries in both Alpha PDF and Beta PDF bool fPartialFlag; ///< Flag for whether to calculate t_res with partial fill geo std::vector fPDFAlphaLog; ///< Log distribution of Alpha hit residuals std::vector fPDFBetaLog; ///< Log distribution of Beta hit residuals TVector3 fEventPos; ///< Fitted event position double fEventTime; ///< Fitted event time int fNhit; ///< Event Nhit (summed over retrigger hits) bool fRetrigger; ///< True if events were automatically retriggered double fLogAlphaProb; ///< Log Likelihood Alpha double fLogBetaProb; ///< Log Likelihood Beta RAT::DS::UniversalTime fRetriggerCutoff; ///< Cutoff determining whether event is a retrigger of the previous event RAT::DS::UniversalTime *fLastEventTime; ///< Pointer to the time of the last event TVector3 fLastEventPos; ///< Fitted previous event position to be used in retriggers }; } //::Classifiers } //::RAT #endif