- Improve handling of phase-space generation for cases of decays having e+e- pair to make RareLbToLll model useable.
- Some code modernization of RareLbToLll to make things const where they are constant and pass const references instead of raw pointers in most places.
Tested locally that nothing changes for Lz mu mu final state. In case of Lb --> Lz e+ e-, without this change model is effectively unuseable as maximum probability gets too high and accept-reject fails to find working configuration in 1000 trials. After change code can generate 1M events without any issue and gives expected q2 distribution. I'm not adding test as I will do this directly to new framework.
Changes look OK. It is good to see unnecessary pointers being removed. Just have a few minor suggestions.
Need to run clang-formatting to have extra space inside braces?
Should we remove the static here? Hopefully there are no other statics used in this model?
This could be const as well.
Thanks Michal, this indeed looks like a good set of clean-ups as well as the actual physics improvement.
Just a few inline suggestions for further small clean-ups, fixes, etc.
A const member function should not return a non-const pointer to a member since it allows the client to subsequently modify the internal state. As such it is better to have two versions of the function, a const function that returns a const pointer and a non-const function that returns a non-const pointer.
As per comment on the header, we need two versions of the function for const-correctness reasons.
Would be good to at least initialise these to 0 here, or better move their declarations to where they are first used so they are initialised there.
These loop counters should be declared in the loop init-statement not here.