Closed requested to merge tdado/athena:RadDmgCode into master
I opened this MR to start a discussion about potential speed up of the code.
The MR brings two things:
- A minor speed up by factoring out the HepMC links calculation form the loops (this was probably done by the compiler anyway) and also adding a simple speed up by skipping loops where the ramo potentials for electrons and holes were set to 0 and the iduced charge was thus zero as well. The second part actually changes the digitisation output - probably due to floating point precision or some random numbers, but this impact only radiation code and the changes are tiny (0.1%).
- The second part of the MR is the main point for discussion. It adds two cutoff values that can be set via JO file. The allow to skip some loops and thus significanctly reduce the reunning time, however, they also impact the result. The cutoff values are for ramo potential diffence (induced charge), these are rather safe but gain only a bit of CPU time since they do not really skip loops just the expensive part of the chanrge addition. The other cut simply skips the digitisation if the deposited energy is smaller than the cutoff - this is obviously more dangerous but also gains huge speed up. E.g. I tested a setup where the number of charges was reduced by 1-1.5% and gained a speed of around 30%. By default, both of the cutoff values are set to -1 so no cut is applied. Note that this also adds small CPU processing time since the condition has to be evaluated in the loops and by default it will always return false.
After a discusion in yesterdays radiation damage meeting it was agree that the changes are ok (reminderL by default this will not apply any cut).