#ifndef __JPYTHIA__ #define __JPYTHIA__ #include namespace JSIRENE { /** * Map of GEANT particle code to integrated light yield relative to that of EM shower. */ class Phytia : public std::map { public: /** * Default constructor. */ Phytia() : std::map() { using std::make_pair; insert(make_pair( 1, 1.0)); // photon insert(make_pair( 2, 0.1)); // e+ insert(make_pair( 3, 1.0)); // e- insert(make_pair( 8, 0.7)); // pi+ insert(make_pair( 9, 0.7)); // pi- } /** * Get relative light yield. * * \param index GEANT particle code * \return weight */ double operator()(const int index) const { const_iterator i = find(index); if (i != end()) return i->second; else return 0.0; } }; /** * Function object for relative light yield as a function of GEANT particle code. */ static Phytia phytia; } #endif