Check performance of csresmap and csrespec
|Status:||In Progress||Start date:||02/04/2021|
|Assigned To:||Tibaldo Luigi||% Done:|
These tools have become really slow: calculating residuals takes much longer than performing likelihood fits in some cases. We should check where the bottlenecks are, whether they can be sped up etc
#2 Updated by Tibaldo Luigi almost 2 years ago
- Status changed from New to In Progress
I investigated a bit the issue, and I think I understood what was happening in the cases that were reported.
This happens for unbinned analyses. It it actually the binning of the events and computation of the binned model (with evaluation of stacked response on the fly) in csresmap and csrespec that makes it more time-consuming that the unbinned fit (especially for few events).
I guess that for a one-shot usage this is just unavoidable. However, it’s annoying for someone that does iterative model adjustment and residual check because at every iteration you spend time redoing over and over the binning and stacked model response calculation.
We could modify the tools so that internally the count cubes and stacked response are kept in memory and not recalculated each time the tool is run. Another simpler approach would be to add warnings/examples to the documentation in the two cscripts reference manuals, in the basic tutorials, and in the tutorial on advanced model manipulation and fitting (where it is actually done in the suboptimal way that makes you recalculate binned events and response each time)