#ifndef __JFIT__JK40__ #define __JFIT__JK40__ #include #include "JPhysics/JConstants.hh" #include "JPhysics/JGeane.hh" #include "JPhysics/JPDFToolkit.hh" #include "JFit/JFitToolkit.hh" /** * \author mdejong */ namespace JFIT {} namespace JPP { using namespace JFIT; } namespace JFIT { /** * Auxiliary class for handling light yields due to K40 decays. */ struct JK40 { /** * Default constructor. */ JK40() : y0(0.0) {} /** * Constructor. * * \param y0 light yield due to random background [npe] */ JK40(const double y0) : y0(y0) {} /** * Get light yield due to random background. * * \return light yield [npe] */ double getY0() const { return y0; } /** * Expected number of photo-electrons for random background hypothesis. * * \return light yield [npe] */ inline double getH0() const { return this->getY0(); } /** * Get probability for observing a hit or not. * * \param hit hit * \return probability */ double getP(const bool hit) const { return JFIT::getP(this->getH0(), hit); } /** * Get chi2 for observing a hit or not. * * \param hit hit * \return probability */ double getChi2(const bool hit) const { return JFIT::getChi2(this->getH0(), hit); } protected: double y0; //!< light yield due to random background [npe] }; } #endif