I’m trying something a little unorthodox here, so I’m not sure if anyone has any suggestions but hoping for a little guidance.
I’ve been working on testing some spin polarization effects in low energy neutron scattering using the ParticleHP model. In order to do this, I need to store and call the spin polarization of the neutrons. This is possible for a G4DynamicParticle using GetPolarization(), but for the ParticleHP model, the neutron is stored as a G4HadProjectile. I was able to add a GetPolarization() function to a custom G4HadProjectile class that works as intended when I am simulating elastic scattering. However, when I try to add inelastic processes (G4HadronPhysicsQGSP_BIC_HP and G4IonPhysicsXS), I get a segmentation fault when running the simulation. Everything is able to compile, but it seems that the GetPolarization function I added is causing issues with some process in the classes I used for inelastic physics. I’ve been investigating where the problem is coming from but haven’t been able to find anything. I am wondering if anyone has any insight or guidance into what process might be causing problems because of a GetPolarization function I add to the G4HadProjectile class. Thank you.