From 002d505d765edbd239f63cae42fb3255642263ae Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Fri, 9 Mar 2012 11:19:27 +0000 Subject: [PATCH] Apply deadtime correction also to gradient in GCTAModelRadialAcceptance::eval_gradients. --- inst/cta/src/GCTAModelRadialAcceptance.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/inst/cta/src/GCTAModelRadialAcceptance.cpp b/inst/cta/src/GCTAModelRadialAcceptance.cpp index de77e59..6fd1713 100644 --- a/inst/cta/src/GCTAModelRadialAcceptance.cpp +++ b/inst/cta/src/GCTAModelRadialAcceptance.cpp @@ -377,11 +377,12 @@ double GCTAModelRadialAcceptance::eval_gradients(const GEvent& event, double value = rad * spec * temp; // Apply deadtime correction - value *= obs.deadc(event.time()); + double deadc = obs.deadc(event.time()); + value *= deadc; // Multiply factors to radial gradients if (radial() != NULL) { - double fact = spec * temp; + double fact = spec * temp * deadc; if (fact != 1.0) { for (int i = 0; i < radial()->size(); ++i) (*radial())[i].gradient( (*radial())[i].gradient() * fact ); @@ -390,7 +391,7 @@ double GCTAModelRadialAcceptance::eval_gradients(const GEvent& event, // Multiply factors to spectral gradients if (spectral() != NULL) { - double fact = rad * temp; + double fact = rad * temp * deadc; if (fact != 1.0) { for (int i = 0; i < spectral()->size(); ++i) (*spectral())[i].gradient( (*spectral())[i].gradient() * fact ); @@ -399,7 +400,7 @@ double GCTAModelRadialAcceptance::eval_gradients(const GEvent& event, // Multiply factors to temporal gradients if (temporal() != NULL) { - double fact = rad * spec; + double fact = rad * spec * deadc; if (fact != 1.0) { for (int i = 0; i < temporal()->size(); ++i) (*temporal())[i].gradient( (*temporal())[i].gradient() * fact ); -- libgit2 0.21.4