apt-sim / AdePT

Accelerated demonstrator of electromagnetic Particle Transport
Apache License 2.0
25 stars 34 forks source link

FillG4NavigationHistory fix #303

Closed WitekPokorski closed 2 weeks ago

WitekPokorski commented 3 weeks ago

This fixes the wrong logic in FillG4NavigationHistory and adds the missing MaterialCutsCouple pointer in the 'fake' step reconstructed from AdePT information and used to call the G4 sensitive detectors.

phsft-bot commented 3 weeks ago

Can one of the admins verify this patch?

agheata commented 3 weeks ago

Looks like example1 is failing with these changes

WitekPokorski commented 3 weeks ago

OK, this is super weird. The reason for the crash is that sometimes (very rarely) the volume that is reconstructed as sensitive is ECAL, which is the mother volume of the sensitive detectors (and it's not sensitive on its own). The thing is that all other sensitive volumes are reconstructed OK and all the physics results are correct. I don't know what's happening, but one possibility is that with the fix for the navigation history, we are now hitting some rare bug in VecGeom which gives the mother volume instead of the daughter volume in some rare cases. But I could be wrong.... I will keep on investigating.

WitekPokorski commented 3 weeks ago

OK, I found one additional problem which I overlooked in the previous fix (visible only in specific case which we hit with example1). Now, it should be all fine.