// Generate an EventList, rate is the number of event per second. Events have a time between tmin and tmax. virtual GTestEventList* generateList(const double &rate, const GTime &tmin, const GTime &tmax, GRan &ran) { // Create an event list GTestEventList * list = new GTestEventList(); // Set min and max energy for ebounds // npred method integrate the model on time and energy. // In order to have a rate which not depend on energy we create an interval of 1 Mev. GEnergy engmin,engmax; engmin.MeV(1.0); engmax.MeV(2.0); // Instrument Direction GTestInstDir dir; // Generate an times list. GTimes times = m_modelTps->mc(rate,tmin, tmax,ran); for (int i = 0; i < times.size() ; ++i) { GTestEventAtom event; event.dir(dir); event.energy(engmin); event.time(times[i]); // Add the event to the list list->append(event); } // Create a time interval and add it to the list. GGti gti; gti.append(tmin,tmax); list->gti(gti); // Create an energy interval and add it to the list GEbounds ebounds; ebounds.append(engmin,engmax); list->ebounds(ebounds); return list; }
void copy_members(const GTestEventAtom& atom) { m_dir = atom.dir(); m_time = atom.time(); m_energy = atom.energy(); return; }