//////////////////////////////////////////////////////////////////////// /// \class RAT::Classifiers::AlphaBetaClassifier /// /// \brief Calculates the likelihood ratio for an event to be BiPo event /// /// \author name Eric Marzec /// /// REVISION HISTORY:\n /// - 01/14/2014 : Eric Marzec - New file /// - 2015/04/15 : M Mottram: optimised method (assumes equal binning /// in time and energy). /// - 2020/07/29 : Meng Luo - added nhit cut feature /// /// \details Calculates a log likelihood that an event is either a BiPo event /// or a two beta event and returns the ratio of those likelihoods. /// /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_Classifiers_AlphaBetaClassifier_ #define __RAT_Classifiers_AlphaBetaClassifier_ #include #include #include namespace RAT { namespace DS { class FitResult; } namespace Classifiers { class AlphaBetaClassifier : public OptimisedClassifier, public SeededClassifier { public: AlphaBetaClassifier() : fNHitCut(0) { } virtual std::string GetName() const { return AlphaBetaClassifier::Name(); } static std::string Name() { return std::string( "AlphaBetaClassifier" ); } void Initialise( const std::string& param ); void BeginOfRun( DS::Run& run ); void EndOfRun( DS::Run& ) { } void DefaultSeed(); void SetI( const std::string& name, const int value ); void SetSeed(const DS::FitResult& seed); virtual std::vector GetParams() const; virtual std::vector GetPositiveErrors() const; virtual std::vector GetNegativeErrors() const; virtual double operator() (const std::vector& params); virtual void SetParams( const std::vector& params); virtual void SetPositiveErrors( const std::vector& errors); virtual void SetNegativeErrors( const std::vector& errors); virtual DS::ClassifierResult GetClassification(); private: std::vector fTimeResiduals; std::vector fTimes,fEnergies,fEnergyProb,fBetaProbability,fAlphaProbability,fTwoBetaProbability; std::vector fSummedBetaProbability, fSummedAlphaProbability, fSummedTwoBetaProbability; std::vector fParams; std::vector fPositiveErrors,fNegativeErrors; double fEnergyStep, fTimeStep; double fMinValue; std::string fIndex; ///< Optional index override bool fFitHypothesis;///< This acts as a switch for fitting under a two beta hypothesis or a BiPo one. TVector3 fEventPos; double fEventTime; DU::TimeResidualCalculator fTRCalc; std::vector MakePDF(std::vector); void MattMethod(const std::vector&, double); protected: size_t fNHitCut; }; } //::Classifier } //::RAT #endif