Commit e8e62adbb5ab2fead273e8696da322ecbd6dd5a3
1 parent
5f248f00
Retrieve reference to background instead of making a copy.
Showing
1 changed file
with
4 additions
and
4 deletions
inst/cta/src/GCTAModelCubeBackground.cpp
| @@ -280,8 +280,8 @@ double GCTAModelCubeBackground::eval(const GEvent& event, | @@ -280,8 +280,8 @@ double GCTAModelCubeBackground::eval(const GEvent& event, | ||
| 280 | throw GException::invalid_argument(G_EVAL, msg); | 280 | throw GException::invalid_argument(G_EVAL, msg); |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | - // Retrieve pointer to CTA cube background | ||
| 284 | - const GCTACubeBackground bgd = rsp->background(); | 283 | + // Retrieve reference to CTA cube background |
| 284 | + const GCTACubeBackground& bgd = rsp->background(); | ||
| 285 | 285 | ||
| 286 | // Evaluate function | 286 | // Evaluate function |
| 287 | double logE = event.energy().log10TeV(); | 287 | double logE = event.energy().log10TeV(); |
| @@ -338,8 +338,8 @@ double GCTAModelCubeBackground::eval_gradients(const GEvent& event, | @@ -338,8 +338,8 @@ double GCTAModelCubeBackground::eval_gradients(const GEvent& event, | ||
| 338 | throw GException::invalid_argument(G_EVAL_GRADIENTS, msg); | 338 | throw GException::invalid_argument(G_EVAL_GRADIENTS, msg); |
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | - // Retrieve pointer to CTA cube background | ||
| 342 | - const GCTACubeBackground bgd = rsp->background(); | 341 | + // Retrieve reference to CTA cube background |
| 342 | + const GCTACubeBackground& bgd = rsp->background(); | ||
| 343 | 343 | ||
| 344 | // Evaluate function | 344 | // Evaluate function |
| 345 | double logE = event.energy().log10TeV(); | 345 | double logE = event.energy().log10TeV(); |