From 7f5315dfa342193bf576551a4cc88e03af5102fe Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Mon, 3 Feb 2014 20:37:16 +0100 Subject: [PATCH] Dump total number of simulated counts in log file. --- src/ctobssim/ctobssim.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+), 0 deletions(-) diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index 82d49dd..37382f8 100644 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -324,12 +324,24 @@ void ctobssim::run(void) // Increment counter n_observations++; + // Save number of events before entering simulation + int events_before = obs->events()->size(); + // Simulate source events simulate_source(obs, m_obs.models(), m_rans[i], &wrklog); // Simulate source events simulate_background(obs, m_obs.models(), m_rans[i], &wrklog); + // Dump simulation results + if (logNormal()) { + wrklog << gammalib::parformat("MC events"); + wrklog << obs->events()->size() - events_before; + wrklog << " (all models)"; + wrklog << std::endl; + } + + } // endif: CTA observation found } // endfor: looped over observations -- libgit2 0.21.4