From 444d0496c31a71fd5e3136e59f63f66a89d53b00 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 20 Dec 2012 23:28:08 +0100 Subject: [PATCH] Add event identifier to event list. --- src/ctobssim/ctobssim.cpp | 10 ++++++++++ src/ctobssim/ctobssim.hpp | 1 + 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index b45dea5..79ba433 100644 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -733,8 +733,10 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, *obs, ran); if (event != NULL) { + event->event_id(m_event_id); events->append(*event); delete event; + m_event_id++; } } // endfor: looped over events @@ -873,6 +875,10 @@ void ctobssim::simulate_background(GCTAObservation* obs, // Get event pointer GCTAEventAtom* event = (*list)[k]; + // Set event identifier + event->event_id(m_event_id); + m_event_id++; + // Append event events->append(*event); @@ -943,6 +949,9 @@ void ctobssim::init_members(void) // a better mechanism to implement the CTA reference MJD. m_cta_ref.set(G_CTA_MJDREF, "s", "TT", "LOCAL"); + // Initialise first event identifier + m_event_id = 1; + // Set logger properties log.date(true); @@ -982,6 +991,7 @@ void ctobssim::copy_members(const ctobssim& app) m_use_xml = app.m_use_xml; m_read_ahead = app.m_read_ahead; m_cta_ref = app.m_cta_ref; + m_event_id = app.m_event_id; // Return return; diff --git a/src/ctobssim/ctobssim.hpp b/src/ctobssim/ctobssim.hpp index e095619..7b60214 100644 --- a/src/ctobssim/ctobssim.hpp +++ b/src/ctobssim/ctobssim.hpp @@ -102,6 +102,7 @@ protected: bool m_use_xml; //!< Use XML file instead of FITS file bool m_read_ahead; //!< Read ahead parameters GTimeReference m_cta_ref; //!< CTA time reference + int m_event_id; //!< Event identifier }; #endif /* CTOBSSIM_HPP */ -- libgit2 0.21.4