#ifndef __JFIT__JSHOWERNPEHIT__ #define __JFIT__JSHOWERNPEHIT__ #include "JFit/JShowerNPE.hh" /** * \author mdejong, adomi */ namespace JFIT {} namespace JPP { using namespace JFIT; } namespace JFIT { /** * Auxiliary class for simultaneously handling light yields and response of PMT. */ struct JShowerNPEHit : public JShowerNPE { using JShowerNPE::getP; using JShowerNPE::getChi2; /** * Default constructor. */ JShowerNPEHit() : JShowerNPE(), __n (0) {} /** * Constructor. * * \param npe npe * \param n number of hits */ JShowerNPEHit(const JShowerNPE& npe, const size_t n) : JShowerNPE(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 shower 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