#ifndef __JFIT__JNPEHIT__ #define __JFIT__JNPEHIT__ #include "JFit/JNPE.hh" /** * \author mdejong */ namespace JFIT {} namespace JPP { using namespace JFIT; } namespace JFIT { /** * Auxiliary class for simultaneously handling light yields and response of PMT. */ struct JNPEHit : public JNPE { using JNPE::getP; using JNPE::getChi2; /** * Default constructor. */ JNPEHit() : JNPE(), __n (0) {} /** * Constructor. * * \param npe npe * \param n number of hits */ JNPEHit(const JNPE& npe, const size_t n) : JNPE(npe), __n (n) {} /** * Get number of hits. * * \return number of hits */ inline size_t getN() const { return __n; } /** * Get probability. * * \return probability */ double getP() const { return this->getP(this->getN()); } /** * Get muon energy dependent probability. * * \param E_GeV energy [GeV] * \return probability */ double getP(const double E_GeV) const { return this->getP(E_GeV, this->getN() > 0); } /** * Get chi2. * * \param E_GeV energy [GeV] * \return chi2 */ double getChi2(const double E_GeV) const { return this->getChi2(E_GeV, this->getN() > 0); } protected: size_t __n; }; } #endif