Commit e8e62adbb5ab2fead273e8696da322ecbd6dd5a3

Authored by Jürgen Knödlseder
1 parent 5f248f00

Retrieve reference to background instead of making a copy.

inst/cta/src/GCTAModelCubeBackground.cpp
... ... @@ -280,8 +280,8 @@ double GCTAModelCubeBackground::eval(const GEvent& event,
280 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 286 // Evaluate function
287 287 double logE = event.energy().log10TeV();
... ... @@ -338,8 +338,8 @@ double GCTAModelCubeBackground::eval_gradients(const GEvent& event,
338 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 344 // Evaluate function
345 345 double logE = event.energy().log10TeV();
... ...