acts-project / acts

Experiment-independent toolkit for (charged) particle track reconstruction in (high energy) physics experiments implemented in modern C++
https://acts.readthedocs.io
Mozilla Public License 2.0
105 stars 168 forks source link

[Bug] Fatras can't seem to handle energy loss for electrons on thin surfaces #2498

Open janheinri opened 1 year ago

janheinri commented 1 year ago

Hello,

I am using the provided python bindings to generate electrons via the particle gun. addParticleGun( s, EtaConfig(-0.0002, 0.0002), PhiConfig(3.141592654/2-0.001,3.141592654/2+0.001), ParticleConfig(1, acts.PdgParticle.eElectron), vtxGen=FixedVertexGenerator( fixed=acts.Vector4(0, 1700, 0, 0),), multiplicity=1, momentumConfig=MomentumConfig(1000 * u.MeV, 1001 * u.MeV,True), rnd=rnd, outputDirRoot=outputDir, )

The simulation is done by Fatras. Possible interactions can occur in silicon layers with a thickness of 100E-6 m:

addFatras( s, trackingGeometry=trackingGeometry, field=field, rnd=rnd, enableInteractions=True, )

However I think the sampling of the Bethe Heitler distribution does not seem to work correctly. I get the following messages on my console: 0# 0x00007F8711CDE997 in /lib64/libm.so.6 1# 0x00007F8711CDF4E4 in /lib64/libm.so.6 2# pow in /lib64/libm.so.6 3# double std::gamma_distribution<double>::operator()<std::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul> >(std::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>&, std::gamma_distribution<double>::param_type const&) in /home/physik/ACTS/ACTSInstall/python/acts/../../lib64/libActsExamplesFatras.so 4# 0x00007F86E3DEA09B in /home/physik/ACTS/ACTSInstall/python/acts/../../lib64/libActsExamplesFatras.so 5# 0x00007F86E3DEAD9A in /home/physik/ACTS/ACTSInstall/python/acts/../../lib64/libActsExamplesFatras.so 6# 0x00007F86E3DEE464 in /home/physik/ACTS/ACTSInstall/python/acts/../../lib64/libActsExamplesFatras.so 7# 0x00007F86E3DEFE63 in /home/physik/ACTS/ACTSInstall/python/acts/../../lib64/libActsExamplesFatras.so

Note that this does not occur for other particles (e.g. muons) where the main source of energy loss is not Bremsstrahlung. This is not super critical as you can always run a complete Geant4 simulation, but I thought I might raise awareness to it. In case necessary information is missing, I will try to provide it.

paulgessinger commented 1 year ago

Are these printouts from the FPE monitoring, or are this crashes?

janheinri commented 1 year ago

I think this is indeed a printout from FPE monitoring. I forgot to include the following line in the above description: 14:21:26 Sequencer INFO FPE of type FLTUND exceeded configured per-event threshold of 0 (mask: NONE) (seen: 1 FPEs)

paulgessinger commented 1 year ago

Right, ok. We've seen this in some cases, indeed, that the RNG has problems with the inputs we give it. I don't there was a conclusive answer to whether this can be fixed. We can probably try to guard this with a limited-range exp function to hide this. Do you observe this in statistically relevant frequencey?

janheinri commented 1 year ago

I ran 100 Events and saw this in 11 cases. So even though this is not a huge amount of statistics, I would say it happens quite frequently

github-actions[bot] commented 1 year ago

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.

github-actions[bot] commented 4 months ago

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.