Commit 002d505d765edbd239f63cae42fb3255642263ae

Authored by knodlseder
1 parent 500fc41f

Apply deadtime correction also to gradient in GCTAModelRadialAcceptance::eval_gradients.

inst/cta/src/GCTAModelRadialAcceptance.cpp
... ... @@ -377,11 +377,12 @@ double GCTAModelRadialAcceptance::eval_gradients(const GEvent& event,
377 377 double value = rad * spec * temp;
378 378  
379 379 // Apply deadtime correction
380   - value *= obs.deadc(event.time());
  380 + double deadc = obs.deadc(event.time());
  381 + value *= deadc;
381 382  
382 383 // Multiply factors to radial gradients
383 384 if (radial() != NULL) {
384   - double fact = spec * temp;
  385 + double fact = spec * temp * deadc;
385 386 if (fact != 1.0) {
386 387 for (int i = 0; i < radial()->size(); ++i)
387 388 (*radial())[i].gradient( (*radial())[i].gradient() * fact );
... ... @@ -390,7 +391,7 @@ double GCTAModelRadialAcceptance::eval_gradients(const GEvent&amp; event,
390 391  
391 392 // Multiply factors to spectral gradients
392 393 if (spectral() != NULL) {
393   - double fact = rad * temp;
  394 + double fact = rad * temp * deadc;
394 395 if (fact != 1.0) {
395 396 for (int i = 0; i < spectral()->size(); ++i)
396 397 (*spectral())[i].gradient( (*spectral())[i].gradient() * fact );
... ... @@ -399,7 +400,7 @@ double GCTAModelRadialAcceptance::eval_gradients(const GEvent&amp; event,
399 400  
400 401 // Multiply factors to temporal gradients
401 402 if (temporal() != NULL) {
402   - double fact = rad * spec;
  403 + double fact = rad * spec * deadc;
403 404 if (fact != 1.0) {
404 405 for (int i = 0; i < temporal()->size(); ++i)
405 406 (*temporal())[i].gradient( (*temporal())[i].gradient() * fact );
... ...